类java.awt.SystemColor源码实例Demo

下面列出了怎么用java.awt.SystemColor的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: netbeans   文件: BrowserConsoleLogger.java
private void setIOColors() {
    if (IOColors.isSupported(io) && IOColorPrint.isSupported(io)) {
        Color colorStd = IOColors.getColor(io, IOColors.OutputType.OUTPUT);
        //Color colorErr = IOColors.getColor(io, IOColors.OutputType.ERROR);
        Color background = UIManager.getDefaults().getColor("nb.output.background");    // NOI18N
        if (background == null) {
            background = SystemColor.window;
        }
        colorStdBrighter = shiftTowards(colorStd, background);
        //colorErrBrighter = shiftTowards(colorErr, background);
        Color foreground = UIManager.getDefaults().getColor("nb.output.foreground");    // NOI18N
        if (foreground == null) {
            foreground = SystemColor.textText;
        }
        IOColors.setColor(io, IOColors.OutputType.INPUT, shiftTowards(foreground, Color.GREEN));
    }
}
 
源代码2 项目: netbeans   文件: ColorComboBoxRenderer.java
@Override
public Component getListCellRendererComponent (
    JList<? extends ColorValue>
                list,
    ColorValue  value,
    int         index,
    boolean     isSelected,
    boolean     cellHasFocus
) {
    this.value = value;
    setEnabled (list.isEnabled ());
    setBackground (isSelected ? 
        SystemColor.textHighlight : SystemColor.text
        //Color.RED
    );
    setForeground (isSelected ? 
        SystemColor.textHighlightText : SystemColor.textText
    );
    return this;
}
 
源代码3 项目: pumpernickel   文件: AquaAudioListUI.java
@Override
public Component getListCellRendererComponent(JList list,
		Object soundObject, int row, boolean isSelected,
		boolean hasFocus) {
	label.setText(getSoundName(soundObject));

	if (isSelected) {
		label.setOpaque(true);
		label.setBackground(SystemColor.textHighlight);
		label.setForeground(SystemColor.textHighlightText);
	} else {
		label.setOpaque(list.isOpaque());
		label.setBackground(SystemColor.text);
		label.setForeground(SystemColor.textText);
	}
	return label;
}
 
源代码4 项目: dsworkbench   文件: ColoredProgressBar.java
public ColoredProgressBar(int start, int end) {
    setMinimum(start);
    setMaximum(end);
    setForeground(SystemColor.window);
    setBackground(SystemColor.window);
    setBorder(new EmptyBorder(3, 5, 3, 5));
    Dimension size = new Dimension(300, 20);
    setPreferredSize(size);
    setMaximumSize(size);
    setMinimumSize(size);
    BasicProgressBarUI ui = new BasicProgressBarUI() {

        @Override
        protected Color getSelectionForeground() {
            return Color.BLACK;
        }

        @Override
        protected Color getSelectionBackground() {
            return Color.BLACK;
        }
    };
    setUI(ui);
}
 
源代码5 项目: jclic   文件: Editor.java
public JTree createJTree() {
  setCurrentTree(new JTree(getTreeModel()));
  currentTree.setCellRenderer(new DefaultTreeCellRenderer() {
    @Override
    public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded,
        boolean leaf, int row, boolean hasFocus) {
      super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
      if (value instanceof Editor) {
        Icon icon = ((Editor) value).getIcon(leaf, expanded);
        if (icon != null)
          setIcon(icon);
        if (clip == value && clipCutted) {
          setForeground(SystemColor.textInactiveText);
        }
      }
      return this;
    }
  });
  return currentTree;
}
 
源代码6 项目: dragonwell8_jdk   文件: LWTextComponentPeer.java
LWTextComponentPeer(final T target,
                    final PlatformComponent platformComponent) {
    super(target, platformComponent);
    if (!getTarget().isBackgroundSet()) {
        getTarget().setBackground(SystemColor.text);
    }
}
 
源代码7 项目: dragonwell8_jdk   文件: XComponentPeer.java
/**
 * 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;
}
 
源代码8 项目: TencentKona-8   文件: LWTextComponentPeer.java
LWTextComponentPeer(final T target,
                    final PlatformComponent platformComponent) {
    super(target, platformComponent);
    if (!getTarget().isBackgroundSet()) {
        getTarget().setBackground(SystemColor.text);
    }
}
 
源代码9 项目: TencentKona-8   文件: XComponentPeer.java
/**
 * 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;
}
 
源代码10 项目: jdk8u60   文件: LWTextComponentPeer.java
LWTextComponentPeer(final T target,
                    final PlatformComponent platformComponent) {
    super(target, platformComponent);
    if (!getTarget().isBackgroundSet()) {
        getTarget().setBackground(SystemColor.text);
    }
}
 
源代码11 项目: jdk8u60   文件: XComponentPeer.java
/**
 * 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;
}
 
源代码12 项目: openjdk-jdk8u   文件: LWTextComponentPeer.java
LWTextComponentPeer(final T target,
                    final PlatformComponent platformComponent) {
    super(target, platformComponent);
    if (!getTarget().isBackgroundSet()) {
        getTarget().setBackground(SystemColor.text);
    }
}
 
源代码13 项目: openjdk-jdk8u   文件: XComponentPeer.java
/**
 * 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;
}
 
源代码14 项目: netbeans   文件: SplashUISupport.java
public void setItem(Object anObject) {
    value = anObject;
    if (value instanceof String) {
        setText(NbBundle.getMessage(SplashUISupport.class, "SplashUISupport_color_default"));
        super.setForeground(SystemColor.textText);
        super.setBackground(SystemColor.text);
    } else {
        setText("");
        super.setBackground((Color) value);
    }
}
 
源代码15 项目: netbeans   文件: ToggleProfilingPointAction.java
public void setProfilingPointFactory(ProfilingPointFactory ppFactory, int index) {
    this.ppFactory = ppFactory;

    if (ppFactory != null) {
        label.setText(ppFactory.getType());
        label.setIcon(ppFactory.getIcon());
    } else {
        label.setText(NO_ACTION_NAME);
        label.setIcon(NO_ACTION_ICON);
    }

    Component selected = null;

    if ((index >= 0) && (index < previewPanel.getComponentCount())) {
        selected = previewPanel.getComponent(index);
    }

    for (Component c : previewPanel.getComponents()) {
        if (c == selected) {
            Border empt1 = BorderFactory.createEmptyBorder(2, 2, 2, 2);
            Border sel = BorderFactory.createMatteBorder(1, 1, 1, 1, SystemColor.textHighlight);
            Border empt2 = BorderFactory.createEmptyBorder(0, 2, 0, 2);
            Border comp1 = BorderFactory.createCompoundBorder(empt2, sel);
            Border comp2 = BorderFactory.createCompoundBorder(comp1, empt1);
            ((JComponent) c).setBorder(comp2);
        } else {
            ((JComponent) c).setBorder(BorderFactory.createEmptyBorder(3, 5, 3, 5));
        }
    }
}
 
源代码16 项目: netbeans   文件: TooltipLabel.java
@Override
public JToolTip createToolTip() {
    JToolTip tooltp = new JToolTip();
    tooltp.setBackground(SystemColor.control);
    tooltp.setFont(getFont());
    tooltp.setOpaque(true);
    tooltp.setComponent(this);
    tooltp.setBorder(null);
    return tooltp;
}
 
源代码17 项目: netbeans   文件: ColorComboBoxRenderer.java
@Override
public Component getEditorComponent () {
    setEnabled (comboBox.isEnabled ());
    setBackground (comboBox.isFocusOwner () ? 
        SystemColor.textHighlight : SystemColor.text
    );
    setForeground (comboBox.isFocusOwner () ? 
        SystemColor.textHighlightText : SystemColor.textText
    );
    return this;
}
 
源代码18 项目: openjdk-jdk8u-backup   文件: LWTextComponentPeer.java
LWTextComponentPeer(final T target,
                    final PlatformComponent platformComponent) {
    super(target, platformComponent);
    if (!getTarget().isBackgroundSet()) {
        getTarget().setBackground(SystemColor.text);
    }
}
 
源代码19 项目: openjdk-jdk8u-backup   文件: XComponentPeer.java
/**
 * 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;
}
 
源代码20 项目: openjdk-jdk9   文件: XComponentPeer.java
/**
 * 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;
}
 
源代码21 项目: openjdk-jdk9   文件: LWTextComponentPeer.java
LWTextComponentPeer(final T target,
                    final PlatformComponent platformComponent) {
    super(target, platformComponent);
    if (!getTarget().isBackgroundSet()) {
        getTarget().setBackground(SystemColor.text);
    }
}
 
源代码22 项目: evosql   文件: ConnectionDialog.java
protected static Panel createBorderPanel(Component center) {

        Panel p = new Panel();

        p.setBackground(SystemColor.control);
        p.setLayout(new BorderLayout());
        p.add("Center", center);
        p.add("North", createLabel(""));
        p.add("South", createLabel(""));
        p.add("East", createLabel(""));
        p.add("West", createLabel(""));
        p.setBackground(SystemColor.control);

        return p;
    }
 
源代码23 项目: evosql   文件: Transfer.java
/**
 * Method declaration
 *
 *
 * @param center
 */
private Panel createBorderPanel(Component center) {

    Panel p = new Panel();

    p.setBackground(SystemColor.control);
    p.setLayout(new BorderLayout());
    p.add("Center", center);
    p.add("South", createLabel(""));
    p.add("East", createLabel(""));
    p.add("West", createLabel(""));
    p.setBackground(SystemColor.control);

    return p;
}
 
源代码24 项目: jdk8u-jdk   文件: LWTextComponentPeer.java
LWTextComponentPeer(final T target,
                    final PlatformComponent platformComponent) {
    super(target, platformComponent);
    if (!getTarget().isBackgroundSet()) {
        getTarget().setBackground(SystemColor.text);
    }
}
 
源代码25 项目: jdk8u-jdk   文件: XComponentPeer.java
/**
 * 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;
}
 
源代码26 项目: hottub   文件: LWTextComponentPeer.java
LWTextComponentPeer(final T target,
                    final PlatformComponent platformComponent) {
    super(target, platformComponent);
    if (!getTarget().isBackgroundSet()) {
        getTarget().setBackground(SystemColor.text);
    }
}
 
源代码27 项目: hottub   文件: XComponentPeer.java
/**
 * 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;
}
 
源代码28 项目: openjdk-8-source   文件: LWTextComponentPeer.java
LWTextComponentPeer(final T target,
                    final PlatformComponent platformComponent) {
    super(target, platformComponent);
    if (!getTarget().isBackgroundSet()) {
        getTarget().setBackground(SystemColor.text);
    }
}
 
源代码29 项目: openjdk-8-source   文件: XComponentPeer.java
/**
 * 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;
}
 
源代码30 项目: clipper-java   文件: StatusBar.java
public StatusBar() {
    setLayout( new BorderLayout() );
    setPreferredSize( new Dimension( 10, 23 ) );

    final JPanel rightPanel = new JPanel( new BorderLayout() );
    rightPanel.add( new JLabel( new AngledLinesWindowsCornerIcon() ), BorderLayout.SOUTH );
    rightPanel.setOpaque( false );

    text = new JLabel();
    add( text, BorderLayout.WEST );
    add( rightPanel, BorderLayout.EAST );
    setBackground( SystemColor.control );
}
 
 类所在包
 同包方法