javax.swing.plaf.BorderUIResource Java Examples

The following examples show how to use javax.swing.plaf.BorderUIResource. 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
Source File: ContrastMetalTheme.java    From dragonwell8_jdk with 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 #2
Source File: SubstanceComboBoxUI.java    From radiance with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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 #3
Source File: __UI__.java    From beautyeye with 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 #4
Source File: ContrastMetalTheme.java    From jdk8u-jdk with 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
Source File: ContrastMetalTheme.java    From openjdk-jdk9 with 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 #6
Source File: ContrastMetalTheme.java    From hottub with 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 #7
Source File: JTipOfTheDayAddon.java    From orbit-image-analysis with GNU General Public License v3.0 6 votes vote down vote up
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 #8
Source File: IconPackagerButtonBarUI.java    From orbit-image-analysis with GNU General Public License v3.0 6 votes vote down vote up
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 #9
Source File: ContrastMetalTheme.java    From jdk8u60 with 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 #10
Source File: ContrastMetalTheme.java    From jdk8u_jdk with 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 #11
Source File: ContrastMetalTheme.java    From jdk8u-dev-jdk with 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
Source File: MaterialOceanicTheme.java    From material-ui-swing with 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 #13
Source File: __UI__.java    From beautyeye with 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 #14
Source File: __UI__.java    From beautyeye with 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
Source File: SubstancePasswordFieldUI.java    From radiance with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@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
Source File: SubstanceFormattedTextFieldUI.java    From radiance with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@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 File: BasicCommandButtonUI.java    From radiance with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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 #18
Source File: __UI__.java    From beautyeye with 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 #19
Source File: BegBorders.java    From consulo with 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 #20
Source File: BegBorders.java    From consulo with 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 #21
Source File: PopUpMenu.java    From mars-sim with 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 #22
Source File: __UI__.java    From beautyeye with 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 #23
Source File: __UI__.java    From beautyeye with 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 #24
Source File: TreeStatFrame.java    From beast-mcmc with GNU Lesser General Public License v2.1 5 votes vote down vote up
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 #25
Source File: UIUtilities.java    From ccu-historian with 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 #26
Source File: CoalGenFrame.java    From beast-mcmc with GNU Lesser General Public License v2.1 5 votes vote down vote up
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 #27
Source File: AbstractMaterialTheme.java    From material-ui-swing with MIT License 4 votes vote down vote up
public BorderUIResource getBorderTableHeader() {
    return borderTableHeader;
}
 
Example #28
Source File: PopUpUnitMenu.java    From mars-sim with GNU General Public License v3.0 4 votes vote down vote up
public PopUpUnitMenu(final SettlementWindow swindow, final Unit unit){
    	this.unit = unit;
    	desktop = swindow.getDesktop();
    	this.settlement = swindow.getMapPanel().getSettlement();
      
        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"));
        itemTwo = new JMenuItem(Msg.getString("PopUpUnitMenu.itemTwo"));  
        itemThree = new JMenuItem(Msg.getString("PopUpUnitMenu.itemThree"));
        itemOne.setForeground(new Color(139,69,19));
        itemTwo.setForeground(new Color(139,69,19));
        itemThree.setForeground(new Color(139,69,19));
        
        if (unit instanceof Person) {
        	add(itemTwo);
        	buildItemTwo(unit);
        }
        
        else if (unit instanceof Vehicle) {
        	add(itemOne);
        	add(itemTwo);
        	add(itemThree);
        	buildItemOne(unit);
            buildItemTwo(unit);
            buildItemThree(unit);
        }
        else {
            add(itemOne);
        	add(itemTwo);
        	buildItemOne(unit);
            buildItemTwo(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 #29
Source File: AbstractMaterialTheme.java    From material-ui-swing with MIT License 4 votes vote down vote up
public BorderUIResource getCellBorderTableHeader() {
    return cellBorderTableHeader;
}
 
Example #30
Source File: AbstractMaterialTheme.java    From material-ui-swing with MIT License 4 votes vote down vote up
public void setBorderTable(BorderUIResource borderTable) {
    this.borderTable = borderTable;
}