Example usage for javax.swing BoxLayout Y_AXIS

List of usage examples for javax.swing BoxLayout Y_AXIS

Introduction

In this page you can find the example usage for javax.swing BoxLayout Y_AXIS.

Prototype

int Y_AXIS

To view the source code for javax.swing BoxLayout Y_AXIS.

Click Source Link

Document

Specifies that components should be laid out top to bottom.

Usage

From source file:AppearanceExplorer.java

PointAttributesEditor(PointAttributes init) {
    super(BoxLayout.Y_AXIS);
    pointAttr = init;/*  ww w.j a v a2s. co  m*/
    pointSize = pointAttr.getPointSize();
    pointAAEnable = pointAttr.getPointAntialiasingEnable();

    LogFloatLabelJSlider pointSizeSlider = new LogFloatLabelJSlider("Size", 0.1f, 100.0f, pointSize);
    pointSizeSlider.setMajorTickSpacing(1.0f);
    pointSizeSlider.setPaintTicks(true);
    pointSizeSlider.addFloatListener(new FloatListener() {
        public void floatChanged(FloatEvent e) {
            pointSize = e.getValue();
            pointAttr.setPointSize(pointSize);
        }
    });
    add(pointSizeSlider);

    JCheckBox pointAACheckBox = new JCheckBox(antiAliasString);
    pointAACheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            JCheckBox checkbox = (JCheckBox) e.getSource();
            pointAAEnable = checkbox.isSelected();
            pointAttr.setPointAntialiasingEnable(pointAAEnable);
        }
    });

    add(new LeftAlignComponent(pointAACheckBox));
}

From source file:edu.snu.leader.discrete.simulator.SimulatorLauncherGUI.java

JFrame createJFrameErrorMessages(ErrorPacketContainer errorPackets, JTabbedPane theTabbedPane) {
    JFrame errorMessages = new JFrame();
    JPanel errorMessagesContentPane = new JPanel();

    errorMessages.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    errorMessages.setTitle("Error Messages");
    errorMessages.setBounds(this.getX() + this.getWidth() + 5, this.getY(), 350, 300);
    errorMessagesContentPane = new JPanel();
    errorMessagesContentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    errorMessagesContentPane.setLayout(new BorderLayout(0, 0));
    errorMessages.setContentPane(errorMessagesContentPane);

    JPanel panel = new JPanel();
    errorMessagesContentPane.add(panel, BorderLayout.NORTH);
    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));

    for (int i = 0; i < errorPackets.errorMessages.size(); i++) {
        JTextPane temp = createErrorPane(errorPackets.errorMessages.get(i),
                errorPackets.erroredComponents.get(i), theTabbedPane, errorPackets.tabIndexes.get(i));
        panel.add(temp);/*from   ww w  . jav a 2  s.co m*/
    }

    return errorMessages;
}

From source file:com.jtstand.swing.StatsPanel.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//from  w  ww  . j a va2  s.c o  m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    buttonGroupType = new javax.swing.ButtonGroup();
    buttonGroupStatusFilter = new javax.swing.ButtonGroup();
    buttonGroupCountFilter = new javax.swing.ButtonGroup();
    jPanel1 = new javax.swing.JPanel();
    jPanelMainStats = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jLabelLSL = new javax.swing.JLabel();
    jPanel4 = new javax.swing.JPanel();
    jLabelUSL = new javax.swing.JLabel();
    jPanelChartType = new javax.swing.JPanel();
    jPanel5 = new javax.swing.JPanel();
    jRadioButtonStepTime = new javax.swing.JRadioButton();
    jPanel6 = new javax.swing.JPanel();
    jRadioButtonSequenceTime = new javax.swing.JRadioButton();
    jPanel7 = new javax.swing.JPanel();
    jRadioButtonList = new javax.swing.JRadioButton();
    jPanel8 = new javax.swing.JPanel();
    jRadioButtonDistribution = new javax.swing.JRadioButton();
    jPanelSeparate = new javax.swing.JPanel();
    jPanel17 = new javax.swing.JPanel();
    jCheckBoxStation = new javax.swing.JCheckBox();
    jPanel19 = new javax.swing.JPanel();
    jCheckBoxFixture = new javax.swing.JCheckBox();
    jPanel22 = new javax.swing.JPanel();
    jCheckBoxOperator = new javax.swing.JCheckBox();
    jPanel18 = new javax.swing.JPanel();
    jCheckBoxPartNumber = new javax.swing.JCheckBox();
    jPanel23 = new javax.swing.JPanel();
    jCheckBoxPartRevision = new javax.swing.JCheckBox();
    jPanel21 = new javax.swing.JPanel();
    jCheckBoxTestType = new javax.swing.JCheckBox();
    jPanel20 = new javax.swing.JPanel();
    jCheckBoxSerialNumber = new javax.swing.JCheckBox();
    jPanelStatusFilter = new javax.swing.JPanel();
    jPanel9 = new javax.swing.JPanel();
    jRadioButtonAllStatus = new javax.swing.JRadioButton();
    jPanel10 = new javax.swing.JPanel();
    jRadioButtonPassedStep = new javax.swing.JRadioButton();
    jPanel11 = new javax.swing.JPanel();
    jRadioButtonPassedSequence = new javax.swing.JRadioButton();
    jPanelCountFilter = new javax.swing.JPanel();
    jPanel12 = new javax.swing.JPanel();
    jRadioButtonAllCount = new javax.swing.JRadioButton();
    jPanel13 = new javax.swing.JPanel();
    jRadioButtonFirst = new javax.swing.JRadioButton();
    jPanel14 = new javax.swing.JPanel();
    jRadioButtonSecond = new javax.swing.JRadioButton();
    jPanel15 = new javax.swing.JPanel();
    jRadioButtonThird = new javax.swing.JRadioButton();
    jPanel16 = new javax.swing.JPanel();
    jRadioButtonLast = new javax.swing.JRadioButton();
    jPanel2 = new javax.swing.JPanel();
    jSplitPane = new javax.swing.JSplitPane();
    jScrollPaneTop = new javax.swing.JScrollPane();
    jTable = new org.jdesktop.swingx.JXTable();
    jScrollPaneBottom = new javax.swing.JScrollPane();

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

    jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.Y_AXIS));

    jPanelMainStats.setBorder(javax.swing.BorderFactory
            .createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Limits"));
    jPanelMainStats.setLayout(new javax.swing.BoxLayout(jPanelMainStats, javax.swing.BoxLayout.Y_AXIS));

    jPanel3.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

    jLabelLSL.setText("LSL:...");
    jPanel3.add(jLabelLSL);

    jPanelMainStats.add(jPanel3);

    jPanel4.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

    jLabelUSL.setText("USL:...");
    jPanel4.add(jLabelUSL);

    jPanelMainStats.add(jPanel4);

    jPanel1.add(jPanelMainStats);

    jPanelChartType.setBorder(javax.swing.BorderFactory
            .createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Chart Type"));
    jPanelChartType.setLayout(new javax.swing.BoxLayout(jPanelChartType, javax.swing.BoxLayout.Y_AXIS));

    jPanel5.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 2));

    buttonGroupType.add(jRadioButtonStepTime);
    jRadioButtonStepTime.setText("Step Started Time");
    jRadioButtonStepTime.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jRadioButtonStepTime.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonStepTimeActionPerformed(evt);
        }
    });
    jPanel5.add(jRadioButtonStepTime);

    jPanelChartType.add(jPanel5);

    jPanel6.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 2));

    buttonGroupType.add(jRadioButtonSequenceTime);
    jRadioButtonSequenceTime.setText("Sequence Started Time");
    jRadioButtonSequenceTime.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jRadioButtonSequenceTime.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonSequenceTimeActionPerformed(evt);
        }
    });
    jPanel6.add(jRadioButtonSequenceTime);

    jPanelChartType.add(jPanel6);

    jPanel7.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 2));

    buttonGroupType.add(jRadioButtonList);
    jRadioButtonList.setText("As Listed");
    jRadioButtonList.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jRadioButtonList.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonListActionPerformed(evt);
        }
    });
    jPanel7.add(jRadioButtonList);

    jPanelChartType.add(jPanel7);

    jPanel8.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 2));

    buttonGroupType.add(jRadioButtonDistribution);
    jRadioButtonDistribution.setSelected(true);
    jRadioButtonDistribution.setText("Distribution");
    jRadioButtonDistribution.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jRadioButtonDistribution.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonDistributionActionPerformed(evt);
        }
    });
    jPanel8.add(jRadioButtonDistribution);

    jPanelChartType.add(jPanel8);

    jPanel1.add(jPanelChartType);

    jPanelSeparate.setBorder(javax.swing.BorderFactory
            .createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Categories"));
    jPanelSeparate.setLayout(new javax.swing.BoxLayout(jPanelSeparate, javax.swing.BoxLayout.Y_AXIS));

    jPanel17.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 1, 0));

    jCheckBoxStation.setText("Station");
    jCheckBoxStation.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCheckBoxStationActionPerformed(evt);
        }
    });
    jPanel17.add(jCheckBoxStation);

    jPanelSeparate.add(jPanel17);

    jPanel19.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 1, 0));

    jCheckBoxFixture.setText("Fixture");
    jCheckBoxFixture.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCheckBoxFixtureActionPerformed(evt);
        }
    });
    jPanel19.add(jCheckBoxFixture);

    jPanelSeparate.add(jPanel19);

    jPanel22.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 1, 0));

    jCheckBoxOperator.setText("Operator");
    jCheckBoxOperator.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCheckBoxOperatorActionPerformed(evt);
        }
    });
    jPanel22.add(jCheckBoxOperator);

    jPanelSeparate.add(jPanel22);

    jPanel18.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 1, 0));

    jCheckBoxPartNumber.setText("Part Number");
    jCheckBoxPartNumber.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCheckBoxPartNumberActionPerformed(evt);
        }
    });
    jPanel18.add(jCheckBoxPartNumber);

    jPanelSeparate.add(jPanel18);

    jPanel23.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 1, 0));

    jCheckBoxPartRevision.setText("Part Revision");
    jCheckBoxPartRevision.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCheckBoxPartRevisionActionPerformed(evt);
        }
    });
    jPanel23.add(jCheckBoxPartRevision);

    jPanelSeparate.add(jPanel23);

    jPanel21.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 1, 0));

    jCheckBoxTestType.setText("Test Type");
    jCheckBoxTestType.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCheckBoxTestTypeActionPerformed(evt);
        }
    });
    jPanel21.add(jCheckBoxTestType);

    jPanelSeparate.add(jPanel21);

    jPanel20.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 1, 0));

    jCheckBoxSerialNumber.setText("Serial Number");
    jCheckBoxSerialNumber.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCheckBoxSerialNumberActionPerformed(evt);
        }
    });
    jPanel20.add(jCheckBoxSerialNumber);

    jPanelSeparate.add(jPanel20);

    jPanel1.add(jPanelSeparate);

    jPanelStatusFilter.setBorder(javax.swing.BorderFactory
            .createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Test Status Filter"));
    jPanelStatusFilter.setLayout(new javax.swing.BoxLayout(jPanelStatusFilter, javax.swing.BoxLayout.Y_AXIS));

    jPanel9.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 2));

    buttonGroupStatusFilter.add(jRadioButtonAllStatus);
    jRadioButtonAllStatus.setSelected(true);
    jRadioButtonAllStatus.setText("All");
    jRadioButtonAllStatus.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jRadioButtonAllStatus.setPreferredSize(null);
    jRadioButtonAllStatus.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonAllStatusActionPerformed(evt);
        }
    });
    jPanel9.add(jRadioButtonAllStatus);

    jPanelStatusFilter.add(jPanel9);

    jPanel10.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 2));

    buttonGroupStatusFilter.add(jRadioButtonPassedStep);
    jRadioButtonPassedStep.setText("Passed Step");
    jRadioButtonPassedStep.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jRadioButtonPassedStep.setPreferredSize(null);
    jRadioButtonPassedStep.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonPassedStepActionPerformed(evt);
        }
    });
    jPanel10.add(jRadioButtonPassedStep);

    jPanelStatusFilter.add(jPanel10);

    jPanel11.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 2));

    buttonGroupStatusFilter.add(jRadioButtonPassedSequence);
    jRadioButtonPassedSequence.setText("Passed Sequence");
    jRadioButtonPassedSequence.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jRadioButtonPassedSequence.setPreferredSize(null);
    jRadioButtonPassedSequence.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonPassedSequenceActionPerformed(evt);
        }
    });
    jPanel11.add(jRadioButtonPassedSequence);

    jPanelStatusFilter.add(jPanel11);

    jPanel1.add(jPanelStatusFilter);

    jPanelCountFilter.setBorder(javax.swing.BorderFactory
            .createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Test Count Filter"));
    jPanelCountFilter.setLayout(new javax.swing.BoxLayout(jPanelCountFilter, javax.swing.BoxLayout.Y_AXIS));

    jPanel12.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 2));

    buttonGroupCountFilter.add(jRadioButtonAllCount);
    jRadioButtonAllCount.setSelected(true);
    jRadioButtonAllCount.setText("All");
    jRadioButtonAllCount.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jRadioButtonAllCount.setPreferredSize(null);
    jRadioButtonAllCount.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonAllCountActionPerformed(evt);
        }
    });
    jPanel12.add(jRadioButtonAllCount);

    jPanelCountFilter.add(jPanel12);

    jPanel13.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 2));

    buttonGroupCountFilter.add(jRadioButtonFirst);
    jRadioButtonFirst.setText("First");
    jRadioButtonFirst.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jRadioButtonFirst.setPreferredSize(null);
    jRadioButtonFirst.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonFirstActionPerformed(evt);
        }
    });
    jPanel13.add(jRadioButtonFirst);

    jPanelCountFilter.add(jPanel13);

    jPanel14.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 2));

    buttonGroupCountFilter.add(jRadioButtonSecond);
    jRadioButtonSecond.setText("Second");
    jRadioButtonSecond.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jRadioButtonSecond.setPreferredSize(null);
    jRadioButtonSecond.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonSecondActionPerformed(evt);
        }
    });
    jPanel14.add(jRadioButtonSecond);

    jPanelCountFilter.add(jPanel14);

    jPanel15.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 2));

    buttonGroupCountFilter.add(jRadioButtonThird);
    jRadioButtonThird.setText("Third");
    jRadioButtonThird.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jRadioButtonThird.setPreferredSize(null);
    jRadioButtonThird.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonThirdActionPerformed(evt);
        }
    });
    jPanel15.add(jRadioButtonThird);

    jPanelCountFilter.add(jPanel15);

    jPanel16.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 2));

    buttonGroupCountFilter.add(jRadioButtonLast);
    jRadioButtonLast.setText("Last");
    jRadioButtonLast.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jRadioButtonLast.setPreferredSize(null);
    jRadioButtonLast.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonLastActionPerformed(evt);
        }
    });
    jPanel16.add(jRadioButtonLast);

    jPanelCountFilter.add(jPanel16);

    jPanel1.add(jPanelCountFilter);

    jPanel2.setLayout(new java.awt.BorderLayout());
    jPanel1.add(jPanel2);

    add(jPanel1, java.awt.BorderLayout.WEST);

    jSplitPane.setBorder(null);
    jSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

    jScrollPaneTop.setBorder(null);

    jTable.setModel(
            new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    jTable.setName("Categories"); // NOI18N
    jTable.getTableHeader().setReorderingAllowed(false);
    jScrollPaneTop.setViewportView(jTable);

    jSplitPane.setTopComponent(jScrollPaneTop);

    jScrollPaneBottom.setBorder(null);
    jSplitPane.setBottomComponent(jScrollPaneBottom);

    add(jSplitPane, java.awt.BorderLayout.CENTER);
}

From source file:edu.ucla.stat.SOCR.chart.Chart.java

public void initMapPanel() {
    listIndex = new int[dataTable.getColumnCount()];
    for (int j = 0; j < listIndex.length; j++)
        listIndex[j] = 1;/*from ww w.j av  a2  s.  co  m*/
    bPanel = new JPanel(new BorderLayout());
    // topPanel = new JPanel(new FlowLayout());
    //bottomPanel = new JPanel(new FlowLayout());
    mapPanel = new JPanel(new GridLayout(2, 3, 50, 50));
    //  bPanel.add(new JPanel(),BorderLayout.EAST);
    //   bPanel.add(new JPanel(),BorderLayout.WEST);
    //   bPanel.add(new JPanel(),BorderLayout.SOUTH);
    bPanel.add(mapPanel, BorderLayout.CENTER);
    //   bPanel.add(new JPanel(),BorderLayout.NORTH);

    addButton1.addActionListener(this);
    addButton2.addActionListener(this);
    removeButton1.addActionListener(this);
    removeButton2.addActionListener(this);

    lModelAdded = new DefaultListModel();
    lModelDep = new DefaultListModel();
    lModelIndep = new DefaultListModel();

    //JLabel depLabel = new JLabel(DEPENDENT);
    //JLabel indLabel = new JLabel(INDEPENDENT);        
    //JLabel varLabel = new JLabel(VARIABLE);

    int cellWidth = 10;

    listAdded = new JList(lModelAdded);
    listAdded.setSelectedIndex(0);
    listDepRemoved = new JList(lModelDep);
    listIndepRemoved = new JList(lModelIndep);

    paintMappingLists(listIndex);
    listAdded.setFixedCellWidth(cellWidth);
    listDepRemoved.setFixedCellWidth(cellWidth);
    listIndepRemoved.setFixedCellWidth(cellWidth);

    tools1 = new JToolBar(JToolBar.VERTICAL);
    tools2 = new JToolBar(JToolBar.VERTICAL);

    if (mapDep) {
        tools1.add(depLabel);
        tools1.add(addButton1);
        tools1.add(removeButton1);
    }
    if (mapIndep) {
        tools2.add(indLabel);
        tools2.add(addButton2);
        tools2.add(removeButton2);
    }
    tools1.setFloatable(false);
    tools2.setFloatable(false);

    /*  topPanel.add(listAdded);
    topPanel.add(addButton);
    topPanel.add(listDepRemoved);
    bottomPanel.add(listIndepRemoved);
    bottomPanel.add(addButton2);
    bottomPanel.add(list4); */

    JRadioButton legendPanelOnSwitch;
    JRadioButton legendPanelOffSwitch;
    //
    JPanel choicesPanel = new JPanel();
    choicesPanel.setLayout(new BoxLayout(choicesPanel, BoxLayout.Y_AXIS));
    legendPanelOnSwitch = new JRadioButton("On");
    legendPanelOnSwitch.addActionListener(this);
    legendPanelOnSwitch.setActionCommand(LEGENDON);
    legendPanelOnSwitch.setSelected(false);
    legendPanelOn = false;

    legendPanelOffSwitch = new JRadioButton("Off");
    legendPanelOffSwitch.addActionListener(this);
    legendPanelOffSwitch.setActionCommand(LEGENDOFF);
    legendPanelOffSwitch.setSelected(true);

    ButtonGroup group = new ButtonGroup();
    group.add(legendPanelOnSwitch);
    group.add(legendPanelOffSwitch);
    choicesPanel.add(new JLabel("Turn the legend panel:"));
    choicesPanel.add(legendPanelOnSwitch);
    choicesPanel.add(legendPanelOffSwitch);
    choicesPanel.setPreferredSize(new Dimension(200, 100));

    mapPanel.add(new JScrollPane(listAdded));
    JPanel emptyPanel = new JPanel();
    JPanel emptyPanel2 = new JPanel();
    JPanel emptyPanel3 = new JPanel();

    if (mapDep) {
        mapPanel.add(tools1);
        mapPanel.add(new JScrollPane(listDepRemoved));
        if (LEGEND_SWITCH)
            mapPanel.add(choicesPanel);
        else
            mapPanel.add(emptyPanel);

        if (mapIndep) {
            mapPanel.add(tools2);
            mapPanel.add(new JScrollPane(listIndepRemoved));
        } else {
            mapPanel.add(emptyPanel2);
            mapPanel.add(emptyPanel3);
        }
    } else {
        mapPanel.add(emptyPanel);
        mapPanel.add(emptyPanel2);

        if (LEGEND_SWITCH)
            mapPanel.add(emptyPanel3);
        else
            mapPanel.add(choicesPanel);
        if (mapIndep) {
            mapPanel.add(tools2);
            mapPanel.add(new JScrollPane(listIndepRemoved));
        }
    }

}

From source file:AppearanceExplorer.java

LineAttributesEditor(LineAttributes init) {
    super(BoxLayout.Y_AXIS);
    lineAttr = init;/*from w  w w .  j a v a 2s. co m*/
    lineWidth = lineAttr.getLineWidth();
    linePattern = lineAttr.getLinePattern();
    lineAAEnable = lineAttr.getLineAntialiasingEnable();

    FloatLabelJSlider lineWidthSlider = new FloatLabelJSlider("Width", 0.1f, 0.0f, 5.0f, lineWidth);
    lineWidthSlider.setMajorTickSpacing(1.0f);
    lineWidthSlider.setPaintTicks(true);
    lineWidthSlider.addFloatListener(new FloatListener() {
        public void floatChanged(FloatEvent e) {
            lineWidth = e.getValue();
            lineAttr.setLineWidth(lineWidth);
        }
    });
    lineWidthSlider.setAlignmentX(Component.LEFT_ALIGNMENT);
    add(lineWidthSlider);

    String[] patternNames = { "PATTERN_SOLID", "PATTERN_DASH", "PATTERN_DOT", "PATTERN_DASH_DOT" };
    int[] patternValues = { LineAttributes.PATTERN_SOLID, LineAttributes.PATTERN_DASH,
            LineAttributes.PATTERN_DOT, LineAttributes.PATTERN_DASH_DOT };

    IntChooser patternChooser = new IntChooser("Pattern:", patternNames, patternValues, linePattern);
    patternChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            int value = event.getValue();
            lineAttr.setLinePattern(value);
        }
    });
    patternChooser.setAlignmentX(Component.LEFT_ALIGNMENT);
    add(patternChooser);

    JCheckBox lineAACheckBox = new JCheckBox(antiAliasString);
    lineAACheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            JCheckBox checkbox = (JCheckBox) e.getSource();
            lineAAEnable = checkbox.isSelected();
            lineAttr.setLineAntialiasingEnable(lineAAEnable);
        }
    });
    lineAACheckBox.setAlignmentX(Component.LEFT_ALIGNMENT);
    // add the checkbox to the panel
    add(lineAACheckBox);
}

From source file:AppearanceExplorer.java

PolygonAttributesEditor(PolygonAttributes init) {
    super(BoxLayout.Y_AXIS);
    polygonAttr = init;//  w ww .j  av a2 s  .c  o m
    polygonMode = polygonAttr.getPolygonMode();
    cullFace = polygonAttr.getCullFace();
    polygonOffset = polygonAttr.getPolygonOffset();
    polygonOffsetFactor = polygonAttr.getPolygonOffsetFactor();
    backFaceNormalFlip = polygonAttr.getBackFaceNormalFlip();

    String[] modeNames = { "POLYGON_POINT", "POLYGON_LINE", "POLYGON_FILL", };
    int[] modeValues = { PolygonAttributes.POLYGON_POINT, PolygonAttributes.POLYGON_LINE,
            PolygonAttributes.POLYGON_FILL, };
    IntChooser modeChooser = new IntChooser("Mode:", modeNames, modeValues, polygonMode);
    modeChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            polygonMode = event.getValue();
            polygonAttr.setPolygonMode(polygonMode);
        }
    });
    add(modeChooser);

    String[] cullNames = { "CULL_NONE", "CULL_BACK", "CULL_FRONT", };
    int[] cullValues = { PolygonAttributes.CULL_NONE, PolygonAttributes.CULL_BACK,
            PolygonAttributes.CULL_FRONT, };
    IntChooser cullChooser = new IntChooser("Cull:", cullNames, cullValues, cullFace);
    cullChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            cullFace = event.getValue();
            polygonAttr.setCullFace(cullFace);
        }
    });
    add(cullChooser);

    FloatLabelJSlider polygonOffsetSlider = new FloatLabelJSlider("Offset", 0.1f, 0.0f, 2.0f, polygonOffset);
    polygonOffsetSlider.setMajorTickSpacing(1.0f);
    polygonOffsetSlider.setPaintTicks(true);
    polygonOffsetSlider.addFloatListener(new FloatListener() {
        public void floatChanged(FloatEvent e) {
            polygonOffset = e.getValue();
            polygonAttr.setPolygonOffset(polygonOffset);
        }
    });
    add(polygonOffsetSlider);

    LogFloatLabelJSlider polygonOffsetFactorSlider = new LogFloatLabelJSlider("Offset Factor", 0.1f, 10000.0f,
            polygonOffsetFactor);
    polygonOffsetFactorSlider.addFloatListener(new FloatListener() {
        public void floatChanged(FloatEvent e) {
            polygonOffsetFactor = e.getValue();
            polygonAttr.setPolygonOffsetFactor(polygonOffsetFactor);
        }
    });
    add(polygonOffsetFactorSlider);

    JCheckBox backFaceNormalFlipCheckBox = new JCheckBox("BackFaceNormalFlip", backFaceNormalFlip);
    backFaceNormalFlipCheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            JCheckBox checkbox = (JCheckBox) e.getSource();
            backFaceNormalFlip = checkbox.isSelected();
            polygonAttr.setBackFaceNormalFlip(backFaceNormalFlip);
        }
    });
    // no ablity to change without replcing polygon attributes
    backFaceNormalFlipCheckBox.setEnabled(false);

    add(new LeftAlignComponent(backFaceNormalFlipCheckBox));
}

From source file:AppearanceExplorer.java

RenderingAttributesEditor(RenderingAttributes init) {
    renderingAttr = init;/*from   w w w. ja va  2s .  c  o  m*/
    visible = renderingAttr.getVisible();
    depthBufferEnable = renderingAttr.getDepthBufferEnable();
    depthBufferWriteEnable = renderingAttr.getDepthBufferWriteEnable();
    ignoreVertexColors = renderingAttr.getIgnoreVertexColors();
    rasterOpEnable = renderingAttr.getRasterOpEnable();
    rasterOp = renderingAttr.getRasterOp();
    alphaTestFunction = renderingAttr.getAlphaTestFunction();
    alphaTestValue = renderingAttr.getAlphaTestValue();

    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

    JCheckBox visibleCheckBox = new JCheckBox("Visible", visible);
    visibleCheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            JCheckBox checkbox = (JCheckBox) e.getSource();
            visible = checkbox.isSelected();
            renderingAttr.setVisible(visible);
        }
    });
    // add the checkbox to the panel
    add(new LeftAlignComponent(visibleCheckBox));

    JCheckBox ignoreVertexColorsCheckBox = new JCheckBox("Ignore Vertex Colors", ignoreVertexColors);
    ignoreVertexColorsCheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            JCheckBox checkbox = (JCheckBox) e.getSource();
            ignoreVertexColors = checkbox.isSelected();
            renderingAttr.setIgnoreVertexColors(ignoreVertexColors);
        }
    });
    // add the checkbox to the panel
    add(new LeftAlignComponent(ignoreVertexColorsCheckBox));

    JCheckBox depthBufferEnableCheckBox = new JCheckBox("Depth Buffer Enable", depthBufferEnable);
    depthBufferEnableCheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            JCheckBox checkbox = (JCheckBox) e.getSource();
            depthBufferEnable = checkbox.isSelected();
            renderingAttr.setDepthBufferEnable(depthBufferEnable);
        }
    });
    // add the checkbox to the panel
    add(new LeftAlignComponent(depthBufferEnableCheckBox));
    // no cap bit for depth buffer enable
    depthBufferEnableCheckBox.setEnabled(false);

    JCheckBox depthBufferWriteEnableCheckBox = new JCheckBox("Depth Buffer Write Enable",
            depthBufferWriteEnable);
    depthBufferWriteEnableCheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            JCheckBox checkbox = (JCheckBox) e.getSource();
            depthBufferWriteEnable = checkbox.isSelected();
            renderingAttr.setDepthBufferWriteEnable(depthBufferWriteEnable);
        }
    });
    // add the checkbox to the panel
    add(new LeftAlignComponent(depthBufferWriteEnableCheckBox));
    // no cap bit for depth buffer enable
    depthBufferWriteEnableCheckBox.setEnabled(false);

    JCheckBox rasterOpEnableCheckBox = new JCheckBox("Raster Operation Enable", rasterOpEnable);
    rasterOpEnableCheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            JCheckBox checkbox = (JCheckBox) e.getSource();
            rasterOpEnable = checkbox.isSelected();
            renderingAttr.setRasterOpEnable(rasterOpEnable);
        }
    });
    // add the checkbox to the panel
    add(new LeftAlignComponent(rasterOpEnableCheckBox));

    String[] rasterOpNames = { "ROP_COPY", "ROP_XOR", };
    int[] rasterOpValues = { RenderingAttributes.ROP_COPY, RenderingAttributes.ROP_XOR, };
    IntChooser rasterOpChooser = new IntChooser("Raster Operation:", rasterOpNames, rasterOpValues, rasterOp);
    rasterOpChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            rasterOp = event.getValue();
            renderingAttr.setRasterOp(rasterOp);
        }
    });
    add(rasterOpChooser);

    String[] alphaTestFunctionNames = { "ALWAYS", "NEVER", "EQUAL", "NOT_EQUAL", "LESS", "LESS_OR_EQUAL",
            "GREATER", "GREATER_OR_EQUAL", };
    int[] alphaTestFunctionValues = { RenderingAttributes.ALWAYS, RenderingAttributes.NEVER,
            RenderingAttributes.EQUAL, RenderingAttributes.NOT_EQUAL, RenderingAttributes.LESS,
            RenderingAttributes.LESS_OR_EQUAL, RenderingAttributes.GREATER,
            RenderingAttributes.GREATER_OR_EQUAL, };
    IntChooser alphaTestFunctionChooser = new IntChooser("Alpha Test Function:", alphaTestFunctionNames,
            alphaTestFunctionValues, alphaTestFunction);
    alphaTestFunctionChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            alphaTestFunction = event.getValue();
            renderingAttr.setAlphaTestFunction(alphaTestFunction);
        }
    });
    add(alphaTestFunctionChooser);

    FloatLabelJSlider alphaTestValueSlider = new FloatLabelJSlider("Alpha Test Value: ", 0.1f, 0.0f, 1.0f,
            alphaTestValue);
    alphaTestValueSlider.setMajorTickSpacing(1.0f);
    alphaTestValueSlider.setPaintTicks(true);
    alphaTestValueSlider.addFloatListener(new FloatListener() {
        public void floatChanged(FloatEvent e) {
            alphaTestValue = e.getValue();
            renderingAttr.setAlphaTestValue(alphaTestValue);
        }
    });
    add(alphaTestValueSlider);

}

From source file:edu.ucla.stat.SOCR.analyses.gui.NormalPower.java

protected void setVisualizePanel() {
    visualizePanel.setLayout(new BoxLayout(visualizePanel, BoxLayout.Y_AXIS));
    visualizePanel.setPreferredSize(new Dimension(400, 400));
    visualizePanel.setBackground(Color.WHITE);
    /*//  w w  w .  j a v a2s .c om
          visualizePanel2.setLayout(new BoxLayout(visualizePanel2, BoxLayout.Y_AXIS));
          visualizePanel2.setPreferredSize(new Dimension(400, 400));
          visualizePanel2.setBackground(Color.WHITE);
    */
    //legendPanel = new JPanel();

    Dimension top = graphRawData.getSize(null);

    graphRawData.setPreferredSize(new Dimension(400, 60));
    graphSampleMean.setPreferredSize(new Dimension(400, 120));

    legendPanel.setBackground(Color.WHITE);
    JLabel descriptionTop = new JLabel(
            "   Top: normal curves based on the data. Blue for the null hypothesis; red for the alternative hypothesis.   ");
    JLabel descriptionBottom = new JLabel("   Bottom: normal curves of two sample means.   ");

    legendPanel.add(descriptionTop, BorderLayout.NORTH);
    legendPanel.add(descriptionBottom, BorderLayout.CENTER);
    legendPanel.setLayout(new BoxLayout(legendPanel, BoxLayout.Y_AXIS));
    legendPanel.setBackground(Color.PINK);
    graphSampleMean.addMouseMotionListener(this);

    visualizePanel.removeAll();
    innerPanel = new JPanel();
    JScrollPane graphPane = new JScrollPane(innerPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);

    visualizePanel.add(graphPane);
    innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.Y_AXIS));
    visualizePanel.setLayout(new BoxLayout(visualizePanel, BoxLayout.Y_AXIS));

    innerPanel.add(legendPanel);
    //visualizePanel.setVisible(false);

    legendPanel.setVisible(false);
    /*
    visualizePanel2.removeAll();
    visualizePanel2.add(graphRawData);
    visualizePanel2.add(graphSampleMean);
    visualizePanel2.add(legendPanel);
    */
}

From source file:AppearanceExplorer.java

public MaterialEditor(Material init) {
    super(BoxLayout.Y_AXIS);
    material = init;//  www  .  j  a  v a  2 s .  c  o m
    lightingEnable = material.getLightingEnable();
    material.getAmbientColor(ambientColor);
    material.getDiffuseColor(diffuseColor);
    material.getEmissiveColor(emissiveColor);
    material.getSpecularColor(specularColor);
    shininess = material.getShininess();

    lightingEnableCheckBox = new JCheckBox("Lighting Enable", lightingEnable);
    lightingEnableCheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            JCheckBox checkbox = (JCheckBox) e.getSource();
            lightingEnable = checkbox.isSelected();
            material.setLightingEnable(lightingEnable);
        }
    });
    // add the checkbox to the panel
    add(new LeftAlignComponent(lightingEnableCheckBox));

    ambientEditor = new Color3fEditor("Ambient Color  ", ambientColor);
    ambientEditor.addColor3fListener(new Color3fListener() {
        public void colorChanged(Color3fEvent event) {
            event.getValue(ambientColor);
            material.setAmbientColor(ambientColor);
        }
    });
    add(ambientEditor);

    diffuseEditor = new Color3fEditor("Diffuse Color    ", diffuseColor);
    diffuseEditor.addColor3fListener(new Color3fListener() {
        public void colorChanged(Color3fEvent event) {
            event.getValue(diffuseColor);
            material.setDiffuseColor(diffuseColor);
        }
    });
    add(diffuseEditor);

    emissiveEditor = new Color3fEditor("Emissive Color", emissiveColor);
    emissiveEditor.addColor3fListener(new Color3fListener() {
        public void colorChanged(Color3fEvent event) {
            event.getValue(emissiveColor);
            material.setEmissiveColor(emissiveColor);
        }
    });
    add(emissiveEditor);

    specularEditor = new Color3fEditor("Specular Color ", specularColor);
    specularEditor.addColor3fListener(new Color3fListener() {
        public void colorChanged(Color3fEvent event) {
            event.getValue(specularColor);
            material.setSpecularColor(specularColor);
        }
    });
    add(specularEditor);

    shininessSlider = new FloatLabelJSlider("Shininess: ", 1.0f, 0.0f, 128.0f, shininess);
    shininessSlider.setMajorTickSpacing(16.0f);
    shininessSlider.setPaintTicks(true);
    shininessSlider.addFloatListener(new FloatListener() {
        public void floatChanged(FloatEvent e) {
            shininess = e.getValue();
            material.setShininess(shininess);
        }
    });
    add(shininessSlider);
}

From source file:AppearanceExplorer.java

public Texture2DEditor(Appearance app, String codeBaseString, String[] texImageNames,
        String[] texImageFileNames, int texImageIndex, boolean texEnable, int texBoundaryModeS,
        int texBoundaryModeT, int texMinFilter, int texMagFilter, int texMipMapMode, Color4f texBoundaryColor) {

    super(BoxLayout.Y_AXIS);

    this.appearance = app;
    // TODO: make deep copies?
    this.imageNames = texImageNames;
    this.imageFileNames = texImageFileNames;
    this.imageIndex = texImageIndex;
    this.imageFile = texImageFileNames[texImageIndex];
    this.codeBaseString = codeBaseString;
    this.enable = texEnable;
    this.mipMapMode = texMipMapMode;
    this.boundaryModeS = texBoundaryModeS;
    this.boundaryModeT = texBoundaryModeT;
    this.minFilter = texMinFilter;
    this.magFilter = texMagFilter;
    this.boundaryColor.set(texBoundaryColor);

    // set up the initial texture
    setTexture();//  ww w  .ja v  a  2 s  . co  m

    JCheckBox texEnableCheckBox = new JCheckBox("Enable Texture");
    texEnableCheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            enable = ((JCheckBox) e.getSource()).isSelected();
            // workaround for bug
            // should just be able to
            // texture.setEnable(texEnable);
            // instead we have to:
            setTexture();
        }
    });

    // add the checkbox to the panel
    add(new LeftAlignComponent(texEnableCheckBox));

    IntChooser imgChooser = new IntChooser("Image:", imageNames);
    imgChooser.setValue(imageIndex);
    imgChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            imageIndex = event.getValue();
            imageFile = imageFileNames[imageIndex];
            setTexture();
        }
    });
    add(imgChooser);

    // texture boundaries
    String[] boundaryNames = { "WRAP", "CLAMP", };
    int[] boundaryValues = { Texture.WRAP, Texture.CLAMP, };

    // texture boundary S
    IntChooser bndSChooser = new IntChooser("Boundary S Mode:", boundaryNames, boundaryValues);
    bndSChooser.setValue(texBoundaryModeS);
    bndSChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            int value = event.getValue();
            boundaryModeS = value;
            setTexture();
        }
    });
    add(bndSChooser);

    // texture boundary T
    IntChooser bndTChooser = new IntChooser("Boundary T Mode:", boundaryNames, boundaryValues);
    bndTChooser.setValue(texBoundaryModeT);
    bndTChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            int value = event.getValue();
            boundaryModeT = value;
            setTexture();
        }
    });
    add(bndTChooser);

    // texture min filter
    String[] minFiltNames = { "FASTEST", "NICEST", "BASE_LEVEL_POINT", "BASE_LEVEL_LINEAR", "MULTI_LEVEL_POINT",
            "MULTI_LEVEL_LINEAR", };
    int[] minFiltValues = { Texture.FASTEST, Texture.NICEST, Texture.BASE_LEVEL_POINT,
            Texture.BASE_LEVEL_LINEAR, Texture.MULTI_LEVEL_POINT, Texture.MULTI_LEVEL_LINEAR, };

    // min filter
    IntChooser minFiltChooser = new IntChooser("Min Filter:", minFiltNames, minFiltValues);
    minFiltChooser.setValue(minFilter);
    minFiltChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            int value = event.getValue();
            minFilter = value;
            setTexture();
        }
    });
    add(minFiltChooser);

    // texture mag filter
    String[] magFiltNames = { "FASTEST", "NICEST", "BASE_LEVEL_POINT", "BASE_LEVEL_LINEAR", };
    int[] magFiltValues = { Texture.FASTEST, Texture.NICEST, Texture.BASE_LEVEL_POINT,
            Texture.BASE_LEVEL_LINEAR, };

    // mag filter
    IntChooser magFiltChooser = new IntChooser("Mag Filter:", magFiltNames, magFiltValues);
    magFiltChooser.setValue(magFilter);
    magFiltChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            int value = event.getValue();
            magFilter = value;
            setTexture();
        }
    });
    add(magFiltChooser);

    // texture mipmap mode
    String[] mipMapNames = { "BASE_LEVEL", "MULTI_LEVEL_MIPMAP", };
    int[] mipMapValues = { Texture.BASE_LEVEL, Texture.MULTI_LEVEL_MIPMAP, };

    // mipMap mode
    IntChooser mipMapChooser = new IntChooser("MipMap Mode:", mipMapNames, mipMapValues);
    mipMapChooser.setValue(mipMapMode);
    mipMapChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            int value = event.getValue();
            mipMapMode = value;
            setTexture();
        }
    });
    add(mipMapChooser);

    Color4fEditor boundaryColorEditor = new Color4fEditor("Boundary Color", boundaryColor);
    boundaryColorEditor.addColor4fListener(new Color4fListener() {
        public void colorChanged(Color4fEvent event) {
            event.getValue(boundaryColor);
            setTexture();
        }
    });
    add(boundaryColorEditor);
}