Example usage for javax.media.j3d LineAttributes PATTERN_SOLID

List of usage examples for javax.media.j3d LineAttributes PATTERN_SOLID

Introduction

In this page you can find the example usage for javax.media.j3d LineAttributes PATTERN_SOLID.

Prototype

int PATTERN_SOLID

To view the source code for javax.media.j3d LineAttributes PATTERN_SOLID.

Click Source Link

Document

Draw solid lines with no pattern.

Usage

From source file:AppearanceTest.java

public void onSolid() {
    getLineAttributes().setLinePattern(LineAttributes.PATTERN_SOLID);
}

From source file:AppearanceExplorer.java

LineAttributesEditor(LineAttributes init) {
    super(BoxLayout.Y_AXIS);
    lineAttr = init;//from   w w w.  ja va  2s.  c o  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);
}