private JPanel createDynamicCenterPanel(PrimitiveForm primitiveForm, DOTProperty property) {
    final JTable theTable = new JTable();
    PrimitiveFormPropertyPair pfpPair =
        new PrimitiveFormPropertyPair(primitiveForm.getName(), property);
    _dynamicTables.put(pfpPair, theTable);
    DOTPoint dotPoint = (DOTPoint) _dotDefinitionDialogFrame.getScratchDisplayObjectType();
    final DynamicDOTItemManager tableModel =
        (DynamicDOTItemManager) dotPoint.getTableModel(primitiveForm, property);
    theTable.setModel(tableModel);

    class NumberComparator implements Comparator<Number> {

      public int compare(Number o1, Number o2) {
        final double d1 = o1.doubleValue();
        final double d2 = o2.doubleValue();
        if (d1 < d2) {
          return -1;
        }
        if (d1 == d2) {
          return 0;
        }
        return 1;
      }
    }
    TableRowSorter<DynamicDOTItemManager> tableRowSorter =
        new TableRowSorter<DynamicDOTItemManager>();
    tableRowSorter.setModel(tableModel);
    tableRowSorter.setComparator(4, new NumberComparator());
    tableRowSorter.setComparator(5, new NumberComparator());
    theTable.setRowSorter(tableRowSorter);

    JButton newDOTItemButton = new JButton("Neue Zeile");
    newDOTItemButton.setEnabled(_dotDefinitionDialogFrame.isEditable());
    JButton deleteDOTItemButton = new JButton("Zeile löschen");
    deleteDOTItemButton.setEnabled(false);
    JButton showConflictsButton = new JButton("Zeige Konflikte");

    addButtonListeners(
        primitiveForm, property, newDOTItemButton, deleteDOTItemButton, showConflictsButton);
    addListSelectionListener(theTable, deleteDOTItemButton);

    JPanel dotButtonsPanel = new JPanel();
    dotButtonsPanel.setLayout(new SpringLayout());

    dotButtonsPanel.add(newDOTItemButton);
    dotButtonsPanel.add(deleteDOTItemButton);
    dotButtonsPanel.add(showConflictsButton);

    dotButtonsPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
    SpringUtilities.makeCompactGrid(dotButtonsPanel, 1, 5, 20);

    JPanel thePanel = new JPanel();
    thePanel.setLayout(new SpringLayout());
    thePanel.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.BLACK));
    thePanel.add(new JScrollPane(theTable));
    thePanel.add(dotButtonsPanel);
    SpringUtilities.makeCompactGrid(thePanel, 2, 20, 5);

    return thePanel;
  }
  /*
   * (non-Javadoc)
   *
   * @see com.intel.hpc.stl.ui.common.JSection#getMainPanel()
   */
  @Override
  protected JComponent getMainComponent() {
    JPanel mainPanel = new JPanel();
    mainPanel.setLayout(new BorderLayout());
    mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    mainPanel.add(getCtrlPanel(), BorderLayout.NORTH);
    errorsCardView = new PerfErrorsCardView(STLConstants.K0705_PORT_COUNTERS.getValue());

    JPanel propCardPanel = new JPanel();
    propCardPanel.setLayout(new GridBagLayout());
    propCardPanel.setBorder(BorderFactory.createEmptyBorder(5, 2, 2, 2));

    GridBagConstraints gc = new GridBagConstraints();
    gc.insets = new Insets(2, 2, 2, 2);
    gc.weightx = 1;
    gc.weighty = 1;
    gc.gridwidth = 1;
    gc.fill = GridBagConstraints.BOTH;
    propCardPanel.add(errorsCardView, gc);

    gc.gridwidth = GridBagConstraints.REMAINDER;
    otherCardView = new PerfErrorsCardView(STLConstants.K0715_OTHER_COUNTERS.getValue());
    propCardPanel.add(otherCardView, gc);
    mainPanel.add(propCardPanel, BorderLayout.CENTER);

    JScrollPane scrollPane = new JScrollPane(mainPanel);
    scrollPane.setBorder(BorderFactory.createEmptyBorder());
    return scrollPane;
  }
Example #3
0
  private void initView() {

    // R�cup�ration du sujet pirelli

    setLayout(new BorderLayout(0, 0));

    JPanel panel = new JPanel();
    add(panel, BorderLayout.NORTH);
    panel.setLayout(new BorderLayout(0, 0));

    // affichage du sujet
    JLabel label = new JLabel(model.getTitle());
    panel.add(label, BorderLayout.WEST);

    numberLabel = new JLabel(this.model.getComments().size() + " comments");
    panel.add(numberLabel, BorderLayout.EAST);

    JScrollPane scrollPane = new JScrollPane();
    add(scrollPane, BorderLayout.CENTER);

    commentsPanel = new JPanel();
    scrollPane.setViewportView(commentsPanel);
    commentsPanel.setLayout(new BoxLayout(commentsPanel, BoxLayout.Y_AXIS));

    // affichage des commentaires
    List<Comment> comments = model.getComments();
    for (Comment comment : comments) {
      CommentView commentView = createCommentView(comment);
      commentsPanel.add(commentView);
    }
  }
Example #4
0
  /**
   * The constructor for the SaveDialog class
   *
   * @param parent The LevelEditor class
   */
  public SaveDialog(LevelEditor parent) {
    super();
    le = parent;

    setTitle("SaveDialog");
    setSize(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT);
    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    setLocationRelativeTo(null);
    setResizable(false);

    textField = new JTextField(10);

    String msgString1 = "Please enter filename:";
    JLabel label = new JLabel(msgString1);
    JButton saveButton = new JButton(btnString1);
    saveButton.setActionCommand(btnString1);
    saveButton.addActionListener(this);
    JButton cancelButton = new JButton(btnString2);
    cancelButton.setActionCommand(btnString2);
    cancelButton.addActionListener(this);
    JPanel text = new JPanel();
    text.setLayout(new BoxLayout(text, BoxLayout.Y_AXIS));
    text.setSize(200, 40);
    text.add(label);
    text.add(textField);
    JPanel buttons = new JPanel();
    buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
    buttons.add(saveButton);
    buttons.add(cancelButton);
    add(text);
    add(buttons);
    setVisible(true);
  }
  /** Initialize the contents of the frame. */
  private void initialize() {
    amountOfMoney.setText(Integer.toString(gameController.amountOfMoney));
    numbersPanel.setLayout(new GridLayout(2, 5));
    for (int i = 0; i < 10; i++) {
      buttons.add(new JButton(Integer.toString(i)));
      numbersPanel.add(buttons.get(i));
      buttons.get(i).addActionListener(this);
    }
    numbersPanel.setPreferredSize(new Dimension(1000, 400));

    inputsPanel.setLayout(new GridLayout(1, 5));

    for (int i = 0; i < 4; i++) {
      answers.add(new JButton(""));
      inputsPanel.add(answers.get(i));
      answers.get(i).setEnabled(false);
    }
    inputsPanel.add(deleteButton);
    deleteButton.addActionListener(this);
    submitButton.addActionListener(this);

    resultsPanel.setLayout(new GridLayout(2, 2));
    // resultsPanel.add(moneyLabel);
    // resultsPanel.add(amountOfMoney);
    resultsPanel.add(resultLabel);
    resultsPanel.add(result);

    this.setLayout(new BorderLayout());

    this.add(inputsPanel, BorderLayout.NORTH);
    this.add(numbersPanel, BorderLayout.CENTER);
    this.add(submitButton, BorderLayout.SOUTH);
    this.add(resultsPanel, BorderLayout.EAST);
  }
Example #6
0
  protected JPanel createProgrammerSelection() {
    JPanel pane3a = new JPanel();
    pane3a.setLayout(new BoxLayout(pane3a, BoxLayout.Y_AXIS));
    // create the programmer box
    JPanel progFormat = new JPanel();
    progFormat.setLayout(new BoxLayout(progFormat, BoxLayout.X_AXIS));
    progFormat.add(new JLabel(Bundle.getMessage("ProgrammerFormat")));
    progFormat.setAlignmentX(JLabel.RIGHT_ALIGNMENT);

    programmerBox = new JComboBox<String>(ProgDefault.findListOfProgFiles());
    programmerBox.setSelectedIndex(0);
    if (ProgDefault.getDefaultProgFile() != null) {
      programmerBox.setSelectedItem(ProgDefault.getDefaultProgFile());
    }
    progFormat.add(programmerBox);

    go2 = new JButton(Bundle.getMessage("OpenProgrammer"));
    go2.addActionListener(
        new ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent e) {
            if (log.isDebugEnabled()) {
              log.debug("Open programmer pressed");
            }
            openButton();
          }
        });
    go2.setAlignmentX(JLabel.RIGHT_ALIGNMENT);
    go2.setEnabled(false);
    go2.setToolTipText(Bundle.getMessage("SELECT A LOCOMOTIVE OR DECODER TO ENABLE"));
    pane3a.add(progFormat);
    pane3a.add(go2);
    return pane3a;
  }
  public CurrentCustomerOrderDialog(ArrayList<Object[]> list) {
    scrollPane = new JScrollPane();
    scrollPane.setMaximumSize(new Dimension(1024, 768));
    scrollPane.setMinimumSize(new Dimension(800, 500));
    createTable(list);

    contentPanePanel.setLayout(new MigLayout());
    contentPanePanel.add(scrollPane, "push, grow");
    JPanel panel = new JPanel();
    panel.setLayout(new MigLayout());
    panel.add(btnClearOrder, "wrap, growx");
    contentPanePanel.add(panel, "pushx,wrap,alignx left, aligny top");
    contentPanePanel.add(btnOk, "pushx, alignx center");
    btnOk.addActionListener(this);
    btnClearOrder.addActionListener(this);

    setLayout(new GridBagLayout());
    setContentPane(contentPanePanel);
    setModal(true);
    toFront();
    setTitle("Current order");
    pack();
    setLocationRelativeTo(null);
    setVisible(true);
  }
  public void go() {
    picture();
    ActionListener listener = new BtListener();
    go.addActionListener(listener);
    btn_update_manual.addActionListener(listener);
    go.setForeground(Color.black);
    // rights.setFont((new Font("Arial", Font.PLAIN, 12)));
    title.setFont((new Font("Arial", Font.BOLD, 36)));
    title.setForeground(new Color(238, 253, 253));
    today.setFont((new Font("Arial", Font.BOLD, 16)));
    today.setForeground(new Color(163, 184, 204));
    frame.setLayout(new BorderLayout());
    from.setBackground(Color.white);
    to.setBackground(Color.white);
    converted.setFont(new Font("Arial", Font.BOLD, 24));
    converted.setForeground(new Color(238, 253, 253));
    Lfrom.setForeground(new Color(238, 253, 253));
    Lto.setForeground(new Color(238, 253, 253));
    quantity.setForeground(new Color(238, 253, 253));
    Lfrom.setFont(new Font("Arial", Font.BOLD, 24));
    Lto.setFont(new Font("Arial", Font.BOLD, 24));
    quantity.setFont(new Font("Arial", Font.BOLD, 24));
    north.setLayout(new FlowLayout());
    north.add(title);
    north.setBackground(new Color(59, 62, 71));
    frame.add(BorderLayout.NORTH, north);
    inner.setLayout(new BorderLayout());
    inner.add(BorderLayout.NORTH, today);
    inner.add(BorderLayout.WEST, picPanel);
    center.setLayout(new GridLayout(2, 4, 5, 5));
    center.add(Lfrom);
    center.add(from);
    center.add(Lto);
    center.add(to);
    center.add(quantity);
    center.add(amount);
    center.add(go);
    inner.setBackground(new Color(59, 62, 71));
    inner.add(BorderLayout.SOUTH, center);
    center.setBackground(new Color(59, 62, 71));
    frame.add(BorderLayout.CENTER, inner);
    south.setBackground(new Color(59, 62, 71));
    south.setLayout(new FlowLayout());
    south.add(converted);
    south.add(answer);
    south.add(btn_update_manual);
    // south.add(rights);
    frame.add(BorderLayout.SOUTH, south);
    frame.setSize(850, 700);
    frame.setVisible(true);

    frame.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent event) {
            frame.setVisible(false);
            frame.dispose();
            System.exit(0);
          }
        });
  }
  private void geometry() {

    List<List<JPanel>> base = gridContent.getListGridBase();
    Orientation orientation = gridContent.getGridOrientation();

    // set the orientation of the content
    if (orientation == Orientation.VERTICAL) {
      GridLayout layout = new GridLayout(0, 1);
      setLayout(layout);
    } else {
      GridLayout layout = new GridLayout(1, 0);
      setLayout(layout);
    }

    // fill with components
    for (List<JPanel> subList : base) {
      JPanel subPanel = new JPanel();

      if (orientation == Orientation.VERTICAL) {
        GridLayout layout = new GridLayout(1, 0);
        subPanel.setLayout(layout);
      } else {
        GridLayout layout = new GridLayout(0, 1);
        subPanel.setLayout(layout);
      }

      for (JPanel component : subList) {
        subPanel.add(component);
      }

      add(subPanel);
    }
  }
 public void operationSurPanel() {
   // Bordures
   // Boutons
   SC_Boutons.setLayout(layoutBoutons);
   SC_Boutons.add(BP_Importer);
   SC_Boutons.add(BP_Annuler);
   if (!importationComplete) {
     SC_Boutons.add(BP_Fermer);
   }
   // Composants
   SC_Composants.setLayout(layoutComposants);
   SC_Composants.add(SC_Fichiers, BorderLayout.CENTER);
   SC_Composants.add(SC_Chemin, BorderLayout.NORTH);
   // Chemin
   SC_Chemin.setLayout(layoutChemin);
   SC_Rechercher.setLayout(layoutRechercher);
   SC_Rechercher.add(BP_Rechercher);
   SC_Chemin.add(STC_Chemin, BorderLayout.NORTH);
   SC_Chemin.add(BP_Parcourir, BorderLayout.EAST);
   SC_Chemin.add(LD_Chemin, BorderLayout.CENTER);
   SC_Chemin.add(SC_Rechercher, BorderLayout.SOUTH);
   // Fichiers
   SC_Fichiers.setLayout(layoutFichier);
   SC_Fichiers.add(STC_Fichiers, BorderLayout.NORTH);
   SC_Fichiers.add(SC_Scroll, BorderLayout.CENTER);
   SC_Scroll.setViewportView(LS_Fichiers);
 }
Example #11
0
  /** OptionPaneDemo Constructor */
  public OptionPaneDemo(SwingSet2 swingset) {
    // Set the title for this demo, and an icon used to represent this
    // demo inside the SwingSet2 app.
    super(swingset, "OptionPaneDemo", "toolbar/JOptionPane.gif");

    JPanel demo = getDemoPanel();

    demo.setLayout(new BoxLayout(demo, BoxLayout.X_AXIS));

    JPanel bp =
        new JPanel() {
          public Dimension getMaximumSize() {
            return new Dimension(getPreferredSize().width, super.getMaximumSize().height);
          }
        };
    bp.setLayout(new BoxLayout(bp, BoxLayout.Y_AXIS));

    bp.add(Box.createRigidArea(VGAP30));
    bp.add(Box.createRigidArea(VGAP30));

    bp.add(createInputDialogButton());
    bp.add(Box.createRigidArea(VGAP15));
    bp.add(createWarningDialogButton());
    bp.add(Box.createRigidArea(VGAP15));
    bp.add(createMessageDialogButton());
    bp.add(Box.createRigidArea(VGAP15));
    bp.add(createComponentDialogButton());
    bp.add(Box.createRigidArea(VGAP15));
    bp.add(createConfirmDialogButton());
    bp.add(Box.createVerticalGlue());

    demo.add(Box.createHorizontalGlue());
    demo.add(bp);
    demo.add(Box.createHorizontalGlue());
  }
 private void jbInit() throws Exception {
   border1 = BorderFactory.createEmptyBorder(20, 20, 20, 20);
   contentPane.setBorder(border1);
   contentPane.setLayout(borderLayout1);
   controlsPane.setLayout(gridLayout1);
   gridLayout1.setColumns(1);
   gridLayout1.setHgap(10);
   gridLayout1.setRows(0);
   gridLayout1.setVgap(10);
   okButton.setVerifyInputWhenFocusTarget(true);
   okButton.setMnemonic('O');
   okButton.setText("OK");
   buttonsPane.setLayout(flowLayout1);
   flowLayout1.setAlignment(FlowLayout.CENTER);
   messagePane.setEditable(false);
   messagePane.setText("");
   borderLayout1.setHgap(10);
   borderLayout1.setVgap(10);
   this.setTitle("Subscription Authorization");
   this.getContentPane().add(contentPane, BorderLayout.CENTER);
   contentPane.add(controlsPane, BorderLayout.SOUTH);
   controlsPane.add(responsesComboBox, null);
   controlsPane.add(buttonsPane, null);
   buttonsPane.add(okButton, null);
   contentPane.add(messageScrollPane, BorderLayout.CENTER);
   messageScrollPane.getViewport().add(messagePane, null);
 }
Example #13
0
  protected void init(boolean modal, JComponent content, String[] options) {
    super.setModal(modal);
    m_modal = modal;
    this.setFocusTraversalPolicy(
        new LayoutFocusTraversalPolicy() {
          private static final long serialVersionUID = 1L;

          protected boolean accept(Component component) {
            return !(component instanceof HTMLView);
          }
        });

    this.content = content;

    this.enableEvents(AWTEvent.WINDOW_EVENT_MASK);

    JPanel contentPane = (JPanel) this.getContentPane();
    contentPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    contentPane.setLayout(new BorderLayout());
    contentPane.add(content, BorderLayout.CENTER);
    contentPane.add(jPanelButtonFrame, BorderLayout.SOUTH);
    jPanelButtonFrame.setLayout(new FlowLayout(FlowLayout.CENTER));
    setButtons(options);
    contentPane.setVisible(true);

    /*
      We enable the escape-key for executing the abortCmd. Many thanks to John Zukowski.
         <a href="http://www.javaworld.com/javaworld/javatips/jw-javatip72.html">Java-Tip 72</a>
    */
    KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
    contentPane.getActionMap().put("abort", buttonListener);
    contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(stroke, "abort");
  }
 public StopRenderer() {
   NORMAL_COMPONENT.setLayout(new MigLayout("", "[80, center][]"));
   NORMAL_COMPONENT.setOpaque(false);
   SELECTED_COMPONENT.setLayout(new MigLayout("", "[80, center][]"));
   SELECTED_COMPONENT.setOpaque(false);
   SELECTED_COMPONENT.setUI((PanelUI) FreeColSelectedPanelUI.createUI(SELECTED_COMPONENT));
 }
  private void displayBreakpoint() {
    if (mFieldsPanel != null) {
      remove(mFieldsPanel);
    }

    mFieldsPanel = new JPanel();
    mFieldsPanel.setLayout(new BoxLayout(mFieldsPanel, BoxLayout.Y_AXIS));
    add(mFieldsPanel);

    try {
      for (BreakpointUIComponent component : mUIComponents) {
        JPanel componentPanel = new JPanel();
        componentPanel.setLayout(new BoxLayout(componentPanel, BoxLayout.X_AXIS));

        JLabel lpLabel = new JLabel(component.getLabel() + ":");
        lpLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));

        componentPanel.add(lpLabel);
        JTextField textField = component.getComponent();
        Method method = mBreakpoint.getClass().getMethod(component.getGetterName());
        textField.setText(method.invoke(mBreakpoint).toString());

        componentPanel.add(textField);
        mFieldsPanel.add(componentPanel);
      }
    } catch (Exception e) {
      System.err.println("Error instantiate breakpoint with given parameters.");
    }
  }
  /** Used to find the global attributes that another inspector has set so I can share it. */
  ChartGenerator chartToUse(final String sName, Frame parent, final GUIState simulation) {
    Bag charts = new Bag();
    if (simulation.guiObjects != null)
      for (int i = 0; i < simulation.guiObjects.numObjs; i++)
        if (simulation.guiObjects.objs[i] instanceof ChartGenerator
            && validChartGenerator((ChartGenerator) (simulation.guiObjects.objs[i])))
          charts.add(simulation.guiObjects.objs[i]);
    if (charts.numObjs == 0) return createNewChart(simulation);

    // init the dialog panel
    JPanel p = new JPanel();
    p.setLayout(new BorderLayout());

    String[] chartNames = new String[charts.numObjs + 1];

    chartNames[0] = "[Create a New Chart]";
    for (int i = 0; i < charts.numObjs; i++)
      chartNames[i + 1] = ((ChartGenerator) (charts.objs[i])).getTitle();

    // add widgets
    JPanel panel2 = new JPanel();
    panel2.setLayout(new BorderLayout());
    panel2.setBorder(new javax.swing.border.TitledBorder("Plot on Chart..."));
    JComboBox encoding = new JComboBox(chartNames);
    panel2.add(encoding, BorderLayout.CENTER);
    p.add(panel2, BorderLayout.SOUTH);

    // ask
    if (JOptionPane.showConfirmDialog(
            parent, p, "Create a New Chart...", JOptionPane.OK_CANCEL_OPTION)
        != JOptionPane.OK_OPTION) return null;

    if (encoding.getSelectedIndex() == 0) return createNewChart(simulation);
    else return (ChartGenerator) (charts.objs[encoding.getSelectedIndex() - 1]);
  }
Example #17
0
 /**
  * Creates a new wait dialog with the specified information
  *
  * @param owner Parent frame of the new dialog
  * @param title Title of the dialog
  * @param message Message to be displayed within the dialog.
  */
 public WaitDialog(Frame owner, String title, String message) {
   super(owner, title, false);
   this.title = title;
   this.message = message;
   this.setSize(300, 150);
   JPanel contentPanel = new JPanel();
   contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS));
   contentPanel.add(Box.createVerticalGlue());
   JLabel messageLabel = new JLabel(message);
   messageLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT);
   contentPanel.add(messageLabel);
   contentPanel.add(Box.createVerticalStrut(10));
   JProgressBar waitBar = new JProgressBar();
   waitBar.setIndeterminate(true);
   waitBar.setAlignmentX(JProgressBar.CENTER_ALIGNMENT);
   JPanel waitBarPanel = new JPanel();
   waitBarPanel.setOpaque(false);
   waitBarPanel.setLayout(new BoxLayout(waitBarPanel, BoxLayout.X_AXIS));
   waitBarPanel.add(Box.createHorizontalGlue());
   waitBarPanel.add(waitBar);
   waitBarPanel.add(Box.createHorizontalGlue());
   contentPanel.add(waitBarPanel);
   contentPanel.add(Box.createVerticalGlue());
   this.add(contentPanel);
   this.setLocationRelativeTo(owner);
 }
Example #18
0
  /** Create the frame. */
  public Login() {
    setTitle("LOGIN");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setSize(450, 333);
    setLocationRelativeTo(null);
    contentPane = new JPanel();
    contentPane.setBackground(new Color(204, 255, 255));
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(null);

    JPanel panel = new JPanel();
    panel.setBorder(new LineBorder(new Color(0, 0, 0)));
    panel.setBounds(44, 43, 344, 208);
    contentPane.add(panel);
    panel.setLayout(null);

    JLabel lblNewLabel = new JLabel("USER : "******"PASSWORD:"******"");
    label.setBounds(30, 40, 32, 32);
    panel.add(label);
    label.setIcon(new ImageIcon(Login.class.getResource("/recursos/Administrator-icon.png")));

    JLabel label_1 = new JLabel("");
    label_1.setBounds(30, 98, 32, 32);
    panel.add(label_1);
    label_1.setIcon(new ImageIcon(Login.class.getResource("/recursos/key .png")));

    JButton btnNewButton = new JButton("LOGIN");
    btnNewButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {}
        });
    btnNewButton.setBounds(30, 145, 273, 37);
    panel.add(btnNewButton);

    JComboBox comboBox = new JComboBox();
    comboBox.setBounds(153, 39, 150, 32);
    panel.add(comboBox);

    JLabel lblNewLabel_2 = new JLabel("");
    lblNewLabel_2.setIcon(
        new ImageIcon(
            Login.class.getResource(
                "/recursos/wallpaper_celeste_y_violeta__abstracto__by_tutorialespopcorn-d6accdr.png")));
    lblNewLabel_2.setBounds(0, 0, 450, 300);
    contentPane.add(lblNewLabel_2);
  }
Example #19
0
  protected JXTaskPane getResourcesPane() {
    if (resourcesPane == null) {
      resourcesPane = new JXTaskPane(STLConstants.K1062_SEL_RESOURCES.getValue());
      resourcesPane.setUI(new IntelTaskPaneUI());
      // turned off animation because it has some issues with JScrollPane
      // under our current BorderLayout. Basically we use BorderLayout
      // because we want the <code>resourcePane</code> takes all the
      // remainder space. But the animation intends to specify
      // resourcePane's size (fixed size). The confliction between the the
      // LayoutManager and the animation causes issues. So we turned
      // animation off here.
      resourcesPane.setAnimated(false);

      JPanel content = (JPanel) resourcesPane.getContentPane();
      content.setLayout(new BorderLayout());
      resourcesPanel = new JPanel();
      resourcesPanel.setBackground(UIConstants.INTEL_WHITE);
      resourcesPanel.setBorder(
          BorderFactory.createMatteBorder(2, 2, 2, 2, UIConstants.INTEL_BACKGROUND_GRAY));
      resourcesPanel.setLayout(new GridBagLayout());
      JScrollPane listScroller = new JScrollPane(resourcesPanel);
      listScroller.setBorder(null);
      content.add(listScroller, BorderLayout.CENTER);
    }
    return resourcesPane;
  }
Example #20
0
  private void initLayout() {
    displayPanel.setLayout(new BoxLayout(displayPanel, BoxLayout.LINE_AXIS));

    JPanel subPanel = new JPanel();
    subPanel.setLayout(new BoxLayout(subPanel, BoxLayout.PAGE_AXIS));

    robotButton = new JButton("Robot");
    robotButton.addActionListener(this);
    subPanel.add(robotButton);
    robotMenu = new JPopupMenu();
    robotMenu.addPopupMenuListener(this);
    subPanel.add(robotMenu);
    subPanel.add(Box.createRigidArea(new Dimension(10, 10)));

    createUpdateButtons(subPanel);
    createStreamingButtons(subPanel);
    displayPanel.add(subPanel);

    subPanel = new JPanel();
    subPanel.setLayout(new BoxLayout(subPanel, BoxLayout.PAGE_AXIS));
    subPanel.add(Box.createHorizontalGlue());
    subPanel.add(imagePanel);

    displayPanel.add(subPanel);
  }
Example #21
0
  private void initComponents() {
    JPanel listPane = new JPanel();
    JScrollPane listScrollPane = new JScrollPane();
    JPanel shortcutEditPane = new JPanel();

    CbAction action = new CbAction(this);
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    add(buildFilterPanel());
    listPane.setLayout(new java.awt.GridLayout());

    // This is the list of shortcuts:
    shortcutTable.setModel(model);
    shortcutTable.getSelectionModel().addListSelectionListener(new CbAction(this));
    shortcutTable.setFillsViewportHeight(true);
    shortcutTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    shortcutTable.setAutoCreateRowSorter(true);
    TableColumnModel mod = shortcutTable.getColumnModel();
    mod.getColumn(0).setCellRenderer(new ShortcutTableCellRenderer(true));
    mod.getColumn(1).setCellRenderer(new ShortcutTableCellRenderer(false));
    listScrollPane.setViewportView(shortcutTable);

    listPane.add(listScrollPane);

    add(listPane);

    // and here follows the edit area. I won't object to someone re-designing it, it looks, um,
    // "minimalistic" ;)
    shortcutEditPane.setLayout(new java.awt.GridLayout(5, 2));

    cbDefault.setAction(action);
    cbDefault.setText(tr("Use default"));
    cbShift.setAction(action);
    cbShift.setText(SHIFT); // see above for why no tr()
    cbDisable.setAction(action);
    cbDisable.setText(tr("Disable"));
    cbCtrl.setAction(action);
    cbCtrl.setText(CTRL); // see above for why no tr()
    cbAlt.setAction(action);
    cbAlt.setText(ALT); // see above for why no tr()
    tfKey.setAction(action);
    tfKey.setModel(new DefaultComboBoxModel(keyList.values().toArray()));
    cbMeta.setAction(action);
    cbMeta.setText(META); // see above for why no tr()

    shortcutEditPane.add(cbDefault);
    shortcutEditPane.add(new JLabel());
    shortcutEditPane.add(cbShift);
    shortcutEditPane.add(cbDisable);
    shortcutEditPane.add(cbCtrl);
    shortcutEditPane.add(new JLabel(tr("Key:"), SwingConstants.LEFT));
    shortcutEditPane.add(cbAlt);
    shortcutEditPane.add(tfKey);
    shortcutEditPane.add(cbMeta);

    shortcutEditPane.add(new JLabel(tr("Attention: Use real keyboard keys only!")));

    action.actionPerformed(null); // init checkboxes

    add(shortcutEditPane);
  }
  private JPanel crearPanelNumCarriles() {
    JPanel panelNumCarriles = new JPanel();
    panelNumCarriles.setLayout(new BorderLayout());

    JPanel panelEtiquetasNumero = new JPanel();
    panelEtiquetasNumero.setLayout(new FlowLayout(FlowLayout.CENTER, 30, 5));
    JLabel etiquetaCarril1Numero = new JLabel(Messages.getString("PanelTramo.26")); // $NON-NLS-1$
    JLabel etiquetaCarril2Numero = new JLabel(Messages.getString("PanelTramo.27")); // $NON-NLS-1$
    panelEtiquetasNumero.add(etiquetaCarril1Numero);
    panelEtiquetasNumero.add(etiquetaCarril2Numero);

    JPanel panelCamposNumero = new JPanel();
    panelCamposNumero.setLayout(new FlowLayout(FlowLayout.CENTER, 30, 5));
    campoCarril1Numero = new JSpinner(new SpinnerNumberModel(2, 1, 4, 1));
    campoCarril2Numero = new JSpinner(new SpinnerNumberModel(2, 1, 4, 1));
    campoCarril2Numero.setEnabled(false);
    panelCamposNumero.add(campoCarril1Numero);
    panelCamposNumero.add(campoCarril2Numero);

    panelNumCarriles.setBorder(
        BorderFactory.createTitledBorder(Messages.getString("PanelTramo.28"))); // $NON-NLS-1$
    panelNumCarriles.add(panelEtiquetasNumero, BorderLayout.NORTH);
    panelNumCarriles.add(panelCamposNumero, BorderLayout.SOUTH);

    return panelNumCarriles;
  }
Example #23
0
  public void constructMailPanel() {

    JPanel globalPanel = new JPanel();
    globalPanel.setLayout(new BoxLayout(globalPanel, BoxLayout.Y_AXIS));
    globalPanel.setVisible(true);

    JLabel nameLabel = new JLabel(name);
    nameLabel.setFont(new Font("Serif", Font.PLAIN, 30));
    globalPanel.add(nameLabel);

    this.add(globalPanel);

    followButton = new JButton("Follow/UnFollow");
    followButton.addActionListener(this);
    globalPanel.add(followButton);

    newMessage = new JButton("Write");
    newMessage.addActionListener(this);
    globalPanel.add(newMessage);

    messagePanel = new JPanel();
    messagePanel.setLayout(new BoxLayout(messagePanel, BoxLayout.Y_AXIS));
    JScrollPane scrollPane = new JScrollPane(messagePanel);
    scrollPane.setPreferredSize(new Dimension(500, 400));
    globalPanel.add(scrollPane);
  }
Example #24
0
  /** 构建客户端的聊天界面 */
  private void initUI() {

    sendButton = new JButton("发送");

    userMsgPanel = new JPanel();
    sendMsgTextField = new JTextField("enter sth to sent");
    sendPanel = new JPanel();
    chartTextArea = new JTextArea();

    userMsgPanel.setLayout(new BorderLayout());

    sendPanel.setLayout(new BorderLayout());
    sendPanel.add(sendMsgTextField, BorderLayout.CENTER);
    sendPanel.add(sendButton, BorderLayout.EAST);

    chartTextArea.setEditable(false);
    chartAreaScrollPane = new JScrollPane(chartTextArea);

    frame.setLayout(new BorderLayout());
    frame.add(userMsgPanel, BorderLayout.NORTH);
    frame.add(chartAreaScrollPane, BorderLayout.CENTER);
    frame.add(sendPanel, BorderLayout.SOUTH);

    frame.setSize(500, 300);
    frame.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            frame.setVisible(false);
          }
        });
    frame.setVisible(true);
  }
    private void init() {

      Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
      contentPane.setPreferredSize(new Dimension(screenSize.width / 2, screenSize.height / 3));

      setContentPane(contentPane);
      contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
      buttonBar.setLayout(new FlowLayout());
      buttonBarGrid.setLayout(new FlowLayout());

      JButton cancelButton = new JButton();
      JButton okButton = new JButton();
      okButton.setText("OK");
      okButton.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              onOk();
            }
          });
      cancelButton.setText("CANCEL");
      cancelButton.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              onCancel();
            }
          });
      buttonBarGrid.add(okButton);
      buttonBarGrid.add(cancelButton);
      buttonBar.add(buttonBarGrid);

      controlsPanel.setLayout(new BoxLayout(controlsPanel, BoxLayout.X_AXIS));
      controlsPanel.add(createTab());
      contentPane.add(controlsPanel, BorderLayout.NORTH);
      contentPane.add(buttonBar, BorderLayout.SOUTH);
    }
Example #26
0
  public TargetSequencePanel(TargetListModel list_model) {
    this.list_model = list_model;
    list_model.addListDataListener(this);
    this.setLayout(new BorderLayout());
    // set up the gui
    JPanel northPane = new JPanel();
    northPane.setLayout(new FlowLayout(FlowLayout.LEADING));
    JLabel label = new JLabel("Primary target transcript id:");
    northPane.add(label);
    northPane.add(jtf_id);
    this.add(northPane, BorderLayout.NORTH);

    JPanel centerPane = new JPanel();
    centerPane.setLayout(new BorderLayout());
    label = new JLabel("Primary transcript sequence:");
    centerPane.add(label, BorderLayout.NORTH);
    JScrollPane scrollPane = new JScrollPane(jta_seq);
    centerPane.add(scrollPane, BorderLayout.CENTER);
    jta_seq.setLineWrap(true);
    this.add(centerPane, BorderLayout.CENTER);

    JPanel bttn_pane = new JPanel();
    JButton bttn_OK = new JButton("Save Change");
    bttn_OK.addActionListener(this);
    bttn_OK.setName("Save");
    bttn_pane.add(bttn_OK);
    JButton bttn_Cancel = new JButton("Cancel");
    bttn_pane.setVisible(false);
    bttn_Cancel.addActionListener(this);
    bttn_Cancel.setName("Cancel");
    bttn_pane.add(bttn_Cancel);
    this.add(bttn_pane, BorderLayout.SOUTH);
  }
Example #27
0
  /** Description of the Method */
  public void init() {
    // super.init();
    size = new Dimension(570, 570);
    contentPane = (JPanel) this.getContentPane();
    contentPane.setLayout(borderLayout1);

    Dimension d = messagePanel.getSize();
    d.height += 20;
    messagePanel.setPreferredSize(d);
    contentPane.add(messagePanel, BorderLayout.SOUTH);

    contentPane.setOpaque(true);
    userPanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(2, 2, 2, 2);

    messagePanel.setLayout(borderLayout5);
    contentPane.setOpaque(true);
    contentPane.setBackground(Color.white);
    this.setSize(size);

    messagePanel.add(labelMessage, BorderLayout.NORTH);
    // Logg.logg("MhClient: Före XttTree-skapande", 6);
    this.mhTable = new MhTable(root, false, this.labelMessage);
    // Logg.logg("MhClient: mhTable-skapande klart", 6);
    this.contentPane.add(this.mhTable.splitPane, BorderLayout.CENTER);
  }
Example #28
0
  private void initVnesiIzlet() {
    JPanel panelVnesiIzlet = new JPanel();
    panelVnesiIzlet.setLayout(new BoxLayout(panelVnesiIzlet, BoxLayout.LINE_AXIS));

    JPanel panelVnesi = new JPanel();
    panelVnesi.setLayout(new BoxLayout(panelVnesi, BoxLayout.Y_AXIS));

    jLabelNaziv = new JLabel("Vnesi naziv: ");
    panelVnesi.add(jLabelNaziv);

    jTextFieldNaziv = new JTextField("Naziv oddiha");
    panelVnesi.add(jTextFieldNaziv);

    jLabelZbirnoMesto = new JLabel("Vnesi Zbirno mesto : ");
    panelVnesi.add(jLabelZbirnoMesto);

    jTextFieldZbirnoMesto = new JTextField("Zbirno mesto");
    panelVnesi.add(jTextFieldZbirnoMesto);

    jLabelUraOdhoda = new JLabel("Vnesi uro odhoda : ");
    panelVnesi.add(jLabelUraOdhoda);

    jTextFieldUraOdhoda = new JTextField("20:00");
    panelVnesi.add(jTextFieldUraOdhoda);

    jButtonVnesiIzlet = new JButton("Vnesi");
    panelVnesi.add(jButtonVnesiIzlet);

    PoslusalecIzletVnos poslusalecIzletVnos = new PoslusalecIzletVnos();
    jButtonVnesiIzlet.addActionListener(poslusalecIzletVnos);

    panelVnesiIzlet.add(panelVnesi);
    tabbed.add("Vnos", panelVnesiIzlet);
  }
    public ProjectsDetailedView() {
      super(pageName);

      JPanel viewContainer = (JPanel) ViewUtil.clear(this.getContentPanel());
      viewContainer.setLayout(new BorderLayout());

      JPanel infoContainer = ViewUtil.getClearPanel();
      ViewUtil.applyVerticalBoxLayout(infoContainer);

      viewContainer.add(ViewUtil.getClearBorderlessScrollPane(infoContainer), BorderLayout.CENTER);

      CollapsiblePanes panes = new CollapsiblePanes();
      panes.setOpaque(false);
      infoContainer.add(panes);

      infoPanel = new CollapsiblePane();
      infoPanel.setStyle(CollapsiblePane.TREE_STYLE);
      infoPanel.setCollapsible(false);
      panes.add(infoPanel);
      panes.addExpansion();

      content = new JPanel();
      content.setLayout(new BorderLayout());
      infoPanel.setLayout(new BorderLayout());
      infoPanel.add(content, BorderLayout.CENTER);

      details = ViewUtil.getClearPanel();

      content.add(details);
    }
Example #30
0
  /**
   * Diese Methode initialisiert die OptionalFields Panel und fuegt die benuetigte Text Areas ein
   *
   * @return javax.swing.JPanel
   */
  private JPanel getOptTextField(Undomanager manager) {

    // Optional Field Pane
    JPanel myOpt = new JPanel();
    JPanel jPanelOpt = new JPanel();
    myOpt.setLayout(new BorderLayout());

    jPanelOpt = new JPanel();
    isRequired = false;
    // Skalierung in Y - Richtung
    jPanelOpt.setLayout(new BoxLayout(jPanelOpt, BoxLayout.Y_AXIS));

    // Felder einfuegen
    jPanelOpt.add(getFilePanel(Main.fileField, manager));
    for (int i = 1; i < entryType.getOptionalFields().size(); i++) {
      if (!entryType.getOptionalFields().get(i).equals("pdfField")) {
        jPanelOpt.add(getTextPanel(entryType.getOptionalFields().get(i), manager));
      }
    }
    jScrollPaneOpt.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jScrollPaneOpt.getVerticalScrollBar().setUnitIncrement(12);
    jScrollPaneOpt.setViewportView(jPanelOpt);

    myOpt.add(getTypePanel(), BorderLayout.WEST);
    myOpt.add(jScrollPaneOpt, BorderLayout.CENTER);
    myOpt.add(getBottomPanel(), BorderLayout.PAGE_END);
    return myOpt;
  }