< prev index next >

src/java.desktop/share/classes/javax/swing/border/AbstractBorder.java

Print this page

        

*** 39,49 **** * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * * @author David Kloba */ @SuppressWarnings("serial") --- 39,49 ---- * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. * * @author David Kloba */ @SuppressWarnings("serial")
*** 77,87 **** /** * Reinitializes the insets parameter with this Border's current Insets. * @param c the component for which this border insets value applies * @param insets the object to be reinitialized ! * @return the <code>insets</code> object */ public Insets getBorderInsets(Component c, Insets insets) { insets.left = insets.top = insets.right = insets.bottom = 0; return insets; } --- 77,87 ---- /** * Reinitializes the insets parameter with this Border's current Insets. * @param c the component for which this border insets value applies * @param insets the object to be reinitialized ! * @return the {@code insets} object */ public Insets getBorderInsets(Component c, Insets insets) { insets.left = insets.top = insets.right = insets.bottom = 0; return insets; }
*** 97,123 **** * @param c the component for which this border is being computed * @param x the x position of the border * @param y the y position of the border * @param width the width of the border * @param height the height of the border ! * @return a <code>Rectangle</code> containing the interior coordinates */ public Rectangle getInteriorRectangle(Component c, int x, int y, int width, int height) { return getInteriorRectangle(c, this, x, y, width, height); } /** * Returns a rectangle using the arguments minus the * insets of the border. This is useful for determining the area * that components should draw in that will not intersect the border. * @param c the component for which this border is being computed ! * @param b the <code>Border</code> object * @param x the x position of the border * @param y the y position of the border * @param width the width of the border * @param height the height of the border ! * @return a <code>Rectangle</code> containing the interior coordinates */ public static Rectangle getInteriorRectangle(Component c, Border b, int x, int y, int width, int height) { Insets insets; if(b != null) insets = b.getBorderInsets(c); --- 97,123 ---- * @param c the component for which this border is being computed * @param x the x position of the border * @param y the y position of the border * @param width the width of the border * @param height the height of the border ! * @return a {@code Rectangle} containing the interior coordinates */ public Rectangle getInteriorRectangle(Component c, int x, int y, int width, int height) { return getInteriorRectangle(c, this, x, y, width, height); } /** * Returns a rectangle using the arguments minus the * insets of the border. This is useful for determining the area * that components should draw in that will not intersect the border. * @param c the component for which this border is being computed ! * @param b the {@code Border} object * @param x the x position of the border * @param y the y position of the border * @param width the width of the border * @param height the height of the border ! * @return a {@code Rectangle} containing the interior coordinates */ public static Rectangle getInteriorRectangle(Component c, Border b, int x, int y, int width, int height) { Insets insets; if(b != null) insets = b.getBorderInsets(c);
*** 134,147 **** * does not have a reasonable baseline. * <p> * The default implementation returns -1. Subclasses that support * baseline should override appropriately. If a value &gt;= 0 is * returned, then the component has a valid baseline for any ! * size &gt;= the minimum size and <code>getBaselineResizeBehavior</code> * can be used to determine how the baseline changes with size. * ! * @param c <code>Component</code> baseline is being requested for * @param width the width to get the baseline for * @param height the height to get the baseline for * @return the baseline or &lt; 0 indicating there is no reasonable * baseline * @throws IllegalArgumentException if width or height is &lt; 0 --- 134,147 ---- * does not have a reasonable baseline. * <p> * The default implementation returns -1. Subclasses that support * baseline should override appropriately. If a value &gt;= 0 is * returned, then the component has a valid baseline for any ! * size &gt;= the minimum size and {@code getBaselineResizeBehavior} * can be used to determine how the baseline changes with size. * ! * @param c {@code Component} baseline is being requested for * @param width the width to get the baseline for * @param height the height to get the baseline for * @return the baseline or &lt; 0 indicating there is no reasonable * baseline * @throws IllegalArgumentException if width or height is &lt; 0
*** 161,181 **** * Returns an enum indicating how the baseline of a component * changes as the size changes. This method is primarily meant for * layout managers and GUI builders. * <p> * The default implementation returns ! * <code>BaselineResizeBehavior.OTHER</code>, subclasses that support * baseline should override appropriately. Subclasses should ! * never return <code>null</code>; if the baseline can not be ! * calculated return <code>BaselineResizeBehavior.OTHER</code>. Callers * should first ask for the baseline using ! * <code>getBaseline</code> and if a value &gt;= 0 is returned use * this method. It is acceptable for this method to return a ! * value other than <code>BaselineResizeBehavior.OTHER</code> even if ! * <code>getBaseline</code> returns a value less than 0. * ! * @param c <code>Component</code> to return baseline resize behavior for * @return an enum indicating how the baseline changes as the border is * resized * @see java.awt.Component#getBaseline(int,int) * @see java.awt.Component#getBaselineResizeBehavior() * @since 1.6 --- 161,181 ---- * Returns an enum indicating how the baseline of a component * changes as the size changes. This method is primarily meant for * layout managers and GUI builders. * <p> * The default implementation returns ! * {@code BaselineResizeBehavior.OTHER}, subclasses that support * baseline should override appropriately. Subclasses should ! * never return {@code null}; if the baseline can not be ! * calculated return {@code BaselineResizeBehavior.OTHER}. Callers * should first ask for the baseline using ! * {@code getBaseline} and if a value &gt;= 0 is returned use * this method. It is acceptable for this method to return a ! * value other than {@code BaselineResizeBehavior.OTHER} even if ! * {@code getBaseline} returns a value less than 0. * ! * @param c {@code Component} to return baseline resize behavior for * @return an enum indicating how the baseline changes as the border is * resized * @see java.awt.Component#getBaseline(int,int) * @see java.awt.Component#getBaselineResizeBehavior() * @since 1.6
< prev index next >