Beispiel #1
0
  private JPanel createRegressionPanel() {

    // components
    String[] orders = {"2", "3", "4", "5", "6", "7", "8", "9"};
    cbPolyOrder = new JComboBox(orders);
    cbPolyOrder.setSelectedIndex(0);
    cbPolyOrder.addActionListener(this);
    cbPolyOrder.setFocusable(false);

    regressionLabels = new String[Regression.values().length];
    setRegressionLabels();
    cbRegression = new JComboBox(regressionLabels);
    cbRegression.addActionListener(this);
    cbRegression.setFocusable(false);

    lblRegEquation = new JLabel();
    lblEqn = new JLabel();

    // regression combo panel
    JPanel cbPanel = new JPanel();
    cbPanel.setLayout(new BoxLayout(cbPanel, BoxLayout.Y_AXIS));
    cbPanel.add(LayoutUtil.flowPanel(cbRegression));
    cbPanel.add(LayoutUtil.flowPanel(cbPolyOrder));

    // regression label panel
    JPanel eqnPanel = new JPanel(new BorderLayout());
    eqnPanel.add(lblRegEquation, BorderLayout.CENTER);
    JScrollPane scroller = new JScrollPane(eqnPanel);
    scroller.setBorder(BorderFactory.createEmptyBorder());

    // prediction panel
    createPredictionPanel();

    // model panel: equation + prediction
    JPanel modelPanel = new JPanel();
    modelPanel.setLayout(new BoxLayout(modelPanel, BoxLayout.Y_AXIS));
    modelPanel.add(scroller);
    modelPanel.add(predictionPanel);

    // put it all together
    regressionPanel = new JPanel(new BorderLayout(30, 0));
    regressionPanel.add(modelPanel, BorderLayout.CENTER);
    regressionPanel.add(cbPanel, loc.borderWest());
    regressionPanel.setBorder(BorderFactory.createTitledBorder(loc.getMenu("RegressionModel")));

    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(regressionPanel, BorderLayout.CENTER);

    return mainPanel;
  }
  private void createGUI() {

    dataSourcePanel = new DataSourcePanel(app, mode);

    lblTitle = new JLabel();
    lblTitle.setIconTextGap(10);

    btnOK = new JButton();
    btnOK.addActionListener(this);

    btnCancel = new JButton();
    btnCancel.addActionListener(this);

    JPanel titlePanel = LayoutUtil.flowPanel(lblTitle);
    // titlePanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));

    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(titlePanel, BorderLayout.NORTH);
    mainPanel.add(dataSourcePanel, BorderLayout.CENTER);
    mainPanel.add(LayoutUtil.flowPanelRight(5, 0, 0, btnCancel, btnOK), BorderLayout.SOUTH);

    mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(mainPanel, BorderLayout.CENTER);
    setLabels();
  }
Beispiel #3
0
  private void createBarChartPanel() {

    // create components
    ckAutoBarWidth = new JCheckBox();
    ckAutoBarWidth.addActionListener(this);
    lblBarWidth = new JLabel();
    fldBarWidth = new MyTextFieldD(app, fieldWidth);
    fldBarWidth.setEditable(true);
    fldBarWidth.addActionListener(this);
    fldBarWidth.addFocusListener(this);

    // barChartWidthPanel
    barChartWidthPanel = new JPanel();
    barChartWidthPanel.setLayout(new BoxLayout(barChartWidthPanel, BoxLayout.Y_AXIS));
    barChartWidthPanel.add(LayoutUtil.flowPanel(ckAutoBarWidth));
    barChartWidthPanel.add(LayoutUtil.flowPanel(tab, lblBarWidth, fldBarWidth));

    layoutBarChartPanel();
  }
Beispiel #4
0
  private void createBoxPlotPanel() {

    // create components
    ckShowOutliers = new JCheckBox();
    ckShowOutliers.addActionListener(this);

    // layout
    Box p = Box.createVerticalBox();
    p.add(LayoutUtil.flowPanel(ckShowOutliers));

    boxPlotPanel = new JPanel(new BorderLayout());
    boxPlotPanel.add(p, BorderLayout.NORTH);
  }