Example usage for javax.media.j3d TransparencyAttributes SCREEN_DOOR

List of usage examples for javax.media.j3d TransparencyAttributes SCREEN_DOOR

Introduction

In this page you can find the example usage for javax.media.j3d TransparencyAttributes SCREEN_DOOR.

Prototype

int SCREEN_DOOR

To view the source code for javax.media.j3d TransparencyAttributes SCREEN_DOOR.

Click Source Link

Document

Use screen-door transparency.

Usage

From source file:AppearanceTest.java

public void onSCREEN_DOOR() {
    getTransparencyAttributes().setTransparencyMode(TransparencyAttributes.SCREEN_DOOR);
}

From source file:AppearanceExplorer.java

TransparencyAttributesEditor(TransparencyAttributes init) {
    transpAttr = init;/*  w  ww  .  j  a  v  a  2 s  . c o m*/
    transparency = transpAttr.getTransparency();
    mode = transpAttr.getTransparencyMode();
    srcBlendFunction = transpAttr.getSrcBlendFunction();
    dstBlendFunction = transpAttr.getDstBlendFunction();

    setLayout(new GridLayout(4, 1));

    FloatLabelJSlider transparencySlider = new FloatLabelJSlider("Transparency", 0.1f, 0.0f, 1.0f,
            transparency);
    transparencySlider.setMajorTickSpacing(0.1f);
    transparencySlider.setPaintTicks(true);
    transparencySlider.addFloatListener(new FloatListener() {
        public void floatChanged(FloatEvent e) {
            transparency = e.getValue();
            transpAttr.setTransparency(transparency);
        }
    });
    add(transparencySlider);

    String[] modeNames = { "NONE", "SCREEN_DOOR", "BLENDED", "NICEST", "FASTEST" };
    int[] modeValues = { TransparencyAttributes.NONE, TransparencyAttributes.SCREEN_DOOR,
            TransparencyAttributes.BLENDED, TransparencyAttributes.NICEST, TransparencyAttributes.FASTEST };

    IntChooser modeChooser = new IntChooser("Mode:", modeNames, modeValues, mode);
    modeChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            mode = event.getValue();
            transpAttr.setTransparencyMode(mode);
        }
    });
    add(modeChooser);

    String[] blendNames = { "BLEND_ZERO", "BLEND_ONE", "BLEND_SRC_ALPHA", "BLEND_ONE_MINUS_SRC_ALPHA" };
    int[] blendValues = { TransparencyAttributes.BLEND_ZERO, TransparencyAttributes.BLEND_ONE,
            TransparencyAttributes.BLEND_SRC_ALPHA, TransparencyAttributes.BLEND_ONE_MINUS_SRC_ALPHA, };
    IntChooser srcBlendFunctionChooser = new IntChooser("Src Blend Func:", blendNames, blendValues,
            srcBlendFunction);
    srcBlendFunctionChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            srcBlendFunction = event.getValue();
            transpAttr.setSrcBlendFunction(srcBlendFunction);
        }
    });
    add(srcBlendFunctionChooser);
    IntChooser dstBlendFunctionChooser = new IntChooser("Dst Blend Func:", blendNames, blendValues,
            dstBlendFunction);
    dstBlendFunctionChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            dstBlendFunction = event.getValue();
            transpAttr.setDstBlendFunction(dstBlendFunction);
        }
    });
    add(dstBlendFunctionChooser);
}