当前位置: 首页>>代码示例>>Java>>正文


Java BorderUIResource.LineBorderUIResource方法代码示例

本文整理汇总了Java中javax.swing.plaf.BorderUIResource.LineBorderUIResource方法的典型用法代码示例。如果您正苦于以下问题:Java BorderUIResource.LineBorderUIResource方法的具体用法?Java BorderUIResource.LineBorderUIResource怎么用?Java BorderUIResource.LineBorderUIResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.plaf.BorderUIResource的用法示例。


在下文中一共展示了BorderUIResource.LineBorderUIResource方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInternalFrameBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
 * Returns a border that is composed of a raised bevel border and a
 * one-pixel thick line border.
 *
 * <p><img src="doc-files/BasicBorders-2.png" width="300" height="200"
 * alt="[A screen shot of a border returned by this method]" />
 *
 * <p>The colors of the border are retrieved from the
 * <code>UIDefaults</code> of the currently active look and feel
 * using the keys <code>&#x201c;InternalFrame.borderShadow&#x201d;</code>,
 * <code>&#x201c;InternalFrame.borderDarkShadow&#x201d;</code>,
 * <code>&#x201c;InternalFrame.borderLight&#x201d;</code>,
 * <code>&#x201c;InternalFrame.borderHighlight&#x201d;</code>, and
 * (for the inner one-pixel thick line)
 * <code>&#x201c;InternalFrame.borderColor&#x201d;</code>.
 */
public static Border getInternalFrameBorder()
{
  Color shadow, darkShadow, highlight, lightHighlight, line;

  /* See comment in methods above for why this border is not shared. */
  shadow = UIManager.getColor("InternalFrame.borderShadow");
  darkShadow = UIManager.getColor("InternalFrame.borderDarkShadow");
  highlight = UIManager.getColor("InternalFrame.borderLight");
  lightHighlight = UIManager.getColor("InternalFrame.borderHighlight");
  line = UIManager.getColor("InternalFrame.borderColor");

  return new BorderUIResource.CompoundBorderUIResource(
    /* outer border */
    new BorderUIResource.BevelBorderUIResource(
      BevelBorder.RAISED,
      (highlight != null) ? highlight : Color.lightGray,
      (lightHighlight != null) ? lightHighlight : Color.white,
      (darkShadow != null) ? darkShadow : Color.black,
      (shadow != null) ? shadow : Color.gray),

    /* inner border */
    new BorderUIResource.LineBorderUIResource(
      (line != null) ? line : Color.lightGray));
}
 
开发者ID:vilie,项目名称:javify,代码行数:41,代码来源:BasicBorders.java

示例2: getScrollPaneBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
public static Border getScrollPaneBorder() {
  if (ourScrollPaneBorder == null) {
    ourScrollPaneBorder = new BorderUIResource.LineBorderUIResource(MetalLookAndFeel.getControlDarkShadow());
    //ourScrollPaneBorder = new FlatLineBorder();
  }
  return ourScrollPaneBorder;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:BegBorders.java

示例3: PopUpMenu

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
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);
    }
    */

}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:35,代码来源:PopUpMenu.java

示例4: init

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
protected void init() {
  GuiUtils.replaceJSplitPaneWithIDEASplitter(main);
  HTMLEditorKit kit = new HTMLEditorKit();
  StyleSheet sheet = kit.getStyleSheet();
  sheet.addRule("ul {margin-left: 16px}"); // list-style-type: none;
  myDescriptionTextArea.setEditorKit(kit);
  myDescriptionTextArea.setEditable(false);
  myDescriptionTextArea.addHyperlinkListener(new MyHyperlinkListener());

  JScrollPane installedScrollPane = createTable();
  myPluginHeaderPanel = new PluginHeaderPanel(this);
  myHeader.setBackground(UIUtil.getTextFieldBackground());
  myPluginHeaderPanel.getPanel().setBackground(UIUtil.getTextFieldBackground());
  myPluginHeaderPanel.getPanel().setOpaque(true);

  myHeader.add(myPluginHeaderPanel.getPanel(), BorderLayout.CENTER);
  installTableActions();

  myTablePanel.add(installedScrollPane, BorderLayout.CENTER);
  UIUtil.applyStyle(UIUtil.ComponentStyle.SMALL, myPanelDescription);
  myPanelDescription.setBorder(JBUI.Borders.emptyLeft(7));

  final JPanel header = new JPanel(new BorderLayout()) {
    @Override
    protected void paintComponent(Graphics g) {
      super.paintComponent(g);
      final Color bg = UIUtil.getTableBackground(false);
      ((Graphics2D)g).setPaint(new GradientPaint(0, 0, ColorUtil.shift(bg, 1.4), 0, getHeight(), ColorUtil.shift(bg, 0.9)));
      g.fillRect(0,0, getWidth(), getHeight());
    }
  };
  header.setBorder(new CustomLineBorder(1, 1, 0, 1));
  final JLabel mySortLabel = new JLabel();
  mySortLabel.setForeground(UIUtil.getLabelDisabledForeground());
  mySortLabel.setBorder(JBUI.Borders.empty(1, 1, 1, 5));
  mySortLabel.setIcon(AllIcons.General.SplitDown);
  mySortLabel.setHorizontalTextPosition(SwingConstants.LEADING);
  header.add(mySortLabel, BorderLayout.EAST);
  myTablePanel.add(header, BorderLayout.NORTH);
  myToolbarPanel.setLayout(new BorderLayout());
  myActionToolbar = ActionManager.getInstance().createActionToolbar("PluginManager", getActionGroup(true), true);
  final JComponent component = myActionToolbar.getComponent();
  myToolbarPanel.add(component, BorderLayout.CENTER);
  myToolbarPanel.add(myFilter, BorderLayout.WEST);
  new ClickListener() {
    @Override
    public boolean onClick(@NotNull MouseEvent event, int clickCount) {
      JBPopupFactory.getInstance().createActionGroupPopup("Sort by:", createSortersGroup(), DataManager.getInstance().getDataContext(pluginTable),
                                                          JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true).showUnderneathOf(mySortLabel);
      return true;
    }
  }.installOn(mySortLabel);
  final TableModelListener modelListener = new TableModelListener() {
    @Override
    public void tableChanged(TableModelEvent e) {
      String text = "Sort by:";
      if (pluginsModel.isSortByStatus()) {
        text += " status,";
      }
      if (pluginsModel.isSortByRating()) {
        text += " rating,";
      }
      if (pluginsModel.isSortByDownloads()) {
        text += " downloads,";
      }
      if (pluginsModel.isSortByUpdated()) {
        text += " updated,";
      }
      text += " name";
      mySortLabel.setText(text);
    }
  };
  pluginTable.getModel().addTableModelListener(modelListener);
  modelListener.tableChanged(null);

  myDescriptionScrollPane.setBackground(UIUtil.getTextFieldBackground());
  Border border = new BorderUIResource.LineBorderUIResource(new JBColor(Gray._220, Gray._55), 1);
  myInfoPanel.setBorder(border);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:80,代码来源:PluginManagerMain.java

示例5: PopUpUnitMenu

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
public PopUpUnitMenu(final SettlementWindow swindow, final Unit unit){
    	//this.building = building;
    	//this.vehicle = vehicle;
    	this.unit = unit;
    	this.settlement = swindow.getMapPanel().getSettlement();
        this.desktop = (MainDesktopPane) swindow.getDesktop();

        if (desktop.getMainWindow() != null)
        	mainWindow = desktop.getMainWindow();
        else if (desktop.getMainScene() != null)
        	mainScene = desktop.getMainScene();

        UIResource res = null;

        if (mainScene != null) {
	        if (MainScene.getTheme() == 7)
	        	new BorderUIResource.LineBorderUIResource(Color.orange);
	        else if (MainScene.getTheme() == 0 || MainScene.getTheme() == 6)
	        	new BorderUIResource.LineBorderUIResource(Color.blue);
        }
        else
        	new BorderUIResource.LineBorderUIResource(Color.blue);


        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 if (unit instanceof Building) {
            add(itemOne);
        	add(itemTwo);
        	buildItemOne(unit);
            buildItemTwo(unit);
        }
        else if (unit instanceof Robot) {
            //add(itemOne);
        	add(itemTwo);
        	//buildItemOne(unit);
            buildItemTwo(unit);
        }
        else if (unit instanceof ConstructionSite) {
            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);
        }
*/
    }
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:80,代码来源:PopUpUnitMenu.java

示例6: getProgressBarBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
 * Returns a two-pixel thick, green
 * <code>LineBorderUIResource</code>.  This is so ugly that look and
 * feels better use different borders for their progress bars, or
 * they will look really terrible.
 *
 * <p><img src="doc-files/BasicBorders-1.png" width="120" height="80"
 * alt="[A screen shot of a border returned by this method]" />
 */
public static Border getProgressBarBorder()
{
  /* There does not seem to exist a way to parametrize the color
   * or thickness of the border through UIDefaults.
   */
  return new BorderUIResource.LineBorderUIResource(Color.green, 2);
}
 
开发者ID:vilie,项目名称:javify,代码行数:17,代码来源:BasicBorders.java


注:本文中的javax.swing.plaf.BorderUIResource.LineBorderUIResource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。