|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.townleyenterprises.swing.SpringHints
This class is used to provide per-component layout hints to the SpringUtils utility class. This class describes the component's layout constraints in a similar manner to the way you can describe component layout behavior in the NEXTSTEP/MacOS X InterfaceBuilder application.
To use this class, create a new instance and put it on the
component to be layed out using the JComponent.putClientProperty(java.lang.Object, java.lang.Object)
method. The SpringUtils
class will attempt to access this information before applying the
layout.
The following example illustrates this use:
JPanel container = new JPanel(new SpringLayout()); JLabel label = new JLabel("Label:"); JTextField text = new JTextField(); // add the spring hints text.putClientProperty(SpringHints.PROPERTY, new SpringHints(true, false)); container.add(label); container.add(text); SpringUtils.applyLayout(content, 2, 2, 6, 6, 12, 6);
Field Summary | |
static java.lang.String |
PROPERTY
this is the property name used to access the hints instances on the component |
Constructor Summary | |
SpringHints(boolean springWidth,
boolean springHeight)
This version of the constructor specifies the internal "springy-ness" of the component. |
|
SpringHints(boolean springNorth,
boolean springSouth,
boolean springEast,
boolean springWest,
boolean springWidth,
boolean springHeight)
This version of the constructor specifies the complete ways that the component may be affected by the springs. |
Method Summary | |
boolean |
getSpringEast()
|
boolean |
getSpringHeight()
|
boolean |
getSpringNorth()
|
boolean |
getSpringSouth()
|
boolean |
getSpringWest()
|
boolean |
getSpringWidth()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String PROPERTY
Constructor Detail |
public SpringHints(boolean springWidth, boolean springHeight)
springWidth
- true to say the component can expand in
widthspringHeight
- true to say if the component can expand
in heightpublic SpringHints(boolean springNorth, boolean springSouth, boolean springEast, boolean springWest, boolean springWidth, boolean springHeight)
springNorth
- true if the top of the component can move
relative to the containerspringSouth
- true if the bottom of the component can
move relative to the containerspringEast
- true if the right side of the component
can move relative to the containerspringWest
- true if the left side of the component
can move relative to the containerspringWidth
- true to say the component can expand in
widthspringHeight
- true to say if the component can expand
in heightMethod Detail |
public boolean getSpringNorth()
public boolean getSpringSouth()
public boolean getSpringEast()
public boolean getSpringWest()
public boolean getSpringWidth()
public boolean getSpringHeight()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |