Java Doc for JideBoxLayout.java in  » Swing-Library » jide-common » com » jidesoft » swing » 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 » Swing Library » jide common » com.jidesoft.swing 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jidesoft.swing.JideBoxLayout

JideBoxLayout
public class JideBoxLayout implements LayoutManager2(Code)
JideBoxLayout is very similar to BoxLayout in the way that all components are arragned either from left to right or from top to bottom. Different \ from BoxLayout, there are three possible contraints when adding component to this layout - FIX, FLEXIBLE and VARY.
  • FIX: use the preferred size of the compoent and size is fixed
  • FLEXIBLE: respect the preferred size of the compoennt but size can be changed.
  • VARY: ignore preferred size. Its size is calculated based how much area left.
This is the default layout manager for com.jidesoft.swing.JideSplitPane .


Field Summary
final public static  StringFIX
     For FIX component, the width (or height if vertical) is and will always be the preferred width.
final public static  StringFLEXIBLE
     FLEXIBLE components try to keep the preferred width.
final public static  intLINE_AXIS
     Specifies that components should be laid out in the direction of a line of text as determined by the target container's ComponentOrientation property.
final public static  intPAGE_AXIS
     Specifies that components should be laid out in the direction that lines flow across a page as determined by the target container's ComponentOrientation property.
final public static  StringVARY
     For VARY component, the width will always be whatever width left.
final public static  intX_AXIS
     Specifies that components should be laid out left to right.
final public static  intY_AXIS
     Specifies that components should be laid out top to bottom.
protected  int_axis
     Axis, 0 for horizontal, or 1 for veritcal.
protected  int[]_componentSizes
    
protected  Container_target
    

Constructor Summary
public  JideBoxLayout(Container target)
     Creates a layout manager that will lay out components along the given axis.
public  JideBoxLayout(Container target, int axis)
    
Parameters:
  target - the container that needs to be laid out
Parameters:
  axis - the axis to lay out components along.
public  JideBoxLayout(Container target, int axis, int gap)
    
Parameters:
  target - the container that needs to be laid out
Parameters:
  axis - the axis to lay out components along.

Method Summary
public  voidaddLayoutComponent(String name, Component component)
     If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.
public  voidaddLayoutComponent(Component comp, Object constraints)
     Adds the specified component to the layout, using the specified constraint object.
protected  booleancalculateComponentSizes(int availableSize, int startIndex, int endIndex)
    
protected  booleancomponentCountChanged(Container c)
    
protected  intgetAvailableSize(Dimension containerSize, Insets insets)
     Returns the available width based on the container size and Insets.
public  Map<Component, Object>getConstraintMap()
     Gets the map of constraints.
public  intgetGap()
     Gets the gap between each component.
protected  intgetInitialLocation(Insets insets)
     Returns the left inset, unless the Insets are null in which case 0 is returned.
public synchronized  floatgetLayoutAlignmentX(Container target)
     Returns the alignment along the x axis.
public synchronized  floatgetLayoutAlignmentY(Container target)
     Returns the alignment along the y axis.
 intgetMinimumSizeOfComponent(Component c)
     Returns the width of the passed in Components minimum size.
protected  DimensiongetPreferredSizeOf(Component comp, int atIndex)
    
protected  intgetPreferredSizeOfComponent(Component c)
     Returns the width of the passed in Components preferred size.
 intgetSizeForPrimaryAxis(Dimension size)
     If the axis == 0, the width is returned, otherwise the height.
 intgetSizeForPrimaryAxis(Insets insets, boolean isTop)
     Returns a particular value of the inset identified by the axis and isTop

.

 intgetSizeForSecondaryAxis(Dimension size)
     If the axis == X_AXIS, the width is returned, otherwise the height.
 intgetSizeForSecondaryAxis(Insets insets, boolean isTop)
     Returns a particular value of the inset identified by the axis and isTop

.

protected  intgetSizeOfComponent(Component c)
     Returns the width of the passed in component.
public synchronized  voidinvalidateLayout(Container c)
     Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
public  booleanisResetWhenInvalidate()
     Checks of the layout should be reset when JideBoxLayout.invalidateLayout(java.awt.Container) is called.
public  voidlayoutContainer(Container container)
     Lays out the specified container.
public  DimensionmaximumLayoutSize(Container target)
     Returns the maximum layout size, which is Integer.MAX_VALUE in both directions.
public  DimensionminimumLayoutSize(Container container)
     Returns the minimum size needed to contain the children.
public  DimensionpreferredLayoutSize(Container container)
     Returns the preferred size needed to contain the children.
public  voidremoveLayoutComponent(Component comp)
     Removes the specified component from the layout.
protected static  intresolveAxis(int axis, ComponentOrientation o)
     Given one of the 4 axis values, resolve it to an absolute axis. The relative axis values, PAGE_AXIS and LINE_AXIS are converted to their absolute couterpart given the target's ComponentOrientation value.
protected  voidsetComponentToSize(Component c, int size, int location, Insets insets, Dimension containerSize)
     Sets the width of the component c to be size, placing its x location at location, y to the insets.top and height to the containersize.height less the top and bottom insets.
public  voidsetGap(int gap)
     Sets the gap between each component.
public  voidsetResetWhenInvalidate(boolean resetWhenInvalidate)
     Sets the flag if the layout should be reset when JideBoxLayout.invalidateLayout(java.awt.Container) is called.

Field Detail
FIX
final public static String FIX(Code)
For FIX component, the width (or height if vertical) is and will always be the preferred width.



FLEXIBLE
final public static String FLEXIBLE(Code)
FLEXIBLE components try to keep the preferred width. If there isn't enough space, all FLEXIBLE components will shrink proportionally.



LINE_AXIS
final public static int LINE_AXIS(Code)
Specifies that components should be laid out in the direction of a line of text as determined by the target container's ComponentOrientation property.



PAGE_AXIS
final public static int PAGE_AXIS(Code)
Specifies that components should be laid out in the direction that lines flow across a page as determined by the target container's ComponentOrientation property.



VARY
final public static String VARY(Code)
For VARY component, the width will always be whatever width left. You can allow add multiple FIX or FLEXIBLE components but only one VARY component is allowed.



X_AXIS
final public static int X_AXIS(Code)
Specifies that components should be laid out left to right.



Y_AXIS
final public static int Y_AXIS(Code)
Specifies that components should be laid out top to bottom.



_axis
protected int _axis(Code)
Axis, 0 for horizontal, or 1 for veritcal.



_componentSizes
protected int[] _componentSizes(Code)



_target
protected Container _target(Code)




Constructor Detail
JideBoxLayout
public JideBoxLayout(Container target)(Code)
Creates a layout manager that will lay out components along the given axis.
Parameters:
  target - the container that needs to be laid out
throws:
  AWTError - if the value of axis is invalid



JideBoxLayout
public JideBoxLayout(Container target, int axis)(Code)

Parameters:
  target - the container that needs to be laid out
Parameters:
  axis - the axis to lay out components along. Can be one of:JideBoxLayout.X_AXIS,JideBoxLayout.Y_AXIS,JideBoxLayout.LINE_AXIS orJideBoxLayout.PAGE_AXIS



JideBoxLayout
public JideBoxLayout(Container target, int axis, int gap)(Code)

Parameters:
  target - the container that needs to be laid out
Parameters:
  axis - the axis to lay out components along. Can be one of:JideBoxLayout.X_AXIS,JideBoxLayout.Y_AXIS,JideBoxLayout.LINE_AXIS orJideBoxLayout.PAGE_AXIS
Parameters:
  gap -




Method Detail
addLayoutComponent
public void addLayoutComponent(String name, Component component)(Code)
If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.
Parameters:
  name - the string to be associated with the component
Parameters:
  component - the component to be added



addLayoutComponent
public void addLayoutComponent(Component comp, Object constraints)(Code)
Adds the specified component to the layout, using the specified constraint object.
Parameters:
  comp - the component to be added
Parameters:
  constraints - where/how the component is added to the layout.



calculateComponentSizes
protected boolean calculateComponentSizes(int availableSize, int startIndex, int endIndex)(Code)



componentCountChanged
protected boolean componentCountChanged(Container c)(Code)



getAvailableSize
protected int getAvailableSize(Dimension containerSize, Insets insets)(Code)
Returns the available width based on the container size and Insets.



getConstraintMap
public Map<Component, Object> getConstraintMap()(Code)
Gets the map of constraints. the map of constraints



getGap
public int getGap()(Code)
Gets the gap between each component. the gap between each component.



getInitialLocation
protected int getInitialLocation(Insets insets)(Code)
Returns the left inset, unless the Insets are null in which case 0 is returned.



getLayoutAlignmentX
public synchronized float getLayoutAlignmentX(Container target)(Code)
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.



getLayoutAlignmentY
public synchronized float getLayoutAlignmentY(Container target)(Code)
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.



getMinimumSizeOfComponent
int getMinimumSizeOfComponent(Component c)(Code)
Returns the width of the passed in Components minimum size.



getPreferredSizeOf
protected Dimension getPreferredSizeOf(Component comp, int atIndex)(Code)



getPreferredSizeOfComponent
protected int getPreferredSizeOfComponent(Component c)(Code)
Returns the width of the passed in Components preferred size.



getSizeForPrimaryAxis
int getSizeForPrimaryAxis(Dimension size)(Code)
If the axis == 0, the width is returned, otherwise the height.



getSizeForPrimaryAxis
int getSizeForPrimaryAxis(Insets insets, boolean isTop)(Code)
Returns a particular value of the inset identified by the axis and isTop

. axis isTop 0 true - left 0 false - right 1 true - top 1 false - bottom




getSizeForSecondaryAxis
int getSizeForSecondaryAxis(Dimension size)(Code)
If the axis == X_AXIS, the width is returned, otherwise the height.



getSizeForSecondaryAxis
int getSizeForSecondaryAxis(Insets insets, boolean isTop)(Code)
Returns a particular value of the inset identified by the axis and isTop

. axis isTop 0 true - left 0 false - right 1 true - top 1 false - bottom




getSizeOfComponent
protected int getSizeOfComponent(Component c)(Code)
Returns the width of the passed in component.



invalidateLayout
public synchronized void invalidateLayout(Container c)(Code)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.



isResetWhenInvalidate
public boolean isResetWhenInvalidate()(Code)
Checks of the layout should be reset when JideBoxLayout.invalidateLayout(java.awt.Container) is called. true or false.



layoutContainer
public void layoutContainer(Container container)(Code)
Lays out the specified container.
Parameters:
  container - the container to be laid out



maximumLayoutSize
public Dimension maximumLayoutSize(Container target)(Code)
Returns the maximum layout size, which is Integer.MAX_VALUE in both directions.



minimumLayoutSize
public Dimension minimumLayoutSize(Container container)(Code)
Returns the minimum size needed to contain the children. The width is the sum of all the childrens min widths and the height is the largest of the childrens minimum heights.



preferredLayoutSize
public Dimension preferredLayoutSize(Container container)(Code)
Returns the preferred size needed to contain the children. The width is the sum of all the childrens preferred widths and the height is the largest of the childrens preferred heights.



removeLayoutComponent
public void removeLayoutComponent(Component comp)(Code)
Removes the specified component from the layout.
Parameters:
  comp - the component to be removed



resolveAxis
protected static int resolveAxis(int axis, ComponentOrientation o)(Code)
Given one of the 4 axis values, resolve it to an absolute axis. The relative axis values, PAGE_AXIS and LINE_AXIS are converted to their absolute couterpart given the target's ComponentOrientation value. The absolute axes, X_AXIS and Y_AXIS are returned unmodified.
Parameters:
  axis - the axis to resolve
Parameters:
  o - the ComponentOrientation to resolve against the resolved axis



setComponentToSize
protected void setComponentToSize(Component c, int size, int location, Insets insets, Dimension containerSize)(Code)
Sets the width of the component c to be size, placing its x location at location, y to the insets.top and height to the containersize.height less the top and bottom insets.



setGap
public void setGap(int gap)(Code)
Sets the gap between each component. Make sure you cal doLayout() after you change the gap.
Parameters:
  gap -



setResetWhenInvalidate
public void setResetWhenInvalidate(boolean resetWhenInvalidate)(Code)
Sets the flag if the layout should be reset when JideBoxLayout.invalidateLayout(java.awt.Container) is called.
Parameters:
  resetWhenInvalidate -



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.