Java Doc for LayoutHelper.java in  » Installer » IzPack » com » izforge » izpack » installer » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Installer » IzPack » com.izforge.izpack.installer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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


Field Summary
final public static  StringALL_X_GAP
     Identifier of x gap for all default x gaps.
final public static  StringALL_Y_GAP
     Identifier of x gap for all default y gaps.
protected static  intANCHOR
    
protected static  DoubleDOUBLE_ZERO
    
protected static  doubleFULL_COLUMN_STRETCH_DEFAULT
    
protected static  doubleFULL_LINE_STRETCH_DEFAULT
    
protected static  DoubleINITIAL_STRETCH_DEFAULT
    
final public static  String[]X_GAP_NAME_LOOK_UP
     Look-up table for gap identifier to gap names for the x direction.
protected static  intX_STRETCH_TYPE
    
final public static  String[]Y_GAP_NAME_LOOK_UP
     Look-up table for gap identifier to gap names for the y direction.
protected static  intY_STRETCH_TYPE
    
protected  ObjectdefaultConstraints
     The default grid bag constraint.
protected  intgridxCounter
     Current x position of grid.
protected  intgridyCounter
     Current y position of grid.
protected  LayoutManager2izPanelLayout
    
protected  booleanlayoutStarted
    
 JComponentparent
    

Constructor Summary
public  LayoutHelper(JComponent parent)
     Only useable constructor.
protected  LayoutHelper()
     The default constructor is only useable by derived classes.

Method Summary
public  voidcompleteLayout()
     Complete layout determining.
public static  intgetAnchor()
     Returns the anchor as value declared in GridBagConstraints.
public  ObjectgetDefaultConstraints()
     Returns the default constraints of this panel.
public static  doublegetFullColumnStretch()
     Returns the default value for stretching to a full column.
public static  doublegetFullLineStretch()
     Returns the default value for stretching to a full line.
public  LayoutManager2getLayout()
     Returns the layout manager which current used by this layout helper.
public  ObjectgetNewConstraints(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  ObjectgetNewConstraints(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  ObjectgetNextXConstraints()
     Returns a newly created constraints for the next column of the current layout row.
public  ObjectgetNextYConstraints()
     Returns a newly created constraints with column 0 for the next row.
public  ObjectgetNextYConstraints(int gridwidth, int gridheight)
     Returns a newly created constraints with column 0 for the next row using the given parameters.
public static  intgetXGap(int gapId)
     Returns the gap which should be used between the given gui objects for the x direction.
public static  intgetXStretchType()
     Returns the used stretch type for the x direction.
public static  intgetYGap(int gapId)
     Returns the gap which should be used between the given gui objects for the y direction.
public static  intgetYStretchType()
     Returns the used stretch type for the y direction.
public  voidresetGridCounter()
     Resets the grid counters which are used at getNextXConstraints and getNextYConstraints.
public  voidsetDefaultConstraints(Object constraints)
     Sets the default constraints of this panel to the given object.
public  voidsetLayout(LayoutManager2 izPanelLayout)
     Sets the given layout manager for this layout helper to be used.
public  voidstartLayout(LayoutManager2 layout)
     Start layout determining.

Field Detail
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"



DOUBLE_ZERO
protected static Double DOUBLE_ZERO(Code)



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.



izPanelLayout
protected LayoutManager2 izPanelLayout(Code)
internal layout



layoutStarted
protected boolean layoutStarted(Code)
Indicates whether grid bag layout was started or not



parent
JComponent parent(Code)




Constructor Detail
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.




Method Detail
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



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.