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


Java SubstanceLookAndFeel类代码示例

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


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

示例1: main

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
/**
 * @param args the command line arguments
 */
public static void main(String args[]) {
    /*
     * Create and display the form
     */
    JFrame.setDefaultLookAndFeelDecorated(true);
    JDialog.setDefaultLookAndFeelDecorated(true);
    EventQueue.invokeLater(new Runnable() {

        @Override
        public void run() {
            SubstanceLookAndFeel.setSkin(new CremeCoffeeSkin());
            MainFrame frame = new MainFrame();
            frame.initActionPerform();
            frame.initListSelectionListener();
            frame.setVisible(true);
        }
    });
}
 
开发者ID:ajtdnyy,项目名称:PackagePlugin,代码行数:22,代码来源:MainFrame.java

示例2: AtsSlider

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
public AtsSlider(int min, int max, AtsInteger integer) {
    setHorizontalAlignment(JLabel.CENTER);
    setFocusable(true);

    addFocusListener(this);
    addMouseListener(this);
    addKeyListener(this);
    addMouseMotionListener(this);

    this.integer = integer;
    setText(String.valueOf(integer.getValue()));
    currentValue = integer.getValue();

    putClientProperty(SubstanceLookAndFeel.COLORIZATION_FACTOR, new Double(1.0));

    // FIXME: do this better
    setPreferredSize(new Dimension(10, (int) new JComboBox().getPreferredSize().getHeight()));
}
 
开发者ID:jdiemke,项目名称:XPTS,代码行数:19,代码来源:AtsSlider.java

示例3: main

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
/**
     * @param args the command line arguments
     */
    public static void main(final String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                
                AppConfig config = new AppConfig(args);
                config.load();    
                
// Set the look and feel.
// JG 6 May 2013 to Multicatch                
                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) {
                }
                
                new JdbUpdate(config).setVisible(true);
            }
        });
    }
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:29,代码来源:JdbUpdate.java

示例4: createSegmentButton

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
public T createSegmentButton(String style, String position, ButtonGroup buttonGrp) {
	T button = supplier.get();

	// client properties for Mac OS X
	button.putClientProperty("JButton.buttonType", style);
	button.putClientProperty("JButton.segmentPosition", position);

	// client properties for Substance L&F
	Set<Side> openSides = new LinkedHashSet<Side>();
	if (position.equals("first")) {
		openSides.add(Side.RIGHT);
	} else if (position.equals("middle")) {
		openSides.add(Side.LEFT);
		openSides.add(Side.RIGHT);
	} else if (position.equals("last")) {
		openSides.add(Side.LEFT);
	}

	button.putClientProperty(SubstanceLookAndFeel.BUTTON_OPEN_SIDE_PROPERTY, openSides);

	buttonGrp.add(button);
	return button;
}
 
开发者ID:phon-ca,项目名称:phon,代码行数:24,代码来源:SegmentedButtonBuilder.java

示例5: main

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

                 final ConexionBD BD=new ConexionBD();
            final PrincipalView PV=new PrincipalView(); 
        EventQueue.invokeLater(new Runnable(){
            public void run(){
            try{
                PrincipalView.setDefaultLookAndFeelDecorated(true);  
                //JFrame.
                SubstanceLookAndFeel.setSkin(new RavenSkin());
                new PrincipalView().setVisible(true);
            }              
            catch(Exception e){
            }  
            BD.Conectar();
            //PV.setLocationRelativeTo(null);
            //PV.setVisible(true);          
            //new PrincipalView().setLocationRelativeTo(null);
            }
   
            });
}
 
开发者ID:lfernandez93,项目名称:SEAntiMalware,代码行数:23,代码来源:Main.java

示例6: main

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

        final ConexionBD BD=new ConexionBD();
        PrincipalView PV=new PrincipalView(); 
        EventQueue.invokeLater(new Runnable(){
            public void run(){
            try{
                PrincipalView.setDefaultLookAndFeelDecorated(true);  
                //JFrame.
                SubstanceLookAndFeel.setSkin(new RavenSkin());
                new PrincipalView().setVisible(true);
            }              
            catch(Exception e){
            }  
            BD.Conectar();
            //PV.setLocationRelativeTo(null);
            //PV.setVisible(true);          
            //new PrincipalView().setLocationRelativeTo(null);
            }
   
            });
}
 
开发者ID:lfernandez93,项目名称:SEAntiMalwareMaven,代码行数:23,代码来源:Main.java

示例7: SubstanceTitlePane

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
/**
 * Creates a new title pane.
 * 
 * @param root
 *            Root pane.
 * @param ui
 *            Root pane UI.
 */
public SubstanceTitlePane(JRootPane root, SubstanceRootPaneUI ui) {
	this.rootPane = root;
	this.rootPaneUI = ui;

	this.state = -1;

	this.installSubcomponents();
	this.installDefaults();

	this.setLayout(this.createLayout());

	this.setToolTipText(this.getTitle());

	SubstanceLookAndFeel.setDecorationType(this,
			DecorationAreaType.PRIMARY_TITLE_PANE);
	this.setForeground(SubstanceColorUtilities
			.getForegroundColor(SubstanceCoreUtilities.getSkin(this)
					.getBackgroundColorScheme(
							DecorationAreaType.PRIMARY_TITLE_PANE)));
	// SubstanceColorSchemeUtilities
	// .getColorScheme(this, ComponentState.ACTIVE)));
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:31,代码来源:SubstanceTitlePane.java

示例8: getActiveColorScheme

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
/**
 * Returns the color scheme of the component.
 * 
 * @param component
 *            Component.
 * @param associationKind
 *            Association kind.
 * @param componentState
 *            Component state.
 * @return Component color scheme.
 */
public static SubstanceColorScheme getActiveColorScheme(
		Component component, ComponentState componentState) {
	// special case - if the component is marked as flat and
	// it is in the default state, get the color scheme of the parent.
	// However, flat toolbars should be ignored, since they are
	// the "top" level decoration area.
	if (!(component instanceof JToolBar)
			&& SubstanceCoreUtilities.hasFlatAppearance(component, false)
			&& (componentState == ComponentState.ENABLED)) {
		component = component.getParent();
	}

	SubstanceColorScheme nonColorized = SubstanceCoreUtilities.getSkin(
			component).getActiveColorScheme(
			SubstanceLookAndFeel.getDecorationType(component));
	return getColorizedScheme(component, nonColorized, !componentState
			.isDisabled());
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:30,代码来源:SubstanceColorSchemeUtilities.java

示例9: installDefaults

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
@Override
protected void installDefaults() {
	super.installDefaults();

	// support for per-window skins
	SwingUtilities.invokeLater(new Runnable() {
		@Override
		public void run() {
			if (!SubstanceLookAndFeel.isCurrentLookAndFeel())
				return;
			if (textArea == null)
				return;
			Color foregr = textArea.getForeground();
			if ((foregr == null) || (foregr instanceof UIResource)) {
				textArea
						.setForeground(SubstanceColorUtilities
								.getForegroundColor(SubstanceLookAndFeel
										.getCurrentSkin(textArea)
										.getEnabledColorScheme(
												SubstanceLookAndFeel
														.getDecorationType(textArea))));
			}
		}
	});
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:26,代码来源:SubstanceTextAreaUI.java

示例10: addIcon

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
@Override
protected void addIcon(Container top) {
	Icon sideIcon = (optionPane == null ? null : optionPane.getIcon());

	if (sideIcon == null && optionPane != null)
		sideIcon = super.getIconForType(optionPane.getMessageType());

	if (sideIcon != null) {
		if (!SubstanceLookAndFeel.isToUseConstantThemesOnDialogs()) {
			sideIcon = SubstanceCoreUtilities.getThemedIcon(null, sideIcon);
		}

		this.substanceIconLabel = new OptionPaneLabel();
		this.iconGlowTracker = new IconGlowTracker(substanceIconLabel);
		this.substanceIconLabel.setIcon(new GlowingIcon(sideIcon,
				this.iconGlowTracker));

		this.substanceIconLabel.setName("OptionPane.iconLabel");
		this.substanceIconLabel.setVerticalAlignment(SwingConstants.TOP);
		top.add(this.substanceIconLabel, BorderLayout.BEFORE_LINE_BEGINS);
	}
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:23,代码来源:SubstanceOptionPaneUI.java

示例11: installDefaults

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
@Override
protected void installDefaults(final JScrollPane scrollpane) {
	super.installDefaults(scrollpane);
	if (SubstanceCoreUtilities.toDrawWatermark(scrollpane)
			&& (SubstanceLookAndFeel.getCurrentSkin(scrollpane)
					.getWatermark() != null)) {
		scrollpane.setOpaque(false);
		scrollpane.getViewport().setOpaque(false);
	}
	scrollpane.setLayout(new AdjustedLayout((ScrollPaneLayout) scrollpane
			.getLayout()));

	SwingUtilities.invokeLater(new Runnable() {
		public void run() {
			// System.out.println("Installing");
			installTableHeaderCornerFiller(scrollpane);
		}
	});
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:20,代码来源:SubstanceScrollPaneUI.java

示例12: installDefaults

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
@Override
protected void installDefaults() {
	super.installDefaults();

	// support for per-window skins
	SwingUtilities.invokeLater(new Runnable() {
		@Override
		public void run() {
			if (editorPane == null)
				return;
			Color foregr = editorPane.getForeground();
			if ((foregr == null) || (foregr instanceof UIResource)) {
				editorPane
						.setForeground(SubstanceColorUtilities
								.getForegroundColor(SubstanceLookAndFeel
										.getCurrentSkin(editorPane)
										.getEnabledColorScheme(
												SubstanceLookAndFeel
														.getDecorationType(editorPane))));
			}
		}
	});
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:24,代码来源:SubstanceEditorPaneUI.java

示例13: installUI

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
/**
 * Invokes supers implementation of <code>installUI</code> to install the
 * necessary state onto the passed in <code>JRootPane</code> to render the
 * metal look and feel implementation of <code>RootPaneUI</code>. If the
 * <code>windowDecorationStyle</code> property of the <code>JRootPane</code>
 * is other than <code>JRootPane.NONE</code>, this will add a custom
 * <code>Component</code> to render the widgets to <code>JRootPane</code>,
 * as well as installing a custom <code>Border</code> and
 * <code>LayoutManager</code> on the <code>JRootPane</code>.
 * 
 * @param c
 *            the JRootPane to install state onto
 */
@Override
public void installUI(JComponent c) {
	super.installUI(c);
	this.root = (JRootPane) c;
	int style = this.root.getWindowDecorationStyle();
	if (style != JRootPane.NONE) {
		this.installClientDecorations(this.root);
	}

	if (SubstanceCoreUtilities.isRootPaneModified(this.root)) {
		propagateModificationState();
	}

	if (this.root.getClientProperty(SubstanceLookAndFeel.SKIN_PROPERTY) instanceof SubstanceSkin) {
		rootPanesWithCustomSkin++;
	}
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:31,代码来源:SubstanceRootPaneUI.java

示例14: propagateModificationState

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
private void propagateModificationState() {
	JComponent titlePane = getTitlePane();
	if (titlePane instanceof SubstanceTitlePane) {
		((SubstanceTitlePane) titlePane)
				.getCloseButton()
				.putClientProperty(
						SubstanceLookAndFeel.WINDOW_MODIFIED,
						root
								.getClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED));
		return;
	}

	JInternalFrame jif = (JInternalFrame) SwingUtilities
			.getAncestorOfClass(JInternalFrame.class, this.root);
	if (jif != null) {
		SubstanceInternalFrameUI internalFrameUI = (SubstanceInternalFrameUI) jif
				.getUI();
		internalFrameUI.setWindowModified(Boolean.TRUE.equals(root
				.getClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED)));
	}
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:22,代码来源:SubstanceRootPaneUI.java

示例15: installDefaults

import org.pushingpixels.substance.api.SubstanceLookAndFeel; //导入依赖的package包/类
@Override
protected void installDefaults() {
	super.installDefaults();
	this.menuItem.setRolloverEnabled(true);
	// this.menuItem.setOpaque(false);

	this.arrowIcon = new MenuArrowIcon((JMenu) this.menuItem);

	this.defaultTextIconGap = SubstanceSizeUtils
			.getTextIconGap(SubstanceSizeUtils
					.getComponentFontSize(this.menuItem));

	this.menuItem.putClientProperty(SubstanceLookAndFeel.FLAT_PROPERTY,
			Boolean.TRUE);

	LookAndFeel.installProperty(menuItem, "opaque", Boolean.FALSE);
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:18,代码来源:SubstanceMenuUI.java


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