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