예제 #1
0
  public TextView(ObjectViewContainer aContainer) {
    super(aContainer);

    setLayout(new GridBagLayout());
    GridBagConstraints aConstraints = new GridBagConstraints();

    JLabel aLabel = new JLabel("Text:");
    aConstraints.gridy = 0;
    aConstraints.weightx = 1;
    aConstraints.fill = GridBagConstraints.HORIZONTAL;
    add(aLabel, aConstraints);

    maTextLabel = new JLabel("");
    aConstraints.gridx = 1;
    aConstraints.fill = GridBagConstraints.NONE;
    aConstraints.anchor = GridBagConstraints.WEST;
    add(maTextLabel, aConstraints);

    aLabel = new JLabel("Caret position:");
    aConstraints.gridx = 0;
    aConstraints.gridy = 1;
    aConstraints.weightx = 1;
    aConstraints.fill = GridBagConstraints.HORIZONTAL;
    add(aLabel, aConstraints);

    maCaretPositionLabel = new JLabel("");
    aConstraints.gridx = 1;
    aConstraints.fill = GridBagConstraints.NONE;
    aConstraints.anchor = GridBagConstraints.WEST;
    add(maCaretPositionLabel, aConstraints);
  }
예제 #2
0
  public void createGUI() {
    setLayout(new BorderLayout());

    buttonPanel.add(submitButton);
    buttonPanel.setSize(400, 400);
    hostPanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    ImageIcon imageIcon = new ImageIcon("images/logo.png"); // load the image to a imageIcon
    Image image = imageIcon.getImage(); // transform it
    Image newimg =
        image.getScaledInstance(600, 120, java.awt.Image.SCALE_SMOOTH); // scale it the smooth way
    imageIcon = new ImageIcon(newimg); // transform it back
    JLabel scrabbleLabel = new JLabel(imageIcon, SwingConstants.CENTER);
    add(scrabbleLabel, BorderLayout.NORTH);
    gbc.gridx = 0;
    gbc.gridy = 0;
    hostPanel.add(hostLabel, gbc);
    gbc.gridx = 0;
    gbc.insets = new Insets(46, 0, 46, 0);
    gbc.gridy = 1;
    hostPanel.add(portLabel, gbc);
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.anchor = GridBagConstraints.EAST;
    hostPanel.add(portTF, gbc);
    gbc.anchor = GridBagConstraints.CENTER;
    gbc.gridx = 0;
    gbc.gridy = 2;
    gbc.gridwidth = 2;
    hostPanel.add(buttonPanel, gbc);
    add(hostPanel, BorderLayout.CENTER);
  }
  public JFrame createFrame() {
    SQLElement element = Configuration.getInstance().getDirectory().getElement("SAISIE_ACHAT");
    ListeGestCommEltPanel panel = new ListeGestCommEltPanel(element);
    panel.setAddVisible(true);
    IListFrame frame = new IListFrame(panel);
    IListTotalPanel total =
        new IListTotalPanel(
            frame.getPanel().getListe(),
            Arrays.asList(
                element.getTable().getField("MONTANT_HT"),
                element.getTable().getField("MONTANT_TTC")));
    GridBagConstraints c = new DefaultGridBagConstraints();
    c.gridy = 3;
    c.weightx = 0;
    c.fill = GridBagConstraints.NONE;
    c.anchor = GridBagConstraints.EAST;
    frame.getPanel().add(total, c);

    // Date panel
    Map<IListe, SQLField> map = new HashMap<IListe, SQLField>();
    map.put(frame.getPanel().getListe(), element.getTable().getField("DATE"));

    IListFilterDatePanel datePanel =
        new IListFilterDatePanel(map, IListFilterDatePanel.getDefaultMap());
    c.gridy = 4;
    c.anchor = GridBagConstraints.CENTER;
    c.weighty = 0;
    datePanel.setFilterOnDefault();
    frame.getPanel().add(datePanel, c);
    return frame;
  }
  private JPanel createPublishSettingsPanel() {
    final JComboBox fileFormat = new JComboBox(exportFormatModel);

    final GridBagConstraints c = new GridBagConstraints();
    final JPanel publishSettingsPanel = new JPanel(new GridBagLayout());

    c.insets = new Insets(5, 5, 0, 5);
    c.gridwidth = 1;
    c.gridx = 0;
    c.gridy = 0;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.WEST;
    publishSettingsPanel.add(
        new JLabel(Messages.getInstance().getString("RepositoryPublishDialog.OutputType")), c);

    c.insets = new Insets(5, 5, 5, 0);
    c.gridwidth = 1;
    c.gridx = 0;
    c.gridy = 1;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.WEST;
    c.weightx = 0.0;
    publishSettingsPanel.add(fileFormat, c);

    c.insets = new Insets(0, 5, 5, 5);
    c.fill = GridBagConstraints.NONE;
    c.anchor = GridBagConstraints.WEST;
    c.gridx = 1;
    c.gridy = 1;
    c.weightx = 1.0;
    publishSettingsPanel.add(lockOutputTypeCheckBox, c);
    return publishSettingsPanel;
  }
예제 #5
0
  // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    nameLabel = new javax.swing.JLabel();
    nameTextField = new javax.swing.JTextField();

    setLayout(new java.awt.GridBagLayout());

    setBorder(javax.swing.BorderFactory.createEmptyBorder(12, 12, 12, 12));
    nameLabel.setLabelFor(nameTextField);
    nameLabel.setText("Folders:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 6);
    add(nameLabel, gridBagConstraints);

    nameTextField.setColumns(25);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    add(nameTextField, gridBagConstraints);
  }
예제 #6
0
 /**
  * This method initializes jContentPane
  *
  * @return javax.swing.JPanel
  */
 private JPanel getJContentPane() {
   if (jContentPane == null) {
     GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
     gridBagConstraints2.gridx = 1;
     gridBagConstraints2.gridy = 1;
     GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
     gridBagConstraints11.fill = GridBagConstraints.BOTH;
     gridBagConstraints11.gridy = 0;
     gridBagConstraints11.weightx = 1.0;
     gridBagConstraints11.weighty = 1.0;
     gridBagConstraints11.gridheight = 2;
     gridBagConstraints11.gridx = 0;
     GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
     gridBagConstraints4.gridx = 1;
     gridBagConstraints4.weightx = 0.0D;
     gridBagConstraints4.weighty = 1.0D;
     gridBagConstraints4.fill = GridBagConstraints.BOTH;
     gridBagConstraints4.anchor = GridBagConstraints.NORTH;
     gridBagConstraints4.gridy = 0;
     GridBagConstraints gridBagConstraints = new GridBagConstraints();
     gridBagConstraints.gridx = 0;
     gridBagConstraints.weighty = 1.0D;
     gridBagConstraints.fill = GridBagConstraints.VERTICAL;
     gridBagConstraints.anchor = GridBagConstraints.NORTH;
     gridBagConstraints.gridy = 0;
     jContentPane = new JPanel();
     jContentPane.setLayout(new GridBagLayout());
     jContentPane.add(getVolumeMaster(), gridBagConstraints4);
     jContentPane.add(getScrollSlaves(), gridBagConstraints11);
     jContentPane.add(jLabel, gridBagConstraints2);
   }
   return jContentPane;
 }
예제 #7
0
  private JPanel getMainPanel() {
    if (mainPanel == null) {
      mainPanel = new JPanel();
      mainPanel.setPreferredSize(new Dimension(550, 300));
      GridBagLayout layout = new GridBagLayout();

      mainPanel.setLayout(layout);

      GridBagConstraints constraints = new GridBagConstraints();

      constraints.fill = GridBagConstraints.BOTH;
      constraints.weightx = 2;
      constraints.weighty = 1;
      constraints.anchor = GridBagConstraints.NORTHWEST;
      constraints.gridwidth = 2;
      layout.setConstraints(getAvailableRobotsPanel(), constraints);
      mainPanel.add(getAvailableRobotsPanel());
      constraints.gridwidth = 1;
      constraints.weightx = 0;
      constraints.weighty = 0;
      constraints.anchor = GridBagConstraints.CENTER;
      layout.setConstraints(getButtonsPanel(), constraints);
      mainPanel.add(getButtonsPanel());
      constraints.gridwidth = GridBagConstraints.REMAINDER;
      constraints.weightx = 1;
      constraints.weighty = 1;
      constraints.anchor = GridBagConstraints.NORTHWEST;
      layout.setConstraints(getSelectedRobotsPanel(), constraints);
      mainPanel.add(getSelectedRobotsPanel());
    }
    return mainPanel;
  }
예제 #8
0
  /**
   * Adds a labeled item to the panel on the current myNextItemRow, at the specified column.
   *
   * @param name The label text for the item.
   * @param item The item to be added.
   * @param col desired grid bag layor column
   */
  public void addItem(final String name, final JComponent item, int col) {

    JLabel label = new JLabel(name);

    GridBagConstraints labelConstraints = new GridBagConstraints();

    labelConstraints.gridx = col;
    labelConstraints.gridy = myNextItemRow;
    labelConstraints.insets = new Insets(10, 10, 0, 0);
    labelConstraints.anchor = GridBagConstraints.NORTHEAST;
    labelConstraints.fill = GridBagConstraints.NONE;

    add(label, labelConstraints);

    // Add the component with its constraints
    GridBagConstraints itemConstraints = new GridBagConstraints();

    itemConstraints.gridx = col + 1;
    itemConstraints.gridy = myNextItemRow;
    itemConstraints.insets = new Insets(10, 10, 0, 10);
    itemConstraints.weightx = 1.0;
    itemConstraints.anchor = GridBagConstraints.WEST;
    itemConstraints.fill = GridBagConstraints.HORIZONTAL;

    add(item, itemConstraints);
  }
예제 #9
0
  /**
   * Add a labeled item to the panel. The item is added to the row below the last item added.
   *
   * @param labelText The label text for the item.
   * @param item The item to be added.
   */
  public void addItem(final String labelText, final JComponent item) {
    // Create the label and its constraints
    JLabel label = new JLabel(labelText);

    GridBagConstraints labelConstraints = new GridBagConstraints();

    labelConstraints.gridx = 0;
    labelConstraints.gridy = myNextItemRow;
    labelConstraints.insets = new Insets(10, 10, 0, 0);
    labelConstraints.anchor = GridBagConstraints.NORTHEAST;
    labelConstraints.fill = GridBagConstraints.NONE;

    add(label, labelConstraints);

    // Add the component with its constraints
    GridBagConstraints itemConstraints = new GridBagConstraints();

    itemConstraints.gridx = 1;
    itemConstraints.gridy = myNextItemRow;
    itemConstraints.insets = new Insets(10, 10, 0, 10);
    itemConstraints.weightx = 1.0;
    itemConstraints.anchor = GridBagConstraints.WEST;
    itemConstraints.fill = GridBagConstraints.HORIZONTAL;

    add(item, itemConstraints);

    myNextItemRow++;
  }
예제 #10
0
  // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    toolButtonGroup = new javax.swing.ButtonGroup();
    scrollPane = new javax.swing.JScrollPane();
    view = new org.jhotdraw.draw.DefaultDrawingView();
    jPanel1 = new javax.swing.JPanel();
    creationToolbar = new javax.swing.JToolBar();
    attributesToolbar = new javax.swing.JToolBar();

    setLayout(new java.awt.BorderLayout());

    scrollPane.setViewportView(view);

    add(scrollPane, java.awt.BorderLayout.CENTER);

    jPanel1.setLayout(new java.awt.GridBagLayout());

    creationToolbar.setFloatable(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    jPanel1.add(creationToolbar, gridBagConstraints);

    attributesToolbar.setFloatable(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    jPanel1.add(attributesToolbar, gridBagConstraints);

    add(jPanel1, java.awt.BorderLayout.SOUTH);
  } // </editor-fold>//GEN-END:initComponents
  // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    savingDataLabel = new javax.swing.JLabel();

    setPreferredSize(new java.awt.Dimension(450, 50));
    setLayout(new java.awt.GridBagLayout());

    savingDataLabel.setText(
        org.openide.util.NbBundle.getMessage(
            SavingProjectDataPanel.class, "LBL_savingDataLabel")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(8, 8, 0, 8);
    add(savingDataLabel, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 8, 8, 8);
    gridBagConstraints.weightx = 1.0;
    add(component, gridBagConstraints);
  } // </editor-fold>//GEN-END:initComponents
예제 #12
0
  private void constructFieldsPanel() {
    GridBagConstraints c = new GridBagConstraints();
    c.gridy = 0;

    c.gridx = 0;
    c.insets = new Insets(0, 0, 5, 10);
    c.anchor = GridBagConstraints.LINE_END;
    fieldsPanel.add(emailLabel, c);

    c.gridx = 1;
    c.insets = new Insets(0, 0, 5, 0);
    c.anchor = GridBagConstraints.LINE_START;
    fieldsPanel.add(emailField, c);

    c.gridy = 1;
    c.gridx = 0;
    c.insets = new Insets(0, 0, 10, 10);
    c.anchor = GridBagConstraints.LINE_END;
    fieldsPanel.add(passwordLabel, c);

    c.gridx = 1;
    c.insets = new Insets(0, 0, 10, 0);
    c.anchor = GridBagConstraints.LINE_START;
    fieldsPanel.add(passwordField, c);
  }
예제 #13
0
  /**
   * Construct the demo
   *
   * @param window
   * @param capture
   * @throws Exception
   */
  public VideoColourSIFT(final JComponent window, final VideoCapture capture) throws Exception {
    final int width = capture.getWidth();
    final int height = capture.getHeight();
    this.capture = capture;
    this.polygonListener = new PolygonDrawingListener();

    GridBagConstraints gbc = new GridBagConstraints();

    final JLabel label =
        new JLabel(
            "<html><body><p>Hold an object in front of the camera, and press space. Select<br/>"
                + "the outline of the object by clicking points on the frozen video<br/>"
                + "image, and press C when you're done. Press space to start the video<br/>"
                + "again, and the object should be tracked.</p></body></html>");
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 2;
    gbc.insets = new Insets(8, 8, 8, 8);
    window.add(label, gbc);

    this.vidPanel = new JPanel(new GridBagLayout());
    this.vidPanel.setBorder(BorderFactory.createTitledBorder("Live Video"));
    this.videoFrame = VideoDisplay.createVideoDisplay(capture, this.vidPanel);
    gbc = new GridBagConstraints();
    gbc.gridy = 1;
    gbc.gridx = 0;
    gbc.gridwidth = 1;
    window.add(this.vidPanel, gbc);

    this.modelPanel = new JPanel(new GridBagLayout());
    this.modelPanel.setBorder(BorderFactory.createTitledBorder("Model"));
    this.modelFrame = new ImageComponent(true, false);
    this.modelFrame.setSize(width, height);
    this.modelFrame.setPreferredSize(new Dimension(width, height));
    this.modelPanel.add(this.modelFrame);
    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.PAGE_START;
    gbc.gridy = 1;
    gbc.gridx = 1;
    window.add(this.modelPanel, gbc);

    this.matchPanel = new JPanel(new GridBagLayout());
    this.matchPanel.setBorder(BorderFactory.createTitledBorder("Matches"));
    this.matchFrame = new ImageComponent(true, false);
    this.matchFrame.setSize(width * 2, height);
    this.matchFrame.setPreferredSize(new Dimension(width * 2, height));
    this.matchPanel.add(this.matchFrame);
    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.PAGE_END;
    gbc.gridy = 2;
    gbc.gridx = 0;
    gbc.gridwidth = 2;
    window.add(this.matchPanel, gbc);

    this.videoFrame.getScreen().addMouseListener(this.polygonListener);

    this.videoFrame.addVideoListener(this);
    this.engine = new DoGColourSIFTEngine();
    this.engine.getOptions().setDoubleInitialImage(false);
  }
예제 #14
0
  /**
   * This method initializes panelCommand
   *
   * @return javax.swing.JPanel
   */
  private javax.swing.JPanel getPanelCommand() {
    if (panelCommand == null) {

      panelCommand = new javax.swing.JPanel();
      panelCommand.setLayout(new java.awt.GridBagLayout());
      panelCommand.setName(prefix + ".panel");

      GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
      GridBagConstraints gridBagConstraints2 = new GridBagConstraints();

      gridBagConstraints1.gridx = 0;
      gridBagConstraints1.gridy = 0;
      gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
      gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTHWEST;
      gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
      gridBagConstraints1.weightx = 1.0D;
      gridBagConstraints2.gridx = 0;
      gridBagConstraints2.gridy = 1;
      gridBagConstraints2.weightx = 1.0;
      gridBagConstraints2.weighty = 1.0;
      gridBagConstraints2.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints2.insets = new java.awt.Insets(0, 0, 0, 0);
      gridBagConstraints2.anchor = java.awt.GridBagConstraints.NORTHWEST;

      panelCommand.add(this.getPanelToolbar(), gridBagConstraints1);
      panelCommand.add(getWorkPanel(), gridBagConstraints2);
    }
    return panelCommand;
  }
  public MantisToolGripperControlPanel(RobotOverlord gui, MantisToolGripper tool) {
    super();

    this.tool = tool;

    this.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 1;
    c.weighty = 1;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.fill = GridBagConstraints.HORIZONTAL;

    CollapsiblePanel gripper = new CollapsiblePanel("Gripper");
    this.add(gripper, c);

    GridBagConstraints con1 = new GridBagConstraints();
    con1.gridx = 0;
    con1.gridy = 0;
    con1.weightx = 1;
    con1.weighty = 1;
    con1.fill = GridBagConstraints.HORIZONTAL;
    con1.anchor = GridBagConstraints.NORTH;

    JPanel p = new JPanel(new GridLayout(1, 0));
    gripper.getContentPane().add(p);
    p.add(arm5ServoOpen = createButton("Open"));
    p.add(servo = new JLabel("0.00"));
    p.add(arm5ServoClose = createButton("Close"));
  }
예제 #16
0
  private void buildConfigPanel() {

    initConfigPanel();

    GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(0, 0, 0, 0);

    c.anchor = GridBagConstraints.FIRST_LINE_START;
    c.gridx = 0;
    c.gridy = 0;
    c.gridwidth = 1;
    c.gridheight = 1;
    configPanel.add(new JLabel("Database output directory:"), c);

    //        c.anchor = GridBagConstraints.FIRST_LINE_END;
    c.gridy = 1;
    configPanel.add(rdoUseGlobalDir, c);
    c.gridy = 2;
    configPanel.add(rdoUseCustomDir, c);

    c.anchor = GridBagConstraints.CENTER;
    c.gridy = 3;
    c.gridwidth = 2;
    configPanel.add(lblCustomOutDir, c);

    c.anchor = GridBagConstraints.FIRST_LINE_END;
    c.gridy = 4;
    c.gridwidth = 1;
    configPanel.add(btnCustomDir, c);
  }
예제 #17
0
  /** initialization of graphical components */
  public JMainWinView() {

    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setBounds(200, 200, 800, 600);

    /** initialization jContentPanel */
    jContentPanel = new JPanel();
    jContentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    GridBagLayout gbl_jContentPanel = new GridBagLayout();
    gbl_jContentPanel.columnWeights = new double[] {1.0, 0.0};
    gbl_jContentPanel.rowWeights = new double[] {0.0, 1.0};
    jContentPanel.setLayout(gbl_jContentPanel);
    setContentPane(jContentPanel);

    /** initialization jMainMenu */
    jMainMenu = new JMainMenuView();
    GridBagConstraints gbc_jMainMenu = new GridBagConstraints();
    gbc_jMainMenu.anchor = GridBagConstraints.NORTH;
    gbc_jMainMenu.insets = new Insets(0, 0, 0, 0);
    gbc_jMainMenu.fill = GridBagConstraints.HORIZONTAL;
    gbc_jMainMenu.gridx = 0;
    gbc_jMainMenu.gridy = 0;
    gbc_jMainMenu.gridwidth = 2;
    jContentPanel.add(jMainMenu, gbc_jMainMenu);

    /** initialization jPanelFiles */
    jPanelFiles = new JPanelFiles();
    GridBagConstraints gbc_jPanelFiles = new GridBagConstraints();
    gbc_jPanelFiles.anchor = GridBagConstraints.NORTH;
    gbc_jPanelFiles.insets = new Insets(0, 0, 0, 0);
    gbc_jPanelFiles.fill = GridBagConstraints.HORIZONTAL;
    gbc_jPanelFiles.gridx = 0;
    gbc_jPanelFiles.gridy = 1;
    jContentPanel.add(jPanelFiles, gbc_jPanelFiles);
  }
  protected void initializeLayout() {
    this.sortedFieldsAdapter = this.buildSortedInsertFieldReturnOnlyFlagsAdapter();
    this.tableModel = this.buildTableModel();
    this.rowSelectionModel = this.buildRowSelectionModel();

    GridBagConstraints constraints = new GridBagConstraints();

    // Create the button panel first
    JPanel buttonPanel = buildButtonPanel();
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_END;
    constraints.insets = new Insets(5, 0, 0, 0);

    add(buttonPanel, constraints);

    // Create the table after since some listeners need access to the buttons
    JComponent insertTablePane = buildInsertPanel();
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 1;
    constraints.fill = GridBagConstraints.BOTH;
    constraints.anchor = GridBagConstraints.FIRST_LINE_START;
    constraints.insets = new Insets(0, 0, 0, 0);

    add(insertTablePane, constraints);
  }
예제 #19
0
  void buildLayout() {
    GridBagLayout layout = new GridBagLayout();
    GridBagConstraints constraints = new GridBagConstraints();
    panel.setLayout(layout);

    constraints.fill = GridBagConstraints.NONE;
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.insets.top = 50;
    constraints.insets.bottom = 0;
    constraints.anchor = GridBagConstraints.CENTER;
    layout.setConstraints(loginPanel, constraints);

    constraints.fill = GridBagConstraints.NONE;
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.insets.top = 0;
    constraints.insets.bottom = 15;
    constraints.anchor = GridBagConstraints.CENTER;
    layout.setConstraints(lblWashU, constraints);

    constraints.fill = GridBagConstraints.NONE;
    constraints.gridx = 0;
    constraints.gridy = 2;
    constraints.insets.top = 0;
    constraints.insets.bottom = 10;
    constraints.anchor = GridBagConstraints.CENTER;
    layout.setConstraints(lblHost, constraints);
  }
  protected JPanel buildVersionLockingFieldChooser() {
    GridBagConstraints constraints = new GridBagConstraints();
    Pane lockingPanel = new Pane(new GridBagLayout());

    JLabel lockingFieldLabel = buildLabel("EIS_LOCKING_POLICY_XPATH");
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(0, 0, 0, 0);
    lockingPanel.add(lockingFieldLabel, constraints);

    XpathChooser xpathChooser =
        new XpathChooser(this.getWorkbenchContextHolder(), buildLockingFieldSelectionHolder());
    xpathChooser.setAccessibleLabeler(lockingFieldLabel);
    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(0, 5, 0, 0);
    lockingPanel.add(xpathChooser, constraints);

    return lockingPanel;
  }
  protected JPanel createLocationFieldPanel() {
    final GridBagConstraints c = new GridBagConstraints();
    final JPanel locationFieldPanel = new JPanel();
    locationFieldPanel.setLayout(new GridBagLayout());
    c.insets = new Insets(0, 5, 5, 0);
    c.gridx = 0;
    c.gridy = 0;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1.0;
    c.anchor = GridBagConstraints.WEST;
    locationFieldPanel.add(getLocationCombo(), c);

    c.insets = new Insets(5, 8, 5, 0);
    c.gridx = 1;
    c.gridy = 0;
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0.0;
    c.anchor = GridBagConstraints.WEST;
    locationFieldPanel.add(new BorderlessButton(new LevelUpAction()), c);

    c.gridx = 2;
    c.gridy = 0;
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0.0;
    c.anchor = GridBagConstraints.EAST;
    locationFieldPanel.add(new BorderlessButton(new BrowseRepositoryAction()), c);

    c.gridx = 3;
    c.gridy = 0;
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0.0;
    c.anchor = GridBagConstraints.EAST;
    locationFieldPanel.add(new BorderlessButton(new NewFolderAction()), c);
    return locationFieldPanel;
  }
예제 #22
0
 /**
  * Start layout determining. If it is needed, a dummy component will be created as first row. This
  * will be done, if the IzPack guiprefs modifier with the key "layoutAnchor" has the value "SOUTH"
  * or "SOUTHWEST". The earlier used value "BOTTOM" and the declaration via the IzPack variable
  * <code>IzPanel.LayoutType</code> are also supported.
  */
 private void startGridBagLayout() {
   if (layoutStarted) {
     return;
   }
   layoutStarted = true;
   if (izPanelLayout == null || !(izPanelLayout instanceof GridBagLayout)) {
     izPanelLayout = new GridBagLayout();
   }
   GridBagConstraints dgbc = new GridBagConstraints();
   dgbc.insets = new Insets(0, 0, getYGap(LABEL_GAP), 0);
   dgbc.anchor = GridBagConstraints.WEST;
   defaultConstraints = dgbc;
   parent.setLayout(izPanelLayout);
   switch (getAnchor()) {
     case SOUTH:
     case SOUTH_WEST:
       // Make a header to push the rest to the bottom.
       IzPanel.Filler dummy = new IzPanel.Filler();
       GridBagConstraints gbConstraint = (GridBagConstraints) getNextYConstraints();
       gbConstraint.weighty = 1.0;
       gbConstraint.fill = GridBagConstraints.BOTH;
       gbConstraint.anchor = GridBagConstraints.WEST;
       parent.add(dummy, gbConstraint);
       break;
     default:
       break;
   }
   // TODO: impl for layout type CENTER, ...
 }
예제 #23
0
  private void initialize() {
    setName("JunkPanel");
    setLayout(new GridBagLayout());
    refreshLanguage();

    // Adds all of the components
    final GridBagConstraints constraints = new GridBagConstraints();
    constraints.anchor = GridBagConstraints.WEST;
    final Insets insets5555 = new Insets(5, 5, 5, 5);
    constraints.insets = insets5555;
    constraints.weightx = 1.0;
    constraints.gridwidth = 1;
    constraints.gridy = 0;

    constraints.insets = insets5555;
    constraints.gridx = 0;

    add(hideJunkMessagesCheckBox, constraints);

    constraints.gridy++;

    add(markJunkIdentityBadCheckBox, constraints);

    constraints.gridy++;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    {
      final JSeparator separator = new JSeparator(SwingConstants.HORIZONTAL);
      add(separator, constraints);
    }
    constraints.fill = GridBagConstraints.NONE;
    constraints.gridy++;

    add(stopBoardUpdatesWhenDosedCheckBox, constraints);

    constraints.gridy++;

    {
      final JPanel subPanel = new JPanel(new GridBagLayout());
      final GridBagConstraints subConstraints = new GridBagConstraints();
      subConstraints.insets = new Insets(0, 10, 0, 10);
      subConstraints.anchor = GridBagConstraints.WEST;
      subConstraints.gridx = 0;
      subPanel.add(LinvalidSubsequentMessagesThreshold, subConstraints);
      subConstraints.gridx = 1;
      subPanel.add(TfInvalidSubsequentMessagesThreshold, subConstraints);

      add(subPanel, constraints);
    }

    // glue
    constraints.gridy++;
    constraints.gridx = 0;
    constraints.fill = GridBagConstraints.BOTH;
    constraints.weightx = 1;
    constraints.weighty = 1;
    add(new JLabel(""), constraints);

    // Add listeners
    stopBoardUpdatesWhenDosedCheckBox.addActionListener(listener);
  }
예제 #24
0
  public void insert(Container cont, GridBagLayout gbl, int x, int y) {
    GridBagConstraints gbc = new GridBagConstraints();

    gbc.gridx = x;
    gbc.gridy = y;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    gbc.weightx = 1;
    gbc.weighty = 1;
    gbc.anchor = GridBagConstraints.EAST;
    gbc.fill = GridBagConstraints.NONE;

    gbl.setConstraints(name, gbc);
    cont.add(name);

    gbc.gridx = x + 1;
    gbc.weightx = 10;
    gbc.anchor = GridBagConstraints.CENTER;
    gbc.fill = GridBagConstraints.HORIZONTAL;

    gbl.setConstraints(scroll, gbc);
    cont.add(scroll);

    gbc.gridx = x + 2;
    gbc.weightx = 1;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.NONE;

    gbl.setConstraints(field, gbc);
    cont.add(field);
  }
예제 #25
0
  private static JPanel makePanel(String title, String href) {
    JPanel p = new JPanel(new GridBagLayout());
    p.setBorder(BorderFactory.createTitledBorder(title));

    JLabel label = new JLabel(href);

    JEditorPane editor = new JEditorPane("text/html", href);
    editor.setOpaque(false);
    editor.setEditable(false);
    editor.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);

    GridBagConstraints c = new GridBagConstraints();
    c.gridheight = 1;

    c.gridx = 0;
    c.insets = new Insets(5, 5, 5, 0);
    c.anchor = GridBagConstraints.EAST;
    c.gridy = 0;
    p.add(new JLabel("JLabel: "), c);
    c.gridy = 2;
    p.add(new JLabel("JEditorPane: "), c);

    c.gridx = 1;
    c.weightx = 1d;
    c.anchor = GridBagConstraints.WEST;
    c.gridy = 0;
    p.add(label, c);
    c.gridy = 2;
    p.add(editor, c);

    return p;
  }
예제 #26
0
    public void addRow(String label, JComponent component) {
      GridBagConstraints labelConstraints = new GridBagConstraints();
      labelConstraints.gridx = 0;
      labelConstraints.gridy = rowCount;
      labelConstraints.insets = new Insets(0, 0, 5, 5);
      labelConstraints.anchor = GridBagConstraints.LINE_END;

      GridBagConstraints componentConstraints = new GridBagConstraints();
      componentConstraints.gridx = 1;
      componentConstraints.gridy = rowCount;
      componentConstraints.gridwidth = GridBagConstraints.REMAINDER;
      componentConstraints.fill = GridBagConstraints.HORIZONTAL;
      componentConstraints.insets = new Insets(0, 0, 5, 0);
      componentConstraints.anchor = GridBagConstraints.LINE_START;

      JLabel l = new JLabel(label + ":");
      add(l, labelConstraints);
      add(component, componentConstraints);
      rowCount++;

      // Add another column/row that takes up all available space.
      // This moves the layout to the top-left corner.
      layout.columnWidths = new int[] {0, 0, 0};
      layout.columnWeights = new double[] {0.0, 0.0, 1.0E-4};
      layout.rowHeights = new int[rowCount + 1];
      layout.rowWeights = new double[rowCount + 1];
      layout.rowWeights[rowCount] = 1.0E-4;
    }
  // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    jPanelEmptyDataSource = new javax.swing.JPanel();
    jLabel24 = new javax.swing.JLabel();
    jSpinnerNumRecords = new javax.swing.JSpinner();

    setLayout(new java.awt.BorderLayout());

    jPanelEmptyDataSource.setLayout(new java.awt.GridBagLayout());

    jLabel24.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    jLabel24.setText("Number of empty records");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(16, 20, 0, 4);
    jPanelEmptyDataSource.add(jLabel24, gridBagConstraints);

    jSpinnerNumRecords.setPreferredSize(new java.awt.Dimension(70, 18));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(14, 0, 0, 20);
    jPanelEmptyDataSource.add(jSpinnerNumRecords, gridBagConstraints);

    add(jPanelEmptyDataSource, java.awt.BorderLayout.CENTER);
  } // </editor-fold>//GEN-END:initComponents
  /**
   * This method initializes jPanelForm
   *
   * @return javax.swing.JPanel
   */
  private JPanel getJPanelForm() {
    if (jPanelForm == null) {

      if (jPanelFormData == null) {
        throw new IllegalStateException("Internal error. 'jPanelFormData' must be sets already.");
      }

      GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
      gridBagConstraints1.weighty = 1.0D;
      gridBagConstraints1.gridy = 1;
      gridBagConstraints1.gridx = 0;
      gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
      gridBagConstraints1.anchor = GridBagConstraints.NORTH;
      gridBagConstraints1.weightx = 1.0D;

      GridBagConstraints gridBagConstraints = new GridBagConstraints();
      gridBagConstraints.gridy = 0;
      gridBagConstraints.anchor = GridBagConstraints.NORTH;
      gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
      gridBagConstraints.gridx = 0;
      jPanelForm = new JPanel();
      jPanelForm.setLayout(new GridBagLayout());
      jPanelForm.add(this.jPanelFormData, gridBagConstraints);

      jPanelForm.add(getJPanelFormImageControl(), gridBagConstraints1);
      if (readOnly) {
        this.jLabelImage.setVisible(false);
        this.jButtonLoad.setVisible(false);
        this.jButtonReset.setVisible(false);
      }
    }
    return jPanelForm;
  }
  /** stellt das Datenidentifikationsauswahl-Panel zusammen */
  private void createAndShowGui() {
    GridBagConstraints gbc;

    // Zeile für Zeile hinzufügen
    // Attributgruppe
    gbc = makegbc(0, 0, 1, 1);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    _gridBagLayout.setConstraints(_atgLabel, gbc);
    add(_atgLabel);

    gbc = makegbc(1, 0, 1, 1);
    gbc.weightx = 1;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    _gridBagLayout.setConstraints(_atgTextField, gbc);
    add(_atgTextField);

    // Aspekte
    gbc = makegbc(0, 1, 1, 1);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    _gridBagLayout.setConstraints(_aspLabel, gbc);
    add(_aspLabel);

    gbc = makegbc(1, 1, 1, 1);
    gbc.weightx = 1;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    _gridBagLayout.setConstraints(_aspTextField, gbc);
    add(_aspTextField);

    // Simulationsvariante
    gbc = makegbc(0, 2, 1, 1);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    _gridBagLayout.setConstraints(_simLabel, gbc);
    add(_simLabel);

    gbc = makegbc(1, 2, 1, 1);
    gbc.weightx = 1;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    _gridBagLayout.setConstraints(_simTextField, gbc);
    add(_simTextField);

    // Objekte
    gbc = makegbc(0, 3, 1, 1);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    _gridBagLayout.setConstraints(_objLabel, gbc);
    add(_objLabel);

    JScrollPane scrollPane = new JScrollPane(_objList);
    gbc = makegbc(1, 3, 1, 1);
    gbc.weightx = 1;
    gbc.weighty = 1;
    gbc.fill = GridBagConstraints.BOTH;
    _gridBagLayout.setConstraints(scrollPane, gbc);
    add(scrollPane);

    // Ändern - Button
    gbc = makegbc(2, 0, 1, 4);
    gbc.anchor = GridBagConstraints.SOUTHEAST;
    _gridBagLayout.setConstraints(_changeButton, gbc);
    add(_changeButton);
  }
예제 #30
0
  /** Builds up the pane. */
  private void buildDesktop(final Container aDesktop) {
    // set up for using the gridbag layout
    aDesktop.setLayout(new GridBagLayout());

    aDesktop.setLayout(new GridBagLayout());
    GridBagConstraints dc = new GridBagConstraints();
    dc.insets = new Insets(2, 2, 2, 2);

    int row = 0;

    dc.anchor = GridBagConstraints.CENTER;
    dc.gridx = 0;
    dc.gridy = row++;
    aDesktop.add(buildBundlePanel(), dc);

    dc.anchor = GridBagConstraints.EAST;
    dc.gridx = 0;
    dc.gridy = row++;
    aDesktop.add(buildInstallPanel(), dc);

    dc.anchor = GridBagConstraints.EAST;
    dc.gridx = 0;
    dc.gridy = row++;
    aDesktop.add(buildButtonsPanel(), dc);
  }