本文整理汇总了Java中javax.swing.plaf.metal.MetalTabbedPaneUI类的典型用法代码示例。如果您正苦于以下问题:Java MetalTabbedPaneUI类的具体用法?Java MetalTabbedPaneUI怎么用?Java MetalTabbedPaneUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MetalTabbedPaneUI类属于javax.swing.plaf.metal包,在下文中一共展示了MetalTabbedPaneUI类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TabManager
import javax.swing.plaf.metal.MetalTabbedPaneUI; //导入依赖的package包/类
public TabManager(final JTabbedPane tabbedPane, final int tabBarWidth, final int tabLayoutPolicy) {
this.tabbedPane = tabbedPane;
this.tabbedPane.setTabLayoutPolicy(tabLayoutPolicy);
this.TAB_BAR_WIDTH = tabBarWidth;
final TabbedPaneUI tabUI = this.tabbedPane.getUI();
if (tabUI instanceof MetalTabbedPaneUI) {
this.tabbedPane.setUI(new CustomMetalTabbedPaneUI(this));
} else if (tabUI instanceof SynthTabbedPaneUI) {
this.tabbedPane.setUI(new CustomSynthTabbedPaneUI(this));
} else if (tabUI instanceof MotifTabbedPaneUI) {
this.tabbedPane.setUI(new CustomMotifTabbedPaneUI(this));
} else if (tabUI instanceof WindowsTabbedPaneUI) {
this.tabbedPane.setUI(new CustomWindowsTabbedPaneUI(this));
} else {
this.tabbedPane.setUI(new CustomBasicTabbedPaneUI(this));
}
}
示例2: init
import javax.swing.plaf.metal.MetalTabbedPaneUI; //导入依赖的package包/类
/**
* Initializes the <code>CloseableTabbedPane</code>
*
* @param horizontalTextPosition the horizontal position of the text (e.g.
* SwingUtilities.TRAILING or SwingUtilities.LEFT)
*/
private void init(int horizontalTextPosition) {
listenerList = new EventListenerList();
addMouseListener(this);
addMouseMotionListener(this);
if (getUI() instanceof MetalTabbedPaneUI)
setUI(new CloseableMetalTabbedPaneUI(horizontalTextPosition));
else
setUI(new CloseableTabbedPaneUI(horizontalTextPosition));
}
示例3: init
import javax.swing.plaf.metal.MetalTabbedPaneUI; //导入依赖的package包/类
/**
* Initializes the <code>CloseableTabbedPane</code>
*
* @param horizontalTextPosition the horizontal position of the text (e.g.
* SwingUtilities.TRAILING or SwingUtilities.LEFT)
*/
private void init(int horizontalTextPosition) {
listenerList = new EventListenerList();
addMouseListener(this);
addMouseMotionListener(this);
if (getUI() instanceof MetalTabbedPaneUI) {
setUI(new CloseableMetalTabbedPaneUI(horizontalTextPosition));
} else {
setUI(new CloseableTabbedPaneUI(horizontalTextPosition));
}
}
示例4: testCalculateLayoutInfo
import javax.swing.plaf.metal.MetalTabbedPaneUI; //导入依赖的package包/类
public void testCalculateLayoutInfo() {
try {
MetalTabbedPaneUI localMetalTabbedPaneUI = new MetalTabbedPaneUI();
BasicTabbedPaneUI.TabbedPaneLayout localTabbedPaneLayout =
localMetalTabbedPaneUI.new TabbedPaneLayout();
JPopupMenu localJPopupMenu = new JPopupMenu();
localTabbedPaneLayout.removeLayoutComponent(localJPopupMenu);
} catch (NullPointerException npe) {
fail("NPE should not be thrown");
}
}
示例5: init
import javax.swing.plaf.metal.MetalTabbedPaneUI; //导入依赖的package包/类
/**
* Initializes the <code>CloseableTabbedPane</code>
* @param horizontalTextPosition the horizontal position of the text (e.g.
* SwingUtilities.TRAILING or SwingUtilities.LEFT)
*/
private void init(int horizontalTextPosition) {
listenerList = new EventListenerList();
addMouseListener(this);
addMouseMotionListener(this);
if (getUI() instanceof MetalTabbedPaneUI)
setUI(new CloseableMetalTabbedPaneUI(horizontalTextPosition));
else
setUI(new CloseableTabbedPaneUI(horizontalTextPosition));
}
示例6: installDefaults
import javax.swing.plaf.metal.MetalTabbedPaneUI; //导入依赖的package包/类
@Override
protected void installDefaults() {
PaletteLookAndFeel laf = PaletteLookAndFeel.getInstance();
MetalTabbedPaneUI mtpui;
PaletteLookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background",
"TabbedPane.foreground", "TabbedPane.font");
highlight = laf.getColor("TabbedPane.light");
lightHighlight = laf.getColor("TabbedPane.highlight");
shadow = laf.getColor("TabbedPane.shadow");
darkShadow = laf.getColor("TabbedPane.darkShadow");
focus = laf.getColor("TabbedPane.focus");
selectedColor = laf.getColor("TabbedPane.selected"); // will probably not
// work as expected since we don't override enough colors from BasicTabbedPaneUI
textIconGap = laf.getInt("TabbedPane.textIconGap");
tabInsets = laf.getInsets("TabbedPane.tabInsets");
selectedTabPadInsets = laf.getInsets("TabbedPane.selectedTabPadInsets");
tabAreaInsets = laf.getInsets("TabbedPane.tabAreaInsets");
tabsOverlapBorder = laf.getBoolean("TabbedPane.tabsOverlapBorder");
; // will probably not
// work as expected since we don't override enough colors from BasicTabbedPaneUI
contentBorderInsets = laf.getInsets("TabbedPane.contentBorderInsets");
tabRunOverlay = laf.getInt("TabbedPane.tabRunOverlay");
tabsOpaque = laf.getBoolean("TabbedPane.tabsOpaque");// will probably not
// work as expected since we don't override enough colors from BasicTabbedPaneUI
contentOpaque = laf.getBoolean("TabbedPane.contentOpaque");// will probably not
// work as expected since we don't override enough colors from BasicTabbedPaneUI
Object opaque = laf.get("TabbedPane.opaque");
if (opaque == null) {
opaque = Boolean.FALSE;
}
PaletteLookAndFeel.installProperty(tabPane, "opaque", opaque);
// Fix for 6711145 BasicTabbedPanuUI should not throw a NPE if these
// keys are missing. So we are setting them to there default values here
// if the keys are missing.
if (tabInsets == null) {
tabInsets = new Insets(0, 4, 1, 4);
}
if (selectedTabPadInsets == null) {
selectedTabPadInsets = new Insets(2, 2, 2, 1);
}
if (tabAreaInsets == null) {
tabAreaInsets = new Insets(3, 2, 0, 2);
}
if (contentBorderInsets == null) {
contentBorderInsets = new Insets(2, 2, 3, 3);
}
}