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


Java Options类代码示例

本文整理汇总了Java中com.jgoodies.looks.Options的典型用法代码示例。如果您正苦于以下问题:Java Options类的具体用法?Java Options怎么用?Java Options使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Options类属于com.jgoodies.looks包,在下文中一共展示了Options类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureUI

import com.jgoodies.looks.Options; //导入依赖的package包/类
/**
 * Configures the UI; tries to set the system look on Mac,
 * <code>WindowsLookAndFeel</code> on general Windows, and
 * <code>Plastic3DLookAndFeel</code> on Windows XP and all other OS.<p>
 *
 * The JGoodies Swing Suite's <code>ApplicationStarter</code>,
 * <code>ExtUIManager</code>, and <code>LookChoiceStrategies</code>
 * classes provide a much more fine grained algorithm to choose and
 * restore a look and theme.
 */
private void configureUI ()
{
    UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
    //Options.setGlobalFontSizeHints(FontSizeHints.MIXED);
    Options.setDefaultIconSize(new Dimension(18, 18));

    String lafName
            = LookUtils.IS_OS_WINDOWS_XP
                    ? Options.getCrossPlatformLookAndFeelClassName()
                    : Options.getSystemLookAndFeelClassName();

    try {
        UIManager.setLookAndFeel(lafName);
    } catch (Exception e) {
        System.err.println("Can't set look & feel:" + e);
    }
}
 
开发者ID:Audiveris,项目名称:audiveris,代码行数:28,代码来源:Tiny.java

示例2: buildMenuBar

import com.jgoodies.looks.Options; //导入依赖的package包/类
/**
 * Builds and answers the menu bar.
 */
private JMenuBar buildMenuBar ()
{
    JMenu menu;
    JMenuBar menuBar = new JMenuBar();
    menuBar.putClientProperty(Options.HEADER_STYLE_KEY, Boolean.TRUE);

    menu = new JMenu("File");
    menu.add(new JMenuItem("New..."));
    menu.add(new JMenuItem("Open..."));
    menu.add(new JMenuItem("Save"));
    menu.addSeparator();
    menu.add(new JMenuItem("Print..."));
    menuBar.add(menu);

    menu = new JMenu("Edit");
    menu.add(new JMenuItem("Cut"));
    menu.add(new JMenuItem("Copy"));
    menu.add(new JMenuItem("Paste"));
    menuBar.add(menu);

    return menuBar;
}
 
开发者ID:Audiveris,项目名称:audiveris,代码行数:26,代码来源:Tiny.java

示例3: createInstance

import com.jgoodies.looks.Options; //导入依赖的package包/类
public static void createInstance() {
	try {
		Toolkit.getDefaultToolkit().setDynamicLayout(true);
		System.setProperty("sun.awt.noerasebackground","true");

		// JGoodies
		Options.setDefaultIconSize(new Dimension(16, 16));		// menu icons
		Options.setUseNarrowButtons(false);
		Options.setPopupDropShadowEnabled(true);

		UIManager.setLookAndFeel(System.getProperty("os.name").toLowerCase().startsWith("windows")
				? new WindowsLookAndFeel() : new PlasticXPLookAndFeel());

		_instance = new MainFrame();
	} catch (Exception e) {
		System.err.println(e);
	}
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:19,代码来源:MainFrame.java

示例4: focusGained

import com.jgoodies.looks.Options; //导入依赖的package包/类
public void focusGained(FocusEvent e)
/*  21:    */   {
/*  22: 64 */     JTextComponent c = getComponent();
/*  23: 65 */     if (c.isEnabled())
/*  24:    */     {
/*  25: 66 */       setVisible(true);
/*  26: 67 */       setSelectionVisible(true);
/*  27:    */     }
/*  28: 69 */     if ((!c.isEnabled()) || (!this.isKeyboardFocusEvent) || (!Options.isSelectOnFocusGainActive(c))) {
/*  29: 72 */       return;
/*  30:    */     }
/*  31: 74 */     if ((c instanceof JFormattedTextField)) {
/*  32: 75 */       EventQueue.invokeLater(new Runnable()
/*  33:    */       {
/*  34:    */         public void run()
/*  35:    */         {
/*  36: 77 */           PlasticFieldCaret.this.selectAll();
/*  37:    */         }
/*  38:    */       });
/*  39:    */     } else {
/*  40: 81 */       selectAll();
/*  41:    */     }
/*  42:    */   }
 
开发者ID:xiwc,项目名称:confluence.keygen,代码行数:24,代码来源:PlasticFieldCaret.java

示例5: MenuBar

import com.jgoodies.looks.Options; //导入依赖的package包/类
private MenuBar()
{
    putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.BOTH);
    putClientProperty(PlasticLookAndFeel.BORDER_STYLE_KEY, BorderStyle.SEPARATOR);

    //
    // File menu
    //
    JMenu fileMenu = new JMenu("File");
    fileMenu.setMnemonic(java.awt.event.KeyEvent.VK_F);
    add(fileMenu);
    fileMenu.add(_login);
    fileMenu.add(_logout);
    if(!System.getProperty("os.name").startsWith("Mac OS"))
    {
        fileMenu.add(_exit);
    }

    //
    // Help menu
    //
    JMenu helpMenu = new JMenu("Help");
    helpMenu.setMnemonic(java.awt.event.KeyEvent.VK_H);
    add(helpMenu);
    helpMenu.add(_about);
}
 
开发者ID:zeroc-ice,项目名称:ice-demos,代码行数:27,代码来源:MainView.java

示例6: createMenu

import com.jgoodies.looks.Options; //导入依赖的package包/类
/**
 * Populates the menu
 */
private void createMenu()
{
    JMenu fileMenu = new JMenu("File");
    JMenuItem exitItem = new JMenuItem("Exit");
    fileMenu.add(exitItem);
    menuBar.add(fileMenu);
    
    exitItem.addActionListener(new ActionListener()
    {
        @Override
        public void actionPerformed(ActionEvent arg0)
        {
            LOGGER.info("Exiting...");
            JFreeStockFrame.this.dispose();
        }
    });
            
    JMenu helpMenu = new JMenu("Help");
    JMenuItem aboutItem = new JMenuItem("About");
    helpMenu.add(aboutItem);
    menuBar.add(helpMenu);
    
    menuBar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.BOTH);
    setJMenuBar(menuBar);
}
 
开发者ID:joshpassenger,项目名称:jfreestock,代码行数:29,代码来源:JFreeStockFrame.java

示例7: configureUI

import com.jgoodies.looks.Options; //导入依赖的package包/类
/**
 * Configures the UI; tries to set the system look on Mac, 
 * <code>WindowsLookAndFeel</code> on general Windows, and
 * <code>Plastic3DLookAndFeel</code> on Windows XP and all other OS.<p>
 * 
 * The JGoodies Swing Suite's <code>ApplicationStarter</code>,
 * <code>ExtUIManager</code>, and <code>LookChoiceStrategies</code>
 * classes provide a much more fine grained algorithm to choose and
 * restore a look and theme.
 */
private void configureUI() {
    UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
    //Options.setGlobalFontSizeHints(FontSizeHints.MIXED);
    Options.setDefaultIconSize(new Dimension(18, 18));

    String lafName =
        LookUtils.IS_OS_WINDOWS_XP
            ? Options.getCrossPlatformLookAndFeelClassName()
            : Options.getSystemLookAndFeelClassName();

    try {
        UIManager.setLookAndFeel(lafName);
    } catch (Exception e) {
        System.err.println("Can't set look & feel:" + e);
    }
}
 
开发者ID:jlpoolen,项目名称:libreveris,代码行数:27,代码来源:Tiny.java

示例8: buildMenuBar

import com.jgoodies.looks.Options; //导入依赖的package包/类
/**
 * Builds and answers the menu bar.
 */
private JMenuBar buildMenuBar() {
    JMenu menu;
    JMenuBar menuBar = new JMenuBar();
    menuBar.putClientProperty(Options.HEADER_STYLE_KEY, Boolean.TRUE);

    menu = new JMenu("File");
    menu.add(new JMenuItem("New..."));
    menu.add(new JMenuItem("Open..."));
    menu.add(new JMenuItem("Save"));
    menu.addSeparator();
    menu.add(new JMenuItem("Print..."));
    menuBar.add(menu);

    menu = new JMenu("Edit");
    menu.add(new JMenuItem("Cut"));
    menu.add(new JMenuItem("Copy"));
    menu.add(new JMenuItem("Paste"));
    menuBar.add(menu);

    return menuBar;
}
 
开发者ID:jlpoolen,项目名称:libreveris,代码行数:25,代码来源:Tiny.java

示例9: propertyChange

import com.jgoodies.looks.Options; //导入依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent e) {
    String pName = e.getPropertyName();

    if (null == pName) {
        return;
    }

    super.propertyChange(e);

    if (pName.equals("tabPlacement")) {
        tabPlacementChanged();
        return;
    }
    if (pName.equals(Options.EMBEDDED_TABS_KEY)) {
        embeddedTabsPropertyChanged((Boolean) e.getNewValue());
        return;
    }
    if (pName.equals(Options.NO_CONTENT_BORDER_KEY)) {
        noContentBorderPropertyChanged((Boolean) e.getNewValue());
        return;
    }
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:24,代码来源:PlasticTabbedPaneUI.java

示例10: focusGained

import com.jgoodies.looks.Options; //导入依赖的package包/类
@Override
    public void focusGained(FocusEvent e) {
        final JTextComponent c = getComponent();
        if (c.isEnabled()) {
            setVisible(true);
            setSelectionVisible(true);
        }
        if (   !c.isEnabled()
            || !isKeyboardFocusEvent
            || !Options.isSelectOnFocusGainActive(c)) {
            return;
        }
        if (c instanceof JFormattedTextField) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    selectAll();
                }
            });
        } else {
            selectAll();
        }
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:23,代码来源:PlasticFieldCaret.java

示例11: propertyChange

import com.jgoodies.looks.Options; //导入依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent e) {
    super.propertyChange(e);

    String pName = e.getPropertyName();
    if (null == pName) {
        return;
    }
    if (pName.equals(Options.EMBEDDED_TABS_KEY)) {
       embeddedTabsPropertyChanged((Boolean)e.getNewValue());
       return;
    }
    if (pName.equals(Options.NO_CONTENT_BORDER_KEY)) {
       noContentBorderPropertyChanged((Boolean)e.getNewValue());
       return;
    }

}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:19,代码来源:WindowsTabbedPaneUI.java

示例12: focusGained

import com.jgoodies.looks.Options; //导入依赖的package包/类
@Override
public void focusGained(FocusEvent e) {
    final JTextComponent c = getComponent();
    if (c.isEnabled()) {
        setVisible(true);
        setSelectionVisible(true);
    }
    if (   !c.isEnabled()
        || !isKeyboardFocusEvent
        || !Options.isSelectOnFocusGainActive(c)) {
        return;
    }
    if (c instanceof JFormattedTextField) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                selectAll();
            }
        });
    } else {
        selectAll();
    }
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:23,代码来源:WindowsFieldCaret.java

示例13: hideIcons

import com.jgoodies.looks.Options; //导入依赖的package包/类
/**
 * Checks and answers if the parent menu indicates that we should use no icons.
 */
private boolean hideIcons() {
    Component parent = menuItem.getParent();
    if (!(parent instanceof JPopupMenu)) {
        return false;
    }
	JPopupMenu popupMenu = (JPopupMenu) parent;
	Object value = popupMenu.getClientProperty(Options.NO_ICONS_KEY);
	if (value == null) {
 	Component invoker = popupMenu.getInvoker();
 	if (invoker != null && invoker instanceof JMenu) {
            value = ((JMenu) invoker).getClientProperty(Options.NO_ICONS_KEY);
        }
	}
	return Boolean.TRUE.equals(value);
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:19,代码来源:MenuItemRenderer.java

示例14: createInstance

import com.jgoodies.looks.Options; //导入依赖的package包/类
public static void createInstance() {
	try {
		Toolkit.getDefaultToolkit().setDynamicLayout(true);
		System.setProperty("sun.awt.noerasebackground","true");

		// JGoodies
		Options.setDefaultIconSize(new Dimension(16, 16));		// menu icons
		Options.setUseNarrowButtons(false);
		Options.setPopupDropShadowEnabled(true);

		UIManager.setLookAndFeel(new PlasticXPLookAndFeel());
		_instance = new MainFrame();
	} catch (Exception e) {
		System.err.println(e);
	}
}
 
开发者ID:p4553d,项目名称:carPirate,代码行数:17,代码来源:MainFrame.java

示例15: configureUI

import com.jgoodies.looks.Options; //导入依赖的package包/类
private static void configureUI(String plafURI) {
	UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE);
	// Options.setGlobalFontSizeHints(FontSizeHints.MIXED);
	Options.setDefaultIconSize(new Dimension(18, 18));
	try {

		UIManager.setLookAndFeel(plafURI);
	} catch (Exception e) {
		System.err.println("Can't set look & feel:" + e);
	}
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:12,代码来源:MMQueues.java


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