/[classpath]/classpath/javax/swing/plaf/metal/MetalBorders.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/metal/MetalBorders.java

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

revision 1.26 by rabbit78, Wed Oct 19 13:46:02 2005 UTC revision 1.27 by trebligd, Thu Oct 27 09:50:58 2005 UTC
# Line 45  import java.awt.Insets; Line 45  import java.awt.Insets;
45    
46  import javax.swing.AbstractButton;  import javax.swing.AbstractButton;
47  import javax.swing.ButtonModel;  import javax.swing.ButtonModel;
48    import javax.swing.JButton;
49  import javax.swing.JInternalFrame;  import javax.swing.JInternalFrame;
50  import javax.swing.JMenu;  import javax.swing.JMenu;
51  import javax.swing.JMenuBar;  import javax.swing.JMenuBar;
52  import javax.swing.JMenuItem;  import javax.swing.JMenuItem;
53  import javax.swing.JOptionPane;  import javax.swing.JOptionPane;
54    import javax.swing.JScrollPane;
55  import javax.swing.JTextField;  import javax.swing.JTextField;
56  import javax.swing.JToggleButton;  import javax.swing.JToggleButton;
57  import javax.swing.JToolBar;  import javax.swing.JToolBar;
# Line 65  import javax.swing.text.JTextComponent; Line 67  import javax.swing.text.JTextComponent;
67    
68    
69  /**  /**
70   * This factory class creates borders for the different Swing components   * A factory class that creates borders for the different Swing components.
  * UI.  
71   *   *
72   * @author Roman Kennke (roman@kennke.org)   * @author Roman Kennke (roman@kennke.org)
73   */   */
# Line 88  public class MetalBorders Line 89  public class MetalBorders
89    /** The shared instance for getTextFieldBorder(). */    /** The shared instance for getTextFieldBorder(). */
90    private static Border textFieldBorder;    private static Border textFieldBorder;
91    
92    /**    /** The shared instance for getTextBorder(). */
    * The shared instance for getTextBorder().  
    */  
93    private static Border textBorder;    private static Border textBorder;
94    
95    /** The shared instance for getRolloverBorder(). */    /** The shared instance for getRolloverBorder(). */
# Line 104  public class MetalBorders Line 103  public class MetalBorders
103    private static BasicBorders.MarginBorder marginBorder;    private static BasicBorders.MarginBorder marginBorder;
104    
105    /**    /**
106     * The border that is drawn around Swing buttons.     * A border used for {@link JButton} components.
107     */     */
108    public static class ButtonBorder extends AbstractBorder implements UIResource    public static class ButtonBorder extends AbstractBorder implements UIResource
109    {    {
# Line 112  public class MetalBorders Line 111  public class MetalBorders
111      protected static Insets borderInsets = new Insets(3, 3, 3, 3);      protected static Insets borderInsets = new Insets(3, 3, 3, 3);
112    
113      /**      /**
114       * Creates a new instance of ButtonBorder.       * Creates a new instance of <code>ButtonBorder</code>.
115       */       */
116      public ButtonBorder()      public ButtonBorder()
117      {      {
# Line 186  public class MetalBorders Line 185  public class MetalBorders
185      }      }
186    
187      /**      /**
188       * Returns the insets of the ButtonBorder.       * Returns the insets of the <code>ButtonBorder</code>.
189       *       *
190       * @param c the component for which the border is used       * @param c the component for which the border is used
191       *       *
192       * @return the insets of the ButtonBorder       * @return The insets of the ButtonBorder
193       */       */
194      public Insets getBorderInsets(Component c)      public Insets getBorderInsets(Component c)
195      {      {
# Line 198  public class MetalBorders Line 197  public class MetalBorders
197      }      }
198    
199      /**      /**
200       * Returns the insets of the ButtonBorder in the specified Insets object.       * Returns the insets of the <code>ButtonBorder</code> in the specified
201         * <code>newInsets</code> object.
202       *       *
203       * @param c the component for which the border is used       * @param c the component for which the border is used
204       * @param newInsets the insets object where to put the values       * @param newInsets the insets object where to put the values (if
205         *        <code>null</code>, a new instance is created).
206       *       *
207       * @return the insets of the ButtonBorder       * @return The insets.
208       */       */
209      public Insets getBorderInsets(Component c, Insets newInsets)      public Insets getBorderInsets(Component c, Insets newInsets)
210      {      {
211        if (newInsets == null)        if (newInsets == null)
212          newInsets = new Insets(0, 0, 0, 0);          newInsets = new Insets(0, 0, 0, 0);
213    
       AbstractButton b = (AbstractButton) c;  
214        newInsets.bottom = borderInsets.bottom;        newInsets.bottom = borderInsets.bottom;
215        newInsets.left = borderInsets.left;        newInsets.left = borderInsets.left;
216        newInsets.right = borderInsets.right;        newInsets.right = borderInsets.right;
# Line 488  public class MetalBorders Line 488  public class MetalBorders
488    }    }
489    
490    /**    /**
491     * A border used when painting {@link JInternalFrame} instances.     * A border used for the {@link JInternalFrame} component.
492     */     */
493    public static class InternalFrameBorder extends AbstractBorder    public static class InternalFrameBorder extends AbstractBorder
494      implements UIResource      implements UIResource
# Line 587  public class MetalBorders Line 587  public class MetalBorders
587    }    }
588    
589    /**    /**
590     * A border used when painting {@link JInternalFrame} instances that are     * A border used for {@link JInternalFrame} components that are
591     * presented as dialogs (by the {@link JOptionPane} class).     * presented as dialogs (by the {@link JOptionPane} class).
592     */     */
593    public static class OptionDialogBorder extends AbstractBorder    public static class OptionDialogBorder extends AbstractBorder
# Line 863  public class MetalBorders Line 863  public class MetalBorders
863    }    }
864    
865    /**    /**
866     * A border for JScrollPanes.     * A border for {@link JScrollPane} components.
867     */     */
868    public static class ScrollPaneBorder    public static class ScrollPaneBorder
869      extends AbstractBorder      extends AbstractBorder
# Line 1116  public class MetalBorders Line 1116  public class MetalBorders
1116    }    }
1117    
1118    /**    /**
1119     * A border used for {@link JToggleButton} components.     * A border used for the {@link JToggleButton} component.
1120     *     *
1121     * @since 1.3     * @since 1.3
1122     */     */
# Line 1209  public class MetalBorders Line 1209  public class MetalBorders
1209    }    }
1210    
1211    /**    /**
1212     * A border used when painting {@link JToolBar} instances.     * A border used for the {@link JToolBar} component.
1213     */     */
1214    public static class ToolBarBorder extends AbstractBorder    public static class ToolBarBorder extends AbstractBorder
1215      implements UIResource, SwingConstants      implements UIResource, SwingConstants

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

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