net.xoetrope.xui
Interface LayoutHelper

All Known Implementing Classes:
XLayoutHelper, XLayoutHelper

public interface LayoutHelper

A helper class for working with layout managers. This class provides mappings between the names of layout styles and constraints and the corresponding Java constants.

Copyright (c) Xoetrope Ltd., 2002-2003

License: see license.txt

$Revision: 2.21 $


Field Summary
static int BOTTOM
           
static int LEFT
           
static int RIGHT
           
static int TOP
           
 
Method Summary
 java.lang.Object addLayout(java.lang.Object cont, int type)
          Sets a LayoutManager for the panel
 java.lang.Object addLayout(java.lang.Object cont, int type, java.util.Hashtable attribs)
          Sets a LayoutManager for the panel
 int getAlignment(java.lang.String name)
          Gets a constraint object corresponding to a constraint name
 java.lang.Object getConstraint(java.lang.String name)
          Gets a constraint object corresponding to a constraint name
 java.lang.String getLayoutClass(java.lang.Object layout)
          Get the layout type
 int getLayoutType(java.lang.String ls)
          Get the layout type enumerated in XPage
 boolean getUsesConstraints(java.lang.Object layout)
          Does the layout manager use constraints for its children?
 boolean getUsesDimensions(java.lang.Object layout)
          Does this layout manager used the absoulte dimensions?
 void setAttrib(java.lang.Object cont, java.lang.Object lm, java.lang.String attrib, java.lang.Object value)
          Set the attributes for a layout manager
 

Field Detail

LEFT

static final int LEFT
See Also:
Constant Field Values

RIGHT

static final int RIGHT
See Also:
Constant Field Values

TOP

static final int TOP
See Also:
Constant Field Values

BOTTOM

static final int BOTTOM
See Also:
Constant Field Values
Method Detail

addLayout

java.lang.Object addLayout(java.lang.Object cont,
                           int type)
Sets a LayoutManager for the panel

Parameters:
cont - the container whose layout manager is being set or null to set the parent panel's layout manager
type - the layout manager as defined in the XLayoutHelper class

addLayout

java.lang.Object addLayout(java.lang.Object cont,
                           int type,
                           java.util.Hashtable attribs)
Sets a LayoutManager for the panel

Parameters:
cont - the container whose layout manager is being set or null to set the parent panel's layout manager
type - the layout manager as defined in the XLayoutHelper class

getAlignment

int getAlignment(java.lang.String name)
Gets a constraint object corresponding to a constraint name

Parameters:
name - the constraint name
Returns:
the constraint object

getLayoutType

int getLayoutType(java.lang.String ls)
Get the layout type enumerated in XPage

Parameters:
ls - the layout style
Returns:
the type id

getLayoutClass

java.lang.String getLayoutClass(java.lang.Object layout)
Get the layout type

Parameters:
layout - the layout manager instance
Returns:
the type name e.g. FLOW or BORDER

getUsesConstraints

boolean getUsesConstraints(java.lang.Object layout)
Does the layout manager use constraints for its children?

Parameters:
layout - the layout manager instance
Returns:
true if the layout uses constraints

getUsesDimensions

boolean getUsesDimensions(java.lang.Object layout)
Does this layout manager used the absoulte dimensions?

Parameters:
layout - the layout manager instance
Returns:
true if the X,Y,W,H dimensions are used

getConstraint

java.lang.Object getConstraint(java.lang.String name)
Gets a constraint object corresponding to a constraint name

Parameters:
name - the quoted constraint name e.g. "WEST"
  • WEST=BorderLayout.WEST
  • EAST=BorderLayout.EAST
  • NORTH=BorderLayout.NORTH
  • SOUTH=BorderLayout.SOUTH
  • CENTER=BorderLayout.CENTER
  • AFTER_LAST_LINE=BorderLayout.AFTER_LAST_LINE
  • AFTER_LINE_ENDS=BorderLayout.AFTER_LINE_ENDS
  • BEFORE_FIRST_LINE=BorderLayout.BEFORE_FIRST_LINE
  • BEFORE_LINE_BEGINS=BorderLayout.BEFORE_LINE_BEGINS
  • GridBagConstraints=14 GridBagConstraint parameters separated by commas
    1. gridx - The initial gridx value
    2. gridy - The initial gridy value.
    3. gridwidth - The initial gridwidth value.
    4. gridheight - The initial gridheight value.
    5. weightx - The initial weightx value.
    6. weighty - The initial weighty value.
    7. anchorstr - The anchor string value (EAST|WEST|NORTH|SOUTH|NORTHEAST|NORTHWEST|SOUTHEAST|SOUTHWEST)
    8. fillstr - The fill string value (HORIZONTAL|VERTICAL)
    9. insets top - The initial inset
    10. insets left - The initial inset
    11. insets right - The initial inset
    12. insets bottom - The initial inset
    13. ipadx - The initial ipadx value
    14. ipady - The initial ipady value
Returns:
the constraint object

setAttrib

void setAttrib(java.lang.Object cont,
               java.lang.Object lm,
               java.lang.String attrib,
               java.lang.Object value)
Set the attributes for a layout manager

Parameters:
cont - the container
lm - the layout manager
attrib - the attribute name
value - the value of the attribute