Java Code Examples for javax.swing.plaf.synth.SynthConstants#ENABLED

The following examples show how to use javax.swing.plaf.synth.SynthConstants#ENABLED . 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: State.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static String toString(int state) {
    StringBuffer buffer = new StringBuffer();
    if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
        buffer.append("Default");
    }
    if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Disabled");
    }
    if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Enabled");
    }
    if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Focused");
    }
    if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("MouseOver");
    }
    if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Pressed");
    }
    if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Selected");
    }
    return buffer.toString();
}
 
Example 2
Source File: State.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
private static String toString(int state) {
    StringBuffer buffer = new StringBuffer();
    if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
        buffer.append("Default");
    }
    if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Disabled");
    }
    if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Enabled");
    }
    if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Focused");
    }
    if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("MouseOver");
    }
    if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Pressed");
    }
    if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Selected");
    }
    return buffer.toString();
}
 
Example 3
Source File: State.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static String toString(int state) {
    StringBuffer buffer = new StringBuffer();
    if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
        buffer.append("Default");
    }
    if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Disabled");
    }
    if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Enabled");
    }
    if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Focused");
    }
    if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("MouseOver");
    }
    if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Pressed");
    }
    if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Selected");
    }
    return buffer.toString();
}
 
Example 4
Source File: State.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private static String toString(int state) {
    StringBuffer buffer = new StringBuffer();
    if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
        buffer.append("Default");
    }
    if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Disabled");
    }
    if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Enabled");
    }
    if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Focused");
    }
    if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("MouseOver");
    }
    if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Pressed");
    }
    if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Selected");
    }
    return buffer.toString();
}
 
Example 5
Source File: SeaGlassLookAndFeel.java    From seaglass with Apache License 2.0 5 votes vote down vote up
/**
 * Used by the renderers. For the most part the renderers are implemented as
 * Labels, which is problematic in so far as they are never selected. To
 * accomodate this SeaGlassLabelUI checks if the current UI matches that of
 * <code>selectedUI</code> (which this methods sets), if it does, then a
 * state as set by this method is set in the field {@code selectedUIState}.
 * This provides a way for labels to have a state other than selected.
 *
 * @param uix      a UI delegate.
 * @param selected is the component selected?
 * @param focused  is the component focused?
 * @param enabled  is the component enabled?
 * @param rollover is the component's rollover state enabled?
 */
public static void setSelectedUI(ComponentUI uix, boolean selected, boolean focused, boolean enabled, boolean rollover) {
    selectedUI      = uix;
    selectedUIState = 0;

    if (selected) {
        selectedUIState = SynthConstants.SELECTED;

        if (focused) {
            selectedUIState |= SynthConstants.FOCUSED;
        }
    } else if (rollover && enabled) {
        selectedUIState |= SynthConstants.MOUSE_OVER | SynthConstants.ENABLED;

        if (focused) {
            selectedUIState |= SynthConstants.FOCUSED;
        }
    } else {

        if (enabled) {
            selectedUIState |= SynthConstants.ENABLED;
            selectedUIState = SynthConstants.FOCUSED;
        } else {
            selectedUIState |= SynthConstants.DISABLED;
        }
    }
}
 
Example 6
Source File: State.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static String toString(int state) {
    StringBuffer buffer = new StringBuffer();
    if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
        buffer.append("Default");
    }
    if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Disabled");
    }
    if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Enabled");
    }
    if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Focused");
    }
    if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("MouseOver");
    }
    if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Pressed");
    }
    if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Selected");
    }
    return buffer.toString();
}
 
Example 7
Source File: State.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private static String toString(int state) {
    StringBuilder sb = new StringBuilder();
    if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
        sb.append("Default");
    }
    if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
        if (sb.length() > 0) sb.append("+");
        sb.append("Disabled");
    }
    if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
        if (sb.length() > 0) sb.append("+");
        sb.append("Enabled");
    }
    if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
        if (sb.length() > 0) sb.append("+");
        sb.append("Focused");
    }
    if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
        if (sb.length() > 0) sb.append("+");
        sb.append("MouseOver");
    }
    if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
        if (sb.length() > 0) sb.append("+");
        sb.append("Pressed");
    }
    if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
        if (sb.length() > 0) sb.append("+");
        sb.append("Selected");
    }
    return sb.toString();
}
 
Example 8
Source File: State.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static String toString(int state) {
    StringBuilder sb = new StringBuilder();
    if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
        sb.append("Default");
    }
    if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
        if (sb.length() > 0) sb.append("+");
        sb.append("Disabled");
    }
    if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
        if (sb.length() > 0) sb.append("+");
        sb.append("Enabled");
    }
    if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
        if (sb.length() > 0) sb.append("+");
        sb.append("Focused");
    }
    if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
        if (sb.length() > 0) sb.append("+");
        sb.append("MouseOver");
    }
    if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
        if (sb.length() > 0) sb.append("+");
        sb.append("Pressed");
    }
    if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
        if (sb.length() > 0) sb.append("+");
        sb.append("Selected");
    }
    return sb.toString();
}
 
Example 9
Source File: State.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static String toString(int state) {
    StringBuffer buffer = new StringBuffer();
    if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
        buffer.append("Default");
    }
    if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Disabled");
    }
    if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Enabled");
    }
    if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Focused");
    }
    if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("MouseOver");
    }
    if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Pressed");
    }
    if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Selected");
    }
    return buffer.toString();
}
 
Example 10
Source File: SeaGlassLabelUI.java    From seaglass with Apache License 2.0 5 votes vote down vote up
private int getComponentState(JComponent c) {
    int state = SeaGlassLookAndFeel.getComponentState(c);
    if (SeaGlassLookAndFeel.selectedUI == this && state == SynthConstants.ENABLED) {
        state = SeaGlassLookAndFeel.selectedUIState | SynthConstants.ENABLED;
    }
    return state;
}
 
Example 11
Source File: State.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static String toString(int state) {
    StringBuffer buffer = new StringBuffer();
    if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
        buffer.append("Default");
    }
    if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Disabled");
    }
    if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Enabled");
    }
    if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Focused");
    }
    if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("MouseOver");
    }
    if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Pressed");
    }
    if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Selected");
    }
    return buffer.toString();
}
 
Example 12
Source File: State.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static String toString(int state) {
    StringBuffer buffer = new StringBuffer();
    if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
        buffer.append("Default");
    }
    if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Disabled");
    }
    if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Enabled");
    }
    if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Focused");
    }
    if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("MouseOver");
    }
    if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Pressed");
    }
    if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Selected");
    }
    return buffer.toString();
}
 
Example 13
Source File: State.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static String toString(int state) {
    StringBuffer buffer = new StringBuffer();
    if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
        buffer.append("Default");
    }
    if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Disabled");
    }
    if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Enabled");
    }
    if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Focused");
    }
    if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("MouseOver");
    }
    if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Pressed");
    }
    if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Selected");
    }
    return buffer.toString();
}
 
Example 14
Source File: State.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static String toString(int state) {
    StringBuffer buffer = new StringBuffer();
    if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
        buffer.append("Default");
    }
    if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Disabled");
    }
    if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Enabled");
    }
    if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Focused");
    }
    if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("MouseOver");
    }
    if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Pressed");
    }
    if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
        if (buffer.length() > 0) buffer.append("+");
        buffer.append("Selected");
    }
    return buffer.toString();
}
 
Example 15
Source File: MainPanel.java    From java-swing-tips with MIT License 4 votes vote down vote up
private Insets getSynthInsets(Region region) {
  SynthStyle style = SynthLookAndFeel.getStyle(this, region);
  SynthContext context = new SynthContext(this, region, style, SynthConstants.ENABLED);
  return style.getInsets(context, null);
}
 
Example 16
Source File: MainPanel.java    From java-swing-tips with MIT License 4 votes vote down vote up
private Insets getSynthInsets(Region region) {
  SynthStyle style = SynthLookAndFeel.getStyle(this, region);
  SynthContext context = new SynthContext(this, region, style, SynthConstants.ENABLED);
  return style.getInsets(context, null);
}
 
Example 17
Source File: MainPanel.java    From java-swing-tips with MIT License 4 votes vote down vote up
private Insets getSynthInsets(Region region) {
  SynthStyle style = SynthLookAndFeel.getStyle(this, region);
  SynthContext context = new SynthContext(this, region, style, SynthConstants.ENABLED);
  return style.getInsets(context, null);
}
 
Example 18
Source File: MainPanel.java    From java-swing-tips with MIT License 4 votes vote down vote up
private Insets getSynthInsets(Region region) {
  SynthStyle style = SynthLookAndFeel.getStyle(this, region);
  SynthContext context = new SynthContext(this, region, style, SynthConstants.ENABLED);
  return style.getInsets(context, null);
}
 
Example 19
Source File: MainPanel.java    From java-swing-tips with MIT License 4 votes vote down vote up
private Insets getSynthInsets(Region region) {
  SynthStyle style = SynthLookAndFeel.getStyle(this, region);
  SynthContext context = new SynthContext(this, region, style, SynthConstants.ENABLED);
  return style.getInsets(context, null);
}
 
Example 20
Source File: MainPanel.java    From java-swing-tips with MIT License 4 votes vote down vote up
private Insets getSynthInsets(Region region) {
  SynthStyle style = SynthLookAndFeel.getStyle(this, region);
  SynthContext context = new SynthContext(this, region, style, SynthConstants.ENABLED);
  return style.getInsets(context, null);
}