< prev index next >

src/java.desktop/share/classes/javax/swing/Box.java

Print this page

        

*** 39,65 **** * Box provides several class methods * that are useful for containers using BoxLayout -- * even non-Box containers. * * <p> ! * The <code>Box</code> class can create several kinds * of invisible components * that affect layout: * glue, struts, and rigid areas. ! * If all the components your <code>Box</code> contains * have a fixed size, * you might want to use a glue component ! * (returned by <code>createGlue</code>) * to control the components' positions. * If you need a fixed amount of space between two components, * try using a strut ! * (<code>createHorizontalStrut</code> or <code>createVerticalStrut</code>). * If you need an invisible component * that always takes up the same amount of space, ! * get it by invoking <code>createRigidArea</code>. * <p> ! * If you are implementing a <code>BoxLayout</code> you * can find further information and examples in * <a href="http://docs.oracle.com/javase/tutorial/uiswing/layout/box.html">How to Use BoxLayout</a>, * a section in <em>The Java Tutorial.</em> * <p> --- 39,65 ---- * Box provides several class methods * that are useful for containers using BoxLayout -- * even non-Box containers. * * <p> ! * The {@code Box} class can create several kinds * of invisible components * that affect layout: * glue, struts, and rigid areas. ! * If all the components your {@code Box} contains * have a fixed size, * you might want to use a glue component ! * (returned by {@code createGlue}) * to control the components' positions. * If you need a fixed amount of space between two components, * try using a strut ! * ({@code createHorizontalStrut} or {@code createVerticalStrut}). * If you need an invisible component * that always takes up the same amount of space, ! * get it by invoking {@code createRigidArea}. * <p> ! * If you are implementing a {@code BoxLayout} you * can find further information and examples in * <a href="http://docs.oracle.com/javase/tutorial/uiswing/layout/box.html">How to Use BoxLayout</a>, * a section in <em>The Java Tutorial.</em> * <p>
*** 67,77 **** * 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}. * * @see BoxLayout * * @author Timothy Prinzing --- 67,77 ---- * 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}. * * @see BoxLayout * * @author Timothy Prinzing
*** 79,110 **** */ @SuppressWarnings("serial") public class Box extends JComponent implements Accessible { /** ! * Creates a <code>Box</code> that displays its components * along the specified axis. * * @param axis can be {@link BoxLayout#X_AXIS}, * {@link BoxLayout#Y_AXIS}, * {@link BoxLayout#LINE_AXIS} or * {@link BoxLayout#PAGE_AXIS}. ! * @throws AWTError if the <code>axis</code> is invalid * @see #createHorizontalBox * @see #createVerticalBox */ public Box(int axis) { super(); super.setLayout(new BoxLayout(this, axis)); } /** ! * Creates a <code>Box</code> that displays its components ! * from left to right. If you want a <code>Box</code> that * respects the component orientation you should create the ! * <code>Box</code> using the constructor and pass in ! * <code>BoxLayout.LINE_AXIS</code>, eg: * <pre> * Box lineBox = new Box(BoxLayout.LINE_AXIS); * </pre> * * @return the box --- 79,110 ---- */ @SuppressWarnings("serial") public class Box extends JComponent implements Accessible { /** ! * Creates a {@code Box} that displays its components * along the specified axis. * * @param axis can be {@link BoxLayout#X_AXIS}, * {@link BoxLayout#Y_AXIS}, * {@link BoxLayout#LINE_AXIS} or * {@link BoxLayout#PAGE_AXIS}. ! * @throws AWTError if the {@code axis} is invalid * @see #createHorizontalBox * @see #createVerticalBox */ public Box(int axis) { super(); super.setLayout(new BoxLayout(this, axis)); } /** ! * Creates a {@code Box} that displays its components ! * from left to right. If you want a {@code Box} that * respects the component orientation you should create the ! * {@code Box} using the constructor and pass in ! * {@code BoxLayout.LINE_AXIS}, eg: * <pre> * Box lineBox = new Box(BoxLayout.LINE_AXIS); * </pre> * * @return the box
*** 112,126 **** public static Box createHorizontalBox() { return new Box(BoxLayout.X_AXIS); } /** ! * Creates a <code>Box</code> that displays its components ! * from top to bottom. If you want a <code>Box</code> that * respects the component orientation you should create the ! * <code>Box</code> using the constructor and pass in ! * <code>BoxLayout.PAGE_AXIS</code>, eg: * <pre> * Box lineBox = new Box(BoxLayout.PAGE_AXIS); * </pre> * * @return the box --- 112,126 ---- public static Box createHorizontalBox() { return new Box(BoxLayout.X_AXIS); } /** ! * Creates a {@code Box} that displays its components ! * from top to bottom. If you want a {@code Box} that * respects the component orientation you should create the ! * {@code Box} using the constructor and pass in ! * {@code BoxLayout.PAGE_AXIS}, eg: * <pre> * Box lineBox = new Box(BoxLayout.PAGE_AXIS); * </pre> * * @return the box
*** 222,232 **** * the fixed-size components are centered in the box. * * <p> * * To use glue, ! * call <code>Box.createGlue</code> * and add the returned component to a container. * The glue component has no minimum or preferred size, * so it takes no space unless excess space is available. * If excess space is available, * then the glue component takes its share of available --- 222,232 ---- * the fixed-size components are centered in the box. * * <p> * * To use glue, ! * call {@code Box.createGlue} * and add the returned component to a container. * The glue component has no minimum or preferred size, * so it takes no space unless excess space is available. * If excess space is available, * then the glue component takes its share of available
*** 268,284 **** public void setLayout(LayoutManager l) { throw new AWTError("Illegal request"); } /** ! * Paints this <code>Box</code>. If this <code>Box</code> has a UI this * method invokes super's implementation, otherwise if this ! * <code>Box</code> is opaque the <code>Graphics</code> is filled * using the background. * ! * @param g the <code>Graphics</code> to paint to ! * @throws NullPointerException if <code>g</code> is null * @since 1.6 */ protected void paintComponent(Graphics g) { if (ui != null) { // On the off chance some one created a UI, honor it --- 268,284 ---- public void setLayout(LayoutManager l) { throw new AWTError("Illegal request"); } /** ! * Paints this {@code Box}. If this {@code Box} has a UI this * method invokes super's implementation, otherwise if this ! * {@code Box} is opaque the {@code Graphics} is filled * using the background. * ! * @param g the {@code Graphics} to paint to ! * @throws NullPointerException if {@code g} is null * @since 1.6 */ protected void paintComponent(Graphics g) { if (ui != null) { // On the off chance some one created a UI, honor it
*** 298,308 **** * 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}. */ @SuppressWarnings("serial") public static class Filler extends JComponent implements Accessible { --- 298,308 ---- * 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}. */ @SuppressWarnings("serial") public static class Filler extends JComponent implements Accessible {
*** 337,354 **** } // ---- Component methods ------------------------------------------ /** ! * Paints this <code>Filler</code>. If this ! * <code>Filler</code> has a UI this method invokes super's ! * implementation, otherwise if this <code>Filler</code> is ! * opaque the <code>Graphics</code> is filled using the * background. * ! * @param g the <code>Graphics</code> to paint to ! * @throws NullPointerException if <code>g</code> is null * @since 1.6 */ protected void paintComponent(Graphics g) { if (ui != null) { // On the off chance some one created a UI, honor it --- 337,354 ---- } // ---- Component methods ------------------------------------------ /** ! * Paints this {@code Filler}. If this ! * {@code Filler} has a UI this method invokes super's ! * implementation, otherwise if this {@code Filler} is ! * opaque the {@code Graphics} is filled using the * background. * ! * @param g the {@code Graphics} to paint to ! * @throws NullPointerException if {@code g} is null * @since 1.6 */ protected void paintComponent(Graphics g) { if (ui != null) { // On the off chance some one created a UI, honor it
*** 379,389 **** return accessibleContext; } /** * This class implements accessibility support for the ! * <code>Box.Filler</code> class. */ @SuppressWarnings("serial") protected class AccessibleBoxFiller extends AccessibleAWTComponent { // AccessibleContext methods // --- 379,389 ---- return accessibleContext; } /** * This class implements accessibility support for the ! * {@code Box.Filler} class. */ @SuppressWarnings("serial") protected class AccessibleBoxFiller extends AccessibleAWTComponent { // AccessibleContext methods //
*** 420,430 **** return accessibleContext; } /** * This class implements accessibility support for the ! * <code>Box</code> class. */ @SuppressWarnings("serial") protected class AccessibleBox extends AccessibleAWTContainer { // AccessibleContext methods // --- 420,430 ---- return accessibleContext; } /** * This class implements accessibility support for the ! * {@code Box} class. */ @SuppressWarnings("serial") protected class AccessibleBox extends AccessibleAWTContainer { // AccessibleContext methods //
< prev index next >