/[classpath]/classpath/javax/swing/BorderFactory.java
ViewVC logotype

Diff of /classpath/javax/swing/BorderFactory.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by mkoch, Mon Jun 9 15:48:11 2003 UTC revision 1.6 by mkoch, Tue Jun 10 19:57:03 2003 UTC
# Line 64  public class BorderFactory Line 64  public class BorderFactory
64    }    }
65    
66    /**    /**
67     * 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).     * Creates a line border withe the specified color and width. The width
68       * applies to all 4 sides of the border. To specify widths individually for
69       * the top, bottom, left, and right, use
70       * createMatteBorder(int,int,int,int,Color).
71     *     *
72     * @param color A color to use for the line.     * @param color A color to use for the line.
73     * @param thickness An int specifying the width in pixels.     * @param thickness An int specifying the width in pixels.
# Line 77  public class BorderFactory Line 80  public class BorderFactory
80    }    }
81    
82    /**    /**
83     * 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.)     * Created a border with a raised beveled edge, using brighter shades of
84       * the component's current background color for highlighting, and darker
85       * shading for shadows. (In a raised border, highlights are on top and
86       * shadows are underneath.)
87     *     *
88     * @return The Border object     * @return The Border object
89     */     */
# Line 87  public class BorderFactory Line 93  public class BorderFactory
93    }    }
94    
95    /**    /**
96     * 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.)     * Created a border with a lowered beveled edge, using brighter shades of
97       * the component's current background color for highlighting, and darker
98       * shading for shadows. (In a lowered border, shadows are on top and
99       * highlights are underneath.)
100     *     *
101     * @return The Border object     * @return The Border object
102     */     */
# Line 97  public class BorderFactory Line 106  public class BorderFactory
106    }    }
107    
108    /**    /**
109     * 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.).     * Create a beveled border of the specified type, using brighter shades of
110       * the component's current background color for highlighting, and darker
111       * shading for shadows. (In a lowered border, shadows are on top and
112       * highlights are underneath.).
113     *     *
114     * @param type An int specifying either BevelBorder.LOWERED or BevelBorder.RAISED     * @param type An int specifying either BevelBorder.LOWERED or
115       * BevelBorder.RAISED
116     *     *
117     * @Return The Border object     * @Return The Border object
118     */     */
# Line 109  public class BorderFactory Line 122  public class BorderFactory
122    }    }
123    
124    /**    /**
125     * 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.     * Create a beveled border of the specified type, using the specified
126       * highlighting and shadowing. The outer edge of the highlighted area uses
127       * a brighter shade of the highlight color. The inner edge of the shadow
128       * area uses a brighter shade of the shadaw color.
129     *     *
130     * @param type An int specifying either BevelBorder.LOWERED or BevelBorder.RAISED     * @param type An int specifying either BevelBorder.LOWERED or
131       * BevelBorder.RAISED
132     * @param highlight A Color object for highlights     * @param highlight A Color object for highlights
133     * @param shadow A Color object for shadows     * @param shadow A Color object for shadows
134     *     *
# Line 124  public class BorderFactory Line 141  public class BorderFactory
141    }    }
142    
143    /**    /**
144     * Create a beveled border of the specified type, using the specified colors for the inner and outer highlight and shadow areas.     * Create a beveled border of the specified type, using the specified colors
145       * for the inner and outer highlight and shadow areas.
146     *     *
147     * @param type An int specifying either BevelBorder.LOWERED or BevelBorder.RAISED     * @param type An int specifying either BevelBorder.LOWERED or
148     * @param highlightOuter A Color object for the outer edge of the highlight area     * BevelBorder.RAISED
149     * @param highlightInner A Color object for the inner edge of the highlight area     * @param highlightOuter A Color object for the outer edge of the
150       * highlight area
151       * @param highlightInner A Color object for the inner edge of the
152       * highlight area
153     * @param shadowOuter A Color object for the outer edge of the shadow area     * @param shadowOuter A Color object for the outer edge of the shadow area
154     * @param shadowInner A Color object for the inner edge of the shadow area     * @param shadowInner A Color object for the inner edge of the shadow area
155     *     *
# Line 138  public class BorderFactory Line 159  public class BorderFactory
159                                            Color highlightInner,                                            Color highlightInner,
160                                            Color shadowOuter, Color shadowInner)                                            Color shadowOuter, Color shadowInner)
161    {    {
162      return new BevelBorder (type, highlightOuter, highlightInner, shadowOuter, shadowInner);      return new BevelBorder (type, highlightOuter, highlightInner, shadowOuter,
163                                shadowInner);
164    }    }
165    
166    /**    /**
167     * Create a border with an "etched" look using the component's current background color for highlighting and shading.     * Create a border with an "etched" look using the component's current
168       * background color for highlighting and shading.
169     *     *
170     * @return The Border object     * @return The Border object
171     */     */
# Line 152  public class BorderFactory Line 175  public class BorderFactory
175    }    }
176    
177    /**    /**
178     * Create a border with an "etched" look using the specified highlighting and shading colors.     * Create a border with an "etched" look using the component's current
179       * background color for highlighting and shading.
180       *
181       * @return The Border object
182       */
183      public static Border createEtchedBorder (int etchType)
184      {
185        return new EtchedBorder (etchType);
186      }
187    
188      /**
189       * Create a border with an "etched" look using the specified highlighting and
190       * shading colors.
191     *     *
192     * @param highlight A Color object for the border highlights     * @param highlight A Color object for the border highlights
193     * @param shadow A Color object for the border shadows     * @param shadow A Color object for the border shadows
# Line 165  public class BorderFactory Line 200  public class BorderFactory
200    }    }
201    
202    /**    /**
203     * Create a new title border specifying the text of the title, using the default border (etched), using the default text position (sitting on the top line) and default justification (left) and using the default font and text color determined by the current look and feel.     * Create a border with an "etched" look using the specified highlighting and
204       * shading colors.
205       *
206       * @param highlight A Color object for the border highlights
207       * @param shadow A Color object for the border shadows
208       *
209       * @return The Border object
210       */
211      public static Border createEtchedBorder (int etchType, Color highlight,
212                                               Color shadow)
213      {
214        return new EtchedBorder (etchType, highlight, shadow);
215      }
216    
217      /**
218       * Create a new title border specifying the text of the title, using the
219       * default border (etched), using the default text position (sitting on the
220       * top line) and default justification (left) and using the default font and
221       * text color determined by the current look and feel.
222     *     *
223     * @param title A String containing the text of the title     * @param title A String containing the text of the title
224     *     *
# Line 177  public class BorderFactory Line 230  public class BorderFactory
230    }    }
231    
232    /**    /**
233     * Create a new title border with an empty title specifying the border object, using the default text position (sitting on the top line) and default justification (left) and using the default font, text color, and border determined by the current look and feel. (The Motif and Windows look and feels use an etched border; The Java look and feel use a gray border.)     * Create a new title border with an empty title specifying the border
234       * object, using the default text position (sitting on the top line) and
235       * default justification (left) and using the default font, text color,
236       * and border determined by the current look and feel. (The Motif and Windows
237       * look and feels use an etched border; The Java look and feel use a
238       * gray border.)
239     *     *
240     * @param border The Border object to add the title to     * @param border The Border object to add the title to
241     *     *
# Line 189  public class BorderFactory Line 247  public class BorderFactory
247    }    }
248    
249    /**    /**
250     * Add a title to an existing border, specifying the text of the title, using the default positioning (sitting on the top line) and default justification (left) and using the default font and text color determined by the current look and feel.     * Add a title to an existing border, specifying the text of the title, using
251       * the default positioning (sitting on the top line) and default
252       * justification (left) and using the default font and text color determined
253       * by the current look and feel.
254     *     *
255     * border - the Border object to add the title totitle - a String containing the text of the title     * @param order The Border object to add the title to
256       * @param title A String containing the text of the title
257     *     *
258     * @return The TitledBorder object     * @return The TitledBorder object
259     */     */
# Line 201  public class BorderFactory Line 263  public class BorderFactory
263    }    }
264    
265    /**    /**
266     * Add a title to an existing border, specifying the text of the title along with its positioning, using the default font and text color determined by the current look and feel.     * Add a title to an existing border, specifying the text of the title along
267       * with its positioning, using the default font and text color determined by
268       * the current look and feel.
269     *     *
270     * @param border The Border object to add the title to     * @param border The Border object to add the title to
271     * @param title A String containing the text of the title     * @param title A String containing the text of the title
# Line 211  public class BorderFactory Line 275  public class BorderFactory
275     * @param titlePosition An int specifying the vertical position of the text     * @param titlePosition An int specifying the vertical position of the text
276     * in relation to the border -- one of: TitledBorder.ABOVE_TOP,     * in relation to the border -- one of: TitledBorder.ABOVE_TOP,
277     * TitledBorder.TOP (sitting on the top line), TitledBorder.BELOW_TOP,     * TitledBorder.TOP (sitting on the top line), TitledBorder.BELOW_TOP,
278     * TitledBorder.ABOVE_BOTTOM, TitledBorder.BOTTOM (sitting on the bottom line),     * TitledBorder.ABOVE_BOTTOM, TitledBorder.BOTTOM (sitting on the bottom
279     * TitledBorder.BELOW_BOTTOM, or TitledBorder.DEFAULT_POSITION (top).     * line), TitledBorder.BELOW_BOTTOM, or TitledBorder.DEFAULT_POSITION (top).
280     *     *
281     * @return The TitledBorder object     * @return The TitledBorder object
282     */     */
# Line 224  public class BorderFactory Line 288  public class BorderFactory
288    }    }
289    
290    /**    /**
291     * Add a title to an existing border, specifying the text of the title along with its positioning and font, using the default text color determined by the current look and feel.     * Add a title to an existing border, specifying the text of the title along
292       * with its positioning and font, using the default text color determined by
293       * the current look and feel.
294     *     *
295     * @param border - the Border object to add the title to     * @param border - the Border object to add the title to
296     * @param title - a String containing the text of the title     * @param title - a String containing the text of the title
297     * @param titleJustification - an int specifying the left/right position of the title -- one of TitledBorder.LEFT, TitledBorder.CENTER, or TitledBorder.RIGHT, TitledBorder.DEFAULT_JUSTIFICATION (left).     * @param titleJustification - an int specifying the left/right position of
298     * @param titlePosition - an int specifying the vertical position of the text in relation to the border -- one of: TitledBorder.ABOVE_TOP, TitledBorder.TOP (sitting on the top line), TitledBorder.BELOW_TOP, TitledBorder.ABOVE_BOTTOM, TitledBorder.BOTTOM (sitting on the bottom line), TitledBorder.BELOW_BOTTOM, or TitledBorder.DEFAULT_POSITION (top).     * the title -- one of TitledBorder.LEFT, TitledBorder.CENTER, or
299       * TitledBorder.RIGHT, TitledBorder.DEFAULT_JUSTIFICATION (left).
300       * @param titlePosition - an int specifying the vertical position of the
301       * text in relation to the border -- one of: TitledBorder.ABOVE_TOP,
302       * TitledBorder.TOP (sitting on the top line), TitledBorder.BELOW_TOP,
303       * TitledBorder.ABOVE_BOTTOM, TitledBorder.BOTTOM (sitting on the bottom
304       * line), TitledBorder.BELOW_BOTTOM, or TitledBorder.DEFAULT_POSITION (top).
305     * @param titleFont - a Font object specifying the title font     * @param titleFont - a Font object specifying the title font
306     *     *
307     * @return The TitledBorder object     * @return The TitledBorder object
# Line 239  public class BorderFactory Line 311  public class BorderFactory
311                                                   int titlePosition,                                                   int titlePosition,
312                                                   Font titleFont)                                                   Font titleFont)
313    {    {
314      return new TitledBorder (border, title, titleJustification, titlePosition, titleFont);      return new TitledBorder (border, title, titleJustification, titlePosition,
315                                 titleFont);
316    }    }
317    
318    /**    /**
319     * Add a title to an existing border, specifying the text of the title along with its positioning, font, and color.     * Add a title to an existing border, specifying the text of the title along
320       * with its positioning, font, and color.
321     *     *
322     * @param border - the Border object to add the title to     * @param border - the Border object to add the title to
323     * @param title - a String containing the text of the title     * @param title - a String containing the text of the title
324     * @param titleJustification - an int specifying the left/right position of the title -- one of TitledBorder.LEFT, TitledBorder.CENTER, or TitledBorder.RIGHT, TitledBorder.DEFAULT_JUSTIFICATION (left).     * @param titleJustification - an int specifying the left/right position of
325     * @param titlePosition - an int specifying the vertical position of the text in relation to the border -- one of: TitledBorder.ABOVE_TOP, TitledBorder.TOP (sitting on the top line), TitledBorder.BELOW_TOP, TitledBorder.ABOVE_BOTTOM, TitledBorder.BOTTOM (sitting on the bottom line), TitledBorder.BELOW_BOTTOM, or TitledBorder.DEFAULT_POSITION (top).     * the title -- one of TitledBorder.LEFT, TitledBorder.CENTER, or
326       * TitledBorder.RIGHT, TitledBorder.DEFAULT_JUSTIFICATION (left).
327       * @param titlePosition - an int specifying the vertical position of the text
328       * in relation to the border -- one of: TitledBorder.ABOVE_TOP,
329       * TitledBorder.TOP (sitting on the top line), TitledBorder.BELOW_TOP,
330       * TitledBorder.ABOVE_BOTTOM, TitledBorder.BOTTOM (sitting on the bottom
331       * line), TitledBorder.BELOW_BOTTOM, or TitledBorder.DEFAULT_POSITION (top).
332     * @param titleFont - a Font object specifying the title font     * @param titleFont - a Font object specifying the title font
333     * @param titleColor - a Color object specifying the title color     * @param titleColor - a Color object specifying the title color
334     *     *
# Line 261  public class BorderFactory Line 341  public class BorderFactory
341                                                   Font titleFont,                                                   Font titleFont,
342                                                   Color titleColor)                                                   Color titleColor)
343    {    {
344      return new TitledBorder (border, title, titleJustification, titlePosition, titleFont, titleColor);      return new TitledBorder (border, title, titleJustification, titlePosition,
345                                 titleFont, titleColor);
346    }    }
347    
348    /**    /**
349     * Creates an empty border that takes up no space. (The width of the top, bottom, left, and right sides are all zero.)     * Creates an empty border that takes up no space. (The width of the top,
350       * bottom, left, and right sides are all zero.)
351     *     *
352     * @return The Border object     * @return The Border object
353     */     */
# Line 275  public class BorderFactory Line 357  public class BorderFactory
357    }    }
358    
359    /**    /**
360     * Creates an empty border that takes up no space but which does no drawing, specifying the width of the top, left, bottom, and right sides.     * Creates an empty border that takes up no space but which does no drawing,
361       * specifying the width of the top, left, bottom, and right sides.
362     *     *
363     * @param top An int specifying the width of the top in pixels     * @param top An int specifying the width of the top in pixels
364     * @param left An int specifying the width of the left side in pixels     * @param left An int specifying the width of the left side in pixels
# Line 284  public class BorderFactory Line 367  public class BorderFactory
367     *     *
368     * @return The Border object     * @return The Border object
369     */     */
370    public static Border createEmptyBorder (int top, int left, int bottom,int right)    public static Border createEmptyBorder (int top, int left, int bottom,
371                                              int right)
372    {    {
373      return new EmptyBorder (top, left, bottom, right);      return new EmptyBorder (top, left, bottom, right);
374    }    }
# Line 300  public class BorderFactory Line 384  public class BorderFactory
384    }    }
385    
386    /**    /**
387     * Create a compound border specifying the border objects to use for the outside and inside edges.     * Create a compound border specifying the border objects to use for the
388       * outside and inside edges.
389     *     *
390     * @param outsideBorder A Border object for the outer edge of the compound border     * @param outsideBorder A Border object for the outer edge of the
391     * @param insideBorder A Border object for the inner edge of the compound border     * compound border
392       * @param insideBorder A Border object for the inner edge of the
393       * compound border
394     *     *
395     * @return The CompoundBorder object     * @return The CompoundBorder object
396     */     */
397    public static CompoundBorder createCompoundBorder (Border outsideBorder, Border insideBorder)    public static CompoundBorder createCompoundBorder (Border outsideBorder,
398                                                         Border insideBorder)
399    {    {
400      return new CompoundBorder (outsideBorder, insideBorder);      return new CompoundBorder (outsideBorder, insideBorder);
401    }    }
402    
403    /**    /**
404     * Create a matte-look border using a solid color. (The difference between this border and a line border is that you can specify the individual border dimensions.)     * Create a matte-look border using a solid color. (The difference between
405       * this border and a line border is that you can specify the individual
406       * border dimensions.)
407     *     *
408     * @param top An int specifying the width of the top in pixels     * @param top An int specifying the width of the top in pixels
409     * @param left An int specifying the width of the left side in pixels     * @param left An int specifying the width of the left side in pixels
410     * @param bottom An int specifying the width of the right side in pixels     * @param bottom An int specifying the width of the right side in pixels
411     * @param right An int specifying the width of the bottom in pixelscolor - a Color to use for the border     * @param right An int specifying the width of the bottom in pixels
412       * @param color A Color to use for the border
413     *     *
414     * @return The MatteBorder object     * @return The MatteBorder object
415     */     */
416    public static MatteBorder createMatteBorder (int top, int left, int bottom, int right, Color color)    public static MatteBorder createMatteBorder (int top, int left, int bottom,
417                                                   int right, Color color)
418    {    {
419      return new MatteBorder (top, left, bottom, right, color);      return new MatteBorder (top, left, bottom, right, color);
420    }    }
421    
422    /**    /**
423     * Create a matte-look border that consists of multiple tiles of a specified icon. Multiple copies of the icon are placed side-by-side to fill up the border area.     * Create a matte-look border that consists of multiple tiles of a specified
424       * icon. Multiple copies of the icon are placed side-by-side to fill up the
425       * border area.
426     *     *
427     * Note:     * Note:
428     * If the icon doesn't load, the border area is painted gray.     * If the icon doesn't load, the border area is painted gray.
# Line 341  public class BorderFactory Line 435  public class BorderFactory
435     *     *
436     * @return The MatteBorder object     * @return The MatteBorder object
437     */     */
438    public static MatteBorder createMatteBorder (int top, int left, int bottom, int right, Icon tileIcon)    public static MatteBorder createMatteBorder (int top, int left, int bottom,
439                                                   int right, Icon tileIcon)
440    {    {
441      return new MatteBorder (top, left, bottom, right, tileIcon);      return new MatteBorder (top, left, bottom, right, tileIcon);
442    }    }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26