Exemplo n.º 1
0
 /**
  * Adds a label that shows the percentage of hours spent on a particular project.
  *
  * @param gbl The layout to add the label to.
  * @param gbc The layout constraints to use.
  * @param row The row to link against.
  * @see {@link #addRow(GridBagLayout, GridBagConstraints, String, double)}
  */
 private void addPercentLabel(GridBagLayout gbl, GridBagConstraints gbc, Row row) {
   gbc.gridx = 3;
   gbc.ipadx = 5;
   gbl.setConstraints(row.percentL, gbc);
   gbc.ipadx = 0;
   reviewPanel.add(row.percentL);
 }
Exemplo n.º 2
0
 /**
  * This method initializes jContentPane
  *
  * @return javax.swing.JPanel
  */
 private JPanel getJContentPane() {
   if (jContentPane == null) {
     GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
     gridBagConstraints9.gridheight = 1;
     gridBagConstraints9.gridy = 0;
     gridBagConstraints9.ipadx = 0;
     gridBagConstraints9.insets = new Insets(2, 2, 2, 2);
     gridBagConstraints9.weightx = 1.0D;
     gridBagConstraints9.fill = GridBagConstraints.HORIZONTAL;
     gridBagConstraints9.gridx = 0;
     GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
     gridBagConstraints8.gridx = 0;
     gridBagConstraints8.ipadx = 0;
     gridBagConstraints8.ipady = 0;
     gridBagConstraints8.fill = GridBagConstraints.BOTH;
     gridBagConstraints8.insets = new Insets(2, 2, 2, 2);
     gridBagConstraints8.weightx = 1.0D;
     gridBagConstraints8.weighty = 1.0D;
     gridBagConstraints8.gridy = 1;
     jContentPane = new JPanel();
     jContentPane.setLayout(new GridBagLayout());
     jContentPane.add(getMainPanel(), gridBagConstraints8);
     jContentPane.add(getTitlePanel(), gridBagConstraints9);
   }
   return jContentPane;
 }
Exemplo n.º 3
0
 /**
  * Adds a simple 'h' to show that the time period is specified in hours.
  *
  * @param gbl The layout to add the label to.
  * @param gbc The layout constraints to use.
  * @see {@link #addRow(GridBagLayout, GridBagConstraints, String, double)}
  */
 private void addRightLabel(GridBagLayout gbl, GridBagConstraints gbc) {
   JLabel hLabel = new JLabel("h", SwingConstants.CENTER);
   gbc.gridx = 2;
   gbc.ipadx = 5;
   gbl.setConstraints(hLabel, gbc);
   gbc.ipadx = 0;
   reviewPanel.add(hLabel);
 }
 protected GridBagConstraints createConstraints(int x, int y) {
   GridBagConstraints c = new GridBagConstraints();
   c.gridx = x;
   c.gridy = y;
   c.gridwidth = 2;
   c.gridheight = 1;
   c.ipadx = 1;
   c.weightx = 0.5;
   c.weighty = 0.5;
   c.fill = GridBagConstraints.BOTH;
   c.anchor = GridBagConstraints.CENTER;
   return c;
 }
  /**
   * This method initializes jContentPane
   *
   * @return javax.swing.JPanel
   */
  private javax.swing.JPanel getJContentPane() {
    if (jContentPane == null) {
      java.awt.GridBagConstraints gridBagConstraints1 = new GridBagConstraints();

      java.awt.GridBagConstraints gridBagConstraints14 = new GridBagConstraints();

      java.awt.GridBagConstraints gridBagConstraints13 = new GridBagConstraints();

      java.awt.GridBagConstraints gridBagConstraints12 = new GridBagConstraints();

      javax.swing.JLabel jLabel = new JLabel();

      jContentPane = new javax.swing.JPanel();
      jContentPane.setLayout(new GridBagLayout());
      jLabel.setName("jLabel");
      jLabel.setText("");
      gridBagConstraints12.gridx = 0;
      gridBagConstraints12.gridy = 1;
      gridBagConstraints12.ipadx = 0;
      gridBagConstraints12.ipady = 0;
      gridBagConstraints12.anchor = java.awt.GridBagConstraints.WEST;
      gridBagConstraints12.fill = java.awt.GridBagConstraints.HORIZONTAL;
      gridBagConstraints12.insets = new java.awt.Insets(2, 2, 2, 2);
      gridBagConstraints12.weightx = 1.0D;
      gridBagConstraints13.gridx = 1;
      gridBagConstraints13.gridy = 1;
      gridBagConstraints13.ipadx = 0;
      gridBagConstraints13.ipady = 0;
      gridBagConstraints13.fill = java.awt.GridBagConstraints.NONE;
      gridBagConstraints13.anchor = java.awt.GridBagConstraints.EAST;
      gridBagConstraints13.insets = new java.awt.Insets(2, 2, 2, 2);
      gridBagConstraints14.gridx = 2;
      gridBagConstraints14.gridy = 1;
      gridBagConstraints14.ipadx = 0;
      gridBagConstraints14.ipady = 0;
      gridBagConstraints14.anchor = java.awt.GridBagConstraints.EAST;
      gridBagConstraints14.insets = new java.awt.Insets(2, 2, 2, 2);
      gridBagConstraints1.weightx = 1.0;
      gridBagConstraints1.weighty = 1.0;
      gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTHWEST;
      gridBagConstraints1.gridwidth = 3;
      gridBagConstraints1.gridx = 0;
      gridBagConstraints1.gridy = 0;
      jContentPane.add(getJSplitPane(), gridBagConstraints1);
      jContentPane.add(jLabel, gridBagConstraints12);
      jContentPane.add(getBtnOK(), gridBagConstraints13);
      jContentPane.add(getBtnCancel(), gridBagConstraints14);
    }
    return jContentPane;
  }
Exemplo n.º 6
0
    protected void layoutUIComponents(String strPath, boolean bDefaultFile) {
      JLabel label = null;

      // i18n
      // label = new JLabel( "File names can be constructed from a template. The LABEL field is " );
      label =
          new JLabel(
              Util.getAdmLabel(
                  "_admin_File_names_can_be_constructed_from_a_template._The_LABEL_field_is_"));
      label.setForeground(Color.black);
      // m_gbc.weightx = 0.5;
      showInstruction(m_gbl, m_gbc, 0, 0, 7, label);

      // i18n
      // label = new JLabel( "presented as the choice to the user in the \"Data save\" pop-up." );
      label =
          new JLabel(
              Util.getAdmLabel(
                  "_admin_presented_as_the_choice_to_the_user_in_the_Data_save_pop-up."));
      showInstruction(m_gbl, m_gbc, 0, 1, 7, label);
      showInstruction(m_gbl, m_gbc, 0, 2, 1, new JLabel(""));

      label = new JLabel(Util.getAdmLabel("_adm_LABEL"));
      label.setForeground(Color.black);
      m_gbc.gridx = 1;
      m_gbc.gridy = 2;
      m_gbc.ipadx = 10;
      m_gbl.setConstraints(label, m_gbc);
      m_pnlDisplay.add(label);

      label = new JLabel("     ");
      m_gbc.gridx = 2;
      m_gbc.gridy = 2;
      m_gbc.ipadx = 0; // reset to default
      m_gbc.gridwidth = 5;
      m_gbl.setConstraints(label, m_gbc);
      // add( label );

      showInstruction(m_gbl, m_gbc, 2, 2, 1, new JLabel(Util.getAdmLabel("_admin_TEMPLATE")));

      m_nRow = 3;
      m_bDefaultFile = bDefaultFile;
      m_objTxfValue.clearArrays();
      displayNewTxf(strPath);

      m_pnlDisplay.setBorder(
          new CompoundBorder(
              BorderFactory.createTitledBorder(Util.getAdmLabel("_admin_User_Directories")),
              BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    }
Exemplo n.º 7
0
  private void packDevices() {
    int i, j;
    GridBagLayout gbl = new GridBagLayout();
    getContentPane().setLayout(gbl);
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.insets = new Insets(2, 2, 2, 2);

    for (i = 0, j = 0; i < cnt; i++) {
      if (devArray[i].isSpecial) continue;

      gbc.weightx = 0.8;
      gbc.fill = GridBagConstraints.HORIZONTAL;
      gbc.gridx = 0;
      gbc.gridy = j;
      gbc.ipadx = 5;
      gbc.ipady = 5;
      gbl.setConstraints(devArray[i].widgetset.l1, gbc);
      getContentPane().add(devArray[i].widgetset.l1);

      gbc.weightx = 1.0;
      gbc.gridx = 1;
      gbc.gridy = j;
      gbc.ipadx = 0;
      gbc.ipady = 0;
      gbl.setConstraints(devArray[i].widgetset.wc, gbc);
      getContentPane().add(devArray[i].widgetset.wc);

      gbc.weightx = 0.8;
      gbc.gridx = 2;
      gbc.gridy = j;
      gbc.ipadx = 5;
      gbc.ipady = 5;
      gbl.setConstraints(devArray[i].widgetset.l2, gbc);
      getContentPane().add(devArray[i].widgetset.l2);

      gbc.gridx = 3;
      gbc.gridy = j;
      gbl.setConstraints(devArray[i].widgetset.ln, gbc);
      getContentPane().add(devArray[i].widgetset.ln);

      gbc.gridx = 4;
      gbc.gridy = j;
      gbl.setConstraints(devArray[i].widgetset.lval, gbc);
      getContentPane().add(devArray[i].widgetset.lval);

      j++;
    }

    pack();
  }
Exemplo n.º 8
0
  // Initializing this component.
  private void jbInit() {
    callStackTable.addFocusListener(
        new FocusListener() {
          public void focusGained(FocusEvent e) {
            callStackTable_focusGained(e);
          }

          public void focusLost(FocusEvent e) {
            callStackTable_focusLost(e);
          }
        });
    callStackTable.setTableHeader(null);
    callStackTable.setDefaultRenderer(callStackTable.getColumnClass(0), getCellRenderer());
    scrollPane = new JScrollPane(callStackTable);
    setVisibleRows(DEFAULT_VISIBLE_ROWS);
    scrollPane.setLocation(0, 27);
    setBorder(BorderFactory.createEtchedBorder());
    // this.setLayout(null);
    this.setLayout(new GridBagLayout());
    nameLbl.setText("Call Stack");
    nameLbl.setBounds(new Rectangle(3, 4, 70, 23));
    nameLbl.setFont(Utilities.labelsFont);

    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 1;
    c.gridwidth = 7;
    c.gridheight = 1;
    c.anchor = GridBagConstraints.PAGE_END;
    c.gridx = 0;
    c.gridy = 2;
    this.add(scrollPane, c);

    c.fill = GridBagConstraints.HORIZONTAL;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 0.0;
    c.gridwidth = 3;
    c.gridheight = 1;
    c.anchor = GridBagConstraints.FIRST_LINE_START;
    c.gridx = 0;
    c.gridy = 0;
    c.insets = new Insets(5, 0, 0, 0);
    this.add(nameLbl, c);
  }
  private void setupUI() {
    setLayout(new GridBagLayout());
    GridBagConstraints c;

    labelPlay = new JLabel(play_transparent);
    labelPlay.setToolTipText(I18n.tr("Play/Preview"));
    labelPlay.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseReleased(MouseEvent e) {
            labelPlay_mouseReleased(e);
          }
        });
    c = new GridBagConstraints();
    c.gridx = GridBagConstraints.RELATIVE;
    c.ipadx = 3;
    add(labelPlay, c);

    labelDownload = new JLabel(download_transparent);
    labelDownload.setToolTipText(I18n.tr("Download"));
    labelDownload.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseReleased(MouseEvent e) {
            labelDownload_mouseReleased(e);
          }
        });
    c = new GridBagConstraints();
    c.gridx = GridBagConstraints.RELATIVE;
    c.ipadx = 3;
    add(labelDownload, c);

    labelPartialDownload = new JLabel(details_solid);
    labelPartialDownload.setToolTipText(I18n.tr("Select content to download from this torrent."));
    labelPartialDownload.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseReleased(MouseEvent e) {
            labelPartialDownload_mouseReleased(e);
          }
        });
    c = new GridBagConstraints();
    c.gridx = GridBagConstraints.RELATIVE;
    c.ipadx = 3;
    add(labelPartialDownload, c);

    setEnabled(true);
  }
Exemplo n.º 10
0
  /**
   * This method initializes logPanel
   *
   * @return javax.swing.JPanel
   */
  private JPanel getLogPanel() {
    if (logPanel == null) {
      GridBagConstraints gridBagConstraints15 = new GridBagConstraints();
      gridBagConstraints15.fill = GridBagConstraints.BOTH;
      gridBagConstraints15.weighty = 1.0;
      gridBagConstraints15.gridx = 0;
      gridBagConstraints15.gridy = 1;
      gridBagConstraints15.insets = new Insets(10, 10, 10, 10);
      gridBagConstraints15.weightx = 1.0;

      GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
      gridBagConstraints12.gridx = 0;
      gridBagConstraints12.insets = new Insets(5, 5, 5, 0);
      gridBagConstraints12.gridy = 2;

      GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
      gridBagConstraints9.gridx = 0;
      gridBagConstraints9.insets = new Insets(5, 0, 5, 0);
      gridBagConstraints9.ipadx = 0;
      gridBagConstraints9.gridy = 0;

      logTitleLabel = new JLabel();
      logTitleLabel.setText("EAR Log View");
      logTitleLabel.setFont(new Font("Courier New", Font.BOLD, 20));
      logPanel = new JPanel();
      logPanel.setLayout(new GridBagLayout());
      logPanel.setName("logPanel");
      logPanel.add(logTitleLabel, gridBagConstraints9);
      logPanel.add(getLogScrollPane(), gridBagConstraints15);
      logPanel.add(getBackButton(), gridBagConstraints12);
    }
    return logPanel;
  }
Exemplo n.º 11
0
  private void ustawLayout() {
    layout = new FlowLayout();
    this.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();

    c.fill = GridBagConstraints.BOTH;
    c.ipady = 120;
    c.weightx = 1;
    c.weighty = 1.3;
    c.gridx = 1;
    c.gridy = 0;
    this.add(panelRozmowy, c);

    c.fill = GridBagConstraints.BOTH;
    c.ipady = 100; // make this component tall
    c.weightx = 1;
    c.weighty = 1.9;
    c.gridx = 1;
    c.gridy = 1;
    this.add(panelWiadomosci, c);

    c.fill = GridBagConstraints.EAST;
    c.anchor = GridBagConstraints.WEST;
    c.ipady = 10;
    c.ipadx = 10;
    c.weightx = 1;
    c.weighty = 0.1;
    c.gridx = 1;
    c.gridy = 2;
    add(wyslij, c);
  }
Exemplo n.º 12
0
  /* WARNING: THIS METHOD WILL BE REGENERATED. */
  private javax.swing.JPanel getJDialogContentPane() {
    if (ivjJDialogContentPane == null) {
      try {
        ivjJDialogContentPane = new javax.swing.JPanel();
        ivjJDialogContentPane.setName("JDialogContentPane");
        ivjJDialogContentPane.setLayout(new java.awt.GridBagLayout());

        java.awt.GridBagConstraints constraintsJButton1 = new java.awt.GridBagConstraints();
        constraintsJButton1.gridx = 0;
        constraintsJButton1.gridy = 1;
        constraintsJButton1.ipadx = 50;
        constraintsJButton1.insets = new java.awt.Insets(6, 0, 6, 0);
        getJDialogContentPane().add(getJButton1(), constraintsJButton1);

        java.awt.GridBagConstraints constraintsJScrollPane1 = new java.awt.GridBagConstraints();
        constraintsJScrollPane1.gridx = 0;
        constraintsJScrollPane1.gridy = 0;
        constraintsJScrollPane1.fill = java.awt.GridBagConstraints.BOTH;
        constraintsJScrollPane1.weightx = 1.0;
        constraintsJScrollPane1.weighty = 1.0;
        constraintsJScrollPane1.insets = new java.awt.Insets(6, 6, 6, 4);
        getJDialogContentPane().add(getJScrollPane1(), constraintsJScrollPane1);
        // user code begin {1}
        // user code end
      } catch (java.lang.Throwable ivjExc) {
        // user code begin {2}
        // user code end
        handleException(ivjExc);
      }
    }
    return ivjJDialogContentPane;
  }
Exemplo n.º 13
0
  private void makeGridPanel(Component[] components) {
    final Insets insets = new Insets(5, 5, 5, 5);
    final GridBagConstraints gbc = new GridBagConstraints();

    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    gbc.insets = insets;
    gbc.ipadx = 0;
    gbc.ipady = 0;
    gbc.anchor = GridBagConstraints.EAST;
    gbc.fill = GridBagConstraints.HORIZONTAL;

    int i = 0;
    int j = 0;

    for (Component component : components) {
      gbc.gridx = i;
      gbc.gridy = j;
      gbc.gridwidth = 1;
      gbc.gridheight = 1;

      centerPanel.add(component, gbc);

      i++;

      // 2 components per row
      if ((i % 2) == 0) {
        j++;
        i = 0;
      }
    }
  }
  private void layoutComponents(String hebrewWord, String englishWord) {
    setLayout(new GridBagLayout());

    JLabel hebrewLabel = new JLabel(hebrewWord, SwingConstants.CENTER);
    hebrewLabel.setFont(hebrewLabel.getFont().deriveFont(100.0f));
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridwidth = GridBagConstraints.REMAINDER;
    constraints.weightx = 1;
    constraints.weighty = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.ipadx = 15;
    constraints.insets = new Insets(10, 20, 10, 20);
    add(hebrewLabel, constraints);

    JLabel englishLabel = new JLabel(englishWord, SwingConstants.CENTER);
    englishLabel.setFont(englishLabel.getFont().deriveFont(50.0f));
    constraints = new GridBagConstraints();
    constraints.gridwidth = GridBagConstraints.REMAINDER;
    constraints.weightx = 1;
    constraints.weighty = 1;
    constraints.insets = new Insets(10, 20, 10, 20);
    add(englishLabel, constraints);

    okButton = new JButton("OK");
    constraints = new GridBagConstraints();
    constraints.gridwidth = GridBagConstraints.REMAINDER;
    constraints.weightx = 1;
    constraints.weighty = 1;
    constraints.insets = new Insets(10, 20, 10, 20);
    add(okButton, constraints);
  }
Exemplo n.º 15
0
  public Plot2Da() {
    check_ = new JCheckBox("Hold on");
    plot_ = new Plot2D();

    setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(2, 2, 2, 2);
    c.weightx = 1.0;
    c.weighty = 1.0;

    c.gridheight = 1;
    c.gridwidth = 1;
    c.gridx = 0;
    c.gridy = 0;
    add(check_, c);

    c.gridwidth = 1;
    c.gridheight = 1;
    c.gridx = 0;
    c.gridy = 1;
    c.fill = GridBagConstraints.REMAINDER;
    c.ipadx = plot_.getSize().width + 100;
    c.ipady = plot_.getSize().height + 100;
    plot_.setBackground(Color.WHITE);

    add(plot_, c);

    setBorder(BorderFactory.createEtchedBorder());
  }
  /**
   * This method initializes jPanel
   *
   * @return javax.swing.JPanel
   */
  private JPanel getJPanel() {
    if (jPanel == null) {
      java.awt.GridBagConstraints gridBagConstraints7 = new GridBagConstraints();

      java.awt.GridBagConstraints gridBagConstraints5 = new GridBagConstraints();

      java.awt.GridBagConstraints gridBagConstraints2 = new GridBagConstraints();

      jPanel = new JPanel();
      jPanel.setLayout(new GridBagLayout());
      jPanel.setName("jPanel");
      gridBagConstraints2.weightx = 1.0;
      gridBagConstraints2.weighty = 1.0;
      gridBagConstraints2.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints5.gridx = 0;
      gridBagConstraints5.gridy = 1;
      gridBagConstraints5.ipadx = 0;
      gridBagConstraints5.ipady = 0;
      gridBagConstraints5.fill = java.awt.GridBagConstraints.BOTH;
      gridBagConstraints5.weightx = 1.0D;
      gridBagConstraints5.weighty = 1.0D;
      gridBagConstraints5.insets = new java.awt.Insets(2, 5, 2, 5);
      gridBagConstraints5.anchor = java.awt.GridBagConstraints.NORTHWEST;
      gridBagConstraints7.weightx = 1.0;
      gridBagConstraints7.fill = java.awt.GridBagConstraints.HORIZONTAL;
      gridBagConstraints7.anchor = java.awt.GridBagConstraints.NORTHWEST;
      gridBagConstraints7.gridx = 0;
      gridBagConstraints7.gridy = 0;
      gridBagConstraints7.insets = new java.awt.Insets(2, 5, 2, 5);
      jPanel.add(getTxtHeadline(), gridBagConstraints7);
      jPanel.add(getPanelParam(), gridBagConstraints5);
    }
    return jPanel;
  }
Exemplo n.º 17
0
 public static void addComponent(
     Container container,
     Component component,
     int gridx,
     int gridy,
     int gridwidth,
     int gridheight,
     int fill,
     int anchor,
     Insets insets,
     int ipadx,
     int ipady,
     double weightx,
     double weighty) {
   java.awt.LayoutManager lm = container.getLayout();
   GridBagConstraints gbc = new GridBagConstraints();
   gbc.gridx = gridx;
   gbc.gridy = gridy;
   gbc.gridwidth = gridwidth;
   gbc.gridheight = gridheight;
   gbc.fill = fill;
   gbc.anchor = anchor;
   gbc.insets = insets;
   gbc.ipadx = ipadx;
   gbc.ipady = ipady;
   gbc.weightx = weightx;
   gbc.weighty = weighty;
   ((GridBagLayout) lm).setConstraints(component, gbc);
   container.add(component);
 }
  private void jbInit() throws Exception {
    this.removeAll();

    // creamos y centramos la cuadrícula con los valores pasados
    //    	crearCentrarCuadricula(context, (Double)
    // blackboard.get(GraticuleCreatorPlugIn.CELL_SIDE_LENGTH_X),
    //    			(Double) blackboard.get(GraticuleCreatorPlugIn.CELL_SIDE_LENGTH_Y),
    //    			(Integer) blackboard.get(GraticuleCreatorPlugIn.LAYER_HEIGHT_IN_CELLS),
    //    			(Integer) blackboard.get(GraticuleCreatorPlugIn.LAYER_WIDTH_IN_CELLS),
    //    			(Coordinate) blackboard.get(GraticuleCreatorPlugIn.SOUTHWEST_CORNER_OF_LEFT_LAYER));

    this.setLayout(new GridBagLayout());
    java.awt.GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
    gridBagConstraints1.gridx = 0;
    gridBagConstraints1.gridy = 1;
    gridBagConstraints1.weightx = 1.0;
    gridBagConstraints1.weighty = 1.0;
    gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints1.ipadx = -21;
    gridBagConstraints1.ipady = 141;
    java.awt.GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
    gridBagConstraints2.gridx = 0;
    gridBagConstraints2.gridy = 0;
    gridBagConstraints2.insets = new java.awt.Insets(5, 5, 5, 5);
    this.add(getGraticuleCells(), gridBagConstraints1);
    this.add(getPanelButtonAllUser(), gridBagConstraints2);
  }
Exemplo n.º 19
0
 /**
  * This method initializes jContentPane
  *
  * @return javax.swing.JPanel
  */
 private JPanel getJContentPane() {
   if (jContentPane == null) {
     GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
     gridBagConstraints2.gridx = 0;
     gridBagConstraints2.insets = new Insets(2, 2, 2, 2);
     gridBagConstraints2.gridy = 1;
     GridBagConstraints gridBagConstraints = new GridBagConstraints();
     gridBagConstraints.fill = GridBagConstraints.BOTH;
     gridBagConstraints.gridy = 0;
     gridBagConstraints.weightx = 1.0;
     gridBagConstraints.weighty = 1.0;
     gridBagConstraints.insets = new Insets(2, 2, 2, 2);
     gridBagConstraints.gridx = 0;
     GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
     gridBagConstraints1.gridx = 0;
     gridBagConstraints1.ipadx = 0;
     gridBagConstraints1.ipady = 0;
     gridBagConstraints1.gridy = 1;
     jContentPane = new JPanel();
     jContentPane.setLayout(new GridBagLayout());
     jContentPane.add(getJTabbedPane(), gridBagConstraints);
     jContentPane.add(getBtnCancel(), gridBagConstraints2);
   }
   return jContentPane;
 }
Exemplo n.º 20
0
  public void initComponents() {
    GridBagLayout gridBag = new GridBagLayout();
    GridBagConstraints constraints = new GridBagConstraints();

    JLabel label;
    JPanel panel;
    Dimension size;

    setBorder(new javax.swing.border.EtchedBorder());
    setLayout(gridBag);

    label = new JLabel(name);
    constraints.anchor = GridBagConstraints.WEST;
    constraints.gridwidth = GridBagConstraints.REMAINDER;
    gridBag.setConstraints(label, constraints);
    add(label);

    panel = filterOptions();
    gridBag.setConstraints(panel, constraints);
    add(panel);

    sliderCutoff = new JSlider(JSlider.VERTICAL);
    sliderCutoff.setPaintTicks(true);
    sliderCutoff.setToolTipText("Cutoff Frequency");
    sliderCutoff.setMinimum(0);
    sliderCutoff.setMaximum(500);
    sliderCutoff.setMinorTickSpacing(25);
    sliderCutoff.setMajorTickSpacing(100);
    sliderCutoff.setValue(100);
    sliderCutoff.addChangeListener(new CutoffListener(filter));
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.gridwidth = 1;
    gridBag.setConstraints(sliderCutoff, constraints);
    add(sliderCutoff);

    sliderResonance = new JSlider(JSlider.VERTICAL);
    sliderResonance.setPaintTicks(true);
    sliderResonance.setToolTipText("Resonance (Pass-band Ripple)");
    sliderResonance.setMinimum(1);
    sliderResonance.setMaximum(58);
    sliderResonance.setMinorTickSpacing(3);
    sliderResonance.setMajorTickSpacing(57);
    sliderResonance.setValue(1);
    sliderResonance.addChangeListener(new ResonanceListener(filter));
    constraints.gridwidth = GridBagConstraints.REMAINDER;
    gridBag.setConstraints(sliderResonance, constraints);
    add(sliderResonance);

    label = new JLabel("Cutoff");
    constraints.gridwidth = 1;
    constraints.ipadx = 10;
    gridBag.setConstraints(label, constraints);
    add(label);

    label = new JLabel("Resonance");
    constraints.gridwidth = GridBagConstraints.REMAINDER;
    gridBag.setConstraints(label, constraints);
    add(label);
  }
Exemplo n.º 21
0
 // 设置组件位置并添加到容器中
 private void setupZuJian(
     JComponent component, int gridx, int gridy, int gridwidth, int ipadx, boolean fill) {
   final GridBagConstraints gridBagConstrains = new GridBagConstraints();
   gridBagConstrains.gridx = gridx;
   gridBagConstrains.gridy = gridy;
   if (gridwidth > 1) gridBagConstrains.gridwidth = gridwidth;
   if (ipadx > 0) gridBagConstrains.ipadx = ipadx;
   gridBagConstrains.insets = new Insets(3, 1, 2, 1);
   if (fill) gridBagConstrains.fill = GridBagConstraints.HORIZONTAL;
   if (component == bz) {
     beiZhu.setLineWrap(true);
     gridBagConstrains.gridheight = 3;
     gridBagConstrains.ipadx = ipadx;
     gridBagConstrains.ipady = 50;
   }
   add(component, gridBagConstrains);
 }
Exemplo n.º 22
0
  /** Sets out the panel based upon the items passed in via the ArrayList */
  protected void addToPanel(JPanel panel, List<BeanEditItem> items) {
    GridBagLayout gbLayout = new GridBagLayout();
    GridBagConstraints cL = new GridBagConstraints();
    GridBagConstraints cD = new GridBagConstraints();
    GridBagConstraints cR = new GridBagConstraints();
    cL.fill = GridBagConstraints.HORIZONTAL;
    cL.insets = new Insets(2, 0, 0, 15);
    cR.insets = new Insets(0, 10, 15, 15);
    cD.insets = new Insets(2, 0, 0, 0);
    cD.anchor = GridBagConstraints.NORTHWEST;
    cL.anchor = GridBagConstraints.NORTHWEST;

    int y = 0;
    JPanel p = new JPanel();

    for (BeanEditItem it : items) {
      if (it.getDescription() != null && it.getComponent() != null) {
        JLabel decript = new JLabel(it.getDescription() + ":", JLabel.LEFT);
        if (it.getDescription().equals("")) {
          decript.setText("");
        }
        cL.gridx = 0;
        cL.gridy = y;
        cL.ipadx = 3;

        gbLayout.setConstraints(decript, cL);
        p.setLayout(gbLayout);
        p.add(decript, cL);

        cD.gridx = 1;
        cD.gridy = y;

        gbLayout.setConstraints(it.getComponent(), cD);

        p.add(it.getComponent(), cD);

        cR.gridx = 2;
        cR.gridwidth = 1;
        cR.anchor = GridBagConstraints.WEST;

      } else {
        cR.anchor = GridBagConstraints.CENTER;
        cR.gridx = 0;
        cR.gridwidth = 3;
      }
      cR.gridy = y;
      if (it.getHelp() != null) {
        JTextPane help = new JTextPane();
        help.setText(it.getHelp());
        gbLayout.setConstraints(help, cR);
        formatTextAreaAsLabel(help);
        p.add(help, cR);
      }
      y++;
    }

    panel.add(p);
  }
Exemplo n.º 23
0
 /**
  * This method initializes buttonPanel
  *
  * @return javax.swing.JPanel
  */
 private JPanel getButtonPanel() {
   if (buttonPanel == null) {
     GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
     gridBagConstraints1.insets = new Insets(5, 10, 5, 10);
     gridBagConstraints1.ipadx = 0;
     gridBagConstraints1.gridwidth = 1;
     GridBagConstraints gridBagConstraints = new GridBagConstraints();
     gridBagConstraints.insets = new Insets(5, 10, 5, 10);
     gridBagConstraints.weightx = 0.0;
     gridBagConstraints.ipadx = 0;
     gridBagConstraints.gridwidth = 1;
     buttonPanel = new JPanel();
     buttonPanel.setLayout(new GridBagLayout());
     buttonPanel.add(getCsvButton(), gridBagConstraints);
     buttonPanel.add(getCloseButton(), gridBagConstraints1);
   }
   return buttonPanel;
 }
Exemplo n.º 24
0
  /** init lays out the window and sets up components */
  public void init() {
    /*
     * BorderLayout just makes sure the Object in the Center gets most of
     * the screen
     */
    setLayout(new BorderLayout());
    // Information area where we can put some text occasionally
    info1 = new Label("Welcome !");
    // put it along the top
    add("North", info1);

    // Plotting area - create our own sky class
    theSky = new HealCanvas();
    // put it in the center of the window - most space
    add("Center", theSky);
    theSky.setupScene();
    theSky.showScene();

    // Create a panel to put the controls in - panel is a long strip
    FlowLayout fl = new FlowLayout(FlowLayout.CENTER, 1, 1);
    Panel p = new Panel(fl);

    // Create buttons and add this as Actionlistener - add them to panel
    Button quit = new Button("Quit");
    quit.addActionListener(this);
    p.add("West", quit);
    // put the panel at the bottom of the screen
    add("South", p);

    Panel rp = new Panel();
    rp.setBackground(Color.black);

    // rp.setLayout(new GridLayout(3,1));
    GridBagLayout gridbag = new GridBagLayout();
    rp.setLayout(gridbag);
    GridBagConstraints cons = new GridBagConstraints();
    cons.fill = GridBagConstraints.BOTH;
    cons.gridy = GridBagConstraints.RELATIVE;
    cons.gridx = 0;
    cons.ipadx = 0;
    cons.ipady = 10;

    HealPanel hpan = new HealPanel();
    hpan.setCanvas(theSky);
    gridbag.setConstraints(hpan, cons);
    rp.add(hpan);
    // Create control panel for rotations
    rotPanel = new RotatePanel();
    gridbag.setConstraints(rotPanel, cons);
    rp.add(rotPanel);
    // attach the rotPanel panel to the sky
    rotPanel.setScene(theSky);
    // add to right of screen
    this.add("East", rp);
    rotPanel.start();
  };
Exemplo n.º 25
0
  public void addFields() {
    //		gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.ipadx = 20;
    content.add(new JLabel("Host", JLabel.CENTER), gbc);
    gbc.gridy++;
    content.add(new JLabel("Database", JLabel.CENTER), gbc);
    gbc.gridy++;
    content.add(new JLabel("Table", JLabel.CENTER), gbc);
    gbc.gridy++;
    content.add(new JLabel("Username", JLabel.CENTER), gbc);
    gbc.gridy++;
    content.add(new JLabel("Password", JLabel.CENTER), gbc);
    gbc.gridy = 0;
    gbc.gridx = 1;
    content.add(host, gbc);
    gbc.gridy++;
    content.add(database, gbc);
    gbc.gridy++;
    content.add(table, gbc);
    gbc.gridy++;
    content.add(username, gbc);
    gbc.gridy++;
    content.add(password, gbc);
    gbc.gridy++;
    login.setMnemonic(KeyEvent.VK_L);

    ActionListener act =
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            if (e.getSource() == login) {
              if (username.getText().length() > 0) alive = false;
              else {
                showMessage("Username required", "At least enter a username :)");
              }
            }
            if (e.getSource() == exit) {
              System.exit(0);
            }
          }
        };

    login.addActionListener(act);
    exit.addActionListener(act);
    JPanel p = new JPanel(new FlowLayout());
    p.add(login);
    p.add(exit);

    gbc.gridx = 0;
    gbc.gridwidth = 2;
    content.add(p, gbc);

    username.addKeyListener(this);
    password.addKeyListener(this);
    login.addKeyListener(this);
  }
  // Color gre;
  Rules(String se) {
    email = se;
    conti = new Button("Continue");
    rules = new Button("ClicK Here For Rules");
    p1 = new JOptionPane();
    Icon image = new ImageIcon("books.jpg");
    Icon image1 = new ImageIcon("girl.jpg");
    Icon image2 = new ImageIcon("uit.jpg");
    gl = new GridBagLayout();
    gbc = new GridBagConstraints();
    conti.addActionListener(this);
    rules.addActionListener(this);
    // gre=new Color(117,102,185);
    p = new Panel();
    p2 = new Panel();
    p3 = new Panel();
    p4 = new Panel();
    f = new Frame();
    pic = new JLabel(image);
    pic1 = new JLabel(image1);
    pic2 = new JLabel(image2);
    gbc.anchor = GridBagConstraints.SOUTHWEST;
    gl.setConstraints(pic1, gbc);
    gbc.anchor = GridBagConstraints.SOUTHEAST;
    gl.setConstraints(pic, gbc);
    Insets is = new Insets(30, 30, 30, 30);
    gbc.insets = is;
    gbc.ipadx = 14;
    gbc.ipady = 8;
    gl.setConstraints(rules, gbc);
    gl.setConstraints(conti, gbc);
    p2.setLayout(gl);
    p4.add(pic2);
    p2.add(pic);
    p3.setLayout(gl);
    p3.add(pic1);
    p.add(conti);
    p.add(rules);
    p.setLayout(gl);
    f.add(p4, "North");
    f.add(p3, "East");
    f.add(p2, "West");

    f.add(p, "Center");
    f.setTitle("RULES BOOK");
    // f.setBackground(gre);
    f.setVisible(true);
    f.setSize(900, 600);
    f.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent we) {
            System.exit(0);
          }
        });
  }
Exemplo n.º 27
0
  /**
   * Used to create the top panel describing the current feedback question
   *
   * @param fb Feedback question to describe
   * @return Panel with title and description
   */
  public JPanel createQuestionDataPanel(AbstractFeedbackType fb) {
    JPanel questionPanel = new JPanel();
    questionPanel.setLayout(new GridBagLayout());
    questionPanel.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));

    GridBagConstraints leftBoxConst = new GridBagConstraints();
    leftBoxConst.anchor = GridBagConstraints.LINE_START;
    leftBoxConst.gridx = 0;
    leftBoxConst.gridy = 0;
    leftBoxConst.gridheight = 2;

    JLabel titleLabel = new JLabel(fb.getTitle());
    GridBagConstraints titleLabelConst = new GridBagConstraints();
    titleLabelConst.anchor = GridBagConstraints.CENTER;
    titleLabelConst.gridx = 1;
    titleLabelConst.gridy = 0;
    titleLabelConst.weightx = 1.0;
    Font titleLabelFont = titleLabel.getFont();
    titleLabel.setFont(
        new Font(
            titleLabelFont.getName(),
            Font.BOLD,
            titleLabelFont.getSize() + 4)); // increase label font size by 2

    JLabel descLabel = new JLabel(fb.getDescription());
    GridBagConstraints descLabelConst = new GridBagConstraints();
    descLabelConst.anchor = GridBagConstraints.CENTER;
    descLabelConst.gridx = 1;
    descLabelConst.gridy = 1;
    descLabelConst.weightx = 1.0;

    JLabel exclLabel = new JLabel("!");
    exclLabel.setAlignmentX(RIGHT_ALIGNMENT);
    exclLabel.setToolTipText("Response is mandatory");
    try {
      exclLabel.setFont(loadGlyphFont(titleLabelFont.getSize() + 4));
      exclLabel.setText("\ue101");
    } catch (FontFormatException | IOException e) {
      e.printStackTrace();
    }
    GridBagConstraints rightBoxConst = new GridBagConstraints();
    rightBoxConst.anchor = GridBagConstraints.LINE_END;
    rightBoxConst.gridx = 2;
    rightBoxConst.gridy = 0;
    rightBoxConst.gridheight = 2;
    rightBoxConst.ipadx = 4;

    questionPanel.add(new JPanel(), leftBoxConst);
    questionPanel.add(titleLabel, titleLabelConst);
    questionPanel.add(descLabel, descLabelConst);
    questionPanel.add(fb.isMandatory() ? exclLabel : new JPanel(), rightBoxConst);

    return questionPanel;
  }
 private void setupComponent(
     JComponent component, int gridx, int gridy, int gridwidth, int ipadx, boolean fill) {
   final GridBagConstraints gridBagConstrains = new GridBagConstraints();
   gridBagConstrains.gridx = gridx;
   gridBagConstrains.gridy = gridy;
   gridBagConstrains.insets = new java.awt.Insets(5, 3, 3, 3);
   if (gridwidth > 1) gridBagConstrains.gridwidth = gridwidth;
   if (ipadx > 0) gridBagConstrains.ipadx = ipadx;
   if (fill) gridBagConstrains.fill = GridBagConstraints.VERTICAL;
   this.add(component, gridBagConstrains);
 }
Exemplo n.º 29
0
 // 设置组件位置并添加到容器中
 private void setupComponent(
     JComponent component, int gridx, int gridy, int gridwidth, int ipadx, boolean fill) {
   final GridBagConstraints gridBagConstrains = new GridBagConstraints();
   gridBagConstrains.gridx = gridx;
   gridBagConstrains.gridy = gridy;
   gridBagConstrains.insets = new Insets(5, 1, 3, 1);
   if (gridwidth > 1) gridBagConstrains.gridwidth = gridwidth;
   if (ipadx > 0) gridBagConstrains.ipadx = ipadx;
   if (fill) gridBagConstrains.fill = GridBagConstraints.HORIZONTAL;
   add(component, gridBagConstrains);
 }
 private void initGridBagConstraints(final GridBagConstraints c) {
   c.anchor = GridBagConstraints.CENTER;
   c.fill = GridBagConstraints.NONE;
   c.gridwidth = 1;
   c.gridheight = 1;
   c.gridx = GridBagConstraints.RELATIVE;
   c.gridy = GridBagConstraints.RELATIVE;
   c.insets = zeroInsets;
   c.ipadx = 4; // not the usual default
   c.ipady = 4; // not the usual default
   c.weightx = 0.0;
   c.weighty = 0.0;
 };