⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 borderfactory.java

📁 gcc的组建
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/* BorderFactory.java --   Copyright (C) 2002, 2004  Free Software Foundation, Inc.This file is part of GNU Classpath.GNU Classpath is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU Classpath is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU Classpath; see the file COPYING.  If not, write to theFree Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA02110-1301 USA.Linking this library statically or dynamically with other modules ismaking a combined work based on this library.  Thus, the terms andconditions of the GNU General Public License cover the wholecombination.As a special exception, the copyright holders of this library give youpermission to link this library with independent modules to produce anexecutable, regardless of the license terms of these independentmodules, and to copy and distribute the resulting executable underterms of your choice, provided that you also meet, for each linkedindependent module, the terms and conditions of the license of thatmodule.  An independent module is a module which is not derived fromor based on this library.  If you modify this library, you may extendthis exception to your version of the library, but you are notobligated to do so.  If you do not wish to do so, delete thisexception statement from your version. */package javax.swing;import java.awt.Color;import java.awt.Font;import javax.swing.border.BevelBorder;import javax.swing.border.Border;import javax.swing.border.CompoundBorder;import javax.swing.border.EmptyBorder;import javax.swing.border.EtchedBorder;import javax.swing.border.LineBorder;import javax.swing.border.MatteBorder;import javax.swing.border.TitledBorder;/** * A factory for commonly used borders. * * @author original author unknown */public class BorderFactory{  private BorderFactory()  {    // Do nothing.  }  /**   * Creates a line border withe the specified color.   *   * @param color A color to use for the line.   *   * @return The Border object   */  public static Border createLineBorder(Color color)  {    return createLineBorder(color, 1);  }  /**   * Creates a line border withe the specified color and width. The width   * applies to all 4 sides of the border. To specify widths individually for   * the top, bottom, left, and right, use   * createMatteBorder(int,int,int,int,Color).   *   * @param color A color to use for the line.   * @param thickness An int specifying the width in pixels.   *   * @return The Border object   */  public static Border createLineBorder(Color color, int thickness)  {    return new LineBorder(color, thickness);  }  /**   * Created a border with a raised beveled edge, using brighter shades of   * the component's current background color for highlighting, and darker   * shading for shadows. (In a raised border, highlights are on top and   * shadows are underneath.)   *   * @return The Border object   */  public static Border createRaisedBevelBorder()  {    return new BevelBorder(BevelBorder.RAISED);  }  /**   * Created a border with a lowered beveled edge, using brighter shades of   * the component's current background color for highlighting, and darker   * shading for shadows. (In a lowered border, shadows are on top and   * highlights are underneath.)   *   * @return The Border object   */  public static Border createLoweredBevelBorder()  {    return new BevelBorder(BevelBorder.LOWERED);  }  /**   * Create a beveled border of the specified type, using brighter shades of   * the component's current background color for highlighting, and darker   * shading for shadows. (In a lowered border, shadows are on top and   * highlights are underneath.).   *   * @param type An int specifying either BevelBorder.LOWERED or   *     BevelBorder.RAISED   *   * @return The Border object   */  public static Border createBevelBorder(int type)  {    return new BevelBorder(type);  }  /**   * Create a beveled border of the specified type, using the specified   * highlighting and shadowing. The outer edge of the highlighted area uses   * a brighter shade of the highlight color. The inner edge of the shadow   * area uses a brighter shade of the shadaw color.   *   * @param type An int specifying either BevelBorder.LOWERED or   *     BevelBorder.RAISED   * @param highlight A Color object for highlights   * @param shadow A Color object for shadows   *   * @return The Border object   */  public static Border createBevelBorder(int type, Color highlight, Color shadow)  {    return new BevelBorder(type, highlight, shadow);  }  /**   * Create a beveled border of the specified type, using the specified colors   * for the inner and outer highlight and shadow areas.   *   * @param type An int specifying either BevelBorder.LOWERED or   *     BevelBorder.RAISED   * @param highlightOuter A Color object for the outer edge of the   *     highlight area   * @param highlightInner A Color object for the inner edge of the   *     highlight area   * @param shadowOuter A Color object for the outer edge of the shadow area   * @param shadowInner A Color object for the inner edge of the shadow area   *   * @return The Border object   */  public static Border createBevelBorder(int type, Color highlightOuter,                                         Color highlightInner,                                         Color shadowOuter, Color shadowInner)  {    return new BevelBorder(type, highlightOuter, highlightInner, shadowOuter,                           shadowInner);  }  /**   * Create a border with an "etched" look using the component's current   * background color for highlighting and shading.   *   * @return The Border object   */  public static Border createEtchedBorder()  {    return new EtchedBorder();  }  /**   * Create a border with an "etched" look using the component's current   * background color for highlighting and shading.   *   * @return The Border object   */  public static Border createEtchedBorder(int etchType)  {    return new EtchedBorder(etchType);  }  /**   * Create a border with an "etched" look using the specified highlighting and   * shading colors.   *   * @param highlight A Color object for the border highlights   * @param shadow A Color object for the border shadows   *   * @return The Border object   */  public static Border createEtchedBorder(Color highlight, Color shadow)  {    return new EtchedBorder(highlight, shadow);  }  /**   * Create a border with an "etched" look using the specified highlighting and   * shading colors.   *   * @param highlight A Color object for the border highlights   * @param shadow A Color object for the border shadows   *   * @return The Border object   */  public static Border createEtchedBorder(int etchType, Color highlight,                                          Color shadow)  {    return new EtchedBorder(etchType, highlight, shadow);  }  /**   * Create a new title border specifying the text of the title, using the   * default border (etched), using the default text position (sitting on the

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -