javax.swing.JLabel.getDisabledIcon()方法的使用及代码示例

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

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

JLabel.getDisabledIcon介绍

暂无

代码示例

代码示例来源:origin: net.sf.tinylaf/tinylaf

public Icon getDisabledIcon() {
    if(showIcons) {
      return super.getDisabledIcon();
    }
    
    return null;
  }
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public Icon getDisabledIcon()
{
 if((delegate_==this)||(delegate_==null))
  return super.getDisabledIcon();
 return delegate_.getDisabledIcon();
}

代码示例来源:origin: xyz.cofe/gui.swing

public javax.swing.Icon getTabDisabledIcon() {
  if (isClosed())return null;
  return titleLabel.getDisabledIcon();
}// </editor-fold>

代码示例来源:origin: org.gosu-lang.gosu/gosu-editor

public Dimension getPreferredSizeWithVariableHeightOnly( JComponent c )
{
 JLabel label = (JLabel)c;
 String strText = label.getText();
 Icon icon = label.isEnabled() ? label.getIcon() : label.getDisabledIcon();
 _insetsPaintView = c.getInsets( _insetsPaintView );
 _rcPaintView.x = _insetsPaintView.left;
 _rcPaintView.y = _insetsPaintView.top;
 _rcPaintView.width = c.getWidth() - (_insetsPaintView.left + _insetsPaintView.right);
 _rcPaintView.height = 0; // Set to zero so we can determine total lines of text
 _rcPaintIcon.x = _rcPaintIcon.y = _rcPaintIcon.width = _rcPaintIcon.height = 0;
 _rcPaintText.x = _rcPaintText.y = _rcPaintText.width = _rcPaintText.height = 0;
 FontMetrics fm = c.getFontMetrics( c.getFont() );
 Vector vtext = layoutCL( null, label, fm, strText, icon, _rcPaintView, _rcPaintIcon, _rcPaintText );
 int iWidth = c.getWidth() - (_insetsPaintView.left + _insetsPaintView.right);
 int iHeight = (fm.getHeight() * (vtext == null ? 0 : vtext.size())) - (_insetsPaintView.top + _insetsPaintView.bottom);
 return new Dimension( iWidth, iHeight );
}

代码示例来源:origin: igvteam/igv

Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

JLabel label = (JLabel)c;
String text = label.getText();
Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();

代码示例来源:origin: jrtom/jung

Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();

代码示例来源:origin: jrtom/jung

Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();

代码示例来源:origin: jrtom/jung

Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();

代码示例来源:origin: net.sf.jung/jung-samples

Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();

代码示例来源:origin: com.jidesoft/jide-oss

JLabel oLabel = (JLabel) i_oComponent;
String oText = oLabel.getText();
Icon oIcon = (oLabel.isEnabled()) ? oLabel.getIcon() : oLabel.getDisabledIcon();

代码示例来源:origin: net.sf.kerner-utils/kerner-utils

/** {@inheritDoc} */
@Override
public void paint(final Graphics g, final JComponent c) {
  // parent's update method fills the background
  prepareGraphics(g);
  final JLabel label = (JLabel) c;
  final String text = label.getText();
  final Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();
  if ((icon == null) && (text == null)) {
    return;
  }
  final FontMetrics fm = g.getFontMetrics();
  updateLayout(label, fm, c.getWidth(), c.getHeight());
  if (icon != null) {
    icon.paintIcon(c, g, paintIconR.x, paintIconR.y);
  }
  if (text != null) {
    final View v = (View) c.getClientProperty("html");
    if (v != null) {
      // HTML view disables multi-line painting.
      v.paint(g, paintTextR);
    } else {
      // Paint the multi line text
      paintTextLines(g, label, fm);
    }
  }
}

代码示例来源:origin: org.gosu-lang.gosu/gosu-editor

Icon icon = label.isEnabled() ? label.getIcon() : label.getDisabledIcon();

代码示例来源:origin: net.java.dev.swing-layout/swing-layout

private int getLabelBaseline(JLabel label, int height) {
  Icon icon = (label.isEnabled()) ? label.getIcon() :
            label.getDisabledIcon();
  FontMetrics fm = label.getFontMetrics(label.getFont());
  resetRects(label, height);
  SwingUtilities.layoutCompoundLabel(label, fm,
    "a", icon, label.getVerticalAlignment(),
    label.getHorizontalAlignment(), label.getVerticalTextPosition(),
    label.getHorizontalTextPosition(), viewRect, iconRect, textRect,
    label.getIconTextGap());
  return textRect.y + fm.getAscent();
}

代码示例来源:origin: net.java.dev.swing-layout/swing-layout

private static int getLabelBaseline(JLabel label, int height) {
  Icon icon = (label.isEnabled()) ? label.getIcon() :
            label.getDisabledIcon();
  FontMetrics fm = label.getFontMetrics(label.getFont());
  resetRects(label, height);
  SwingUtilities.layoutCompoundLabel(label, fm,
    "a", icon, label.getVerticalAlignment(),
    label.getHorizontalAlignment(), label.getVerticalTextPosition(),
    label.getHorizontalTextPosition(), viewRect, iconRect, textRect,
    label.getIconTextGap());
  return textRect.y + fm.getAscent();
}

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

icon = label.getDisabledIcon();

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

protected void paint(SeaGlassContext context, Graphics g) {
  JLabel label = (JLabel) context.getComponent();
  Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();
  g.setColor(context.getStyle().getColor(context, ColorType.TEXT_FOREGROUND));
  g.setFont(style.getFont(context));
  context.getStyle().getGraphicsUtils(context).paintText(context, g, label.getText(), icon, label.getHorizontalAlignment(),
    label.getVerticalAlignment(), label.getHorizontalTextPosition(), label.getVerticalTextPosition(),
    label.getIconTextGap(), label.getDisplayedMnemonicIndex(), 0);
}

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

public Dimension getMaximumSize(JComponent c) {
  JLabel label = (JLabel) c;
  Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();
  SeaGlassContext context = getContext(c);
  Dimension size = context.getStyle().getGraphicsUtils(context).getMaximumSize(context, context.getStyle().getFont(context),
    label.getText(), icon, label.getHorizontalAlignment(), label.getVerticalAlignment(), label.getHorizontalTextPosition(),
    label.getVerticalTextPosition(), label.getIconTextGap(), label.getDisplayedMnemonicIndex());
  context.dispose();
  return size;
}

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

public Dimension getPreferredSize(JComponent c) {
  JLabel label = (JLabel) c;
  Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();
  SeaGlassContext context = getContext(c);
  Dimension size = context.getStyle().getGraphicsUtils(context).getPreferredSize(context,
    context.getStyle().getFont(context), label.getText(), icon, label.getHorizontalAlignment(),
    label.getVerticalAlignment(), label.getHorizontalTextPosition(), label.getVerticalTextPosition(),
    label.getIconTextGap(), label.getDisplayedMnemonicIndex());
  context.dispose();
  return size;
}

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

public Dimension getMinimumSize(JComponent c) {
  JLabel label = (JLabel) c;
  Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();
  SeaGlassContext context = getContext(c);
  Dimension size = context.getStyle().getGraphicsUtils(context).getMinimumSize(context, context.getStyle().getFont(context),
    label.getText(), icon, label.getHorizontalAlignment(), label.getVerticalAlignment(), label.getHorizontalTextPosition(),
    label.getVerticalTextPosition(), label.getIconTextGap(), label.getDisplayedMnemonicIndex());
  context.dispose();
  return size;
}

相关文章

JLabel类方法