diff options
Diffstat (limited to 'libjava/classpath/javax/swing/SpringLayout.java')
-rw-r--r-- | libjava/classpath/javax/swing/SpringLayout.java | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/libjava/classpath/javax/swing/SpringLayout.java b/libjava/classpath/javax/swing/SpringLayout.java index 592cc0e02a9..8d46a736a58 100644 --- a/libjava/classpath/javax/swing/SpringLayout.java +++ b/libjava/classpath/javax/swing/SpringLayout.java @@ -1,5 +1,5 @@ /* SpringLayout.java -- - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -150,6 +150,25 @@ public class SpringLayout implements LayoutManager2 } /** + * Create a new Constraints object which tracks the indicated + * component. The x and y positions for this Constraints object + * are constant Springs created with the component's location at + * the time this constructor is called. The width and height + * of this Constraints are Springs created using + * {@link Spring#width(Component)} and {@link Spring#height(Component)}, + * respectively. + * @param component the component to track + * @since 1.5 + */ + public Constraints(Component component) + { + this(Spring.constant(component.getX()), + Spring.constant(component.getY()), + Spring.width(component), + Spring.height(component)); + } + + /** * Returns the constraint for the edge with the <code>edgeName</code>. * This is expected to be one of * {@link #EAST}, {@link #WEST}, {@link #NORTH} or {@link #SOUTH}. @@ -343,8 +362,8 @@ public class SpringLayout implements LayoutManager2 /** * Adds a layout component and a constraint object to this layout. - * This method is usually only called by a {@java.awt.Container}s add - * Method. + * This method is usually only called by a {@link java.awt.Container}s add + * method. * * @param component the component to be added. * @param constraint the constraint to be set. @@ -357,8 +376,8 @@ public class SpringLayout implements LayoutManager2 /** * Adds a layout component and a constraint object to this layout. - * This method is usually only called by a {@java.awt.Container}s add - * Method. This method does nothing, since SpringLayout does not manage + * This method is usually only called by a {@link java.awt.Container}s add + * method. This method does nothing, since SpringLayout does not manage * String-indexed components. * * @param name the name. |