當前位置: 首頁>>代碼示例>>Java>>正文


Java LookAndFeel.installProperty方法代碼示例

本文整理匯總了Java中javax.swing.LookAndFeel.installProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java LookAndFeel.installProperty方法的具體用法?Java LookAndFeel.installProperty怎麽用?Java LookAndFeel.installProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.LookAndFeel的用法示例。


在下文中一共展示了LookAndFeel.installProperty方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
protected void installDefaults(final PRoPanel pp) {

        LookAndFeel.installColorsAndFont(
                pp, "Panel.background",
                "Panel.foreground", "Panel.font"
        );
        LookAndFeel.installBorder(pp, "Panel.border");
        LookAndFeel.installProperty(pp, "opaque", Boolean.TRUE);
    }
 
開發者ID:Naoghuman,項目名稱:typewriter,代碼行數:10,代碼來源:PRoPanel.java

示例2: installUI

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
@Override
public void installUI(JComponent c)
{
    super.installUI(c);

    LookAndFeel.installProperty(frame, "opaque", Boolean.FALSE);
}
 
開發者ID:freeseawind,項目名稱:littleluck,代碼行數:8,代碼來源:LuckInternalFrameUI.java

示例3: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
protected void installDefaults() {
  LookAndFeel.installColorsAndFont(tipPane, "Category.background",
    "Category.foreground", "Category.font");
  LookAndFeel.installBorder(tipPane, "Category.border");
  LookAndFeel.installProperty(tipPane, "opaque", Boolean.TRUE);
  tipFont = UIManager.getFont("Category.tipFont");
}
 
開發者ID:teddyted,項目名稱:iSeleda,代碼行數:8,代碼來源:BasicCategoryUI.java

示例4: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
protected void installDefaults() {
  LookAndFeel.installColorsAndFont(tipPane, "TipOfTheDay.background",
    "TipOfTheDay.foreground", "TipOfTheDay.font");
  LookAndFeel.installBorder(tipPane, "TipOfTheDay.border");
  LookAndFeel.installProperty(tipPane, "opaque", Boolean.TRUE);
  tipFont = UIManager.getFont("TipOfTheDay.tipFont");
}
 
開發者ID:teddyted,項目名稱:iSeleda,代碼行數:8,代碼來源:BasicTipOfTheDayUI.java

示例5: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
/**
 * Installs the default settings.
 *
 * @param b  the button (<code>null</code> not permitted).
 */
protected void installDefaults(AbstractButton b)
{
  String prefix = getPropertyPrefix();
  // Install colors and font.
  LookAndFeel.installColorsAndFont(b, prefix + "background",
                                   prefix + "foreground", prefix + "font");
  // Install border.
  LookAndFeel.installBorder(b, prefix + "border");

  // Install margin property.
  if (b.getMargin() == null || b.getMargin() instanceof UIResource)
    b.setMargin(UIManager.getInsets(prefix + "margin"));

  // Install rollover property.
  Object rollover = UIManager.get(prefix + "rollover");
  if (rollover != null)
    LookAndFeel.installProperty(b, "rolloverEnabled", rollover);

  // Fetch default textShiftOffset.
  defaultTextShiftOffset = UIManager.getInt(prefix + "textShiftOffset");

  // Make button opaque if needed.
  if (b.isContentAreaFilled())
    LookAndFeel.installProperty(b, "opaque", Boolean.TRUE);
  else
    LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:33,代碼來源:BasicButtonUI.java

示例6: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
protected void installDefaults(JComponent c)
{
    LookAndFeel.installColorsAndFont(c, "Viewport.background",
            "Viewport.foreground", "Viewport.font");

    LookAndFeel.installProperty(c, "opaque", Boolean.FALSE);
}
 
開發者ID:freeseawind,項目名稱:littleluck,代碼行數:8,代碼來源:LuckViewportUI.java

示例7: installUI

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
@Override
public void installUI(JComponent c)
{
    super.installUI(c);

    LookAndFeel.installProperty(c, "opaque", Boolean.FALSE);

    if(c.getBorder() instanceof LuckShapeBorder)
    {
        installFocusListener(c);
    }
}
 
開發者ID:freeseawind,項目名稱:littleluck,代碼行數:13,代碼來源:LuckComboBoxUI.java

示例8: updateStyle

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
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();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:55,代碼來源:SynthTreeUI.java

示例9: updateStyle

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
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);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:53,代碼來源:SynthTreeUI.java

示例10: updateStyle

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
private void updateStyle(JTable c) {
        SynthContext context = getContext(c, ENABLED);
        SynthStyle oldStyle = style;
        style = SynthLookAndFeel.updateStyle(context, this);
        if (style != oldStyle) {
            context.setComponentState(ENABLED | SELECTED);

            Color sbg = table.getSelectionBackground();
            if (sbg == null || sbg instanceof UIResource) {
                table.setSelectionBackground(style.getColor(
                                        context, ColorType.TEXT_BACKGROUND));
            }

            Color sfg = table.getSelectionForeground();
            if (sfg == null || sfg instanceof UIResource) {
                table.setSelectionForeground(style.getColor(
                                  context, ColorType.TEXT_FOREGROUND));
            }

            context.setComponentState(ENABLED);

            Color gridColor = table.getGridColor();
            if (gridColor == null || gridColor instanceof UIResource) {
                gridColor = (Color)style.get(context, "Table.gridColor");
                if (gridColor == null) {
                    gridColor = style.getColor(context, ColorType.FOREGROUND);
                }
                table.setGridColor(gridColor == null ? new ColorUIResource(Color.GRAY) : gridColor);
            }

            useTableColors = style.getBoolean(context,
                                  "Table.rendererUseTableColors", true);
            useUIBorder = style.getBoolean(context,
                                  "Table.rendererUseUIBorder", true);

            Object rowHeight = style.get(context, "Table.rowHeight");
            if (rowHeight != null) {
                LookAndFeel.installProperty(table, "rowHeight", rowHeight);
            }
            boolean showGrid = style.getBoolean(context, "Table.showGrid", true);
            if (!showGrid) {
                table.setShowGrid(false);
            }
            Dimension d = table.getIntercellSpacing();
//            if (d == null || d instanceof UIResource) {
            if (d != null) {
                d = (Dimension)style.get(context, "Table.intercellSpacing");
            }
            alternateColor = (Color)style.get(context, "Table.alternateRowColor");
            if (d != null) {
                table.setIntercellSpacing(d);
            }


            if (oldStyle != null) {
                uninstallKeyboardActions();
                installKeyboardActions();
            }
        }
    }
 
開發者ID:campolake,項目名稱:openjdk9,代碼行數:61,代碼來源:SynthTableUI.java

示例11: updateStyle

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
private void updateStyle(JTable c) {
        SynthContext context = getContext(c, ENABLED);
        SynthStyle oldStyle = style;
        style = SynthLookAndFeel.updateStyle(context, this);
        if (style != oldStyle) {
            context.setComponentState(ENABLED | SELECTED);

            Color sbg = table.getSelectionBackground();
            if (sbg == null || sbg instanceof UIResource) {
                table.setSelectionBackground(style.getColor(
                                        context, ColorType.TEXT_BACKGROUND));
            }

            Color sfg = table.getSelectionForeground();
            if (sfg == null || sfg instanceof UIResource) {
                table.setSelectionForeground(style.getColor(
                                  context, ColorType.TEXT_FOREGROUND));
            }

            context.setComponentState(ENABLED);

            Color gridColor = table.getGridColor();
            if (gridColor == null || gridColor instanceof UIResource) {
                gridColor = (Color)style.get(context, "Table.gridColor");
                if (gridColor == null) {
                    gridColor = style.getColor(context, ColorType.FOREGROUND);
                }
                table.setGridColor(gridColor == null ? new ColorUIResource(Color.GRAY) : gridColor);
            }

            useTableColors = style.getBoolean(context,
                                  "Table.rendererUseTableColors", true);
            useUIBorder = style.getBoolean(context,
                                  "Table.rendererUseUIBorder", true);

            Object rowHeight = style.get(context, "Table.rowHeight");
            if (rowHeight != null) {
                LookAndFeel.installProperty(table, "rowHeight", rowHeight);
            }
            boolean showGrid = style.getBoolean(context, "Table.showGrid", true);
            if (!showGrid) {
                table.setShowGrid(false);
            }
            Dimension d = table.getIntercellSpacing();
//            if (d == null || d instanceof UIResource) {
            if (d != null) {
                d = (Dimension)style.get(context, "Table.intercellSpacing");
            }
            alternateColor = (Color)style.get(context, "Table.alternateRowColor");
            if (d != null) {
                table.setIntercellSpacing(d);
            }


            if (oldStyle != null) {
                uninstallKeyboardActions();
                installKeyboardActions();
            }
        }
        context.dispose();
    }
 
開發者ID:Java8-CNAPI-Team,項目名稱:Java8CN,代碼行數:62,代碼來源:SynthTableUI.java

示例12: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
protected void installDefaults()
{
    super.installDefaults();

    LookAndFeel.installProperty(tree, "opaque", Boolean.FALSE);
}
 
開發者ID:freeseawind,項目名稱:littleluck,代碼行數:7,代碼來源:LuckTreeUI.java

示例13: installUI

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
public void installUI( JComponent c )
{
    super.installUI(c);

    LookAndFeel.installProperty(c, "opaque", Boolean.FALSE);
}
 
開發者ID:freeseawind,項目名稱:littleluck,代碼行數:7,代碼來源:LuckToolBarUI.java

示例14: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
public void installDefaults()
{
    super.installDefaults();

    LookAndFeel.installProperty(popupMenu, "opaque", Boolean.FALSE);
}
 
開發者ID:freeseawind,項目名稱:littleluck,代碼行數:7,代碼來源:LuckPopupMenuUI.java

示例15: installUI

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
public void installUI(JComponent c)
{
    super.installUI(c);

    LookAndFeel.installProperty(menuBar, "opaque", Boolean.FALSE);
}
 
開發者ID:freeseawind,項目名稱:littleluck,代碼行數:7,代碼來源:LuckMenuBarUI.java


注:本文中的javax.swing.LookAndFeel.installProperty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。