当前位置: 首页>>代码示例>>Java>>正文


Java MetalTabbedPaneUI类代码示例

本文整理汇总了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));
  }

}
 
开发者ID:UprootLabs,项目名称:swing-htabs,代码行数:21,代码来源:TabManager.java

示例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));
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:17,代码来源:CloseableTabbedPane.java

示例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));
    }
}
 
开发者ID:CLARIN-PL,项目名称:WordnetLoom,代码行数:18,代码来源:CloseableTabbedPane.java

示例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");            
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:12,代码来源:BasicTabbedPaneUI$TabbedPaneLayoutTest.java

示例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));
}
 
开发者ID:NCIP,项目名称:cadsr-semantic-tools,代码行数:16,代码来源:CloseableTabbedPane.java

示例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);
    }
}
 
开发者ID:umple,项目名称:umple,代码行数:50,代码来源:PaletteTabbedPaneUI.java


注:本文中的javax.swing.plaf.metal.MetalTabbedPaneUI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。