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


Java SubstanceLookAndFeel类代码示例

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


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

示例1: main

import org.jvnet.substance.SubstanceLookAndFeel; //导入依赖的package包/类
public static void main(String[] args) {

		try {
			// 设置观感
			UIManager
					.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessBlackSteelLookAndFeel");
			// 设置水印
			SubstanceLookAndFeel
					.setCurrentWatermark("org.jvnet.substance.watermark.SubstanceMosaicWatermark");
			// 设置渐变渲染
			SubstanceLookAndFeel
					.setCurrentGradientPainter("org.jvnet.substance.painter.WaveGradientPainter");

			JFrame.setDefaultLookAndFeelDecorated(true);
			JDialog.setDefaultLookAndFeelDecorated(true);
		} catch (ClassNotFoundException | InstantiationException
				| IllegalAccessException | UnsupportedLookAndFeelException e) {
			e.printStackTrace();
		}

		EventQueue.invokeLater(() -> {
			new HubFrame();
		});

	}
 
开发者ID:JhPocket,项目名称:HubPlayer,代码行数:26,代码来源:Main.java

示例2: main

import org.jvnet.substance.SubstanceLookAndFeel; //导入依赖的package包/类
public static void main(String args[]) {
	try {
           UIManager.setLookAndFeel(new SubstanceLookAndFeel());
           JFrame.setDefaultLookAndFeelDecorated(true);
           JDialog.setDefaultLookAndFeelDecorated(true);
           SubstanceLookAndFeel.setCurrentTheme(new SubstanceTerracottaTheme());
         

         
         SubstanceLookAndFeel.setSkin(new OfficeBlue2007Skin());
         SubstanceLookAndFeel.setCurrentButtonShaper(new ClassicButtonShaper());
         SubstanceLookAndFeel.setCurrentWatermark(new SubstanceBubblesWatermark());
         SubstanceLookAndFeel.setCurrentBorderPainter(new StandardBorderPainter());
           SubstanceLookAndFeel.setCurrentGradientPainter(new StandardGradientPainter());
           
       		
           //SubstanceLookAndFeel.setCurrentTitlePainter(new FlatTitePainter());
       } catch (Exception e) {
           System.err.println("Something went wrong!");
       }
	SeverUI server = new SeverUI();
	server.setVisible(true);
	server.start();
	
	
}
 
开发者ID:TeamProjectNJU,项目名称:Million-WordsGod-Dictionary,代码行数:27,代码来源:SeverUI.java

示例3: initialize

import org.jvnet.substance.SubstanceLookAndFeel; //导入依赖的package包/类
public void initialize() throws Exception {
    String skin = ObjectUtils.toString(config.get("UISkin")).trim();
    String theme = ObjectUtils.toString(config.get("UITheme")).trim();
    
    if(skin.equalsIgnoreCase("default")) //java default
        return;
    
    UIManager.setLookAndFeel(new SubstanceLookAndFeel());
    JFrame.setDefaultLookAndFeelDecorated(true);
    JDialog.setDefaultLookAndFeelDecorated(true);
    
    if(StringUtils.isNotEmpty(theme))
        SubstanceLookAndFeel.setCurrentTheme(theme);
    else if(StringUtils.isNotEmpty(skin))
        SubstanceLookAndFeel.setSkin((SubstanceSkin)newInstance(skin));
    String watermark = ObjectUtils.toString(config.get("UIWatermark")).trim();
    if(StringUtils.isNotEmpty(watermark))
        SubstanceLookAndFeel.setCurrentWatermark((SubstanceWatermark)newInstance(watermark));
    String buttonShaper = ObjectUtils.toString(config.get("UIButtonShaper")).trim();
    if(StringUtils.isNotEmpty(buttonShaper))
        SubstanceLookAndFeel.setCurrentButtonShaper((SubstanceButtonShaper)newInstance(buttonShaper));
    String borderPainter = ObjectUtils.toString(config.get("UIBorderPainter")).trim();
    if(StringUtils.isNotEmpty(borderPainter))
        SubstanceLookAndFeel.setCurrentBorderPainter((SubstanceBorderPainter)newInstance(borderPainter));
    String gradientPainter = ObjectUtils.toString(config.get("UIGradientPainter")).trim();
    if(StringUtils.isNotEmpty(gradientPainter))
        SubstanceLookAndFeel.setCurrentGradientPainter((SubstanceGradientPainter)newInstance(gradientPainter));
}
 
开发者ID:hulang1024,项目名称:PTEAssistant,代码行数:29,代码来源:SkinManager.java

示例4: saveCurrent

import org.jvnet.substance.SubstanceLookAndFeel; //导入依赖的package包/类
public void saveCurrent() {
    try {
        SkinInfo currentSkin = SubstanceLookAndFeel.getAllSkins().get(SubstanceLookAndFeel.getCurrentThemeName());
        ThemeInfo currentTheme = SubstanceLookAndFeel.getAllThemes().get(SubstanceLookAndFeel.getCurrentThemeName());
        config.set("UISkin", currentSkin != null ? currentSkin.getClassName() : "");
        config.set("UITheme", currentTheme != null ? currentTheme.getClassName() : "");
        config.set("UIWatermark", SubstanceLookAndFeel.getCurrentWatermark().getClass().getName());
        config.set("UIButtonShaper", SubstanceLookAndFeel.getCurrentButtonShaper().getClass().getName());
        config.set("UIBorderPainter", SubstanceLookAndFeel.getCurrentBorderPainter().getClass().getName());
        config.set("UIGradientPainter", SubstanceLookAndFeel.getCurrentGradientPainter().getClass().getName());
        config.save();
    } catch (Exception e) {
        e.printStackTrace();
    }
    
}
 
开发者ID:hulang1024,项目名称:PTEAssistant,代码行数:17,代码来源:SkinManager.java

示例5: setLookAndFeel

import org.jvnet.substance.SubstanceLookAndFeel; //导入依赖的package包/类
public static void setLookAndFeel(String theme) {
	try {			
		// Use Business as base Look And Feel
		UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessLookAndFeel");
		
		if (themes.containsKey(theme))
			SubstanceLookAndFeel.setCurrentTheme(themes.get(theme));
		else
			SubstanceLookAndFeel.setCurrentTheme(themes.get(DEFAULT_THEME));

		SubstanceLookAndFeel.setCurrentWatermark(new SubstanceStripeWatermark());
		UIManager.put(SubstanceLookAndFeel.NO_EXTRA_ELEMENTS,Boolean.TRUE);
		JFrame.setDefaultLookAndFeelDecorated(!Kernel.getInstance().state.isMultipleWindow());
	} catch (Exception e) {
	}
}
 
开发者ID:michellemulkey,项目名称:aTunes,代码行数:17,代码来源:LookAndFeelSelector.java

示例6: main

import org.jvnet.substance.SubstanceLookAndFeel; //导入依赖的package包/类
public static void main(String[] args){
	

	 
	try {
           UIManager.setLookAndFeel(new SubstanceLookAndFeel());
           JFrame.setDefaultLookAndFeelDecorated(true);
           JDialog.setDefaultLookAndFeelDecorated(true);
           SubstanceLookAndFeel.setCurrentTheme(new SubstanceTerracottaTheme());
         

         
         SubstanceLookAndFeel.setSkin(new OfficeBlue2007Skin());
         SubstanceLookAndFeel.setCurrentButtonShaper(new ClassicButtonShaper());
         SubstanceLookAndFeel.setCurrentWatermark(new SubstanceBubblesWatermark());
         SubstanceLookAndFeel.setCurrentBorderPainter(new StandardBorderPainter());
           SubstanceLookAndFeel.setCurrentGradientPainter(new StandardGradientPainter());
           //SubstanceLookAndFeel.setCurrentTitlePainter(new FlatTitePainter());
       } catch (Exception e) {
           System.err.println("Something went wrong!");
       }
	
	
	UI frame=new UI();
	frame.setTitle("DictPro");
	frame.setSize(600,500);
	frame.setLocationRelativeTo(null);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setVisible(true);
}
 
开发者ID:TeamProjectNJU,项目名称:Million-WordsGod-Dictionary,代码行数:31,代码来源:UI.java

示例7: startup

import org.jvnet.substance.SubstanceLookAndFeel; //导入依赖的package包/类
public void startup() {
    MainWindowIconManager.apply(this);
    JDialog.setDefaultLookAndFeelDecorated(true);
    UIManager.put(SubstanceLookAndFeel.TABBED_PANE_CONTENT_BORDER_KIND, TabContentPaneBorderKind.SINGLE_FULL);
    setTitle(TITLE_WORKCRAFT);

    // Create main menu.
    mainMenu = new MainMenu(this);
    MenuBarUI menuUI = mainMenu.getUI();
    setJMenuBar(mainMenu);

    // Tweak look-and-feel.
    SilverOceanTheme.enable();
    LookAndFeelHelper.setDefaultLookAndFeel();
    SwingUtilities.updateComponentTreeUI(this);
    if (DesktopApi.getOs().isMac()) {
        // Menu UI needs to be restored for OSX (global menu Look-and-Feel).
        mainMenu.setUI(menuUI);
    }

    // Create content panel and docking ports.
    layout = new MultiBorderLayout();
    content = new JPanel(layout);
    setContentPane(content);
    rootDockingPort = new DefaultDockingPort(FLEXDOCK_DOCKING_PORT);
    content.add(rootDockingPort, BorderLayout.CENTER);
    StandardBorderManager borderManager = new StandardBorderManager(new ShadowBorder());
    rootDockingPort.setBorderManager(borderManager);

    // Create toolbars.
    globalToolbar = new ToolBar(this);
    modelToolbar = new JToolBar("Model tools");
    controlToolbar = new JToolBar("Tool controls");
    mainMenu.registerToolbar(globalToolbar);
    mainMenu.registerToolbar(modelToolbar);
    mainMenu.registerToolbar(controlToolbar);
    loadToolbarParametersFromConfig();

    // Create dockable windows.
    createWindows();
    createDockingLayout();
    loadWindowGeometryFromConfig();
    loadRecentFilesFromConfig();

    // Display window in its default state.
    setVisible(true);
    DockableWindow.updateHeaders(rootDockingPort, getDefaultActionListener());
    DockingManager.display(outputDockable);
    utilityWindows.add(documentPlaceholder);

    new Thread(new Runnable() {
        @Override
        public void run() {
            // Hack to fix the annoying delay occurring when
            // createGlyphVector is called for the first time.
            Font font = new Font(Font.SANS_SERIF, Font.PLAIN, 1);
            FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true);
            font.createGlyphVector(frc, TITLE_PLACEHOLDER);
            // Force SVG rendering classes to load.
            GUI.createIconFromSVG("images/icon.svg");
        }
    }).start();

    setWorkActionsEnableness(false);
}
 
开发者ID:workcraft,项目名称:workcraft,代码行数:66,代码来源:MainWindow.java

示例8: setSubstance

import org.jvnet.substance.SubstanceLookAndFeel; //导入依赖的package包/类
public static void setSubstance(String laf) {
    setLookAndFeel(laf);
    UIManager.put(SubstanceLookAndFeel.TABBED_PANE_CONTENT_BORDER_KIND, TabContentPaneBorderKind.SINGLE_FULL);
}
 
开发者ID:workcraft,项目名称:workcraft,代码行数:5,代码来源:LookAndFeelHelper.java

示例9: main

import org.jvnet.substance.SubstanceLookAndFeel; //导入依赖的package包/类
public static void main (final String args[]) {
    
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            
            if (!registerApp()) {
                System.exit(1);
            }
            
            AppConfig config = new AppConfig(args);
            config.load();
            
            // set Locale.
            String slang = config.getProperty("user.language");
            String scountry = config.getProperty("user.country");
            String svariant = config.getProperty("user.variant");
            if (slang != null && !slang.equals("") && scountry != null && svariant != null) {                                        
                Locale.setDefault(new Locale(slang, scountry, svariant));
            }
            
            // Set the format patterns
            Formats.setIntegerPattern(config.getProperty("format.integer"));
            Formats.setDoublePattern(config.getProperty("format.double"));
            Formats.setCurrencyPattern(config.getProperty("format.currency"));
            Formats.setPercentPattern(config.getProperty("format.percent"));
            Formats.setDatePattern(config.getProperty("format.date"));
            Formats.setTimePattern(config.getProperty("format.time"));
            Formats.setDateTimePattern(config.getProperty("format.datetime"));               
            
            // Set the look and feel.
            try {             
                
                Object laf = Class.forName(config.getProperty("swing.defaultlaf")).newInstance();
                
                if (laf instanceof LookAndFeel){
                    UIManager.setLookAndFeel((LookAndFeel) laf);
                } else if (laf instanceof SubstanceSkin) {                      
                    SubstanceLookAndFeel.setSkin((SubstanceSkin) laf);                   
                }
            } catch (Exception e) {
                logger.log(Level.WARNING, "Cannot set look and feel", e);
            }
            
            String screenmode = config.getProperty("machine.screenmode");
            if ("fullscreen".equals(screenmode)) {
                JRootKiosk rootkiosk = new JRootKiosk();
                rootkiosk.initFrame(config);
            } else {
                JRootFrame rootframe = new JRootFrame(); 
                rootframe.initFrame(config);
            }
        }
    });    
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:55,代码来源:StartPOS.java

示例10: main

import org.jvnet.substance.SubstanceLookAndFeel; //导入依赖的package包/类
/**
     *
     * @param args
     */
    public static void main (final String args[]) {
        
        GraphicsEnvironment ge = GraphicsEnvironment
        .getLocalGraphicsEnvironment();

Font[] allFonts = ge.getAllFonts();

for (Font font : allFonts) {
    System.out.println(font.getFontName(Locale.US));
}
        
        
        
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                
                if (!registerApp()) {
                    System.exit(1);
                }
                
                AppConfig config = new AppConfig(args);
                config.load();
                
                // set Locale.
                String slang = config.getProperty("user.language");
                String scountry = config.getProperty("user.country");
                String svariant = config.getProperty("user.variant");
                if (slang != null && !slang.equals("") && scountry != null && svariant != null) {                                        
                    Locale.setDefault(new Locale(slang, scountry, svariant));
                }
                
                // Set the format patterns
                Formats.setIntegerPattern(config.getProperty("format.integer"));
                Formats.setDoublePattern(config.getProperty("format.double"));
                Formats.setCurrencyPattern(config.getProperty("format.currency"));
                Formats.setPercentPattern(config.getProperty("format.percent"));
                Formats.setDatePattern(config.getProperty("format.date"));
                Formats.setTimePattern(config.getProperty("format.time"));
                Formats.setDateTimePattern(config.getProperty("format.datetime"));               
                
                // Set the look and feel.
                try {             
                    
                    Object laf = Class.forName(config.getProperty("swing.defaultlaf")).newInstance();                    
                    if (laf instanceof LookAndFeel){
                        UIManager.setLookAndFeel((LookAndFeel) laf);
                    } else if (laf instanceof SubstanceSkin) {                      
                        SubstanceLookAndFeel.setSkin((SubstanceSkin) laf);
                    }
// JG 6 May 2013 to multicatch
                } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {                
                    logger.log(Level.WARNING, "Cannot set Look and Feel", e);
                }
// JG July 2014 Hostname for Tickets
                String hostname = config.getProperty("machine.hostname");
                TicketInfo.setHostname(hostname);
                
                String screenmode = config.getProperty("machine.screenmode");
                if ("fullscreen".equals(screenmode)) {
                    JRootKiosk rootkiosk = new JRootKiosk();
                    rootkiosk.initFrame(config);
                } else {
                    JRootFrame rootframe = new JRootFrame(); 
                    rootframe.initFrame(config);
                }
            }
        });    
    }
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:74,代码来源:StartPOS.java

示例11: JPanelConfigGeneral

import org.jvnet.substance.SubstanceLookAndFeel; //导入依赖的package包/类
/** Creates new form JPanelConfigGeneral */
public JPanelConfigGeneral() {

    initComponents();

    jtxtMachineHostname.getDocument().addDocumentListener(dirty);
    jcboLAF.addActionListener(dirty);
    jcboMachineScreenmode.addActionListener(dirty);
    jcboTicketsBag.addActionListener(dirty);
    jchkHideInfo.addActionListener(dirty);  
    jtxtStartupText.getDocument().addDocumentListener(dirty);
    jbtnLogoText.addActionListener(new DirectoryEvent(jtxtStartupText));        
    jtxtStartupLogo.getDocument().addDocumentListener(dirty);
    jbtnLogoName.addActionListener(new DirectoryEvent(jtxtStartupLogo));
    
    // Installed skins
    LookAndFeelInfo[] lafs = UIManager.getInstalledLookAndFeels();
    for (LookAndFeelInfo laf : lafs) {
        jcboLAF.addItem(new LAFInfo(laf.getName(), laf.getClassName()));
    }

    // Substance skins
    // new SubstanceLookAndFeel()
    Map<String, SkinInfo> skins = SubstanceLookAndFeel.getAllSkins();

    for (SkinInfo skin : skins.values()) {
        jcboLAF.addItem(new LAFInfo(skin.getDisplayName(), skin.getClassName()));
    }

    jcboLAF.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            changeLAF();
        }
    });

    jcboMachineScreenmode.addItem("window");
    jcboMachineScreenmode.addItem("fullscreen");

    jcboTicketsBag.addItem("simple");
    jcboTicketsBag.addItem("standard");
    jcboTicketsBag.addItem("restaurant");
}
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:45,代码来源:JPanelConfigGeneral.java

示例12: main

import org.jvnet.substance.SubstanceLookAndFeel; //导入依赖的package包/类
/**
     *
     * @param args
     */
    public static void main (final String args[]) {
        
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                
                if (!registerApp()) {
                    System.exit(1);
                }
                
                AppConfig config = new AppConfig(args);
                config.load();
                
                // set Locale.
                String slang = config.getProperty("user.language");
                String scountry = config.getProperty("user.country");
                String svariant = config.getProperty("user.variant");
                if (slang != null && !slang.equals("") && scountry != null && svariant != null) {                                        
                    Locale.setDefault(new Locale(slang, scountry, svariant));
                }
                
                // Set the format patterns
                Formats.setIntegerPattern(config.getProperty("format.integer"));
                Formats.setDoublePattern(config.getProperty("format.double"));
                Formats.setCurrencyPattern(config.getProperty("format.currency"));
                Formats.setPercentPattern(config.getProperty("format.percent"));
                Formats.setDatePattern(config.getProperty("format.date"));
                Formats.setTimePattern(config.getProperty("format.time"));
                Formats.setDateTimePattern(config.getProperty("format.datetime"));               
                
                // Set the look and feel.
                try {             
                    
                    Object laf = Class.forName(config.getProperty("swing.defaultlaf")).newInstance();                    
                    if (laf instanceof LookAndFeel){
                        UIManager.setLookAndFeel((LookAndFeel) laf);
                    } else if (laf instanceof SubstanceSkin) {                      
                        SubstanceLookAndFeel.setSkin((SubstanceSkin) laf);
                    }
// JG 6 May 2013 to multicatch
                } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {                
                    logger.log(Level.WARNING, "Cannot set Look and Feel", e);
                }
// JG July 2014 Hostname for Tickets
                String hostname = config.getProperty("machine.hostname");
                TicketInfo.setHostname(hostname);
                
                String screenmode = config.getProperty("machine.screenmode");
                if ("fullscreen".equals(screenmode)) {
                    JRootKiosk rootkiosk = new JRootKiosk();
                    rootkiosk.initFrame(config);
                } else {
                    JRootFrame rootframe = new JRootFrame(); 
                    rootframe.initFrame(config);
                }
            }
        });    
    }
 
开发者ID:sbandur84,项目名称:micro-Blagajna,代码行数:63,代码来源:StartPOS.java


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