javax.swing.LookAndFeel#installProperty ( )源码实例Demo

下面列出了javax.swing.LookAndFeel#installProperty ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: FlatLaf   文件: FlatTreeUI.java
@Override
protected void installDefaults() {
	super.installDefaults();

	LookAndFeel.installBorder( tree, "Tree.border" );

	selectionBackground = UIManager.getColor( "Tree.selectionBackground" );
	selectionForeground = UIManager.getColor( "Tree.selectionForeground" );
	selectionInactiveBackground = UIManager.getColor( "Tree.selectionInactiveBackground" );
	selectionInactiveForeground = UIManager.getColor( "Tree.selectionInactiveForeground" );
	selectionBorderColor = UIManager.getColor( "Tree.selectionBorderColor" );
	wideSelection = UIManager.getBoolean( "Tree.wideSelection" );
	showCellFocusIndicator = UIManager.getBoolean( "Tree.showCellFocusIndicator" );

	// scale
	int rowHeight = FlatUIUtils.getUIInt( "Tree.rowHeight", 16 );
	if( rowHeight > 0 )
		LookAndFeel.installProperty( tree, "rowHeight", UIScale.scale( rowHeight ) );
	setLeftChildIndent( UIScale.scale( getLeftChildIndent() ) );
	setRightChildIndent( UIScale.scale( getRightChildIndent() ) );
}
 
源代码2 项目: beautyeye   文件: BEButtonUI.java
protected void installDefaults(AbstractButton b) {
		super.installDefaults(b);
		b.setOpaque(false);
		
		if(!defaults_initialized) {
			String pp = getPropertyPrefix();
			dashedRectGapX = UIManager.getInt(pp + "dashedRectGapX");
			dashedRectGapY = UIManager.getInt(pp + "dashedRectGapY");
			dashedRectGapWidth = UIManager.getInt(pp + "dashedRectGapWidth");
			dashedRectGapHeight = UIManager.getInt(pp + "dashedRectGapHeight");
			focusColor = UIManager.getColor(pp + "focus");
			defaults_initialized = true;
		}

//		BEXPStyle xp = BEXPStyle.getXP();
//		if (xp != null) 
		{
			b.setBorder(new XPEmptyBorder(new Insets(3,3,3,3)));//xp.getBorder(b, getXPButtonType(b)));
			LookAndFeel.installProperty(b, "rolloverEnabled", Boolean.TRUE);
		}
	}
 
源代码3 项目: seaglass   文件: SeaGlassScrollPaneUI.java
protected void installDefaults(JScrollPane scrollpane) {
    LookAndFeel.installBorder(scrollpane, "ScrollPane.border");
    LookAndFeel.installColorsAndFont(scrollpane, "ScrollPane.background", "ScrollPane.foreground", "ScrollPane.font");

    Border vpBorder = scrollpane.getViewportBorder();
    if ((vpBorder == null) || (vpBorder instanceof UIResource)) {
        vpBorder = UIManager.getBorder("ScrollPane.viewportBorder");
        scrollpane.setViewportBorder(vpBorder);
    }

    Object obj = UIManager.get("ScrollPane.cornerPainter");
    if (obj != null && obj instanceof SeaGlassPainter) {
        cornerPainter = (SeaGlassPainter) obj;
    }

    LookAndFeel.installProperty(scrollpane, "opaque", Boolean.TRUE);
    updateStyle(scrollpane);
}
 
源代码4 项目: littleluck   文件: LuckViewportUI.java
protected void installDefaults(JComponent c)
{
    LookAndFeel.installColorsAndFont(c, "Viewport.background",
            "Viewport.foreground", "Viewport.font");

    LookAndFeel.installProperty(c, "opaque", Boolean.FALSE);
}
 
源代码5 项目: littleluck   文件: LuckInternalFrameUI.java
@Override
public void installUI(JComponent c)
{
    super.installUI(c);

    LookAndFeel.installProperty(frame, "opaque", Boolean.FALSE);
}
 
源代码6 项目: netbeans   文件: FlatSlidingButtonUI.java
@Override
protected void installDefaults(AbstractButton b) {
    super.installDefaults(b);

    if(!defaults_initialized) {
        hoverBackground = UIManager.getColor("SlidingButton.hoverBackground");
        selectedBackground = UIManager.getColor("SlidingButton.selectedBackground");
        attentionBackground = UIManager.getColor("SlidingButton.attentionBackground");
        attentionForeground = UIManager.getColor("SlidingButton.attentionForeground");
        defaults_initialized = true;
    }

    LookAndFeel.installProperty(b, "opaque", false);
}
 
源代码7 项目: FlatLaf   文件: FlatUIUtils.java
public static boolean hasOpaqueBeenExplicitlySet( JComponent c ) {
	boolean oldOpaque = c.isOpaque();
	LookAndFeel.installProperty( c, "opaque", !oldOpaque );
	boolean explicitlySet = c.isOpaque() == oldOpaque;
	LookAndFeel.installProperty( c, "opaque", oldOpaque );
	return explicitlySet;
}
 
源代码8 项目: FlatLaf   文件: FlatScrollPaneUI.java
@Override
public void installUI( JComponent c ) {
	super.installUI( c );

	int focusWidth = UIManager.getInt( "Component.focusWidth" );
	LookAndFeel.installProperty( c, "opaque", focusWidth == 0 );

	MigLayoutVisualPadding.install( scrollpane );
}
 
源代码9 项目: FlatLaf   文件: FlatTableUI.java
@Override
protected void installDefaults() {
	super.installDefaults();

	showHorizontalLines = UIManager.getBoolean( "Table.showHorizontalLines" );
	showVerticalLines = UIManager.getBoolean( "Table.showVerticalLines" );
	intercellSpacing = UIManager.getDimension( "Table.intercellSpacing" );

	selectionBackground = UIManager.getColor( "Table.selectionBackground" );
	selectionForeground = UIManager.getColor( "Table.selectionForeground" );
	selectionInactiveBackground = UIManager.getColor( "Table.selectionInactiveBackground" );
	selectionInactiveForeground = UIManager.getColor( "Table.selectionInactiveForeground" );

	toggleSelectionColors();

	int rowHeight = FlatUIUtils.getUIInt( "Table.rowHeight", 16 );
	if( rowHeight > 0 )
		LookAndFeel.installProperty( table, "rowHeight", UIScale.scale( rowHeight ) );

	if( !showHorizontalLines ) {
		oldShowHorizontalLines = table.getShowHorizontalLines();
		table.setShowHorizontalLines( false );
	}
	if( !showVerticalLines ) {
		oldShowVerticalLines = table.getShowVerticalLines();
		table.setShowVerticalLines( false );
	}

	if( intercellSpacing != null ) {
		oldIntercellSpacing = table.getIntercellSpacing();
		table.setIntercellSpacing( intercellSpacing );
	}

	// checkbox is non-opaque in FlatLaf and therefore would not paint selection
	// --> make checkbox renderer opaque (but opaque in Metal or Windows LaF)
	TableCellRenderer booleanRenderer = table.getDefaultRenderer( Boolean.class );
	if( booleanRenderer instanceof JCheckBox )
		((JCheckBox)booleanRenderer).setOpaque( true );
}
 
源代码10 项目: FlatLaf   文件: FlatRadioButtonMenuItemUI.java
@Override
protected void installDefaults() {
	super.installDefaults();

	LookAndFeel.installProperty( menuItem, "iconTextGap", FlatUIUtils.getUIInt( "MenuItem.iconTextGap", 4 ) );

	renderer = createRenderer();
}
 
源代码11 项目: FlatLaf   文件: FlatTextFieldUI.java
@Override
protected void installDefaults() {
	super.installDefaults();

	String prefix = getPropertyPrefix();
	minimumWidth = UIManager.getInt( "Component.minimumWidth" );
	isIntelliJTheme = UIManager.getBoolean( "Component.isIntelliJTheme" );
	placeholderForeground = UIManager.getColor( prefix + ".placeholderForeground" );

	LookAndFeel.installProperty( getComponent(), "opaque", false );

	MigLayoutVisualPadding.install( getComponent() );
}
 
源代码12 项目: JDKSourceCode1.8   文件: SynthTreeUI.java
private void updateStyle(JTree tree) {
    SynthContext context = getContext(tree, ENABLED);
    SynthStyle oldStyle = style;

    style = SynthLookAndFeel.updateStyle(context, this);
    if (style != oldStyle) {
        Object value;

        setExpandedIcon(style.getIcon(context, "Tree.expandedIcon"));
        setCollapsedIcon(style.getIcon(context, "Tree.collapsedIcon"));

        setLeftChildIndent(style.getInt(context, "Tree.leftChildIndent",
                                        0));
        setRightChildIndent(style.getInt(context, "Tree.rightChildIndent",
                                         0));

        drawHorizontalLines = style.getBoolean(
                      context, "Tree.drawHorizontalLines",true);
        drawVerticalLines = style.getBoolean(
                    context, "Tree.drawVerticalLines", true);
        linesStyle = style.get(context, "Tree.linesStyle");

            value = style.get(context, "Tree.rowHeight");
            if (value != null) {
                LookAndFeel.installProperty(tree, "rowHeight", value);
            }

            value = style.get(context, "Tree.scrollsOnExpand");
            LookAndFeel.installProperty(tree, "scrollsOnExpand",
                                                value != null? value : Boolean.TRUE);

        padding = style.getInt(context, "Tree.padding", 0);

        largeModel = (tree.isLargeModel() && tree.getRowHeight() > 0);

        useTreeColors = style.getBoolean(context,
                              "Tree.rendererUseTreeColors", true);

        Boolean showsRootHandles = style.getBoolean(
                context, "Tree.showsRootHandles", Boolean.TRUE);
        LookAndFeel.installProperty(
                tree, JTree.SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles);

        if (oldStyle != null) {
            uninstallKeyboardActions();
            installKeyboardActions();
        }
    }
    context.dispose();

    context = getContext(tree, Region.TREE_CELL, ENABLED);
    cellStyle = SynthLookAndFeel.updateStyle(context, this);
    context.dispose();
}
 
源代码13 项目: seaglass   文件: SeaGlassTreeUI.java
private void updateStyle(JTree tree) {
    SeaGlassContext context = getContext(tree, ENABLED);
    SynthStyle oldStyle = style;

    style = SeaGlassLookAndFeel.updateStyle(context, this);
    if (style != oldStyle) {
        Object value;

        setExpandedIcon(style.getIcon(context, "Tree.expandedIcon"));
        setCollapsedIcon(style.getIcon(context, "Tree.collapsedIcon"));

        setLeftChildIndent(style.getInt(context, "Tree.leftChildIndent", 0));
        setRightChildIndent(style.getInt(context, "Tree.rightChildIndent", 0));

        drawHorizontalLines = style.getBoolean(context, "Tree.drawHorizontalLines", true);
        drawVerticalLines = style.getBoolean(context, "Tree.drawVerticalLines", true);
        linesStyle = style.get(context, "Tree.linesStyle");

        value = style.get(context, "Tree.rowHeight");
        if (value != null) {
            LookAndFeel.installProperty(tree, "rowHeight", value);
        }

        value = style.get(context, "Tree.scrollsOnExpand");
        LookAndFeel.installProperty(tree, "scrollsOnExpand", value != null ? value : Boolean.TRUE);

        padding = style.getInt(context, "Tree.padding", 0);

        largeModel = (tree.isLargeModel() && tree.getRowHeight() > 0);

        useTreeColors = style.getBoolean(context, "Tree.rendererUseTreeColors", true);

        Boolean showsRootHandles = style.getBoolean(context, "Tree.showsRootHandles", Boolean.TRUE);
        LookAndFeel.installProperty(tree, JTree.SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles);

        if (oldStyle != null) {
            uninstallKeyboardActions();
            installKeyboardActions();
        }
    }
    context.dispose();

    context = getContext(tree, Region.TREE_CELL, ENABLED);
    cellStyle = SeaGlassLookAndFeel.updateStyle(context, this);
    context.dispose();
}
 
源代码14 项目: littleluck   文件: LuckMenuBarUI.java
public void installUI(JComponent c)
{
    super.installUI(c);

    LookAndFeel.installProperty(menuBar, "opaque", Boolean.FALSE);
}
 
源代码15 项目: littleluck   文件: LuckOptionPaneUI.java
protected void installDefaults()
{
    super.installDefaults();

    LookAndFeel.installProperty(optionPane, "opaque", Boolean.FALSE);
}
 
源代码16 项目: openjdk-jdk8u   文件: SynthTreeUI.java
private void updateStyle(JTree tree) {
    SynthContext context = getContext(tree, ENABLED);
    SynthStyle oldStyle = style;

    style = SynthLookAndFeel.updateStyle(context, this);
    if (style != oldStyle) {
        Object value;

        setExpandedIcon(style.getIcon(context, "Tree.expandedIcon"));
        setCollapsedIcon(style.getIcon(context, "Tree.collapsedIcon"));

        setLeftChildIndent(style.getInt(context, "Tree.leftChildIndent",
                                        0));
        setRightChildIndent(style.getInt(context, "Tree.rightChildIndent",
                                         0));

        drawHorizontalLines = style.getBoolean(
                      context, "Tree.drawHorizontalLines",true);
        drawVerticalLines = style.getBoolean(
                    context, "Tree.drawVerticalLines", true);
        linesStyle = style.get(context, "Tree.linesStyle");

            value = style.get(context, "Tree.rowHeight");
            if (value != null) {
                LookAndFeel.installProperty(tree, "rowHeight", value);
            }

            value = style.get(context, "Tree.scrollsOnExpand");
            LookAndFeel.installProperty(tree, "scrollsOnExpand",
                                                value != null? value : Boolean.TRUE);

        padding = style.getInt(context, "Tree.padding", 0);

        largeModel = (tree.isLargeModel() && tree.getRowHeight() > 0);

        useTreeColors = style.getBoolean(context,
                              "Tree.rendererUseTreeColors", true);

        Boolean showsRootHandles = style.getBoolean(
                context, "Tree.showsRootHandles", Boolean.TRUE);
        LookAndFeel.installProperty(
                tree, JTree.SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles);

        if (oldStyle != null) {
            uninstallKeyboardActions();
            installKeyboardActions();
        }
    }
    context.dispose();

    context = getContext(tree, Region.TREE_CELL, ENABLED);
    cellStyle = SynthLookAndFeel.updateStyle(context, this);
    context.dispose();
}
 
源代码17 项目: openjdk-jdk9   文件: SynthTreeUI.java
private void updateStyle(JTree tree) {
    SynthContext context = getContext(tree, ENABLED);
    SynthStyle oldStyle = style;

    style = SynthLookAndFeel.updateStyle(context, this);
    if (style != oldStyle) {
        Object value;

        setExpandedIcon(style.getIcon(context, "Tree.expandedIcon"));
        setCollapsedIcon(style.getIcon(context, "Tree.collapsedIcon"));

        setLeftChildIndent(style.getInt(context, "Tree.leftChildIndent",
                                        0));
        setRightChildIndent(style.getInt(context, "Tree.rightChildIndent",
                                         0));

        drawHorizontalLines = style.getBoolean(
                      context, "Tree.drawHorizontalLines",true);
        drawVerticalLines = style.getBoolean(
                    context, "Tree.drawVerticalLines", true);
        linesStyle = style.get(context, "Tree.linesStyle");

            value = style.get(context, "Tree.rowHeight");
            if (value != null) {
                LookAndFeel.installProperty(tree, "rowHeight", value);
            }

            value = style.get(context, "Tree.scrollsOnExpand");
            LookAndFeel.installProperty(tree, "scrollsOnExpand",
                                                value != null? value : Boolean.TRUE);

        padding = style.getInt(context, "Tree.padding", 0);

        largeModel = (tree.isLargeModel() && tree.getRowHeight() > 0);

        useTreeColors = style.getBoolean(context,
                              "Tree.rendererUseTreeColors", true);

        Boolean showsRootHandles = style.getBoolean(
                context, "Tree.showsRootHandles", Boolean.TRUE);
        LookAndFeel.installProperty(
                tree, JTree.SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles);

        if (oldStyle != null) {
            uninstallKeyboardActions();
            installKeyboardActions();
        }
    }

    context = getContext(tree, Region.TREE_CELL, ENABLED);
    cellStyle = SynthLookAndFeel.updateStyle(context, this);
}
 
源代码18 项目: seaglass   文件: SeaGlassSplitPaneUI.java
private void updateStyle(JSplitPane splitPane) {
    SeaGlassContext context = getContext(splitPane, Region.SPLIT_PANE_DIVIDER, ENABLED);
    SynthStyle oldDividerStyle = dividerStyle;
    dividerStyle = SeaGlassLookAndFeel.updateStyle(context, this);
    context.dispose();

    context = getContext(splitPane, ENABLED);
    SynthStyle oldStyle = style;

    style = SeaGlassLookAndFeel.updateStyle(context, this);

    if (style != oldStyle) {
        Object value = style.get(context, "SplitPane.size");
        if (value == null) {
            value = new Integer(6);
        }
        LookAndFeel.installProperty(splitPane, "dividerSize", value);

        value = style.get(context, "SplitPane.oneTouchExpandable");
        if (value != null) {
            LookAndFeel.installProperty(splitPane, "oneTouchExpandable", value);
        }

        if (divider != null) {
            splitPane.remove(divider);
            divider.setDividerSize(splitPane.getDividerSize());
        }
        if (oldStyle != null) {
            uninstallKeyboardActions();
            installKeyboardActions();
        }
    }
    if (style != oldStyle || dividerStyle != oldDividerStyle) {
        // Only way to force BasicSplitPaneDivider to reread the
        // necessary properties.
        if (divider != null) {
            splitPane.remove(divider);
        }
        divider = createDefaultDivider();
        divider.setBasicSplitPaneUI(this);
        splitPane.add(divider, JSplitPane.DIVIDER);
    }
    context.dispose();
}
 
源代码19 项目: littleluck   文件: LuckScrollBarUI.java
protected void installDefaults()
{
    super.installDefaults();

    LookAndFeel.installProperty(scrollbar, "opaque", Boolean.FALSE);
}
 
源代码20 项目: beautyeye   文件: BEToggleButtonUI.java
protected void installDefaults(AbstractButton b) {
	super.installDefaults(b);
	LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
}