Java Doc for PnutsLayout.java in  » Scripting » Pnuts » pnuts » awt » 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 » Scripting » Pnuts » pnuts.awt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   pnuts.awt.PnutsLayout

PnutsLayout
public class PnutsLayout implements LayoutManager2,Serializable(Code)
The PnutsLayout is a general purpose geometry manager. It is very easy to use and can accomplish any grid based layout.
 setLayout(new PnutsLayout(3));
 add(button1, "ipadding=20");
 add(button2, "padding=20");
 add(button3, "colspan=2");
 add(button4, "rowspan=2");
 add(button3, "align=top:left");
 add(button3, "align=bottom:right");
 add(button3, "width=100:center");
 
Property Meaning Default constructor add()
columns The number of columns. 1 true false
uniform Sets the width or height to be the same for each column. Can be x/y/xy/none. none true false
colspan Number of columns the component occupies. 1 false true
rowspan Number of rows the component occupies. 1 false true
spacing Minimum spacing that will be put around the component. Can be a single value (5) or top:right:bottom:left (eg 5:10:5:10). 0 true true
padding Padding around the component. Can be a single value (5) or top:right:bottom:left (eg 5:10:5:10). 0 true true
ipadding Padding inside the component (making it larger). Can be a single value (5) or x:y (eg 5:10). 0 true true
fill Sets the width and/or height of the component to a percentage of the cell width. Can be x/y/xy/none or a single value (5) or x:y (eg 25:75). 0 or none sizes the component to its preferred size. none true true
align Alignment of the component in the cell. Can be top/bottom/left/right/center or top/bottom/center:left/right/center (eg top:right). center true true
expand Expands the size of the cell so the table takes up the size of the container. Can be x/y/xy/none. none true true
border Draws the grid borders of the table. Great for debugging. Can be true/false. false true true


version:
   2.0
author:
   Toyokazu Tomatsu
author:
   Nathan Sweet (misc@n4te.com)


Inner Class :abstract public class Constraints
Inner Class :public class TableConstraints extends Constraints
Inner Class :public class CellConstraints extends Constraints

Field Summary
final public static  intBOTTOM
    
final public static  intCENTER
    
final public static  intLEFT
    
final public static  intNONE
    
final public static  intRIGHT
    
final public static  intTOP
    
final public static  intX
    
final public static  intY
    

Constructor Summary
public  PnutsLayout()
     Constructs a PnutsLayout with a single column.
public  PnutsLayout(int columns)
     Constructs a PnutsLayout with the specified number of columns.
public  PnutsLayout(String str)
    
public  PnutsLayout(Map map)
     Constructs a PnutsLayout from a constraint Map.

Method Summary
public  voidaddLayoutComponent(Component comp, Object obj)
     Adds the specified component to the layout, using the specified constraint object.
public  voidaddLayoutComponent(String name, Component comp)
     Adds the specified component with the specified name to the layout.
public  TableConstraintsgetCellConstraints(Component comp)
     Returns the constraints used by the cell for the specified component.
public  PointgetGridPoint(int gridX, int gridY)
     Returns the left-top point of the specified cell.
public  RectanglegetGridRectangle(Container parent, int index)
     Returns the bounding box for child component at the specified index.
public  floatgetLayoutAlignmentX(Container target)
     Returns the alignment along the x axis.
public  floatgetLayoutAlignmentY(Container target)
     Returns the alignment along the y axis.
public  intgetRows()
     Returns the number of rows in this layout.
public  TableConstraintsgetTableConstraints()
     Returns the constraints used by the table and the default constraints used for all cells in the table.
public  voidinvalidate()
     Invalidates the layout, indicating that if the PnutsLayout has cached information it should be discarded.
public  voidinvalidateLayout(Container target)
     Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
public  voidlayoutContainer(Container target)
     Lays out the container.
public  DimensionmaximumLayoutSize(Container target)
     Returns the maximum size of this component.
public  DimensionminimumLayoutSize(Container target)
     Returns the minimum dimensions needed to layout the components contained in the specified target container.
public  DimensionpreferredLayoutSize(Container target)
     Returns the preferred dimensions for this layout given the components in the specified target container.
public  voidremoveLayoutComponent(Component comp)
     Removes the specified component from the layout.
public  voidsetConstraints(Component comp, String str)
     Sets the constraints for a component.
public  voidsetConstraints(Component comp, Map map)
     Sets the constraints for a component.
public  voidsetConstraints(Component comp, CellConstraints constraints)
     Sets the constraints for a component.
static  Mapstr2table(String constraintString)
     Transforms a constraint name/value pair String into a Map.
public  StringtoString()
    

Field Detail
BOTTOM
final public static int BOTTOM(Code)



CENTER
final public static int CENTER(Code)



LEFT
final public static int LEFT(Code)



NONE
final public static int NONE(Code)



RIGHT
final public static int RIGHT(Code)



TOP
final public static int TOP(Code)



X
final public static int X(Code)



Y
final public static int Y(Code)




Constructor Detail
PnutsLayout
public PnutsLayout()(Code)
Constructs a PnutsLayout with a single column.



PnutsLayout
public PnutsLayout(int columns)(Code)
Constructs a PnutsLayout with the specified number of columns.



PnutsLayout
public PnutsLayout(String str)(Code)



PnutsLayout
public PnutsLayout(Map map)(Code)
Constructs a PnutsLayout from a constraint Map. See PnutsLayout class comments for constraints usage.
Parameters:
  map -




Method Detail
addLayoutComponent
public void addLayoutComponent(Component comp, Object obj)(Code)
Adds the specified component to the layout, using the specified constraint object.
Parameters:
  obj - Map or String defining constraints for the component.



addLayoutComponent
public void addLayoutComponent(String name, Component comp)(Code)
Adds the specified component with the specified name to the layout.



getCellConstraints
public TableConstraints getCellConstraints(Component comp)(Code)
Returns the constraints used by the cell for the specified component. Modifying this object will modify the cell's constraints.



getGridPoint
public Point getGridPoint(int gridX, int gridY)(Code)
Returns the left-top point of the specified cell.



getGridRectangle
public Rectangle getGridRectangle(Container parent, int index)(Code)
Returns the bounding box for child component at the specified index.



getLayoutAlignmentX
public 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 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.



getRows
public int getRows()(Code)
Returns the number of rows in this layout.



getTableConstraints
public TableConstraints getTableConstraints()(Code)
Returns the constraints used by the table and the default constraints used for all cells in the table. Modifying this object will modify the table's constraints.



invalidate
public void invalidate()(Code)
Invalidates the layout, indicating that if the PnutsLayout has cached information it should be discarded. This happens automatically when cell or table constraints are modified.



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



layoutContainer
public void layoutContainer(Container target)(Code)
Lays out the container. This method will actually reshape the components in the target in order to satisfy the constraints of the PnutsLayout object.
See Also:   Container



maximumLayoutSize
public Dimension maximumLayoutSize(Container target)(Code)
Returns the maximum size of this component.
See Also:   java.awt.Component.getMinimumSize
See Also:   java.awt.Component.getPreferredSize
See Also:   LayoutManager



minimumLayoutSize
public Dimension minimumLayoutSize(Container target)(Code)
Returns the minimum dimensions needed to layout the components contained in the specified target container.
See Also:   PnutsLayout.preferredLayoutSize



preferredLayoutSize
public Dimension preferredLayoutSize(Container target)(Code)
Returns the preferred dimensions for this layout given the components in the specified target container.
See Also:   Container
See Also:   PnutsLayout.minimumLayoutSize



removeLayoutComponent
public void removeLayoutComponent(Component comp)(Code)
Removes the specified component from the layout.



setConstraints
public void setConstraints(Component comp, String str)(Code)
Sets the constraints for a component. See PnutsLayout class comments for constraints usage.



setConstraints
public void setConstraints(Component comp, Map map)(Code)
Sets the constraints for a component. See PnutsLayout class comments for constraints usage.



setConstraints
public void setConstraints(Component comp, CellConstraints constraints)(Code)
Sets the constraints for a component. See PnutsLayout class comments for constraints usage.



str2table
static Map str2table(String constraintString)(Code)
Transforms a constraint name/value pair String into a Map.



toString
public String toString()(Code)



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.