Java Code Examples for java.awt.SystemColor#controlShadow()

The following examples show how to use java.awt.SystemColor#controlShadow() . 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: XComponentPeer.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 2
Source File: XComponentPeer.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 3
Source File: XComponentPeer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 4
Source File: XComponentPeer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 5
Source File: XComponentPeer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 6
Source File: XComponentPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 7
Source File: XComponentPeer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 8
Source File: XComponentPeer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 9
Source File: XComponentPeer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 10
Source File: XComponentPeer.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 11
Source File: XComponentPeer.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 12
Source File: XComponentPeer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 13
Source File: XComponentPeer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an array of Colors similar to getGUIcolors(), but using the
 * System colors.  This is useful if pieces of a Component (such as
 * the integrated scrollbars of a List) should retain the System color
 * instead of the background color set by Component.setBackground().
 */
static Color[] getSystemColors() {
    if (systemColors == null) {
        systemColors = new Color[4];
        systemColors[BACKGROUND_COLOR] = SystemColor.window;
        systemColors[HIGHLIGHT_COLOR] = SystemColor.controlLtHighlight;
        systemColors[SHADOW_COLOR] = SystemColor.controlShadow;
        systemColors[FOREGROUND_COLOR] = SystemColor.windowText;
    }
    return systemColors;
}
 
Example 14
Source File: FolderPreviewPanel.java    From jpexs-decompiler with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void paint(Graphics g) {
    super.paint(g);
    repaintQueued = false;
    Rectangle r = getVisibleRect();
    int width = getWidth();

    int cols = width / CELL_WIDTH;
    int rows = (int) Math.ceil(items.size() / (float) cols);
    int height = rows * CELL_HEIGHT;

    int start_y = r.y / CELL_HEIGHT;
    JLabel l = new JLabel();
    Font f = l.getFont().deriveFont(AffineTransform.getScaleInstance(0.8, 0.8));
    int finish_y = (int) Math.ceil((r.y + r.height) / (float) CELL_HEIGHT);
    Color color;
    Color selectedColor;
    Color selectedTextColor;
    Color borderColor;
    Color textColor;
    if (Configuration.useRibbonInterface.get()) {
        SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
        color = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor();
        selectedColor = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getBackgroundFillColor();
        borderColor = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.BORDER, ComponentState.ROLLOVER_SELECTED).getUltraDarkColor();
        textColor = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getForegroundColor();
        selectedTextColor = skin.getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ROLLOVER_SELECTED).getForegroundColor();
    } else {
        color = SystemColor.control;
        selectedColor = SystemColor.textHighlight;
        borderColor = SystemColor.controlShadow;
        textColor = SystemColor.controlText;
        selectedTextColor = SystemColor.textHighlightText;
    }

    //g.setColor(SubstanceLookAndFeel.getCurrentSkin().getColorScheme(DecorationAreaType.GENERAL, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED));
    for (int y = start_y; y <= finish_y; y++) {
        for (int x = 0; x < cols; x++) {
            int index = y * cols + x;
            if (index < items.size()) {

                g.setColor(color);
                if (selectedItems.containsKey(index)) {
                    g.setColor(selectedColor);
                }
                g.fillRect(x * CELL_WIDTH, y * CELL_HEIGHT, CELL_WIDTH, CELL_HEIGHT);
                if (cachedPreviews.contains(index)) {
                    SerializableImage sImg = cachedPreviews.get(index);
                    if (sImg != null) {
                        BufferedImage img = cachedPreviews.get(index).getBufferedImage();
                        g.drawImage(img, x * CELL_WIDTH + BORDER_SIZE + PREVIEW_SIZE / 2 - img.getWidth() / 2, y * CELL_HEIGHT + BORDER_SIZE + PREVIEW_SIZE / 2 - img.getHeight() / 2, null);
                    }
                } else {
                    cachedPreviews.put(index, noImage);
                    renderImageTask(index, items.get(index));
                }
                String s;
                TreeItem treeItem = items.get(index);
                if (treeItem instanceof Tag) {
                    s = ((Tag) treeItem).getTagName();
                    if (treeItem instanceof CharacterTag) {
                        s = s + " (" + ((CharacterTag) treeItem).getCharacterId() + ")";
                    }
                } else {
                    s = treeItem.toString();
                }
                g.setFont(f);
                g.setColor(borderColor);
                g.drawLine(x * CELL_WIDTH, y * CELL_HEIGHT + BORDER_SIZE + PREVIEW_SIZE, x * CELL_WIDTH + CELL_WIDTH, y * CELL_HEIGHT + BORDER_SIZE + PREVIEW_SIZE);
                g.drawRect(x * CELL_WIDTH, y * CELL_HEIGHT, CELL_WIDTH, CELL_HEIGHT);
                g.setColor(textColor);
                if (selectedItems.containsKey(index)) {
                    g.setColor(selectedTextColor);
                }
                g.drawString(s, x * CELL_WIDTH + BORDER_SIZE, y * CELL_HEIGHT + BORDER_SIZE + PREVIEW_SIZE + LABEL_HEIGHT);

            }
        }
    }

    if (lastWidth != width || lastHeight != height) {
        lastWidth = width;
        lastHeight = height;
        setSize(new Dimension(width, height));
    }
}