Examples of GridLayout


Examples of java.awt.GridLayout

    mToTimeSp.setEditor(dateEditor);
    mToTimeSp.setValue(setTimeToDate(mToTime));
    CaretPositionCorrector.createCorrector(dateEditor.getTextField(),
        new char[] { ':' }, -1);

    JPanel timePn = new JPanel(new GridLayout(2, 2));
    timePn.setBorder(BorderFactory.createTitledBorder(mLocalizer.msg(
        "TimeOfDay", "Uhrzeit")));
    timePn.add(new JLabel(mLocalizer.msg("from", "from")));
    timePn.add(mFromTimeSp);
    timePn.add(new JLabel(mLocalizer.msg("till", "till")));
View Full Code Here

Examples of java.awt.GridLayout

    }

    public static Component wrapToolBar(ToolBar toolbar, MainFrame mainFrame) {
      JToolBar moreToolbar = new JToolBar();
      moreToolbar.setOpaque(false);
      moreToolbar.setLayout(new GridLayout());
      moreToolbar.setRollover(true);
      moreToolbar.setFloatable(false);
      moreToolbar.add(new MoreButton(toolbar,mainFrame));
      addMouseAdapter(moreToolbar);
View Full Code Here

Examples of java.awt.GridLayout

    mAvailableActions.insertElementAt(toolbarModel.getGlueAction(), 1);
    mAvailableActions.insertElementAt(toolbarModel.getSpaceAction(), 2);

    // Initialize the Panel with the available Buttons
    mButtonPanel = new JPanel();
    mButtonPanel.setLayout(new GridLayout(0, 4, 2, 2));
    mButtonPanel.setAlignmentX(Component.LEFT_ALIGNMENT);


    // Make the buttonPanel scrollable
    JScrollPane pane = new JScrollPane(mButtonPanel);
View Full Code Here

Examples of java.awt.GridLayout

   */
  public JPanel createSettingsPanel() {
    mChannelListModel = new ChannelListModel();
    JPanel panel = new JPanel(new BorderLayout());

    JPanel northPn = new JPanel(new GridLayout(1, 2));
    JPanel centerPn = new JPanel(new GridLayout(1, 2));
    JPanel southPn = new JPanel(new BorderLayout());
    southPn.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));

    panel.add(northPn, BorderLayout.NORTH);
    panel.add(centerPn, BorderLayout.CENTER);
View Full Code Here

Examples of java.awt.GridLayout

  private void addButtons() {
    JButton okBut = new JButton("OK");
    JButton cancelBut = new JButton("Cancel");
   
    JPanel butHolder = new JPanel();
    butHolder.setLayout(new GridLayout(1, 2));
    butHolder.add(okBut); butHolder.add(cancelBut);
    add(butHolder, BorderLayout.SOUTH);
   
    okBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
View Full Code Here

Examples of java.awt.GridLayout

    holder.setLayout(new BorderLayout());
    holder.add(m_perspectiveConfigurer, BorderLayout.CENTER);
    JButton okBut = new JButton("OK");
    JButton cancelBut = new JButton("Cancel");
    JPanel butHolder = new JPanel();
    butHolder.setLayout(new GridLayout(1,2));
    butHolder.add(okBut);
    butHolder.add(cancelBut);
    holder.add(butHolder, BorderLayout.SOUTH);
    okBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
View Full Code Here

Examples of java.awt.GridLayout

    m_MoreOptions.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
  m_MoreOptions.setEnabled(false);
  JPanel moreOptionsPanel = new JPanel();
  moreOptionsPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
  moreOptionsPanel.setLayout(new GridLayout(10, 1));
  moreOptionsPanel.add(m_OutputModelBut);
  moreOptionsPanel.add(m_OutputPerClassBut);   
  moreOptionsPanel.add(m_OutputEntropyBut);   
  moreOptionsPanel.add(m_OutputConfusionBut);   
  moreOptionsPanel.add(m_StorePredictionsBut);
  JPanel classOutPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
  classOutPanel.add(new JLabel("Output predictions"));
  classOutPanel.add(m_ClassificationOutputPanel);
  moreOptionsPanel.add(classOutPanel);
  JPanel costMatrixOption = new JPanel(new FlowLayout(FlowLayout.LEFT));
  costMatrixOption.add(m_EvalWRTCostsBut);
  costMatrixOption.add(m_SetCostsBut);
  moreOptionsPanel.add(costMatrixOption);
  JPanel seedPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
  seedPanel.add(m_RandomLab);
  seedPanel.add(m_RandomSeedText);
  moreOptionsPanel.add(seedPanel);
  moreOptionsPanel.add(m_PreserveOrderBut);
        JPanel sourcePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        m_OutputSourceCode.setEnabled(m_ClassifierEditor.getValue() instanceof Sourcable);
        m_SourceCodeClass.setEnabled(m_OutputSourceCode.isEnabled() && m_OutputSourceCode.isSelected());
        sourcePanel.add(m_OutputSourceCode);
        sourcePanel.add(m_SourceCodeClass);
        moreOptionsPanel.add(sourcePanel);

  JPanel all = new JPanel();
  all.setLayout(new BorderLayout())

  JButton oK = new JButton("OK");
  JPanel okP = new JPanel();
  okP.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
  okP.setLayout(new GridLayout(1,1,5,5));
  okP.add(oK);

  all.add(moreOptionsPanel, BorderLayout.CENTER);
  all.add(okP, BorderLayout.SOUTH);
 
  final JDialog jd =
    new JDialog(PropertyDialog.getParentFrame(ClassifierPanel.this), "Classifier evaluation options");
  jd.getContentPane().setLayout(new BorderLayout());
  jd.getContentPane().add(all, BorderLayout.CENTER);
  jd.addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent w) {
      jd.dispose();
      m_MoreOptions.setEnabled(true);
    }
  });
  oK.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent a) {
      m_MoreOptions.setEnabled(true);
      jd.dispose();
    }
  });
  jd.pack();
 
  // panel height is only available now
  m_ClassificationOutputPanel.setPreferredSize(new Dimension(300, m_ClassificationOutputPanel.getHeight()));
  jd.pack();
 
  jd.setLocation(m_MoreOptions.getLocationOnScreen());
  jd.setVisible(true);
      }
    });

    // Layout the GUI
    JPanel p1 = new JPanel();
    p1.setBorder(BorderFactory.createCompoundBorder(
     BorderFactory.createTitledBorder("Classifier"),
     BorderFactory.createEmptyBorder(0, 5, 5, 5)
     ));
    p1.setLayout(new BorderLayout());
    p1.add(m_CEPanel, BorderLayout.NORTH);

    JPanel p2 = new JPanel();
    GridBagLayout gbL = new GridBagLayout();
    p2.setLayout(gbL);
    p2.setBorder(BorderFactory.createCompoundBorder(
     BorderFactory.createTitledBorder("Test options"),
     BorderFactory.createEmptyBorder(0, 5, 5, 5)
     ));
    GridBagConstraints gbC = new GridBagConstraints();
    gbC.anchor = GridBagConstraints.WEST;
    gbC.gridy = 0;     gbC.gridx = 0;
    gbL.setConstraints(m_TrainBut, gbC);
    p2.add(m_TrainBut);

    gbC = new GridBagConstraints();
    gbC.anchor = GridBagConstraints.WEST;
    gbC.gridy = 1;     gbC.gridx = 0;
    gbL.setConstraints(m_TestSplitBut, gbC);
    p2.add(m_TestSplitBut);

    gbC = new GridBagConstraints();
    gbC.anchor = GridBagConstraints.EAST;
    gbC.fill = GridBagConstraints.HORIZONTAL;
    gbC.gridy = 1;     gbC.gridx = 1;    gbC.gridwidth = 2;
    gbC.insets = new Insets(2, 10, 2, 0);
    gbL.setConstraints(m_SetTestBut, gbC);
    p2.add(m_SetTestBut);

    gbC = new GridBagConstraints();
    gbC.anchor = GridBagConstraints.WEST;
    gbC.gridy = 2;     gbC.gridx = 0;
    gbL.setConstraints(m_CVBut, gbC);
    p2.add(m_CVBut);

    gbC = new GridBagConstraints();
    gbC.anchor = GridBagConstraints.EAST;
    gbC.fill = GridBagConstraints.HORIZONTAL;
    gbC.gridy = 2;     gbC.gridx = 1;
    gbC.insets = new Insets(2, 10, 2, 10);
    gbL.setConstraints(m_CVLab, gbC);
    p2.add(m_CVLab);

    gbC = new GridBagConstraints();
    gbC.anchor = GridBagConstraints.EAST;
    gbC.fill = GridBagConstraints.HORIZONTAL;
    gbC.gridy = 2;     gbC.gridx = 2;  gbC.weightx = 100;
    gbC.ipadx = 20;
    gbL.setConstraints(m_CVText, gbC);
    p2.add(m_CVText);

    gbC = new GridBagConstraints();
    gbC.anchor = GridBagConstraints.WEST;
    gbC.gridy = 3;     gbC.gridx = 0;
    gbL.setConstraints(m_PercentBut, gbC);
    p2.add(m_PercentBut);

    gbC = new GridBagConstraints();
    gbC.anchor = GridBagConstraints.EAST;
    gbC.fill = GridBagConstraints.HORIZONTAL;
    gbC.gridy = 3;     gbC.gridx = 1;
    gbC.insets = new Insets(2, 10, 2, 10);
    gbL.setConstraints(m_PercentLab, gbC);
    p2.add(m_PercentLab);

    gbC = new GridBagConstraints();
    gbC.anchor = GridBagConstraints.EAST;
    gbC.fill = GridBagConstraints.HORIZONTAL;
    gbC.gridy = 3;     gbC.gridx = 2;  gbC.weightx = 100;
    gbC.ipadx = 20;
    gbL.setConstraints(m_PercentText, gbC);
    p2.add(m_PercentText);


    gbC = new GridBagConstraints();
    gbC.anchor = GridBagConstraints.WEST;
    gbC.fill = GridBagConstraints.HORIZONTAL;
    gbC.gridy = 4;     gbC.gridx = 0;  gbC.weightx = 100;
    gbC.gridwidth = 3;

    gbC.insets = new Insets(3, 0, 1, 0);
    gbL.setConstraints(m_MoreOptions, gbC);
    p2.add(m_MoreOptions);

    JPanel buttons = new JPanel();
    buttons.setLayout(new GridLayout(2, 2));
    buttons.add(m_ClassCombo);
    m_ClassCombo.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    JPanel ssButs = new JPanel();
    ssButs.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    ssButs.setLayout(new GridLayout(1, 2, 5, 5));
    ssButs.add(m_StartBut);
    ssButs.add(m_StopBut);

    buttons.add(ssButs);
   
View Full Code Here

Examples of java.awt.GridLayout

          updateInfoForSliderValue((double)m_thresholdSlider.getValue() / 100.0);
        }
      });
     
      JPanel plotHolder = new JPanel();
      plotHolder.setLayout(new GridLayout(1,2));     
      plotHolder.add(m_performancePanel);
      plotHolder.add(m_costBenefitPanel);
      add(plotHolder, BorderLayout.CENTER);
     
      JPanel lowerPanel = new JPanel();
      lowerPanel.setLayout(new BorderLayout());
     
      ButtonGroup bGroup = new ButtonGroup();
      bGroup.add(m_percPop);
      bGroup.add(m_percOfTarget);
      bGroup.add(m_threshold);
     
      ButtonGroup bGroup2 = new ButtonGroup();
      bGroup2.add(m_costR);
      bGroup2.add(m_benefitR);
      ActionListener rl = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          if (m_costR.isSelected()) {
            m_costBenefitL.setText("Cost: ");
          } else {
            m_costBenefitL.setText("Benefit: ");
          }

          double gain = Double.parseDouble(m_gainV.getText());
          gain = -gain;
          m_gainV.setText(Utils.doubleToString(gain, 2));
        }
      };
      m_costR.addActionListener(rl);
      m_benefitR.addActionListener(rl);
      m_costR.setSelected(true);
     
      m_percPop.setSelected(true);
      JPanel threshPanel = new JPanel();
      threshPanel.setLayout(new BorderLayout());
      JPanel radioHolder = new JPanel();
      radioHolder.setLayout(new FlowLayout());
      radioHolder.add(m_percPop);
      radioHolder.add(m_percOfTarget);
      radioHolder.add(m_threshold);
      threshPanel.add(radioHolder, BorderLayout.NORTH);
      threshPanel.add(m_thresholdSlider, BorderLayout.SOUTH);
     
      JPanel threshInfoPanel = new JPanel();
      threshInfoPanel.setLayout(new GridLayout(3,2));
      threshInfoPanel.add(new JLabel("% of Population: ", SwingConstants.RIGHT));
      threshInfoPanel.add(m_percPopLab);
      threshInfoPanel.add(new JLabel("% of Target: ", SwingConstants.RIGHT));
      threshInfoPanel.add(m_percOfTargetLab);
      threshInfoPanel.add(new JLabel("Score Threshold: ", SwingConstants.RIGHT));
      threshInfoPanel.add(m_thresholdLab);
     
      JPanel threshHolder = new JPanel();
      threshHolder.setBorder(BorderFactory.createTitledBorder("Threshold"));
      threshHolder.setLayout(new BorderLayout());
      threshHolder.add(threshPanel, BorderLayout.CENTER);
      threshHolder.add(threshInfoPanel, BorderLayout.EAST);
     
      lowerPanel.add(threshHolder, BorderLayout.NORTH);
     
      // holder for the two matrixes
      JPanel matrixHolder = new JPanel();
      matrixHolder.setLayout(new GridLayout(1,2));
     
      // confusion matrix
      JPanel confusionPanel = new JPanel();
      confusionPanel.setLayout(new GridLayout(3,3));
      confusionPanel.add(m_conf_predictedA);
      confusionPanel.add(m_conf_predictedB);
      confusionPanel.add(new JLabel()); // dummy
      confusionPanel.add(m_conf_aa);
      confusionPanel.add(m_conf_ab);
      confusionPanel.add(m_conf_actualA);
      confusionPanel.add(m_conf_ba);
      confusionPanel.add(m_conf_bb);
      confusionPanel.add(m_conf_actualB);
      JPanel tempHolderCA = new JPanel();
      tempHolderCA.setLayout(new BorderLayout());
      tempHolderCA.setBorder(BorderFactory.createTitledBorder("Confusion Matrix"));
      tempHolderCA.add(confusionPanel, BorderLayout.CENTER);
     
      JPanel accHolder = new JPanel();
      accHolder.setLayout(new FlowLayout(FlowLayout.LEFT));
      accHolder.add(new JLabel("Classification Accuracy: "));
      accHolder.add(m_classificationAccV);
      tempHolderCA.add(accHolder, BorderLayout.SOUTH);
     
      matrixHolder.add(tempHolderCA);
     
      // cost matrix
      JPanel costPanel = new JPanel();
      costPanel.setBorder(BorderFactory.createTitledBorder("Cost Matrix"));
      costPanel.setLayout(new BorderLayout());
     
      JPanel cmHolder = new JPanel();
      cmHolder.setLayout(new GridLayout(3, 3));
      cmHolder.add(m_cost_predictedA);     
      cmHolder.add(m_cost_predictedB);
      cmHolder.add(new JLabel()); // dummy
      cmHolder.add(m_cost_aa);
      cmHolder.add(m_cost_ab);
      cmHolder.add(m_cost_actualA);
      cmHolder.add(m_cost_ba);
      cmHolder.add(m_cost_bb);
      cmHolder.add(m_cost_actualB);
      costPanel.add(cmHolder, BorderLayout.CENTER);
     
      FocusListener fl = new FocusListener() {
        public void focusGained(FocusEvent e) {
         
        }
       
        public void focusLost(FocusEvent e) {
          if (constructCostBenefitData()) {
            try {
              m_costBenefitPanel.setMasterPlot(m_costBenefit);
              m_costBenefitPanel.validate(); m_costBenefitPanel.repaint();
            } catch (Exception ex) {
              ex.printStackTrace();
            }
            updateCostBenefit();
          }
        }
      };
     
      ActionListener al = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          if (constructCostBenefitData()) {
            try {
              m_costBenefitPanel.setMasterPlot(m_costBenefit);
              m_costBenefitPanel.validate(); m_costBenefitPanel.repaint();
            } catch (Exception ex) {
              ex.printStackTrace();
            }
            updateCostBenefit();
          }
        }
      };
           
      m_cost_aa.addFocusListener(fl);
      m_cost_aa.addActionListener(al);
      m_cost_ab.addFocusListener(fl);
      m_cost_ab.addActionListener(al);
      m_cost_ba.addFocusListener(fl);
      m_cost_ba.addActionListener(al);
      m_cost_bb.addFocusListener(fl);
      m_cost_bb.addActionListener(al);
     
      m_totalPopField.addFocusListener(fl);
      m_totalPopField.addActionListener(al);
     
      JPanel cbHolder = new JPanel();
      cbHolder.setLayout(new BorderLayout());
      JPanel tempP = new JPanel();
      tempP.setLayout(new GridLayout(3, 2));
      tempP.add(m_costBenefitL);
      tempP.add(m_costBenefitV);
      tempP.add(new JLabel("Random: ", SwingConstants.RIGHT));
      tempP.add(m_randomV);
      tempP.add(new JLabel("Gain: ", SwingConstants.RIGHT));
      tempP.add(m_gainV);
      cbHolder.add(tempP, BorderLayout.NORTH);
      JPanel butHolder = new JPanel();
      butHolder.setLayout(new GridLayout(2, 1));
      butHolder.add(m_maximizeCB);
      butHolder.add(m_minimizeCB);
      m_maximizeCB.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          findMaxMinCB(true);
        }
      });
     
      m_minimizeCB.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          findMaxMinCB(false);
        }
      });
     
      cbHolder.add(butHolder, BorderLayout.SOUTH);
      costPanel.add(cbHolder, BorderLayout.EAST);
     
      JPanel popCBR = new JPanel();
      popCBR.setLayout(new GridLayout(1, 2));
      JPanel popHolder = new JPanel();
      popHolder.setLayout(new FlowLayout(FlowLayout.LEFT));
      popHolder.add(new JLabel("Total Population: "));
      popHolder.add(m_totalPopField);
     
View Full Code Here

Examples of java.awt.GridLayout

    int gridHeight = numPlots / m_gridWidth;
   
    if (numPlots % m_gridWidth != 0) {
      gridHeight++;
    }
    hp.setLayout(new GridLayout(gridHeight, 4));
   
    m_plots = new ArrayList<AttributeVisualizationPanel>();     
   
    for (int i = 0; i < numPlots; i++) {
      JPanel temp = new JPanel();
View Full Code Here

Examples of java.awt.GridLayout

  private void addButtons() {
    JButton okBut = new JButton("OK");
    JButton cancelBut = new JButton("Cancel");
   
    JPanel butHolder = new JPanel();
    butHolder.setLayout(new GridLayout(1, 2));
    butHolder.add(okBut); butHolder.add(cancelBut);
    add(butHolder, BorderLayout.SOUTH);
   
    okBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.