Java 类javax.swing.plaf.metal.MetalTabbedPaneUI 实例源码

项目:swing-htabs    文件:TabManager.java   
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));
  }

}
项目:ramus    文件:CloseableTabbedPane.java   
/**
 * 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));
}
项目:WordnetLoom    文件:CloseableTabbedPane.java   
/**
 * 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));
    }
}
项目:cn1    文件:BasicTabbedPaneUI$TabbedPaneLayoutTest.java   
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");            
    }
}
项目:freeVM    文件:BasicTabbedPaneUI$TabbedPaneLayoutTest.java   
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");            
    }
}
项目:freeVM    文件:BasicTabbedPaneUI$TabbedPaneLayoutTest.java   
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");            
    }
}
项目:cadsr-semantic-tools    文件:CloseableTabbedPane.java   
/**
 * 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));
}
项目:umple    文件:PaletteTabbedPaneUI.java   
@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);
    }
}