Java Code Examples for javax.swing.plaf.BorderUIResource

The following examples show how to use javax.swing.plaf.BorderUIResource. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public void addCustomEntriesToTable(UIDefaults table) {

    Border blackLineBorder =
            new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder =
            new BorderUIResource(new LineBorder(getWhite()));

    Object textBorder = new BorderUIResource(new CompoundBorder(
            blackLineBorder,
            new BasicBorders.MarginBorder()));

    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());

    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);


}
 
Example 2
Source Project: material-ui-swing   Source File: MaterialOceanicTheme.java    License: MIT License 6 votes vote down vote up
@Override
protected void installBorders() {
    super.installBorders();
    borderMenuBar = new BorderUIResource(new DropShadowBorder(Color.DARK_GRAY, 10, 4, 0.3f, 12,
            false, false, true, false));
    //borderMenuBar = new BorderUIResource(BorderFactory.createLineBorder(this.menuBackground, 1));;
    borderPopupMenu = MaterialBorders.OCEAN_LINE_BORDER;
    borderSpinner = new BorderUIResource(BorderFactory.createLineBorder(backgroundTextField));
    borderSlider = new BorderUIResource(BorderFactory.createCompoundBorder(MaterialBorders.DARK_LINE_BORDER, BorderFactory.createEmptyBorder(15, 15, 15, 15)));
    cellBorderTableHeader = new BorderUIResource(BorderFactory.createCompoundBorder(
            MaterialBorders.DARK_LINE_BORDER,
            BorderFactory.createEmptyBorder(5, 5, 5, 5)));
    borderToolBar = MaterialBorders.OCEAN_LINE_BORDER;

    borderDialogRootPane = MaterialBorders.OCEAN_LINE_BORDER;

    borderProgressBar = MaterialBorders.OCEAN_LINE_BORDER;

    this.borderComboBox = MaterialBorders.roundedLineColorBorder(MaterialColors.WHITE, 12);
    this.borderTable = MaterialBorders.OCEAN_LINE_BORDER;
    this.borderTableHeader = MaterialBorders.OCEAN_LINE_BORDER;

    super.borderTitledBorder = new BorderUIResource(BorderFactory.createLineBorder(MaterialColors.WHITE));
}
 
Example 3
Source Project: jdk8u60   Source File: ContrastMetalTheme.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void addCustomEntriesToTable(UIDefaults table) {

    Border blackLineBorder =
            new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder =
            new BorderUIResource(new LineBorder(getWhite()));

    Object textBorder = new BorderUIResource(new CompoundBorder(
            blackLineBorder,
            new BasicBorders.MarginBorder()));

    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());

    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);


}
 
Example 4
Source Project: jdk8u-jdk   Source File: ContrastMetalTheme.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void addCustomEntriesToTable(UIDefaults table) {

    Border blackLineBorder =
            new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder =
            new BorderUIResource(new LineBorder(getWhite()));

    Object textBorder = new BorderUIResource(new CompoundBorder(
            blackLineBorder,
            new BasicBorders.MarginBorder()));

    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());

    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);


}
 
Example 5
private void updateComboBoxBorder() {
    Border b = this.comboBox.getBorder();
    if (b == null || b instanceof UIResource) {
        int comboFontSize = SubstanceSizeUtils.getComponentFontSize(this.comboBox);
        Insets comboBorderInsets = SubstanceSizeUtils.getComboBorderInsets(comboFontSize);
        if (this.comboBox.isEditable()) {
            SubstanceTextComponentBorder border = new SubstanceTextComponentBorder(
                    comboBorderInsets);
            this.comboBox.setBorder(border);
        } else {
            this.comboBox
                    .setBorder(new BorderUIResource.EmptyBorderUIResource(comboBorderInsets));
            // BasicComboBoxUI does not invalidate display size when
            // combo becomes uneditable. However, this is not good
            // in Substance which has different preferred size for
            // editable and uneditable combos. Calling the method below
            // will trigger the path in BasicComboBoxUI.Handler that
            // will invalidate the cached sizes.
            this.comboBox.setPrototypeDisplayValue(this.comboBox.getPrototypeDisplayValue());
        }
        this.layoutInsets = SubstanceSizeUtils.getComboLayoutInsets(comboFontSize);
    } else {
        this.layoutInsets = new Insets(0, 0, 0, 0);
    }
}
 
Example 6
Source Project: beautyeye   Source File: __UI__.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Ui impl.
 */
public static void uiImpl()
{
	UIManager.put("SplitPane.shadow",new ColorUIResource(new Color(200,200,200)));// 本属性在BE LNF中暂时没用到
	//JSplitePane的默认背景色
	UIManager.put("SplitPane.background",new ColorUIResource(new Color(250,250,250)));//238,241,243)));
	//JSplitePane的边框实现
	UIManager.put("SplitPane.border",new BorderUIResource(new org.jb2011.lnf.beautyeye.ch4_scroll.ScrollPaneBorder()));//BorderFactory.createEmptyBorder(0, 0, 0, 0)));
	UIManager.put("SplitPaneUI",org.jb2011.lnf.beautyeye.ch17_split.BESplitPaneUI.class.getName());
	
	//分隔条拖动时的颜色(说明:此值可以设置alpha通道以便达到半透明效果哦)
	UIManager.put("SplitPaneDivider.draggingColor",new ColorUIResource(new Color(0,0,0,50)));
	//触碰按钮的默认大小
	UIManager.put("SplitPane.oneTouchButtonSize",4);//drfault is 5
	//分隔条的默认大小
	UIManager.put("SplitPane.dividerSize",7);//drfault is 5
	//分隔条的边框实现
	UIManager.put("SplitPaneDivider.border",new SplitPaneDividerBorder());
}
 
Example 7
@Override
public void addCustomEntriesToTable(UIDefaults table) {

    Border blackLineBorder =
            new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder =
            new BorderUIResource(new LineBorder(getWhite()));

    Object textBorder = new BorderUIResource(new CompoundBorder(
            blackLineBorder,
            new BasicBorders.MarginBorder()));

    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());

    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);


}
 
Example 8
Source Project: hottub   Source File: ContrastMetalTheme.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void addCustomEntriesToTable(UIDefaults table) {

    Border blackLineBorder =
            new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder =
            new BorderUIResource(new LineBorder(getWhite()));

    Object textBorder = new BorderUIResource(new CompoundBorder(
            blackLineBorder,
            new BasicBorders.MarginBorder()));

    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());

    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);


}
 
Example 9
protected void addWindowsDefaults(LookAndFeelAddons addon, List defaults) {
  super.addWindowsDefaults(addon, defaults);

  defaults.add(JTipOfTheDay.uiClassID);
  defaults.add(WindowsTipOfTheDayUI.class.getName());

  defaults.add("TipOfTheDay.background");
  defaults.add(new ColorUIResource(128, 128, 128));

  defaults.add("TipOfTheDay.font");
  defaults.add(UIManager.getFont("Label.font").deriveFont(13f));

  defaults.add("TipOfTheDay.icon");
  defaults.add(LookAndFeel.makeIcon(WindowsTipOfTheDayUI.class,
    "tipoftheday.png"));

  defaults.add("TipOfTheDay.border");
  defaults
    .add(new BorderUIResource(new WindowsTipOfTheDayUI.TipAreaBorder()));

  addResource(defaults,
    "com.l2fprod.common.swing.plaf.windows.resources.TipOfTheDay");
}
 
Example 10
protected void installDefaults() {
  Border b = bar.getBorder();
  if (b == null || b instanceof UIResource) {
    bar.setBorder(
      new BorderUIResource(
        new CompoundBorder(
          BorderFactory.createEtchedBorder(),
          BorderFactory.createEmptyBorder(2, 2, 2, 2))));
  }

  if (bar.getBackground() == null
    || bar.getBackground() instanceof UIResource) {
    bar.setBackground(new ColorUIResource(128, 128, 128));
    bar.setOpaque(true);
  }
}
 
Example 11
Source Project: jdk8u_jdk   Source File: ContrastMetalTheme.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void addCustomEntriesToTable(UIDefaults table) {

    Border blackLineBorder =
            new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder =
            new BorderUIResource(new LineBorder(getWhite()));

    Object textBorder = new BorderUIResource(new CompoundBorder(
            blackLineBorder,
            new BasicBorders.MarginBorder()));

    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());

    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);


}
 
Example 12
@Override
public void addCustomEntriesToTable(UIDefaults table) {

    Border blackLineBorder =
            new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder =
            new BorderUIResource(new LineBorder(getWhite()));

    Object textBorder = new BorderUIResource(new CompoundBorder(
            blackLineBorder,
            new BasicBorders.MarginBorder()));

    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());

    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);


}
 
Example 13
protected void updateBorder() {
    Border currBorder = this.commandButton.getBorder();
    if ((currBorder == null) || (currBorder instanceof UIResource)) {
        int tb = (int) (this.commandButton.getVGapScaleFactor() * 4);
        int lr = (int) (this.commandButton.getHGapScaleFactor() * 6);
        this.commandButton
                .setBorder(new BorderUIResource.EmptyBorderUIResource(tb, lr, tb, lr));
    }
}
 
Example 14
Source Project: beautyeye   Source File: __UI__.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Ui impl.
 */
public static void uiImpl()
{
	UIManager.put("Spinner.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
	UIManager.put("Spinner.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
	UIManager.put("SpinnerUI", org.jb2011.lnf.beautyeye.ch18_spinner.BESpinnerUI.class.getName());
	
	//Spinner组件的边框
	UIManager.put("Spinner.border", new BorderUIResource(new EmptyBorder(5, 5, 10, 5)));//windows lnf中默认是3, 3, 3, 3
	//Spinner组件的2个箭头按钮的内衬距
	UIManager.put("Spinner.arrowButtonInsets", new InsetsUIResource(1,0,2,2));//windows lnf中默认是1,1,1,1
	//Spinner组件的2个箭头按钮的默认大小
	UIManager.put("Spinner.arrowButtonSize",new Dimension(17,9));//windows lnf中默认是17,9
}
 
Example 15
@Override
protected void installDefaults() {
    super.installDefaults();
    Border b = this.passwordField.getBorder();
    if (b == null || b instanceof UIResource) {
        Border newB = new BorderUIResource.CompoundBorderUIResource(
                new SubstanceTextComponentBorder(SubstanceSizeUtils.getTextBorderInsets(
                        SubstanceSizeUtils.getComponentFontSize(this.passwordField))),
                new BasicBorders.MarginBorder());
        this.passwordField.setBorder(newB);
    }

    // support for per-window skins
    SwingUtilities.invokeLater(() -> {
        if (passwordField == null)
            return;
        Color foregr = passwordField.getForeground();
        if ((foregr == null) || (foregr instanceof UIResource)) {
            passwordField.setForeground(SubstanceColorUtilities.getForegroundColor(
                    SubstanceCortex.ComponentScope.getCurrentSkin(passwordField)
                            .getEnabledColorScheme(ComponentOrParentChainScope
                                    .getDecorationType(passwordField))));
        }
    });
    for (SubstanceWidget lafWidget : this.lafWidgets) {
        lafWidget.installDefaults();
    }
}
 
Example 16
@Override
protected void installDefaults() {
    super.installDefaults();
    Border b = this.textField.getBorder();
    if (b == null || b instanceof UIResource) {
        Border newB = new BorderUIResource.CompoundBorderUIResource(
                new SubstanceTextComponentBorder(SubstanceSizeUtils.getTextBorderInsets(
                        SubstanceSizeUtils.getComponentFontSize(this.textField))),
                new BasicBorders.MarginBorder());
        this.textField.setBorder(newB);
    }

    // support for per-window skins
    SwingUtilities.invokeLater(() -> {
        if (textField == null) {
            return;
        }
        Color foregr = textField.getForeground();
        if ((foregr == null) || (foregr instanceof UIResource)) {
            textField.setForeground(SubstanceColorUtilities
                    .getForegroundColor(SubstanceCortex.ComponentScope.getCurrentSkin(textField)
                            .getEnabledColorScheme(ComponentOrParentChainScope
                                    .getDecorationType(textField))));
        }
    });
    for (SubstanceWidget lafWidget : this.lafWidgets) {
        lafWidget.installDefaults();
    }
}
 
Example 17
Source Project: consulo   Source File: BegBorders.java    License: Apache License 2.0 5 votes vote down vote up
public static Border getTextFieldBorder() {
  if (ourTextFieldBorder == null) {
    ourTextFieldBorder = new BorderUIResource.CompoundBorderUIResource(
      new TextFieldBorder(),
      //new FlatLineBorder(),
      BorderFactory.createEmptyBorder(2, 2, 2, 2));
  }
  return ourTextFieldBorder;
}
 
Example 18
Source Project: beautyeye   Source File: __UI__.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Ui impl.
 */
public static void uiImpl()
{
	UIManager.put("ProgressBar.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
	UIManager.put("ProgressBar.selectionForeground",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
	//* 此属性决定水平进度条的默认最小大小:15是相关于.9.png图片的最小填充
	//* 高度或长度的(小于此高度则NinePatch算法无法解决而很难看)
	UIManager.put("ProgressBar.horizontalSize",new DimensionUIResource(146,15));//默认是146,12
	//* 此属性决定垂直进度条的默认最小大小:15是相关于.9.png图片的最小填充
	//* 高度或长度的(小于此高度则NinePatch算法无法解决而很难看)
	UIManager.put("ProgressBar.verticalSize",new DimensionUIResource(15,146));//默认是12,146
	UIManager.put("ProgressBar.border",new BorderUIResource(BorderFactory.createEmptyBorder(0,0,0,0)));
	UIManager.put("ProgressBarUI",org.jb2011.lnf.beautyeye.ch12_progress.BEProgressBarUI.class.getName());
}
 
Example 19
Source Project: mars-sim   Source File: PopUpMenu.java    License: GNU General Public License v3.0 5 votes vote down vote up
public PopUpMenu(final SettlementWindow swindow, final Unit unit){
    	this.unit = unit;
    	this.settlement = swindow.getMapPanel().getSettlement();
        this.desktop = (MainDesktopPane) swindow.getDesktop();

        UIResource res = new BorderUIResource.LineBorderUIResource(Color.orange);
        UIManager.put("PopupMenu.border", res);

        //force to the Heavyweight Component or able for AWT Components
        this.setLightWeightPopupEnabled(false);

    	itemOne = new JMenuItem(Msg.getString("PopUpUnitMenu.itemOne"));
        itemOne.setForeground(new Color(139,69,19));

       	add(itemOne);

       	buildItemOne(unit);
    
//     // Determine what the GraphicsDevice can support.
//        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
//        GraphicsDevice gd = ge.getDefaultScreenDevice();
//        boolean isPerPixelTranslucencySupported =
//            gd.isWindowTranslucencySupported(PERPIXEL_TRANSLUCENT);
//
//        //If translucent windows aren't supported, exit.
//        if (!isPerPixelTranslucencySupported) {
//            System.out.println(
//                "Per-pixel translucency is not supported");
//                System.exit(0);
//        }
       

    }
 
Example 20
public void initializeComponents() {

        setSize(new java.awt.Dimension(800, 600));

        taxonSetsPanel = new TaxonSetsPanel(this, treeStatData);
        statisticsPanel = new StatisticsPanel(this, treeStatData);

        tabbedPane.addTab("Statistics", null, statisticsPanel);
        tabbedPane.addTab("Taxon Sets", null, taxonSetsPanel);

        statusLabel = new JLabel("No statistics selected");
        processTreeFileAction.setEnabled(false);

        JPanel progressPanel = new JPanel(new BorderLayout(0,0));
        progressLabel = new JLabel("");
        progressBar = new JProgressBar();
        progressPanel.add(progressLabel, BorderLayout.NORTH);
        progressPanel.add(progressBar, BorderLayout.CENTER);

        JPanel panel2 = new JPanel(new FlowLayout());
        JButton goButton = new JButton(processTreeFileAction);
        goButton.setFocusable(false);
        goButton.putClientProperty("JButton.buttonType", "textured");
        goButton.setMargin(new Insets(4,4,4,4));
        panel2.add(goButton);
        panel2.add(progressPanel);

        JPanel panel1 = new JPanel(new BorderLayout(0,0));
        panel1.add(statusLabel, BorderLayout.WEST);
        panel1.add(panel2, BorderLayout.EAST);
        panel1.setBorder(new BorderUIResource.EmptyBorderUIResource(new java.awt.Insets(0, 6, 0, 6)));

        JPanel panel = new JPanel(new BorderLayout(0,0));
        panel.add(tabbedPane, BorderLayout.CENTER);
        panel.add(panel1, BorderLayout.SOUTH);
        panel.setBorder(new BorderUIResource.EmptyBorderUIResource(new java.awt.Insets(12, 12, 12, 12)));

        getContentPane().setLayout(new java.awt.BorderLayout(0, 0));
        getContentPane().add(panel, BorderLayout.CENTER);
    }
 
Example 21
Source Project: ccu-historian   Source File: UIUtilities.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * Set up the user interface.
 */
public static void setupUI() {
    try {
        final String classname = UIManager.getSystemLookAndFeelClassName();
        UIManager.setLookAndFeel(classname);
    }
    catch (Exception e) { 
        e.printStackTrace();
    }

    final UIDefaults defaults = UIManager.getDefaults();

    defaults.put(
        "PopupMenu.border", 
        new BorderUIResource.EtchedBorderUIResource(
            EtchedBorder.RAISED, defaults.getColor("controlShadow"), 
            defaults.getColor("controlLtHighlight")
        )
    );

    final MatteBorder matteborder = new MatteBorder(1, 1, 1, 1, Color.black);
    final EmptyBorder emptyborder = new MatteBorder(2, 2, 2, 2, defaults.getColor("control"));
    final BorderUIResource.CompoundBorderUIResource compBorder
        = new BorderUIResource.CompoundBorderUIResource(emptyborder, matteborder);
    final BorderUIResource.EmptyBorderUIResource emptyBorderUI
        = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0);
    defaults.put("SplitPane.border", emptyBorderUI);
    defaults.put("Table.scrollPaneBorder", emptyBorderUI);
    defaults.put("ComboBox.border", compBorder);
    defaults.put("TextField.border", compBorder);
    defaults.put("TextArea.border", compBorder);
    defaults.put("CheckBox.border", compBorder);
    defaults.put("ScrollPane.border", emptyBorderUI);

}
 
Example 22
public void initializeComponents() {

        setSize(new java.awt.Dimension(800, 600));

        inputsPanel = new InputsPanel(this, data);
        dataPanel = new DataPanel(this, data);
        modelPanel = new ModelPanel(this, data);
        simulationsPanel = new SimulationsPanel(this, data);

        tabbedPane.addTab("Inputs", null, inputsPanel);
        tabbedPane.addTab("Taxa", null, dataPanel);
        tabbedPane.addTab("Model", null, modelPanel);
        tabbedPane.addTab("Simulations", null, simulationsPanel);

        statusLabel = new JLabel("No taxa loaded");

        JPanel progressPanel = new JPanel(new BorderLayout(0, 0));
        JLabel progressLabel = new JLabel("");
        JProgressBar progressBar = new JProgressBar();
        progressPanel.add(progressLabel, BorderLayout.NORTH);
        progressPanel.add(progressBar, BorderLayout.CENTER);

        JPanel panel1 = new JPanel(new BorderLayout(0, 0));
        panel1.add(statusLabel, BorderLayout.CENTER);
        panel1.add(progressPanel, BorderLayout.EAST);
        panel1.setBorder(new BorderUIResource.EmptyBorderUIResource(new java.awt.Insets(0, 6, 0, 6)));

        JPanel panel = new JPanel(new BorderLayout(0, 0));
        panel.add(tabbedPane, BorderLayout.CENTER);
        panel.add(panel1, BorderLayout.SOUTH);
        panel.setBorder(new BorderUIResource.EmptyBorderUIResource(new java.awt.Insets(12, 12, 12, 12)));

        getContentPane().setLayout(new java.awt.BorderLayout(0, 0));
        getContentPane().add(panel, BorderLayout.CENTER);
    }
 
Example 23
Source Project: beautyeye   Source File: __UI__.java    License: Apache License 2.0 5 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		//内部窗体的边框颜色(BueaytyEye中无意义,原因是BeautyEye LNF中的border是使用NP图实现)
		UIManager.put("InternalFrame.borderColor",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("InternalFrame.minimizeIconBackground", new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
//		UIManager.put("InternalFrame.paletteCloseIcon"//本属性在beautyEye中不会起效的
//				,org.jb2011.lnf.windows2.ch1.__IconFactory__.getInstance().getInternalFrameCloseIcon());
		UIManager.put("InternalFrame.icon"
				,__IconFactory__.getInstance().getInternalFrameIcon());
		UIManager.put("InternalFrame.iconifyIcon"
				,__IconFactory__.getInstance().getInternalIconfiedIcon());
		UIManager.put("InternalFrame.minimizeIcon"
				,__IconFactory__.getInstance().getInternalFrameMinIcon());
		UIManager.put("InternalFrame.maximizeIcon"
				,__IconFactory__.getInstance().getInternalFrameMaxIcon());
		UIManager.put("InternalFrame.closeIcon"
				,__IconFactory__.getInstance().getInternalFrameCloseIcon());
		UIManager.put("InternalFrameUI",org.jb2011.lnf.beautyeye.ch10_internalframe.BEInternalFrameUI.class.getName());
//		UIManager.put("InternalFrame.paletteTitleHeight",40);//本属性在beautyEye中不会起效的
//		UIManager.put("InternalFrame.titlePaneHeight",38);//default is 25
//		UIManager.put("InternalFrame.borderWidth",10);
		Object internalFrameBorder = new BorderUIResource(new BEShadowBorder());
		UIManager.put("InternalFrame.border", internalFrameBorder);
		UIManager.put("InternalFrame.paletteBorder", internalFrameBorder);
		UIManager.put("InternalFrame.optionDialogBorder", internalFrameBorder);
		
		//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> JDesktopPane相关ui属性设定
		//JDesktopPane的背景色
		UIManager.put("Desktop.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		//此属性暂无意义
//		UIManager.put("Desktop.minOnScreenInsets",new InsetsUIResource(10,10,10,10));//default is 3,3,3,3
		//JDesktopPane中内部窗体最小化时的窗体组件宽度
		UIManager.put("DesktopIcon.width",180);//默认是160
		//BeautyEye LNF中内部窗体标题栏实现
		UIManager.put("DesktopIconUI",org.jb2011.lnf.beautyeye.ch10_internalframe.BEDesktopIconUI.class.getName());
	}
 
Example 24
Source Project: consulo   Source File: BegBorders.java    License: Apache License 2.0 5 votes vote down vote up
public static Border getScrollPaneBorder() {
  if (ourScrollPaneBorder == null) {
    ourScrollPaneBorder = new BorderUIResource.LineBorderUIResource(MetalLookAndFeel.getControlDarkShadow());
    //ourScrollPaneBorder = new FlatLineBorder();
  }
  return ourScrollPaneBorder;
}
 
Example 25
Source Project: beautyeye   Source File: __UI__.java    License: Apache License 2.0 5 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		UIManager.put("control",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("Separator.foreground",new ColorUIResource(new Color(180,180,180)));
		UIManager.put("ToolTip.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		
		UIManager.put("Separator.background",new ColorUIResource(Color.white));
		UIManager.put("Panel.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("Panel.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		
		UIManager.put("Label.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("Label.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));

		UIManager.put("ColorChooser.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("ColorChooser.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("ColorChooser.swatchesDefaultRecentColor",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		
		UIManager.put("TitledBorder.titleColor",new ColorUIResource(new Color(58,135,173)));//TitleBorder的标题颜色
		//TitledBorder的默认border实现(windows LNF中默认是圆色灰色实线距形)
		UIManager.put("TitledBorder.border",new BorderUIResource(new BEDashedRoundRecBorder(BeautyEyeLNFHelper.commonFocusedBorderColor)));
		
//		UIManager.put("OptionPaneUI",org.jb2011.lnf.windows2.ch3.NLOptionPaneUI.class.getName());
		//** Ui里的实现逻辑:此属性为true时将导致JOptionPane里的各按钮按BasicOptionPaneUI里设定的Insets进行
		//** UI展现:当按钮数<=2时使用的Insets=new Instes(2,8,2,8),否则使用new Instes(2,4,2,4),
		//** 这样的逻辑下,BeautyEye L&F实现里会使得按钮高度缩小而不好看,所以要关闭此属性
		UIManager.put("OptionPane.setButtonMargin",false);
		UIManager.put("OptionPane.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("OptionPane.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("OptionPane.questionIcon",__IconFactory__.getInstance().getOptionPaneQUESTIONIcon());
		UIManager.put("OptionPane.warningIcon",__IconFactory__.getInstance().getOptionPaneWARNIcon());
		UIManager.put("OptionPane.informationIcon",__IconFactory__.getInstance().getOptionPaneINFOIcon());
		UIManager.put("OptionPane.errorIcon",__IconFactory__.getInstance().getOptionPaneERRORIcon());
		
		UIManager.put("SeparatorUI",org.jb2011.lnf.beautyeye.ch_x.BESeparatorUI.class.getName());
	}
 
Example 26
Source Project: beautyeye   Source File: __UI__.java    License: Apache License 2.0 5 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		//~* @since 3.4, add by Jack Jiang 2012-11-05
		//~* 【BeautyEye外观的特有定制属性】:true表示BEToolBarUI里,将使用其它典型外观
		//~*  一样的默认纯色填充背景(颜色由ToolBar.background属性指定), 否则将使用BeautyEye
		//~*  默认的渐变NinePatch图实现背景的填充。另外,还可以使用
		//~*  JToolBar.putClientProperty("ToolBar.isPaintPlainBackground", Boolean.TRUE);来进行
		//~*  独立控制背景的填充方法,ClientProperty相比UIManager中的本方法拥有最高优先级
		UIManager.put("ToolBar.isPaintPlainBackground", Boolean.FALSE);
		//此属性目前用于ToolBar.border中表示触点的颜色
		UIManager.put("ToolBar.shadow", new ColorUIResource(new Color(180,183,187)));
		//此属性目前用于ToolBar.border中表示触点的立体阴影效果颜色
		UIManager.put("ToolBar.highlight", new ColorUIResource(Color.white));
		UIManager.put("ToolBar.dockingBackground",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("ToolBar.floatingBackground",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("ToolBar.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("ToolBar.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		//工具栏的border实现
		UIManager.put("ToolBar.border",new BorderUIResource(
//				com.sun.java.swing.plaf.windows.WindowsBorders.getToolBarBorder()));
				new org.jb2011.lnf.beautyeye.ch8_toolbar.BEToolBarUI.ToolBarBorder(UIManager.getColor("ToolBar.shadow"),
						UIManager.getColor("ToolBar.highlight"), new Insets(6, 0, 11, 0))));
//				BorderFactory.createEmptyBorder(5, 0, 8, 0)));//5, 5, 8, 5)));
		//分隔条ui实现
		UIManager.put("ToolBarSeparatorUI"
				, org.jb2011.lnf.beautyeye.ch8_toolbar.BEToolBarSeparatorUI.class.getName());
		UIManager.put("ToolBarUI",org.jb2011.lnf.beautyeye.ch8_toolbar.BEToolBarUI.class.getName());
	}
 
Example 27
Source Project: jdk1.8-source-analysis   Source File: NimbusLookAndFeel.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override public UIDefaults getDefaults() {
    if (uiDefaults == null){
        // Detect platform
        String osName = getSystemProperty("os.name");
        boolean isWindows = osName != null && osName.contains("Windows");

        // We need to call super for basic's properties file.
        uiDefaults = super.getDefaults();
        defaults.initializeDefaults(uiDefaults);

        // Install Keybindings
        if (isWindows) {
            WindowsKeybindings.installKeybindings(uiDefaults);
        } else {
            GTKKeybindings.installKeybindings(uiDefaults);
        }

        // Add Titled Border
        uiDefaults.put("TitledBorder.titlePosition",
                TitledBorder.ABOVE_TOP);
        uiDefaults.put("TitledBorder.border", new BorderUIResource(
                new LoweredBorder()));
        uiDefaults.put("TitledBorder.titleColor",
                getDerivedColor("text",0.0f,0.0f,0.23f,0,true));
        uiDefaults.put("TitledBorder.font",
                new NimbusDefaults.DerivedFont("defaultFont",
                        1f, true, null));

        // Choose Dialog button positions
        uiDefaults.put("OptionPane.isYesLast", !isWindows);

        // Store Table ScrollPane Corner Component
        uiDefaults.put("Table.scrollPaneCornerComponent",
                new UIDefaults.ActiveValue() {
                    @Override
                    public Object createValue(UIDefaults table) {
                        return new TableScrollPaneCorner();
                    }
                });

        // Setup the settings for ToolBarSeparator which is custom
        // installed for Nimbus
        uiDefaults.put("ToolBarSeparator[Enabled].backgroundPainter",
                new ToolBarSeparatorPainter());

        // Populate UIDefaults with a standard set of properties
        for (String componentKey : COMPONENT_KEYS) {
            String key = componentKey+".foreground";
            if (!uiDefaults.containsKey(key)){
                uiDefaults.put(key,
                        new NimbusProperty(componentKey,"textForeground"));
            }
            key = componentKey+".background";
            if (!uiDefaults.containsKey(key)){
                uiDefaults.put(key,
                        new NimbusProperty(componentKey,"background"));
            }
            key = componentKey+".font";
            if (!uiDefaults.containsKey(key)){
                uiDefaults.put(key,
                        new NimbusProperty(componentKey,"font"));
            }
            key = componentKey+".disabledText";
            if (!uiDefaults.containsKey(key)){
                uiDefaults.put(key,
                        new NimbusProperty(componentKey,"Disabled",
                               "textForeground"));
            }
            key = componentKey+".disabled";
            if (!uiDefaults.containsKey(key)){
                uiDefaults.put(key,
                        new NimbusProperty(componentKey,"Disabled",
                                "background"));
            }
        }

        // FileView icon keys are used by some applications, we don't have
        // a computer icon at the moment so using home icon for now
        uiDefaults.put("FileView.computerIcon",
                new LinkProperty("FileChooser.homeFolderIcon"));
        uiDefaults.put("FileView.directoryIcon",
                new LinkProperty("FileChooser.directoryIcon"));
        uiDefaults.put("FileView.fileIcon",
                new LinkProperty("FileChooser.fileIcon"));
        uiDefaults.put("FileView.floppyDriveIcon",
                new LinkProperty("FileChooser.floppyDriveIcon"));
        uiDefaults.put("FileView.hardDriveIcon",
                new LinkProperty("FileChooser.hardDriveIcon"));
    }
    return uiDefaults;
}
 
Example 28
Source Project: beautyeye   Source File: __UI__.java    License: Apache License 2.0 4 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 窗体ui的各项属性设定
		//*~ 本属性是Jack Jiang自已设定的,Java的Metal主题默认对非Frame对象的窗口图标取的是InternalFrame.icon,这是不对的
		UIManager.put("Frame.icon",__IconFactory__.getInstance().getFrameIcon_16_16());
		
		UIManager.put("Frame.iconifyIcon",__IconFactory__.getInstance().getIconfiedIcon());
		UIManager.put("Frame.iconifyIcon_rover",__IconFactory__.getInstance().getIconfiedIcon_rover());
		UIManager.put("Frame.iconifyIcon_pressed",__IconFactory__.getInstance().getIconfiedIcon_pressed());
		
		UIManager.put("Frame.minimizeIcon",__IconFactory__.getInstance().getFrameMinIcon());
		UIManager.put("Frame.minimizeIcon_rover",__IconFactory__.getInstance().getFrameMinIcon_rover());
		UIManager.put("Frame.minimizeIcon_pressed",__IconFactory__.getInstance().getFrameMinIcon_pressed());
		
		UIManager.put("Frame.maximizeIcon",__IconFactory__.getInstance().getFrameMaxIcon());
		UIManager.put("Frame.maximizeIcon_rover",__IconFactory__.getInstance().getFrameMaxIcon_rover());
		UIManager.put("Frame.maximizeIcon_pressed",__IconFactory__.getInstance().getFrameMaxIcon_pressed());
		
		UIManager.put("Frame.closeIcon",__IconFactory__.getInstance().getFrameCloseIcon());
		UIManager.put("Frame.closeIcon_rover",__IconFactory__.getInstance().getFrameCloseIcon_rover());
		UIManager.put("Frame.closeIcon_pressed",__IconFactory__.getInstance().getFrameCloseIcon_pressed());
		
		//设定用于演示之用的“设置”按钮图标
		UIManager.put("Frame.setupIcon",__IconFactory__.getInstance().getFrameSetupIcon());
		
//		UIManager.put("activeCaption",new ColorUIResource(Windows2LookAndFeel.activeCaption));
		UIManager.put("activeCaptionText",new ColorUIResource(BeautyEyeLNFHelper.activeCaptionTextColor));
//		UIManager.put("activeCaptionBorder",new ColorUIResource(Windows2LookAndFeel.activeCaptionBorder));
//		UIManager.put("inactiveCaption",new ColorUIResource(GraphicHandler.getColor(activeCaption,64,42,22)));
		UIManager.put("inactiveCaptionText",new ColorUIResource(BEUtils.getColor(BeautyEyeLNFHelper.activeCaptionTextColor,-49,-27,-7)));
//		UIManager.put("inactiveCaptionBorder",new ColorUIResource(GraphicHandler.getColor(activeCaptionBorder,64,42,22)));
		//此属性即是BeautyEye LNF的窗口标题栏实现
		UIManager.put("RootPaneUI", BERootPaneUI.class.getName());
		
		// These bindings are only enabled when there is a default
		// button set on the rootpane.
		UIManager.put("RootPane.defaultButtonWindowKeyBindings", new Object[] {
				"ENTER", "press",
				"released ENTER", "release",
				"ctrl ENTER", "press",
				"ctrl released ENTER", "release"
		});
		
		//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> OptionPane的各项ui属性设定
		Object dialogBorder = new BorderUIResource(BeautyEyeLNFHelper.__getFrameBorder());//BorderFactory.createLineBorder(new Color(181,181,181)));
		UIManager.put("RootPane.frameBorder", dialogBorder);
		UIManager.put("RootPane.plainDialogBorder", dialogBorder);
		UIManager.put("RootPane.informationDialogBorder", dialogBorder);
		UIManager.put("RootPane.errorDialogBorder", dialogBorder);
		UIManager.put("RootPane.colorChooserDialogBorder", dialogBorder);
		UIManager.put("RootPane.fileChooserDialogBorder", dialogBorder);
		UIManager.put("RootPane.questionDialogBorder", dialogBorder);
		UIManager.put("RootPane.warningDialogBorder", dialogBorder);
	}
 
Example 29
Source Project: material-ui-swing   Source File: AbstractMaterialTheme.java    License: MIT License 4 votes vote down vote up
public void setBorderTable(BorderUIResource borderTable) {
    this.borderTable = borderTable;
}
 
Example 30
/**
 * {@inheritDoc}
 */
@Override public UIDefaults getDefaults() {
    if (uiDefaults == null){
        // Detect platform
        String osName = getSystemProperty("os.name");
        boolean isWindows = osName != null && osName.contains("Windows");

        // We need to call super for basic's properties file.
        uiDefaults = super.getDefaults();
        defaults.initializeDefaults(uiDefaults);

        // Install Keybindings
        if (isWindows) {
            WindowsKeybindings.installKeybindings(uiDefaults);
        } else {
            GTKKeybindings.installKeybindings(uiDefaults);
        }

        // Add Titled Border
        uiDefaults.put("TitledBorder.titlePosition",
                TitledBorder.ABOVE_TOP);
        uiDefaults.put("TitledBorder.border", new BorderUIResource(
                new LoweredBorder()));
        uiDefaults.put("TitledBorder.titleColor",
                getDerivedColor("text",0.0f,0.0f,0.23f,0,true));
        uiDefaults.put("TitledBorder.font",
                new NimbusDefaults.DerivedFont("defaultFont",
                        1f, true, null));

        // Choose Dialog button positions
        uiDefaults.put("OptionPane.isYesLast", !isWindows);

        // Store Table ScrollPane Corner Component
        uiDefaults.put("Table.scrollPaneCornerComponent",
                new UIDefaults.ActiveValue() {
                    @Override
                    public Object createValue(UIDefaults table) {
                        return new TableScrollPaneCorner();
                    }
                });

        // Setup the settings for ToolBarSeparator which is custom
        // installed for Nimbus
        uiDefaults.put("ToolBarSeparator[Enabled].backgroundPainter",
                new ToolBarSeparatorPainter());

        // Populate UIDefaults with a standard set of properties
        for (String componentKey : COMPONENT_KEYS) {
            String key = componentKey+".foreground";
            if (!uiDefaults.containsKey(key)){
                uiDefaults.put(key,
                        new NimbusProperty(componentKey,"textForeground"));
            }
            key = componentKey+".background";
            if (!uiDefaults.containsKey(key)){
                uiDefaults.put(key,
                        new NimbusProperty(componentKey,"background"));
            }
            key = componentKey+".font";
            if (!uiDefaults.containsKey(key)){
                uiDefaults.put(key,
                        new NimbusProperty(componentKey,"font"));
            }
            key = componentKey+".disabledText";
            if (!uiDefaults.containsKey(key)){
                uiDefaults.put(key,
                        new NimbusProperty(componentKey,"Disabled",
                               "textForeground"));
            }
            key = componentKey+".disabled";
            if (!uiDefaults.containsKey(key)){
                uiDefaults.put(key,
                        new NimbusProperty(componentKey,"Disabled",
                                "background"));
            }
        }

        // FileView icon keys are used by some applications, we don't have
        // a computer icon at the moment so using home icon for now
        uiDefaults.put("FileView.computerIcon",
                new LinkProperty("FileChooser.homeFolderIcon"));
        uiDefaults.put("FileView.directoryIcon",
                new LinkProperty("FileChooser.directoryIcon"));
        uiDefaults.put("FileView.fileIcon",
                new LinkProperty("FileChooser.fileIcon"));
        uiDefaults.put("FileView.floppyDriveIcon",
                new LinkProperty("FileChooser.floppyDriveIcon"));
        uiDefaults.put("FileView.hardDriveIcon",
                new LinkProperty("FileChooser.hardDriveIcon"));
    }
    return uiDefaults;
}