javax.swing.text.JTextComponent.getDisabledTextColor()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中javax.swing.text.JTextComponent.getDisabledTextColor()方法的一些代码示例,展示了JTextComponent.getDisabledTextColor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextComponent.getDisabledTextColor()方法的具体详情如下:
包路径:javax.swing.text.JTextComponent
类名称:JTextComponent
方法名:getDisabledTextColor

JTextComponent.getDisabledTextColor介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

RenderingHints.KEY_ANTIALIASING,
  RenderingHints.VALUE_ANTIALIAS_ON);
g.setColor(getDisabledTextColor());
g.drawString(placeholder, getInsets().left, pG.getFontMetrics()
  .getMaxAscent() + getInsets().top);

代码示例来源:origin: bobbylight/RSyntaxTextArea

c = editor.getDisabledTextColor();
if (c==null) {
  c = UIManager.getColor("nimbusDisabledText");

代码示例来源:origin: org.netbeans.api/org-netbeans-spi-quicksearch

public void setNoResults (boolean areNoResults) {
  // no op when called too soon
  if (command == null || origForeground == null) {
    return;
  }
  // don't alter color if showing hint already
  if (command.getForeground().equals(command.getDisabledTextColor())) {
    return;
  }
  command.setForeground(areNoResults ? Color.RED : origForeground);
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

/**
 * Get the foreground color of the prompt text. If no color has been set,
 * the <code>textComponent</code>s disabled text color will be returned.
 * 
 * @param textComponent
 * @return the color of the prompt text or
 *         {@link JTextComponent#getDisabledTextColor()} if none is set
 */
public static Color getForeground(JTextComponent textComponent) {
  if (textComponent.getClientProperty(FOREGROUND) == null) {
    return textComponent.getDisabledTextColor();
  }
  return (Color) textComponent.getClientProperty(FOREGROUND);
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

/**
 * Get the foreground color of the prompt text. If no color has been set,
 * the <code>textComponent</code>s disabled text color will be returned.
 * 
 * @param textComponent
 * @return the color of the prompt text or
 *         {@link JTextComponent#getDisabledTextColor()} if none is set
 */
public static Color getForeground(JTextComponent textComponent) {
  if (textComponent.getClientProperty(FOREGROUND) == null) {
    return textComponent.getDisabledTextColor();
  }
  return (Color) textComponent.getClientProperty(FOREGROUND);
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

/**
 * Get the foreground color of the prompt text. If no color has been set,
 * the <code>textComponent</code>s disabled text color will be returned.
 * 
 * @param textComponent
 * @return the color of the prompt text or
 *         {@link JTextComponent#getDisabledTextColor()} if none is set
 */
public static Color getForeground(JTextComponent textComponent) {
  if (textComponent.getClientProperty(FOREGROUND) == null) {
    return textComponent.getDisabledTextColor();
  }
  return (Color) textComponent.getClientProperty(FOREGROUND);
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

/**
 * Get the foreground color of the prompt text. If no color has been set,
 * the <code>textComponent</code>s disabled text color will be returned.
 * 
 * @param textComponent
 * @return the color of the prompt text or
 *         {@link JTextComponent#getDisabledTextColor()} if none is set
 */
public static Color getForeground(JTextComponent textComponent) {
  if (textComponent.getClientProperty(FOREGROUND) == null) {
    return textComponent.getDisabledTextColor();
  }
  return (Color) textComponent.getClientProperty(FOREGROUND);
}

代码示例来源:origin: stackoverflow.com

RenderingHints.KEY_ANTIALIASING,
  RenderingHints.VALUE_ANTIALIAS_ON);
g.setColor(getDisabledTextColor());
g.drawString(placeholder, getInsets().left, pG.getFontMetrics()
  .getMaxAscent() + getInsets().top);

代码示例来源:origin: stackoverflow.com

RenderingHints.KEY_ANTIALIASING,
  RenderingHints.VALUE_ANTIALIAS_ON);
g.setColor(getDisabledTextColor());
g.drawString(placeholder, getInsets().left, pG.getFontMetrics()
  .getMaxAscent() + getInsets().top);

代码示例来源:origin: org.netbeans.api/org-netbeans-spi-quicksearch

private void setShowHint (boolean showHint) {
  // remember orig color on first invocation
  if (origForeground == null) {
    origForeground = command.getForeground();
  }
  if (showHint) {
    command.setForeground(command.getDisabledTextColor());
    Category evalCat = CommandEvaluator.getEvalCat();
    if (evalCat != null && !CommandEvaluator.isCatTemporary()) {
      command.setText(getHintText(evalCat));
    } else {
      command.setText(getHintText(null));
    }
  } else {
    command.setForeground(origForeground);
    command.setText("");
  }
}

代码示例来源:origin: stackoverflow.com

disabledTextColor = getDisabledTextColor();

代码示例来源:origin: com.fifesoft/rsyntaxtextarea

c = editor.getDisabledTextColor();
if (c==null) {
  c = UIManager.getColor("nimbusDisabledText");

代码示例来源:origin: org.nuiton.thirdparty/rsyntaxtextarea

c = editor.getDisabledTextColor();
if (c==null) {
  c = UIManager.getColor("nimbusDisabledText");

代码示例来源:origin: org.codehaus.jtstand/jtstand-editor

c = editor.getDisabledTextColor();
if (c==null) {
  c = UIManager.getColor("nimbusDisabledText");

代码示例来源:origin: nz.ac.waikato.cms.weka.thirdparty/bounce

/**
 * Invalidates the scanner, to make sure a new range is set later.
 * 
 * @param g
 *            the graphics context.
 * @param a
 *            the shape.
 * @see View#paint(Graphics g, Shape a)
 */
public void paint(Graphics g, Shape a) {
  JTextComponent component = (JTextComponent) getContainer();
  Highlighter highlighter = component.getHighlighter();
  Color unselected = component.isEnabled() ? component.getForeground() : component.getDisabledTextColor();
  Caret caret = component.getCaret();
  selected = !caret.isSelectionVisible() || highlighter == null ? unselected : component.getSelectedTextColor();
  super.paint(g, a);
  scanner.setValid(false);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf-testrunner-ui

@Override
public void paint(Graphics g, Shape a) {
  ((Graphics2D) g).addRenderingHints(getHints());
  Container container = getContainer();
  if (container instanceof JTextComponent) {
    final JTextComponent textComp = (JTextComponent) container;
    selStart = textComp.getSelectionStart();
    selEnd = textComp.getSelectionEnd();
    unselectedFg = textComp.isEnabled()
        ? textComp.getForeground()
        : textComp.getDisabledTextColor();
    selectedFg = textComp.getCaret().isSelectionVisible()
        ? textComp.getSelectedTextColor()
        : unselectedFg;
  }
  super.paint(g, a);
}

代码示例来源:origin: nz.ac.waikato.cms.weka.thirdparty/bounce

sel0 = host.getSelectionStart();
sel1 = host.getSelectionEnd();
unselected = (host.isEnabled()) ? host.getForeground() : host.getDisabledTextColor();
Caret c = host.getCaret();
selected = c.isSelectionVisible() ? host.getSelectedTextColor() : unselected;

代码示例来源:origin: khuxtable/seaglass

Color dfg = c.getDisabledTextColor();

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

Color dfg = editor.getDisabledTextColor();
if ((dfg == null) || (dfg instanceof UIResource)) {
  editor.setDisabledTextColor(plaf.getColor(prefix + ".inactiveForeground"));

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

Color dfg = editor.getDisabledTextColor();
if ((dfg == null) || (dfg instanceof UIResource)) {
  editor.setDisabledTextColor(plaf.getColor(prefix + ".inactiveForeground"));

相关文章

JTextComponent类方法