本文整理了Java中javax.swing.JTabbedPane.getForegroundAt()
方法的一些代码示例,展示了JTabbedPane.getForegroundAt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.getForegroundAt()
方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:getForegroundAt
暂无
代码示例来源:origin: stackoverflow.com
g.setColor(tabPane.getForegroundAt(tabIndex));
BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent());
} else { // tab disabled
代码示例来源:origin: datacleaner/DataCleaner
@Override
public Color getForegroundAt(final int index) {
if (getSelectedIndex() == index) {
return COLOR_FOREGROUND_SELECTED;
}
return super.getForegroundAt(index);
}
代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql
@Override
public void paint(Graphics g) {
int tabIndex = getTabIndex();
if (tabIndex >= 0) {
if (tabIndex == _tabbedPane.getSelectedIndex()) {
_label.setFont(_selectedFont);
// check if the foreground color is not set by user through a call to setForegroundAt
if (_tabbedPane.getForegroundAt(tabIndex) instanceof ColorUIResource) {
_label.setForeground(_selectedColor);
} else {
_label.setForeground(_tabbedPane.getForegroundAt(tabIndex));
}
} else {
_label.setFont(_defaultFont);
_label.setForeground(_tabbedPane.getForegroundAt(tabIndex));
}
}
super.paint(g);
}
代码示例来源:origin: realXuJiang/bigtable-sql
@Override
public void paint(Graphics g) {
int tabIndex = getTabIndex();
if (tabIndex >= 0) {
if (tabIndex == _tabbedPane.getSelectedIndex()) {
_label.setFont(_selectedFont);
// check if the foreground color is not set by user through a call to setForegroundAt
if (_tabbedPane.getForegroundAt(tabIndex) instanceof ColorUIResource) {
_label.setForeground(_selectedColor);
} else {
_label.setForeground(_tabbedPane.getForegroundAt(tabIndex));
}
} else {
_label.setFont(_defaultFont);
_label.setForeground(_tabbedPane.getForegroundAt(tabIndex));
}
}
super.paint(g);
}
代码示例来源:origin: com.fifesoft.rtext/fife.common
g.setFont(font);
Color fg = tabPane.getForegroundAt(tabIndex);
if (isSelected) {
fg = UIManager.getColor("Label.foreground");
代码示例来源:origin: realXuJiang/bigtable-sql
g2.setColor(tabComponent._tabbedPane.getForegroundAt(tabIndex));
代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql
g2.setColor(tabComponent._tabbedPane.getForegroundAt(tabIndex));
代码示例来源:origin: UISpec4J/UISpec4J
public void check() {
int tabCount = jTabbedPane.getTabCount();
AssertAdapter.assertEquals("You specified " + colors.length + " colors but there are " +
tabCount + " tabs -",
colors.length, tabCount);
for (int i = 0; i < colors.length; i++) {
String color = colors[i];
if (!ColorUtils.equals(color, jTabbedPane.getForegroundAt(i))) {
AssertAdapter.fail("Unexpected color for tab '" + jTabbedPane.getTitleAt(i) +
"' (index " + i + ") - expected " + ColorUtils.getColorDescription(color) +
" but was " + ColorUtils.getColorDescription(jTabbedPane.getForegroundAt(i)));
}
}
}
};
代码示例来源:origin: UNIVALI-LITE/Portugol-Studio
Color fg = tabPane.getForegroundAt ( tabIndex );
if ( isSelected && ( fg instanceof UIResource ) )
代码示例来源: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: stackoverflow.com
final Color defaultForeColor = pane.getForegroundAt(1); // default foreground color of tab
代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw
Color fg = tabPane.getForegroundAt(tabIndex);
if (isSelected && (fg instanceof UIResource)) {
Color selectedFG = PaletteLookAndFeel.getInstance().getColor(
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
g.setColor(tabPane.getForegroundAt(tabIndex));
BasicGraphicsUtils.drawStringUnderlineCharAt(
g,
代码示例来源:origin: com.jtattoo/JTattoo
g.setColor(AbstractLookAndFeel.getTabSelectionForegroundColor());
} else {
g.setColor(tabPane.getForegroundAt(tabIndex));
g.setColor(AbstractLookAndFeel.getTheme().getRolloverForegroundColor());
} else {
g.setColor(tabPane.getForegroundAt(tabIndex));
代码示例来源:origin: com.jtattoo/JTattoo
g.setColor(titleColor);
} else {
g.setColor(tabPane.getForegroundAt(tabIndex));
代码示例来源:origin: com.jtattoo/JTattoo
g.setColor(AbstractLookAndFeel.getTheme().getTabSelectionForegroundColor());
} else {
g.setColor(tabPane.getForegroundAt(tabIndex));
代码示例来源:origin: com.synaptix/SynaptixTattoo
g.setColor(titleColor);
} else
g.setColor(tabPane.getForegroundAt(tabIndex));
JTattooUtilities
.drawStringUnderlineCharAt(tabPane, g, title,
代码示例来源:origin: com.jtattoo/JTattoo
AlphaComposite alpha = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.6f);
g2D.setComposite(alpha);
Color fc = tabPane.getForegroundAt(tabIndex);
if (isSelected) {
fc = AbstractLookAndFeel.getTheme().getTabSelectionForegroundColor();
代码示例来源:origin: com.github.insubstantial/substance
Component component = jtp.getComponentAt(tabIndex);
SubstanceColorScheme colorized = getColorizedScheme(component,
nonColorized, jtp.getForegroundAt(tabIndex), jtp
.getBackgroundAt(tabIndex), !componentState
.isDisabled());
代码示例来源:origin: org.java.net.substance/substance
Component component = jtp.getComponentAt(tabIndex);
SubstanceColorScheme colorized = getColorizedScheme(component,
nonColorized, jtp.getForegroundAt(tabIndex), jtp
.getBackgroundAt(tabIndex), !componentState
.isDisabled());
内容来源于网络,如有侵权,请联系作者删除!