Java Code Examples for com.sun.swingset3.demos.ResourceManager#getString()

The following examples show how to use com.sun.swingset3.demos.ResourceManager#getString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LayoutControlPanel.java    From littleluck with Apache License 2.0 4 votes vote down vote up
LayoutControlPanel(ToggleButtonDemo demo, ResourceManager resourceManager) {
    this.demo = demo;

    // this.componentOrientationChanger = componentOrientationChanger;

    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    setAlignmentX(LEFT_ALIGNMENT);
    setAlignmentY(TOP_ALIGNMENT);

    JLabel l;

    // If SwingSet has a ComponentOrientationChanger, then include control
    // for choosing between absolute and relative positioning.  This will
    // only happen when we're running on JDK 1.2 or above.
    //
    // if(componentOrientationChanger != null ) {
    //     l = new JLabel("Positioning:");
    //     add(l);
    //
    //    ButtonGroup group = new ButtonGroup();
    //    PositioningListener positioningListener = new PositioningListener();
    //    JRadioButton absolutePos = new JRadioButton("Absolute");
    //    absolutePos.setMnemonic('a');
    //    absolutePos.setToolTipText("Text/Content positioning is independant of line direction");
    //    group.add(absolutePos);
    //    absolutePos.addItemListener(positioningListener);
    //    add(absolutePos);
    //
    //    JRadioButton relativePos = new JRadioButton("Relative");
    //    relativePos.setMnemonic('r');
    //    relativePos.setToolTipText("Text/Content positioning depends on line direction.");
    //    group.add(relativePos);
    //    relativePos.addItemListener(positioningListener);
    //    add(relativePos);
    //
    //    add(Box.createRigidArea(demo.VGAP20));
    //
    //    absolutePositions = false;
    //    relativePos.setSelected(true);
    //
    //    componentOrientationChanger.addActionListener( new OrientationChangeListener() );
    //} else {
    absolutePositions = true;
    //}

    DirectionPanel textPosition = new DirectionPanel(true, "E", new TextPositionListener());
    DirectionPanel labelAlignment = new DirectionPanel(true, "C", new LabelAlignmentListener());

    // Make sure the controls' text position and label alignment match
    // the initial value of the associated direction panel.
    for (JComponent control : demo.getCurrentControls()) {
        setPosition(control, RIGHT, CENTER);
        setAlignment(control, CENTER, CENTER);
    }

    l = new JLabel(resourceManager.getString("LayoutControlPanel.textposition_label"));
    add(l);
    add(textPosition);

    add(Box.createRigidArea(VGAP20));

    l = new JLabel(resourceManager.getString("LayoutControlPanel.contentalignment_label"));
    add(l);
    add(labelAlignment);

    add(Box.createGlue());
}
 
Example 2
Source File: LayoutControlPanel.java    From beautyeye with Apache License 2.0 4 votes vote down vote up
LayoutControlPanel(ToggleButtonDemo demo, ResourceManager resourceManager) {
    this.demo = demo;

    // this.componentOrientationChanger = componentOrientationChanger;

    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    setAlignmentX(LEFT_ALIGNMENT);
    setAlignmentY(TOP_ALIGNMENT);

    JLabel l;

    // If SwingSet has a ComponentOrientationChanger, then include control
    // for choosing between absolute and relative positioning.  This will
    // only happen when we're running on JDK 1.2 or above.
    //
    // if(componentOrientationChanger != null ) {
    //     l = new JLabel("Positioning:");
    //     add(l);
    //
    //    ButtonGroup group = new ButtonGroup();
    //    PositioningListener positioningListener = new PositioningListener();
    //    JRadioButton absolutePos = new JRadioButton("Absolute");
    //    absolutePos.setMnemonic('a');
    //    absolutePos.setToolTipText("Text/Content positioning is independant of line direction");
    //    group.add(absolutePos);
    //    absolutePos.addItemListener(positioningListener);
    //    add(absolutePos);
    //
    //    JRadioButton relativePos = new JRadioButton("Relative");
    //    relativePos.setMnemonic('r');
    //    relativePos.setToolTipText("Text/Content positioning depends on line direction.");
    //    group.add(relativePos);
    //    relativePos.addItemListener(positioningListener);
    //    add(relativePos);
    //
    //    add(Box.createRigidArea(demo.VGAP20));
    //
    //    absolutePositions = false;
    //    relativePos.setSelected(true);
    //
    //    componentOrientationChanger.addActionListener( new OrientationChangeListener() );
    //} else {
    absolutePositions = true;
    //}

    DirectionPanel textPosition = new DirectionPanel(true, "E", new TextPositionListener());
    DirectionPanel labelAlignment = new DirectionPanel(true, "C", new LabelAlignmentListener());

    // Make sure the controls' text position and label alignment match
    // the initial value of the associated direction panel.
    for (JComponent control : demo.getCurrentControls()) {
        setPosition(control, RIGHT, CENTER);
        setAlignment(control, CENTER, CENTER);
    }

    l = new JLabel(resourceManager.getString("LayoutControlPanel.textposition_label"));
    add(l);
    add(textPosition);

    add(Box.createRigidArea(VGAP20));

    l = new JLabel(resourceManager.getString("LayoutControlPanel.contentalignment_label"));
    add(l);
    add(labelAlignment);

    add(Box.createGlue());
}
 
Example 3
Source File: LayoutControlPanel.java    From Darcula with Apache License 2.0 4 votes vote down vote up
LayoutControlPanel(ToggleButtonDemo demo, ResourceManager resourceManager) {
    this.demo = demo;

    // this.componentOrientationChanger = componentOrientationChanger;

    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    setAlignmentX(LEFT_ALIGNMENT);
    setAlignmentY(TOP_ALIGNMENT);

    JLabel l;

    // If SwingSet has a ComponentOrientationChanger, then include control
    // for choosing between absolute and relative positioning.  This will
    // only happen when we're running on JDK 1.2 or above.
    //
    // if(componentOrientationChanger != null ) {
    //     l = new JLabel("Positioning:");
    //     add(l);
    //
    //    ButtonGroup group = new ButtonGroup();
    //    PositioningListener positioningListener = new PositioningListener();
    //    JRadioButton absolutePos = new JRadioButton("Absolute");
    //    absolutePos.setMnemonic('a');
    //    absolutePos.setToolTipText("Text/Content positioning is independant of line direction");
    //    group.add(absolutePos);
    //    absolutePos.addItemListener(positioningListener);
    //    add(absolutePos);
    //
    //    JRadioButton relativePos = new JRadioButton("Relative");
    //    relativePos.setMnemonic('r');
    //    relativePos.setToolTipText("Text/Content positioning depends on line direction.");
    //    group.add(relativePos);
    //    relativePos.addItemListener(positioningListener);
    //    add(relativePos);
    //
    //    add(Box.createRigidArea(demo.VGAP20));
    //
    //    absolutePositions = false;
    //    relativePos.setSelected(true);
    //
    //    componentOrientationChanger.addActionListener( new OrientationChangeListener() );
    //} else {
    absolutePositions = true;
    //}

    DirectionPanel textPosition = new DirectionPanel(true, "E", new TextPositionListener());
    DirectionPanel labelAlignment = new DirectionPanel(true, "C", new LabelAlignmentListener());

    // Make sure the controls' text position and label alignment match
    // the initial value of the associated direction panel.
    for (JComponent control : demo.getCurrentControls()) {
        setPosition(control, RIGHT, CENTER);
        setAlignment(control, CENTER, CENTER);
    }

    l = new JLabel(resourceManager.getString("LayoutControlPanel.textposition_label"));
    add(l);
    add(textPosition);

    add(Box.createRigidArea(VGAP20));

    l = new JLabel(resourceManager.getString("LayoutControlPanel.contentalignment_label"));
    add(l);
    add(labelAlignment);

    add(Box.createGlue());
}