| |
|
| java.lang.Object com.izforge.izpack.installer.LayoutHelper
LayoutHelper | public class LayoutHelper implements LayoutConstants(Code) | | 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.
author: Klaus Bartz |
Method Summary | |
public void | completeLayout() Complete layout determining. | public static int | getAnchor() Returns the anchor as value declared in GridBagConstraints. | public Object | getDefaultConstraints() Returns the default constraints of this panel. | public static double | getFullColumnStretch() Returns the default value for stretching to a full column. | public static double | getFullLineStretch() Returns the default value for stretching to a full line. | public LayoutManager2 | getLayout() Returns the layout manager which current used by this layout helper. | public 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. | public 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. | public Object | getNextXConstraints() Returns a newly created constraints for the next column of the current layout row. | public Object | getNextYConstraints() Returns a newly created constraints with column 0 for the next row. | public Object | getNextYConstraints(int gridwidth, int gridheight) Returns a newly created constraints with column 0 for the next row using the given
parameters. | public static int | getXGap(int gapId) Returns the gap which should be used between the given gui objects for the x direction. | public static int | getXStretchType() Returns the used stretch type for the x direction. | public static int | getYGap(int gapId) Returns the gap which should be used between the given gui objects for the y direction. | public static int | getYStretchType() Returns the used stretch type for the y direction. | public void | resetGridCounter() Resets the grid counters which are used at getNextXConstraints and getNextYConstraints. | public void | setDefaultConstraints(Object constraints) Sets the default constraints of this panel to the given object. | public void | setLayout(LayoutManager2 izPanelLayout) Sets the given layout manager for this layout helper to be used. | public void | startLayout(LayoutManager2 layout) Start layout determining. |
ALL_X_GAP | final public static String ALL_X_GAP(Code) | | Identifier of x gap for all default x gaps.
|
ALL_Y_GAP | final public static String ALL_Y_GAP(Code) | | Identifier of x gap for all default y gaps.
|
ANCHOR | protected static int ANCHOR(Code) | | Layout anchor declared in the xml file with the guiprefs modifier "layoutAnchor"
|
FULL_COLUMN_STRETCH_DEFAULT | protected static double FULL_COLUMN_STRETCH_DEFAULT(Code) | | |
FULL_LINE_STRETCH_DEFAULT | protected static double FULL_LINE_STRETCH_DEFAULT(Code) | | |
INITIAL_STRETCH_DEFAULT | protected static Double INITIAL_STRETCH_DEFAULT(Code) | | |
X_GAP_NAME_LOOK_UP | final public static String[] X_GAP_NAME_LOOK_UP(Code) | | Look-up table for gap identifier to gap names for the x direction. The gap names can be used
in the XML installation configuration file. Be aware that case sensitivity should be used.
|
X_STRETCH_TYPE | protected static int X_STRETCH_TYPE(Code) | | |
Y_GAP_NAME_LOOK_UP | final public static String[] Y_GAP_NAME_LOOK_UP(Code) | | Look-up table for gap identifier to gap names for the y direction. The gap names can be used
in the XML installation configuration file. Be aware that case sensitivity should be used.
|
Y_STRETCH_TYPE | protected static int Y_STRETCH_TYPE(Code) | | |
defaultConstraints | protected Object defaultConstraints(Code) | | The default grid bag constraint.
|
gridxCounter | protected int gridxCounter(Code) | | Current x position of grid.
|
gridyCounter | protected int gridyCounter(Code) | | Current y position of grid.
|
layoutStarted | protected boolean layoutStarted(Code) | | Indicates whether grid bag layout was started or not
|
LayoutHelper | public LayoutHelper(JComponent parent)(Code) | | Only useable constructor. Creates a layout manager for special purpose.
Parameters: parent - for which this layout manager will be used |
LayoutHelper | protected LayoutHelper()(Code) | | The default constructor is only useable by derived classes.
|
completeLayout | public void completeLayout()(Code) | | Complete layout determining. If it is needed, a dummy component will be created as last row.
This will be done, if the IzPack guiprefs modifier with the key "layoutAnchor" has the value
"NORTH" or "NORTHWEST". The earlier used value "TOP" and the declaration via the IzPack
variable IzPanel.LayoutType are also supported.
|
getAnchor | public static int getAnchor()(Code) | | Returns the anchor as value declared in GridBagConstraints. Possible are NORTH, NORTHWEST,
SOUTH, SOUTHWEST and CENTER. The values can be configured in the xml description file with
the variable "IzPanel.LayoutType". The old values "TOP" and "BOTTOM" from the xml file are
mapped to NORTH and SOUTH.
the anchor defined in the IzPanel.LayoutType variable. |
getDefaultConstraints | public Object getDefaultConstraints()(Code) | | Returns the default constraints of this panel.
the default constraints of this panel |
getFullColumnStretch | public static double getFullColumnStretch()(Code) | | Returns the default value for stretching to a full column. With the modifier
"layoutFullColumnStretch" of the "info" section of the installation configuration file this
can be changed. Valid are doubles for the value. This setting is possible to give panels a
chance to center the controls in y direction also a control uses stretching.
the default value for stretching to a full column |
getFullLineStretch | public static double getFullLineStretch()(Code) | | Returns the default value for stretching to a full line. With the modifier
"layoutFullLineStretch" of the "info" section of the installation configuration file this can
be changed. Valid are doubles for the value. This setting is possible to give panels a chance
to center the controls in x direction also a control uses stretching.
the default value for stretching to a full line |
getLayout | public LayoutManager2 getLayout()(Code) | | Returns the layout manager which current used by this layout helper. The layout manager
implements LayoutManager2. It can be a GridBagLayout or a IzPanelLayout.
current used layout manager |
getNewConstraints | public Object getNewConstraints(int gridx, int gridy)(Code) | | Returns a newly created constraints with the given values and the values from the default
constraints for the other parameters.
Parameters: gridx - value to be used for the new constraint Parameters: gridy - value to be used for the new constraint newly created constraints with the given values and the values from the defaultconstraints for the other parameters |
getNewConstraints | public Object getNewConstraints(int gridx, int gridy, int gridwidth, int gridheight)(Code) | | Returns a newly created constraints with the given values and the values from the
defaultGridBagConstraints for the other parameters.
Parameters: gridx - value to be used for the new constraint Parameters: gridy - value to be used for the new constraint Parameters: gridwidth - value to be used for the new constraint Parameters: gridheight - value to be used for the new constraint newly created constraints with the given values and the values from the defaultconstraints for the other parameters |
getNextXConstraints | public Object getNextXConstraints()(Code) | | Returns a newly created constraints for the next column of the current layout row.
a newly created constraints for the next column of the current layout row |
getNextYConstraints | public Object getNextYConstraints()(Code) | | Returns a newly created constraints with column 0 for the next row.
a newly created constraints with column 0 for the next row |
getNextYConstraints | public Object getNextYConstraints(int gridwidth, int gridheight)(Code) | | Returns a newly created constraints with column 0 for the next row using the given
parameters.
Parameters: gridwidth - width for this constraint Parameters: gridheight - height for this constraint a newly created constraints with column 0 for the next row using the given parameters |
getXGap | public static int getXGap(int gapId)(Code) | | Returns the gap which should be used between the given gui objects for the x direction. The
value will be configurable by guiprefs modifiers. Valid values are all entries in the static
String array X_GAP_NAME_LOOK_UP of this class. There are constant ints for the indexes of
this array.
Parameters: gapId - index in array GAP_NAME_LOOK_UP for the needed gap the gap depend on the xml-configurable guiprefs modifier |
getXStretchType | public static int getXStretchType()(Code) | | Returns the used stretch type for the x direction. Possible are NO_STRETCH, RELATIVE_STRETCH
and ABSOLUTE_STRETCH. The stretch type will be used at rows where one or more components has
a stretch value greater than 0.0 in the constraints. If NO_STRETCH is used, no stretch will
be performed. If ABSOLUTE_STRETCH is used, parts of the unused area are given to the
components depending on the unmodified stretch value. At RELATIVE_STRETCH first the hole
stretch for a row will be computed. Relative to this value the unused area will be splited.
The default type is ABSOLUTE_STRETCH. With the modifier "layoutXStretchType" of the "info"
section of the installation configuration file this can be changed.
used stretch type |
getYGap | public static int getYGap(int gapId)(Code) | | Returns the gap which should be used between the given gui objects for the y direction. The
value will be configurable by guiprefs modifiers. Valid values are all entries in the static
String array Y_GAP_NAME_LOOK_UP of this class. There are constant ints for the indexes of
this array.
Parameters: gapId - index in array GAP_NAME_LOOK_UP for the needed gap the gap depend on the xml-configurable guiprefs modifier |
getYStretchType | public static int getYStretchType()(Code) | | Returns the used stretch type for the y direction. Possible are NO_STRETCH, RELATIVE_STRETCH
and ABSOLUTE_STRETCH. The stretch type will be used at rows where one or more components has
a stretch value greater than 0.0 in the constraints. If NO_STRETCH is used, no stretch will
be performed. If ABSOLUTE_STRETCH is used, parts of the unused area are given to the
components depending on the unmodified stretch value. At RELATIVE_STRETCH first the hole
stretch for a row will be computed. Relative to this value the unused area will be splited.
The default type is ABSOLUTE_STRETCH. With the modifier "layoutYStretchType" of the "info"
section of the installation configuration file this can be changed.
used stretch type |
resetGridCounter | public void resetGridCounter()(Code) | | Resets the grid counters which are used at getNextXConstraints and getNextYConstraints.
|
setDefaultConstraints | public void setDefaultConstraints(Object constraints)(Code) | | Sets the default constraints of this panel to the given object.
Parameters: constraints - which should be set as default for this object |
setLayout | public void setLayout(LayoutManager2 izPanelLayout)(Code) | | Sets the given layout manager for this layout helper to be used.
Parameters: izPanelLayout - layout manager to be used |
startLayout | public void startLayout(LayoutManager2 layout)(Code) | | Start layout determining. If it is needed, a dummy component will be created as first row.
This will be done, if the IzPack guiprefs modifier with the key "layoutAnchor" has the value
"SOUTH" or "SOUTHWEST". The earlier used value "BOTTOM" and the declaration via the IzPack
variable IzPanel.LayoutType are also supported.
Parameters: layout - layout to be used by this layout helper |
|
|
|