|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.izforge.izpack.installer.LayoutHelper
public class LayoutHelper
This class manages the layout for IzPanels. The layout related methods in IzPanel delegates the
work to this class. Use the layout helper directly because the delegating methods in IzPanel will
be removed in the future.
This layout helper works with a GridBagLayout or a IzPanelLayout as layout manager. The layout
manager has to be set at calling the method startLayout
. This method has to be
called before the first add of a component to the IzPanel.
Field Summary | |
---|---|
static java.lang.String |
ALL_X_GAP
Identifier of x gap for all default x gaps. |
static java.lang.String |
ALL_Y_GAP
Identifier of x gap for all default y gaps. |
protected static int |
ANCHOR
Layout anchor declared in the xml file with the guiprefs modifier "layoutAnchor" |
protected java.lang.Object |
defaultConstraints
The default grid bag constraint. |
protected static java.lang.Double |
DOUBLE_ZERO
|
protected static double |
FULL_COLUMN_STRETCH_DEFAULT
|
protected static double |
FULL_LINE_STRETCH_DEFAULT
|
protected int |
gridxCounter
Current x position of grid. |
protected int |
gridyCounter
Current y position of grid. |
protected static java.lang.Double |
INITIAL_STRETCH_DEFAULT
|
protected java.awt.LayoutManager2 |
izPanelLayout
internal layout |
protected boolean |
layoutStarted
Indicates whether grid bag layout was started or not |
(package private) javax.swing.JComponent |
parent
|
static java.lang.String[] |
X_GAP_NAME_LOOK_UP
Look-up table for gap identifier to gap names for the x direction. |
protected static int |
X_STRETCH_TYPE
|
static java.lang.String[] |
Y_GAP_NAME_LOOK_UP
Look-up table for gap identifier to gap names for the y direction. |
protected static int |
Y_STRETCH_TYPE
|
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
---|---|
protected |
LayoutHelper()
The default constructor is only useable by derived classes. |
|
LayoutHelper(javax.swing.JComponent parent)
Only useable constructor. |
Method Summary | |
---|---|
private void |
completeGridBagLayout()
Complete layout determining. |
void |
completeLayout()
Complete layout determining. |
static int |
getAnchor()
Returns the anchor as value declared in GridBagConstraints. |
java.lang.Object |
getDefaultConstraints()
Returns the default constraints of this panel. |
static double |
getFullColumnStretch()
Returns the default value for stretching to a full column. |
static double |
getFullLineStretch()
Returns the default value for stretching to a full line. |
java.awt.LayoutManager2 |
getLayout()
Returns the layout manager which current used by this layout helper. |
private static java.lang.Object |
getModifierValue(java.lang.Object currentVal,
java.lang.Object defaultVal,
java.lang.Object readLimit,
java.lang.String key)
|
java.lang.Object |
getNewConstraints(int gridx,
int gridy)
Returns a newly created constraints with the given values and the values from the default constraints for the other parameters. |
java.lang.Object |
getNewConstraints(int gridx,
int gridy,
int gridwidth,
int gridheight)
Returns a newly created constraints with the given values and the values from the defaultGridBagConstraints for the other parameters. |
java.lang.Object |
getNextXConstraints()
Returns a newly created constraints for the next column of the current layout row. |
java.lang.Object |
getNextYConstraints()
Returns a newly created constraints with column 0 for the next row. |
java.lang.Object |
getNextYConstraints(int gridwidth,
int gridheight)
Returns a newly created constraints with column 0 for the next row using the given parameters. |
static int |
getXGap(int gapId)
Returns the gap which should be used between the given gui objects for the x direction. |
static int |
getXStretchType()
Returns the used stretch type for the x direction. |
static int |
getYGap(int gapId)
Returns the gap which should be used between the given gui objects for the y direction. |
static int |
getYStretchType()
Returns the used stretch type for the y direction. |
private boolean |
isGridBag()
Returns whether the used layout is a GridBagLayout or not. |
private boolean |
isIzPanel()
Returns whether the used layout is an IzPanelLayout or not. |
void |
resetGridCounter()
Resets the grid counters which are used at getNextXConstraints and getNextYConstraints. |
void |
setDefaultConstraints(java.lang.Object constraints)
Sets the default constraints of this panel to the given object. |
void |
setLayout(java.awt.LayoutManager2 izPanelLayout)
Sets the given layout manager for this layout helper to be used. |
private void |
startGridBagLayout()
Start layout determining. |
private void |
startIzPanelLayout()
Special start method for IzPanelLayout. |
void |
startLayout(java.awt.LayoutManager2 layout)
Start layout determining. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
javax.swing.JComponent parent
protected boolean layoutStarted
protected java.lang.Object defaultConstraints
protected int gridxCounter
protected int gridyCounter
protected java.awt.LayoutManager2 izPanelLayout
protected static int ANCHOR
protected static int X_STRETCH_TYPE
protected static int Y_STRETCH_TYPE
protected static double FULL_LINE_STRETCH_DEFAULT
protected static double FULL_COLUMN_STRETCH_DEFAULT
protected static java.lang.Double INITIAL_STRETCH_DEFAULT
protected static java.lang.Double DOUBLE_ZERO
public static final java.lang.String[] X_GAP_NAME_LOOK_UP
public static final java.lang.String[] Y_GAP_NAME_LOOK_UP
public static final java.lang.String ALL_X_GAP
public static final java.lang.String ALL_Y_GAP
Constructor Detail |
---|
public LayoutHelper(javax.swing.JComponent parent)
parent
- for which this layout manager will be usedprotected LayoutHelper()
Method Detail |
---|
private boolean isGridBag()
private boolean isIzPanel()
public void startLayout(java.awt.LayoutManager2 layout)
IzPanel.LayoutType
are also supported.
layout
- layout to be used by this layout helperprivate void startIzPanelLayout()
startLayout
.
public void completeLayout()
IzPanel.LayoutType
are also supported.
public java.lang.Object getDefaultConstraints()
public void setDefaultConstraints(java.lang.Object constraints)
constraints
- which should be set as default for this objectpublic void resetGridCounter()
public java.lang.Object getNewConstraints(int gridx, int gridy)
gridx
- value to be used for the new constraintgridy
- value to be used for the new constraint
public java.lang.Object getNewConstraints(int gridx, int gridy, int gridwidth, int gridheight)
gridx
- value to be used for the new constraintgridy
- value to be used for the new constraintgridwidth
- value to be used for the new constraintgridheight
- value to be used for the new constraint
public java.lang.Object getNextXConstraints()
public java.lang.Object getNextYConstraints()
public java.lang.Object getNextYConstraints(int gridwidth, int gridheight)
gridwidth
- width for this constraintgridheight
- height for this constraint
private void startGridBagLayout()
IzPanel.LayoutType
are also supported.
private void completeGridBagLayout()
IzPanel.LayoutType
are also supported.
public static int getAnchor()
public static int getXGap(int gapId)
gapId
- index in array GAP_NAME_LOOK_UP for the needed gap
public static int getYGap(int gapId)
gapId
- index in array GAP_NAME_LOOK_UP for the needed gap
public static int getXStretchType()
public static int getYStretchType()
public static double getFullLineStretch()
public static double getFullColumnStretch()
private static java.lang.Object getModifierValue(java.lang.Object currentVal, java.lang.Object defaultVal, java.lang.Object readLimit, java.lang.String key)
public java.awt.LayoutManager2 getLayout()
public void setLayout(java.awt.LayoutManager2 izPanelLayout)
izPanelLayout
- layout manager to be used
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |