Java Doc for ColumnLayout.java in  » Portal » jetspeed-2.1.3 » org » apache » jetspeed » portlets » layout » 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 » Portal » jetspeed 2.1.3 » org.apache.jetspeed.portlets.layout 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.jetspeed.portlets.layout.ColumnLayout

ColumnLayout
public class ColumnLayout implements Serializable(Code)

Basics

ColumnLayout is the model used to support any 1 to n column-based layout. ColumnLayout is constrained by a number columns that will not be exceeded, even if a fragment specifies a column outside of this constraint. Any fragment exceeded the specified column constraint will be deposited into the right-most column.

Characteristics:

  • Columns and rows always start at 0.
  • Unless otherwise noted, assume all Collections returned are immutable.
  • Unless otherwise noted, assume that no public method will ever return null.

Layout Events

When any move*() method is invoked and a portlet is actually moved (see indvidual methods for what causes these circumstances), an initial LayoutEvent is dispatched. This may cause a cascade of LayoutEvents to be fired in turn if the movement of the target fragment cause other fragments to be repositioned. In this case a LayoutEvent is dispatched for each portlet moved, which in turn may our may not cause another LayoutEvent to be fired.


See Also:   org.apache.jetspeed.portlets.layout.LayoutEvent
See Also:   org.apache.jetspeed.portlets.layout.LayoutEventListener
See Also:   org.apache.jetspeed.portlets.layout.LayoutCoordinate
See Also:   org.apache.jetspeed.om.page.Fragment
author:
   Scott T. Weaver



Constructor Summary
public  ColumnLayout(int numberOfColumns, String layoutType, String[] columnWidths)
    
Parameters:
  numberOfColumns - the maximum number of columns this layout will have.
Parameters:
  layoutType - this value corresponds to the property settings of thefragments within your psml.
public  ColumnLayout(int numberOfColumns, String layoutType, Collection fragments, String[] columnWidths)
     Same as ColumnLayout(int numberOfColumns, String layoutType) but also supplies a Collection of fragmetns to initially populate the layout with.

Method Summary
public  voidaddFragment(Fragment fragment)
    

Adds a fragment to the layout using fragment properties of row and column as hints on where to put this fragment.

public  voidaddLayoutEventListener(LayoutEventListener eventListener)
     Adds a LayoutEventListener to this layout that will be fired any time a LayoutEvent is disaptched.
protected  voiddoAdd(int columnNumber, int rowNumber, Fragment fragment)
     Adds a fragment at the indicated columnNumber and rowNumber.
protected  voiddoMove(Fragment fragment, LayoutCoordinate oldCoordinate, LayoutCoordinate newCoordinate)
     Performs the actual movement of a fragment.
public  CollectiongetColumn(int columnNumber)
    
Parameters:
  columnNumber - Number of column to retreive requested column (as a immutable Collection).
final protected  intgetColumn(Fragment fragment)
     Gets the row number of this fragment to looking the layoutType property column.
public  StringgetColumnFloat(int columnNumber)
     returns the float to be used with the specified column.
Parameters:
  columnNumber - whose width has been requested.
final protected  SortedMapgetColumnMap(int columnNumber)
     Retrieves this specified columnNumber as a SortedMap.
public  StringgetColumnWidth(int columnNumber)
     returns the width to be used with the specified column.
public  CollectiongetColumns()
     java.util.Collection all of columns (alsoCollection objects) in order within this layout.
public  LayoutCoordinategetCoordinate(Fragment fragment)
    
Parameters:
  fragment - fragment whose LayoutCoordinate we ant.
public  CollectiongetFirstColumn()
     The last column in this layout.
public  FragmentgetFragmentAt(int columnNumber, int rowNumber)
     Retrieves the fragment at the specified loaction.
Parameters:
  columnNumber - Column coordinate (first column starts at 0)
Parameters:
  rowNumber - Row coordinate (first row starts at 0) Fragment at the specified coordinate.
public  FragmentgetFragmentAt(LayoutCoordinate coodinate)
     Retrieves the fragment at the specified loaction.
Parameters:
  coodinate - LayoutCoordinate object that will be used to located a fragment in thislayout.
See Also:   LayoutCoordinate Fragment at the specified coordinate.
public  CollectiongetFragments()
     Returns an immutable Collection of all the Fragments contained within this ColumnLayout in no sepcific order.
public  CollectiongetLastColumn()
     The last column in this layout.
public  intgetLastRowNumber(int columnNumber)
     Returns the index of the last row in the specified column.
Parameters:
  columnNumber - column form whom we ant to identify thelast row.
public  intgetNumberOfColumns()
    
final protected  intgetRow(int currentColumn, Fragment fragment)
     Gets the row number of this fragment to looking the layoutType property row.
public  voidmoveDown(Fragment fragment)
    
public  voidmoveLeft(Fragment fragment)
     Moves a fragment one column to the left.
public  voidmoveRight(Fragment fragment)
     Moves a fragment one column to the right.
public  voidmoveUp(Fragment fragment)
     Moves a fragment one row to the up.
final protected  voidprocessEvent(LayoutEvent event)
     Dispatches a LayoutEvent to all LayoutEventListeners registered to this layout.


Constructor Detail
ColumnLayout
public ColumnLayout(int numberOfColumns, String layoutType, String[] columnWidths)(Code)

Parameters:
  numberOfColumns - the maximum number of columns this layout will have.
Parameters:
  layoutType - this value corresponds to the property settings of thefragments within your psml. Layout type allows segration ofproperty settings based on the type of layout in use. Thiseffectively allows for the interchange of multiple layoutformats without one format effecting the settings of another.
Parameters:
  columnWidths - widths for each column that accumulate to 100% if percentagesare used.
See Also:   org.apache.jetspeed.om.page.Fragment.getType



ColumnLayout
public ColumnLayout(int numberOfColumns, String layoutType, Collection fragments, String[] columnWidths) throws LayoutEventException(Code)
Same as ColumnLayout(int numberOfColumns, String layoutType) but also supplies a Collection of fragmetns to initially populate the layout with. Adding these fragments WILL NOT cause a LayoutEvent to be dispatched.
See Also:    ColumnLayout(int numberOfColumns, String layoutType)
Parameters:
  numberOfColumns - the maximum number of columns this layout will have.
Parameters:
  layoutType - this value corresponds to the property settings of thefragments within your psml. Layout type allows segration ofproperty settings based on the type of layout in use. Thiseffectively allows for the interchange of multiple layoutformats without one format effecting the settings of another.
Parameters:
  fragments - Initial set of fragments to add to this layout.
Parameters:
  columnWidths - widths for each column that accumulate to 100% if percentagesare used.
throws:
  LayoutEventException -




Method Detail
addFragment
public void addFragment(Fragment fragment) throws LayoutEventException(Code)

Adds a fragment to the layout using fragment properties of row and column as hints on where to put this fragment. The following rules apply to malformed fragment definitions:

  • Fragments without a row defined are placed at the bottom of their respective column
  • Fragments without a column are placed in the right-most column.
  • Fragments with overlapping row numbers. The last fragment has priority pushing the fragment in that row down one row.

Parameters:
  fragment - Fragment to add to this layout.
throws:
  LayoutEventException -
See Also:   org.apache.jetspeed.om.page.Fragment



addLayoutEventListener
public void addLayoutEventListener(LayoutEventListener eventListener)(Code)
Adds a LayoutEventListener to this layout that will be fired any time a LayoutEvent is disaptched.
Parameters:
  eventListener -
See Also:   LayoutEventListener
See Also:   LayoutEventListener



doAdd
protected void doAdd(int columnNumber, int rowNumber, Fragment fragment) throws InvalidLayoutLocationException, LayoutEventException(Code)
Adds a fragment at the indicated columnNumber and rowNumber.
Parameters:
  columnNumber -
Parameters:
  rowNumber -
Parameters:
  fragment -
throws:
  InvalidLayoutLocationException - if the coordinates are outside the bounds of this layout.
throws:
  LayoutEventException - id a LayoutEvent fails



doMove
protected void doMove(Fragment fragment, LayoutCoordinate oldCoordinate, LayoutCoordinate newCoordinate) throws InvalidLayoutLocationException, LayoutEventException(Code)
Performs the actual movement of a fragment.
Parameters:
  fragment -
Parameters:
  oldCoordinate -
Parameters:
  newCoordinate -
throws:
  InvalidLayoutLocationException -
throws:
  LayoutEventException -



getColumn
public Collection getColumn(int columnNumber) throws InvalidLayoutLocationException(Code)

Parameters:
  columnNumber - Number of column to retreive requested column (as a immutable Collection). Never returnsnull.
throws:
  InvalidLayoutLocationException - if the column is outisde of the constraints of this layout



getColumn
final protected int getColumn(Fragment fragment)(Code)
Gets the row number of this fragment to looking the layoutType property column. If the column is undefined or exceeds the constriants of this layout, the value returned is numberOfColumns - 1. If the value is less than 0, 0 is returned.
Parameters:
  fragment -



getColumnFloat
public String getColumnFloat(int columnNumber)(Code)
returns the float to be used with the specified column.
Parameters:
  columnNumber - whose width has been requested. "right" for the last column, "left" if more than onecolumn, or "none" otherwise.



getColumnMap
final protected SortedMap getColumnMap(int columnNumber) throws InvalidLayoutLocationException(Code)
Retrieves this specified columnNumber as a SortedMap.
Parameters:
  columnNumber -
throws:
  InvalidLayoutLocationException - if the columnNumber residesoutside the bounds of this layout.



getColumnWidth
public String getColumnWidth(int columnNumber)(Code)
returns the width to be used with the specified column. If there is no specific column setting sfor the specified column 0 is returned.
Parameters:
  columnNumber - whose width has been requested. the width to be used with the specified column. Or 0 if no valuehas been specified.



getColumns
public Collection getColumns()(Code)
java.util.Collection all of columns (alsoCollection objects) in order within this layout. All Collectionsare immutable.



getCoordinate
public LayoutCoordinate getCoordinate(Fragment fragment) throws FragmentNotInLayoutException(Code)

Parameters:
  fragment - fragment whose LayoutCoordinate we ant. LayoutCoordinate representing the current location of thisFragment within this layout.
throws:
  FragmentNotInLayoutException - if the Fragment is not present in this layout.
See Also:   LayoutCoordinate



getFirstColumn
public Collection getFirstColumn()(Code)
The last column in this layout. The Collection is immutable.



getFragmentAt
public Fragment getFragmentAt(int columnNumber, int rowNumber) throws EmptyLayoutLocationException, InvalidLayoutLocationException(Code)
Retrieves the fragment at the specified loaction.
Parameters:
  columnNumber - Column coordinate (first column starts at 0)
Parameters:
  rowNumber - Row coordinate (first row starts at 0) Fragment at the specified coordinate. Never returns null.
throws:
  EmptyLayoutLocationException - if there is no fragment currently located at the specified coordinate.
throws:
  InvalidLayoutLocationException - if the coordinate lies outside the confines of this layout, i.e., thecolumnNumber exceeds the max columns setting for this layout.



getFragmentAt
public Fragment getFragmentAt(LayoutCoordinate coodinate) throws EmptyLayoutLocationException, InvalidLayoutLocationException(Code)
Retrieves the fragment at the specified loaction.
Parameters:
  coodinate - LayoutCoordinate object that will be used to located a fragment in thislayout.
See Also:   LayoutCoordinate Fragment at the specified coordinate. Never returns null.
throws:
  EmptyLayoutLocationException - if there is no fragment currently located at the specified coordinate.
throws:
  InvalidLayoutLocationException - if the coordinate lies outside the confines of this layout, i.e., thecolumnNumber exceeds the max columns setting for this layout.
See Also:   LayoutCoordinate



getFragments
public Collection getFragments()(Code)
Returns an immutable Collection of all the Fragments contained within this ColumnLayout in no sepcific order. Immutable Collection of Fragments.



getLastColumn
public Collection getLastColumn()(Code)
The last column in this layout. The Collection is immutable.



getLastRowNumber
public int getLastRowNumber(int columnNumber)(Code)
Returns the index of the last row in the specified column.
Parameters:
  columnNumber - column form whom we ant to identify thelast row. the index of the last row in the specified column.



getNumberOfColumns
public int getNumberOfColumns()(Code)
The total number of columns in this layout.



getRow
final protected int getRow(int currentColumn, Fragment fragment)(Code)
Gets the row number of this fragment to looking the layoutType property row. If this property is undefined, the bottom-most row number of currentColumn is returned.
Parameters:
  currentColumn -
Parameters:
  fragment - valid row for this fragment within this layout.



moveDown
public void moveDown(Fragment fragment) throws FragmentNotInLayoutException, LayoutEventException(Code)

Parameters:
  fragment -
throws:
  FragmentNotInLayoutException - if the specified fragment is not currently in the layout.
throws:
  LayoutEventException - If a triggered LayoutEvent fails.



moveLeft
public void moveLeft(Fragment fragment) throws FragmentNotInLayoutException, LayoutEventException(Code)
Moves a fragment one column to the left. A LayoutEvent is triggered by this action.

If the fragment currently resides in left-most column, no action is taking and no event LayoutEvent is fired.


Parameters:
  fragment -
throws:
  FragmentNotInLayoutException - if the specified fragment is not currently in the layout.
throws:
  LayoutEventException - If a triggered LayoutEvent fails.



moveRight
public void moveRight(Fragment fragment) throws FragmentNotInLayoutException, LayoutEventException(Code)
Moves a fragment one column to the right. A LayoutEvent is triggered by this action.

If the fragment currently resides in right-most column, no action is taking and no event LayoutEvent is fired.


Parameters:
  fragment - fragment to move.
throws:
  FragmentNotInLayoutException - if the specified fragment is not currently in the layout.
throws:
  LayoutEventException - If a triggered LayoutEvent fails.



moveUp
public void moveUp(Fragment fragment) throws FragmentNotInLayoutException, LayoutEventException(Code)
Moves a fragment one row to the up. A LayoutEvent is triggered by this action.

If the fragment currently resides in top-most row, no action is taking and no event LayoutEvent is fired.


Parameters:
  fragment -
throws:
  FragmentNotInLayoutException - if the specified fragment is not currently in the layout.
throws:
  LayoutEventException - If a triggered LayoutEvent fails.



processEvent
final protected void processEvent(LayoutEvent event) throws LayoutEventException(Code)
Dispatches a LayoutEvent to all LayoutEventListeners registered to this layout.
Parameters:
  event -
throws:
  LayoutEventException - if an error occurs while processing a the LayoutEvent.



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.