Example usage for java.awt CheckboxMenuItem CheckboxMenuItem

List of usage examples for java.awt CheckboxMenuItem CheckboxMenuItem

Introduction

In this page you can find the example usage for java.awt CheckboxMenuItem CheckboxMenuItem.

Prototype

public CheckboxMenuItem(String label, boolean state) throws HeadlessException 

Source Link

Document

Create a check box menu item with the specified label and state.

Usage

From source file:ExAmbientLight.java

public void initialize(String[] args) {
    // Initialize the window, menubar, etc.
    super.initialize(args);
    exampleFrame.setTitle("Java 3D Ambient Light Example");

    ///*  w w  w. jav  a  2s  .  c o m*/
    //  Add a menubar menu to change node parameters
    //    Light on/off
    //    Color -->
    //

    Menu m = new Menu("AmbientLight");

    lightOnOffMenu = new CheckboxMenuItem("Light on/off", lightOnOff);
    lightOnOffMenu.addItemListener(this);
    m.add(lightOnOffMenu);

    colorMenu = new CheckboxMenu("Color", colors, currentColor, this);
    m.add(colorMenu);

    exampleMenuBar.add(m);
}

From source file:ExLightScope.java

public void initialize(String[] args) {
    // Initialize the window, menubar, etc.
    super.initialize(args);
    exampleFrame.setTitle("Java 3D Light Scoping Example");

    ///*w w w  . jav  a  2  s. c om*/
    //  Add a menubar menu to change node parameters
    //    Use bounding leaf
    //

    Menu m = new Menu("DirectionalLights");

    light1OnOffMenu = new CheckboxMenuItem("Red light with sphere set 1 scope", light1OnOff);
    light1OnOffMenu.addItemListener(this);
    m.add(light1OnOffMenu);

    light2OnOffMenu = new CheckboxMenuItem("Blue light with sphere set 2 scope", light2OnOff);
    light2OnOffMenu.addItemListener(this);
    m.add(light2OnOffMenu);

    light3OnOffMenu = new CheckboxMenuItem("White light with universal scope", light3OnOff);
    light3OnOffMenu.addItemListener(this);
    m.add(light3OnOffMenu);

    exampleMenuBar.add(m);
}

From source file:ExLightBounds.java

public void initialize(String[] args) {
    // Initialize the window, menubar, etc.
    super.initialize(args);
    exampleFrame.setTitle("Java 3D Light Bounds Example");

    ////from   w w w. j a va2 s .  c  o  m
    //  Add a menubar menu to change node parameters
    //    Use bounding leaf
    //    Bounds size -->
    //    Bounding leaf position -->
    //

    Menu m = new Menu("DirectionalLight");

    boundingLeafOnOffMenu = new CheckboxMenuItem("Use bounding leaf", boundingLeafOnOff);
    boundingLeafOnOffMenu.addItemListener(this);
    m.add(boundingLeafOnOffMenu);

    boundsMenu = new CheckboxMenu("Bounds size", bounds, currentBounds, this);
    m.add(boundsMenu);

    positionMenu = new CheckboxMenu("Bounding leaf position", positions, currentPosition, this);
    if (boundingLeafOnOff)
        // Bounding leaf on
        positionMenu.setEnabled(true);
    else
        // Bounding leaf off
        positionMenu.setEnabled(false);
    m.add(positionMenu);

    exampleMenuBar.add(m);
}

From source file:ExExponentialFog.java

public void initialize(String[] args) {
    // Initialize the window, menubar, etc.
    super.initialize(args);
    exampleFrame.setTitle("Java 3D ExponentialFog Example");

    ////from   w  ww .j  ava 2s .c  o  m
    //  Add a menubar menu to change node parameters
    //    Coupled background color
    //    Background color -->
    //    Fog color -->
    //    Fog density -->
    //

    Menu m = new Menu("ExponentialFog");

    coupledBackgroundOnOffMenu = new CheckboxMenuItem("Couple background color", coupledBackgroundOnOff);
    coupledBackgroundOnOffMenu.addItemListener(this);
    m.add(coupledBackgroundOnOffMenu);

    backgroundColorMenu = new CheckboxMenu("Background color", colors, currentBackgroundColor, this);
    m.add(backgroundColorMenu);
    backgroundColorMenu.setEnabled(!coupledBackgroundOnOff);

    colorMenu = new CheckboxMenu("Fog color", colors, currentColor, this);
    m.add(colorMenu);

    densityMenu = new CheckboxMenu("Fog density", densities, currentDensity, this);
    m.add(densityMenu);

    exampleMenuBar.add(m);
}

From source file:ExLinearFog.java

public void initialize(String[] args) {
    // Initialize the window, menubar, etc.
    super.initialize(args);
    exampleFrame.setTitle("Java 3D LinearFog Example");

    ///*from   w  ww .  j  av a 2s  .  c om*/
    //  Add a menubar menu to change node parameters
    //    Coupled background color
    //    Background color -->
    //    Fog color -->
    //    Fog front distance -->
    //    Fog back distance -->
    //

    Menu m = new Menu("LinearFog");

    coupledBackgroundOnOffMenu = new CheckboxMenuItem("Couple background color", coupledBackgroundOnOff);
    coupledBackgroundOnOffMenu.addItemListener(this);
    m.add(coupledBackgroundOnOffMenu);

    backgroundColorMenu = new CheckboxMenu("Background color", colors, currentBackgroundColor, this);
    m.add(backgroundColorMenu);
    backgroundColorMenu.setEnabled(!coupledBackgroundOnOff);

    colorMenu = new CheckboxMenu("Fog color", colors, currentColor, this);
    m.add(colorMenu);

    frontMenu = new CheckboxMenu("Fog front distance", fronts, currentFront, this);
    m.add(frontMenu);

    backMenu = new CheckboxMenu("Fog back distance", backs, currentBack, this);
    m.add(backMenu);

    exampleMenuBar.add(m);
}

From source file:ExPointLight.java

public void initialize(String[] args) {
    // Initialize the window, menubar, etc.
    super.initialize(args);
    exampleFrame.setTitle("Java 3D Point Light Example");

    ////from ww  w  . j a  v  a2 s.  c  o m
    //  Add a menubar menu to change node parameters
    //    Light on/off
    //    Color -->
    //    Position -->
    //    Attenuation -->
    //

    Menu m = new Menu("PointLight");

    lightOnOffMenu = new CheckboxMenuItem("Light on/off", lightOnOff);
    lightOnOffMenu.addItemListener(this);
    m.add(lightOnOffMenu);

    colorMenu = new CheckboxMenu("Color", colors, currentColor, this);
    m.add(colorMenu);

    positionMenu = new CheckboxMenu("Position", positions, currentPosition, this);
    m.add(positionMenu);

    attenuationMenu = new CheckboxMenu("Attenuation", attenuations, currentAttenuation, this);
    m.add(attenuationMenu);

    exampleMenuBar.add(m);
}

From source file:ExClip.java

public void initialize(String[] args) {
    // Initialize the window, menubar, etc.
    super.initialize(args);
    exampleFrame.setTitle("Java 3D Clip Example");

    ///* w w  w .  ja v a2 s.c o  m*/
    //  Add a menubar menu to change node parameters
    //    Coupled background color
    //    Background color -->
    //    Fog color -->
    //    Fog front distance -->
    //    Fog back distance -->
    //    Coupled clip back distance
    //    Clip back distance -->
    //

    Menu m = new Menu("Fog and Clip");

    coupledBackgroundOnOffMenu = new CheckboxMenuItem("Couple background color", coupledBackgroundOnOff);
    coupledBackgroundOnOffMenu.addItemListener(this);
    m.add(coupledBackgroundOnOffMenu);

    backgroundColorMenu = new CheckboxMenu("Background color", colors, currentBackgroundColor, this);
    m.add(backgroundColorMenu);
    backgroundColorMenu.setEnabled(!coupledBackgroundOnOff);

    colorMenu = new CheckboxMenu("Fog color", colors, currentColor, this);
    m.add(colorMenu);

    frontMenu = new CheckboxMenu("Fog front distance", fronts, currentFront, this);
    m.add(frontMenu);

    backMenu = new CheckboxMenu("Fog back distance", backs, currentBack, this);
    m.add(backMenu);

    coupledClipBackOnOffMenu = new CheckboxMenuItem("Couple clip back distance", coupledClipBackOnOff);
    coupledClipBackOnOffMenu.addItemListener(this);
    m.add(coupledClipBackOnOffMenu);

    clipBackMenu = new CheckboxMenu("Clip back distance", clipBacks, currentClipBack, this);
    clipBackMenu.setEnabled(!coupledClipBackOnOff);
    m.add(clipBackMenu);

    exampleMenuBar.add(m);
}

From source file:ExTexture.java

public void initialize(String[] args) {
    // Initialize the window, menubar, etc.
    super.initialize(args);
    exampleFrame.setTitle("Java 3D Texture Mapping Example");

    ///*from   www.  j a v  a2  s. co  m*/
    //  Add a menubar menu to change texture parameters
    //    Image -->
    //    Boundary mode -->
    //    Boundary color -->
    //    Filter mode -->
    //

    Menu m = new Menu("Texture");

    textureOnOffMenu = new CheckboxMenuItem("Texturing enabled", textureOnOff);
    textureOnOffMenu.addItemListener(this);
    m.add(textureOnOffMenu);

    imageMenu = new CheckboxMenu("Image", images, currentImage, this);
    m.add(imageMenu);

    boundaryMenu = new CheckboxMenu("Boundary mode", boundaries, currentBoundary, this);
    m.add(boundaryMenu);

    colorMenu = new CheckboxMenu("Boundary color", colors, currentColor, this);
    m.add(colorMenu);

    filterMenu = new CheckboxMenu("Filter mode", filters, currentFilter, this);
    m.add(filterMenu);

    exampleMenuBar.add(m);

    //
    //  Add a menubar menu to change texture attributes parameters
    //    Mode -->
    //    Blend color -->
    //

    m = new Menu("TextureAttributes");

    modeMenu = new CheckboxMenu("Mode", modes, currentMode, this);
    m.add(modeMenu);

    blendColorMenu = new CheckboxMenu("Blend color", colors, currentBlendColor, this);
    m.add(blendColorMenu);

    xformMenu = new CheckboxMenu("Transform", xforms, currentXform, this);
    m.add(xformMenu);

    exampleMenuBar.add(m);

    // Preload the texture images
    //   Use the texture loading utility to read in the texture
    //   files and process them into an ImageComponent2D
    //   for use in the Background node.
    if (debug)
        System.err.println("Loading textures...");

    textureComponents = new Texture2D[images.length];

    String value = null;
    for (int i = 0; i < images.length; i++) {
        value = (String) images[i].value;
        textureComponents[i] = loadTexture(value);
    }

    tex = textureComponents[currentImage];

}

From source file:ExDirectionalLight.java

public void initialize(String[] args) {
    // Initialize the window, menubar, etc.
    super.initialize(args);
    exampleFrame.setTitle("Java 3D Directional Light Example");

    //// w  w w . ja v  a  2s. c  om
    //  Add a menubar menu to change node parameters
    //    Light on/off
    //    Color -->
    //    Direction -->
    //

    Menu m = new Menu("DirectionalLight");

    lightOnOffMenu = new CheckboxMenuItem("Light on/off", lightOnOff);
    lightOnOffMenu.addItemListener(this);
    m.add(lightOnOffMenu);

    colorMenu = new CheckboxMenu("Color", colors, currentColor, this);
    m.add(colorMenu);

    directionMenu = new CheckboxMenu("Direction", directions, currentDirection, this);
    m.add(directionMenu);

    exampleMenuBar.add(m);
}

From source file:ExDepthCue.java

public void initialize(String[] args) {
    // Initialize the window, menubar, etc.
    super.initialize(args);
    exampleFrame.setTitle("Java 3D ExDepthCue Example");

    ////from ww  w .ja  v a2s.  com
    //  Add a menubar menu to change node parameters
    //    Depth cueing
    //    Depth-cue color -->
    //

    Menu m = new Menu("Depth Cueing");

    depthCueOnOffMenu = new CheckboxMenuItem("Depth cueing", depthCueOnOff);
    depthCueOnOffMenu.addItemListener(this);
    m.add(depthCueOnOffMenu);

    colorMenu = new CheckboxMenu("Depth-cue color", colors, currentColor, this);
    m.add(colorMenu);

    exampleMenuBar.add(m);
}