javax.swing.JTabbedPane.getDisplayedMnemonicIndexAt()方法的使用及代码示例

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

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

JTabbedPane.getDisplayedMnemonicIndexAt介绍

暂无

代码示例

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

} else {
  int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);
  if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) {
    g.setColor(tabPane.getForegroundAt(tabIndex));

代码示例来源:origin: com.jtattoo/JTattoo

protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) {
  if (isSelected && tabPane.isEnabledAt(tabIndex) && (tabPane.getBackgroundAt(tabIndex) instanceof ColorUIResource) && (getTextViewForTab(tabIndex) == null)) {
    g.setFont(font);
    Color selColor = AbstractLookAndFeel.getTabSelectionForegroundColor();
    if (ColorHelper.getGrayValue(selColor) > 164) {
      g.setColor(Color.black);
    } else {
      g.setColor(Color.white);
    }
    int mnemIndex = -1;
    if (JTattooUtilities.getJavaVersion() >= 1.4) {
      mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);
    }
    JTattooUtilities.drawStringUnderlineCharAt(tabPane, g, title, mnemIndex, textRect.x, textRect.y + 1 + metrics.getAscent());
  }
  super.paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect, isSelected);
}

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

protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics,
  int tabIndex, String title, Rectangle textRect, boolean isSelected)
{
  g.setFont(font);

  View v = getTextViewForTab(tabIndex);
  
  if(v != null) {
    // html
    v.paint(g, textRect);
  }
  else {
    // plain text
    int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);

    if(tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) {
      g.setColor(tabPane.getForegroundAt(tabIndex));
    }
    else { // tab disabled
      g.setColor(Theme.tabDisabledTextColor.getColor());
    }

    // Note: Using BasicGraphicsUtils.drawStringUnderlineCharAt(...)
    // prevented text antialiasing with JRE 1.6.0_10
    TinyUtils.drawStringUnderlineCharAt(tabPane, g, title,
      mnemIndex, textRect.x, textRect.y + metrics.getAscent());
  }
}

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

final int mnemIndex = tabPane.getDisplayedMnemonicIndexAt ( tabIndex );

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

int mnemIndex= tabPane.getDisplayedMnemonicIndexAt(tabIndex);

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

} else {
  int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);

代码示例来源:origin: com.jtattoo/JTattoo

mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);

代码示例来源:origin: com.jtattoo/JTattoo

mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);

代码示例来源:origin: com.jtattoo/JTattoo

mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);

代码示例来源:origin: com.jtattoo/JTattoo

mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);

代码示例来源:origin: com.synaptix/SynaptixTattoo

mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);

代码示例来源:origin: com.jtattoo/JTattoo

mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);

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

/**
 * Paint the label text for a tab.
 *
 * @param ss           the SynthContext.
 * @param g            the Graphics context.
 * @param tabPlacement the side the tabs are on.
 * @param font         the font to use.
 * @param metrics      the font metrics.
 * @param tabIndex     the index of the tab to lay out.
 * @param title        the text for the label, if any.
 * @param textRect     Rectangle to place text in
 * @param isSelected   is the tab selected?
 */
protected void paintText(SeaGlassContext ss, Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title,
    Rectangle textRect, boolean isSelected) {
  g.setFont(font);
  View v = getTextViewForTab(tabIndex);
  if (v != null) {
    // html
    v.paint(g, textRect);
  } else {
    // plain text
    int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);
    FontMetrics    fm = SwingUtilities2.getFontMetrics(tabPane, g);
    title = SwingUtilities2.clipStringIfNecessary(tabPane, fm, title, textRect.width);
    g.setColor(ss.getStyle().getColor(ss, ColorType.TEXT_FOREGROUND));
    ss.getStyle().getGraphicsUtils(ss).paintText(ss, g, title, textRect, mnemIndex);
  }
}

代码示例来源:origin: org.java.net.substance/substance

} else {
  int mnemIndex = this.tabPane.getDisplayedMnemonicIndexAt(tabIndex);
  StateTransitionTracker.ModelStateInfo modelStateInfo = this
      .getModelStateInfo(tabIndex);

代码示例来源:origin: com.github.insubstantial/substance

} else {
  int mnemIndex = this.tabPane.getDisplayedMnemonicIndexAt(tabIndex);
  StateTransitionTracker.ModelStateInfo modelStateInfo = this
      .getModelStateInfo(tabIndex);

相关文章

JTabbedPane类方法