Search in sources :

Example 6 with LabeledComponentPanel

use of maspack.widgets.LabeledComponentPanel in project artisynth_core by artisynth.

the class NumericProbeEditor method createSubPanes.

private void createSubPanes() {
    mainPane.add(Box.createRigidArea(new Dimension(0, 4)));
    middlePane = new JPanel();
    middlePane.setLayout(new BoxLayout(middlePane, BoxLayout.X_AXIS));
    vectorPane = new JPanel();
    vectorPane.setLayout(new BoxLayout(vectorPane, BoxLayout.Y_AXIS));
    vectorPane.setMaximumSize(new Dimension(85, Integer.MAX_VALUE));
    vectorPane.setPreferredSize(new Dimension(85, 50));
    vectorPane.setOpaque(false);
    vectorPane.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
    vectorPane.setAlignmentY(Component.TOP_ALIGNMENT);
    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    splitPane.setAlignmentY(TOP_ALIGNMENT);
    splitPane.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
    splitPane.setDividerSize(2);
    splitPane.setResizeWeight(0.5);
    splitPane.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
    propPane = new JPanel();
    propPane.setLayout(new BoxLayout(propPane, BoxLayout.Y_AXIS));
    propPane.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
    propPane.setOpaque(false);
    // propPane.setBorder(new LineBorder(Color.black));
    equationPane = new JPanel();
    equationPane.setLayout(new BoxLayout(equationPane, BoxLayout.Y_AXIS));
    equationPane.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
    equationPane.setOpaque(false);
    equationPane.setAlignmentY(Component.TOP_ALIGNMENT);
    // equationPane.setBorder(new LineBorder(Color.black));
    mainPane.add(middlePane);
    // filePane = new JPanel();
    // filePane.setLayout(new BoxLayout(filePane, BoxLayout.X_AXIS));
    // filePane.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
    // filePane.setMaximumSize(new Dimension(Integer.MAX_VALUE, 30));
    // mainPane.add(filePane);
    optionsPane = new JPanel();
    optionsPane.setLayout(new BoxLayout(optionsPane, BoxLayout.X_AXIS));
    // optionsPane.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
    // mainPane.add(optionsPane);
    leftPropertyPanel = new LabeledComponentPanel();
    rightPropertyPanel = new LabeledComponentPanel();
    leftPropertyPanel.setBorder(BorderFactory.createEtchedBorder());
    rightPropertyPanel.setBorder(BorderFactory.createEtchedBorder());
    optionsPane.add(leftPropertyPanel);
    optionsPane.add(rightPropertyPanel);
    // propertyPane.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
    mainPane.add(optionsPane);
    bottomPane = new JPanel();
    bottomPane.setLayout(new BoxLayout(bottomPane, BoxLayout.X_AXIS));
    bottomPane.setAlignmentX(CENTER_ALIGNMENT);
    bottomPane.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
    mainPane.add(bottomPane);
// vectorPane.setBackground(Color.green);
// vectorPane.setBorder(BorderFactory.createLineBorder(Color.BLACK));
// equationPane.setBackground(Color.green);
// equationPane.setBorder(BorderFactory.createLineBorder(Color.BLACK));
}
Also used : JPanel(javax.swing.JPanel) BoxLayout(javax.swing.BoxLayout) Dimension(java.awt.Dimension) JSplitPane(javax.swing.JSplitPane) LabeledComponentPanel(maspack.widgets.LabeledComponentPanel)

Example 7 with LabeledComponentPanel

use of maspack.widgets.LabeledComponentPanel in project artisynth_core by artisynth.

the class RigidBodyAgent method createLocationPanel.

private void createLocationPanel() {
    positionField = new VectorField("position", 3);
    positionField.setStretchable(true);
    positionField.addValueChangeListener(this);
    orientationField = new AxisAngleField("orientiation", new AxisAngle());
    orientationField.setStretchable(true);
    orientationField.addValueChangeListener(this);
    LabeledComponentPanel locationPanel = new LabeledComponentPanel();
    locationPanel.addWidget(positionField);
    locationPanel.addWidget(orientationField);
    addWidget(locationPanel);
    locationPanel.setBorder(GuiUtils.createTitledPanelBorder("Location"));
}
Also used : AxisAngle(maspack.matrix.AxisAngle) VectorField(maspack.widgets.VectorField) AxisAngleField(maspack.widgets.AxisAngleField) LabeledComponentPanel(maspack.widgets.LabeledComponentPanel)

Example 8 with LabeledComponentPanel

use of maspack.widgets.LabeledComponentPanel in project artisynth_core by artisynth.

the class NumericProbeRangeSelectorDialog method commonProbeRangeSelectorInit.

private void commonProbeRangeSelectorInit(NumericProbePanel DisplayProbe) {
    display = DisplayProbe;
    super.setModal(true);
    double[] range = display.getDisplayRange();
    minYRange = range[0];
    maxYRange = range[1];
    autoRanging = display.isAutoRanging();
    getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
    myPanel = new LabeledComponentPanel();
    myPanel.setAlignmentX(Component.CENTER_ALIGNMENT);
    getContentPane().add(myPanel);
    generateWidgets(myPanel);
    JSeparator sep = new JSeparator();
    sep.setAlignmentX(Component.CENTER_ALIGNMENT);
    getContentPane().add(sep);
    OptionPanel options = new OptionPanel("OK Cancel", this);
    options.setAlignmentX(Component.CENTER_ALIGNMENT);
    getContentPane().add(options);
    pack();
    Point offset = display.getLocationOnScreen();
    this.setLocation(offset.x, offset.y);
    // this.setSize(new Dimension(350, 125));
    // this.setMinimumSize(new Dimension(350, 125));
    setVisible(true);
}
Also used : BoxLayout(javax.swing.BoxLayout) Point(java.awt.Point) LabeledComponentPanel(maspack.widgets.LabeledComponentPanel) JSeparator(javax.swing.JSeparator) OptionPanel(maspack.widgets.OptionPanel)

Aggregations

LabeledComponentPanel (maspack.widgets.LabeledComponentPanel)8 BoxLayout (javax.swing.BoxLayout)4 OptionPanel (maspack.widgets.OptionPanel)3 VectorField (maspack.widgets.VectorField)3 Dimension (java.awt.Dimension)2 JSeparator (javax.swing.JSeparator)2 AxisAngle (maspack.matrix.AxisAngle)2 AxisAngleField (maspack.widgets.AxisAngleField)2 IntegerField (maspack.widgets.IntegerField)2 StringField (maspack.widgets.StringField)2 Main (artisynth.core.driver.Main)1 PropertyField (artisynth.core.gui.widgets.PropertyField)1 Container (java.awt.Container)1 Insets (java.awt.Insets)1 Point (java.awt.Point)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 File (java.io.File)1 JButton (javax.swing.JButton)1 JPanel (javax.swing.JPanel)1