|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.visuals.RowLayout
public class RowLayout
RowLayout is a class that implements the java.awt.LayoutManager2 interface to
be able to layout components within a container in rows. It is mainly
used in the TabBar to layout tabs.
The components are laid out in rows. The start index indicates which component is the first
one displayed when rowStyle is SINGLEROW. All components before the start index are not displayed.
Components can be added to different groups. When the rowStyle is MULTIROW, components from different
groups are displayed on different rows. The rows are determined by the components that will fit on
each row. One group can take up several rows, but no two groups will share the same row. The components
can all be justified to the LEFT, RIGHT, CENTER or FULL( to take up the entire row ). They also can
all be oriented to the TOP, BOTTOM, LEFT, or RIGHT.
Field Summary | |
---|---|
static int |
BOTTOM
|
static int |
LEFT
|
static int |
MULTIROW
|
static int |
NONE
|
static int |
RIGHT
|
static int |
SINGLEROW
|
static int |
TOP
|
Fields inherited from interface com.sas.visuals.Direction |
---|
BOTTOM_TO_TOP, COLUMN_MAJOR, LEFT_TO_RIGHT, RB_KEY, RIGHT_TO_LEFT, ROW_MAJOR, TOP_TO_BOTTOM |
Fields inherited from interface com.sas.visuals.Sizing |
---|
PROPORTIONAL, UNIFORM |
Fields inherited from interface com.sas.visuals.Justification |
---|
FULL |
Fields inherited from interface com.sas.visuals.Alignment |
---|
BEGIN, CENTER, END |
Constructor Summary | |
---|---|
RowLayout()
Default constructor. |
|
RowLayout(int sizing,
int just,
int orient,
int fill,
int style,
int compSpacing,
int rSpacing)
Constructor that sets all properties of the RowLayout except the margins. |
|
RowLayout(int sizing,
int just,
int orient,
int fill,
int style,
int compSpacing,
int rSpacing,
int right,
int left,
int top,
int bottom)
Constructor that sets all properties of the RowLayout. |
Method Summary | |
---|---|
void |
addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
Adds the specified component to the layout, using the specified constraint object. |
void |
addLayoutComponent(java.lang.String group,
java.awt.Component comp)
Adds the specified component with the specified name to the layout. |
void |
decrementStartIndex()
Decrement the startIndex to the next visible component. |
java.util.Vector |
getAllGroups()
Get all components from every of the group. |
int |
getBottomMargin()
Get the margin of the bottom of the container. |
java.awt.Dimension |
getComponentSize()
Get the component size used when the sizing property is UNIFORM. |
int |
getEndIndex()
Get the index of the last component showing. |
int |
getFillFrom()
Get the direction to fill the rows from. |
java.util.Vector |
getGroup(int index)
Get the components in the group at the specified index |
int |
getGroupCount()
Get the number of groups. |
int |
getGroupIndex(java.awt.Component comp)
Get the index of the group to which the component belongs. |
int |
getJustification()
Get the justification of the components on the rows. |
float |
getLayoutAlignmentX(java.awt.Container parent)
Returns the alignment along the x axis. |
float |
getLayoutAlignmentY(java.awt.Container parent)
Returns the alignment along the y axis. |
int |
getLeftMargin()
Get the margin of the left of the container. |
protected java.awt.Dimension |
getMaximumSize()
Get the maximum component size. |
int |
getOrientation()
Get the orientation of the rows. |
int |
getRightMargin()
Get the margin of the right of the container. |
int |
getRowCount(int grpIndex)
Get the number of rows a group of components is displayed on. |
int |
getRowHeight()
Get the height of the rows. |
int |
getRowIndex(int grpIndex,
int tabIndex)
Get the index of the row to which the specific component belongs. |
int |
getRowSpacing()
Get the spacing between rows. |
java.util.Vector |
getRowStartPositions()
Get the positions of each row start. |
int |
getRowStyle()
Get the row style. |
int |
getSizing()
Get the type of sizing for the components in this layout. |
int |
getSpacing()
Get the pixel amount of spacing between components. |
int |
getStartIndex()
Get the index of the first component showing. |
int |
getThresholdCount()
Get the number of tabs used to calculate the preferredSize of the container. |
int |
getTopMargin()
Get the margin of the top of the container. |
void |
incrementEndIndex()
|
void |
incrementStartIndex()
Increment the startIndex to the next visible component. |
void |
invalidateLayout(java.awt.Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded. |
boolean |
isDecrementable()
Get if the start index can be decremented. |
boolean |
isIncrementable()
Get if the start index can be incremented. |
void |
layoutContainer(java.awt.Container parent)
Layout the components in the specified container. |
java.awt.Dimension |
maximumLayoutSize(java.awt.Container target)
Returns the maximum dimensions for this layout given the components in the specified target container. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
Returns the minimum dimensions needed to layout the components contained in the specified panel. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Returns the preferred dimensions for this layout given the components in the specified panel. |
void |
removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout. |
void |
reorderComponents(java.awt.Container parent)
Reorder the components to be laid out according to their order in the parent Container. |
void |
setBottomMargin(int margin)
Set the bottom margin. |
java.awt.Dimension |
setComponentSize(java.awt.Dimension newSize)
Set the component size used when the sizing property is set to UNIFORM. |
void |
setFillFrom(int fill)
Set the direction to fill the rows from. |
void |
setFirstGroup(int index)
Set the first group. |
void |
setFirstRow(int index)
Set the first row within the first group. |
void |
setJustification(int just)
Set the justification of the components on the rows. |
void |
setLeftMargin(int margin)
Set the left margin. |
void |
setOrientation(int orient)
Set the orientation of the rows. |
void |
setRightMargin(int margin)
Set the right margin. |
void |
setRowSpacing(int gap)
Set the spacing between the rows. |
void |
setRowStyle(int style)
Set the row style used. |
void |
setSizing(int sizing)
Set the sizing property used to size the components. |
void |
setSpacing(int gap)
Set the pixel amount of spacing between the components. |
void |
setStartIndex(int index)
Set the start index. |
void |
setThresholdCount(int number)
Set the number of tabs used to calculate the preferredSize of the container. |
void |
setTopMargin(int margin)
Set the top margin. |
java.lang.String |
toString()
Returns the String representation of this RowColumnLayout's values. |
Field Detail |
---|
public static final int NONE
public static final int TOP
public static final int BOTTOM
public static final int LEFT
public static final int RIGHT
public static final int SINGLEROW
public static final int MULTIROW
Constructor Detail |
---|
public RowLayout()
public RowLayout(int sizing, int just, int orient, int fill, int style, int compSpacing, int rSpacing)
sizing
- the sizing propertyjust
- the justification propertyorient
- the orientation propertyfill
- the fillFrom direction propertystyle
- the style property: multi-row or single rowcompSpacing
- the spacing between the componentsrSpacing
- the spacing between the rowspublic RowLayout(int sizing, int just, int orient, int fill, int style, int compSpacing, int rSpacing, int right, int left, int top, int bottom)
sizing
- the sizing propertyjust
- the justification propertyorient
- the orientation propertyfill
- the fillFrom direction propertystyle
- the style property: multi-row or single rowcompSpacing
- the spacing between the componentsrSpacing
- the spacing between the rowsright
- the rightMarginleft
- the leftMargintop
- the topMarginbottom
- the bottomMarginMethod Detail |
---|
public int getStartIndex()
setStartIndex(int)
public int getEndIndex()
public java.awt.Dimension getComponentSize()
setComponentSize(java.awt.Dimension)
protected java.awt.Dimension getMaximumSize()
public int getFillFrom()
Direction
,
setFillFrom(int)
public int getJustification()
Justification
,
setJustification(int)
public int getBottomMargin()
setBottomMargin(int)
public int getLeftMargin()
setLeftMargin(int)
public int getRightMargin()
setRightMargin(int)
public int getTopMargin()
setTopMargin(int)
public int getOrientation()
setOrientation(int)
public int getGroupIndex(java.awt.Component comp)
comp
- the component to find the index of
public int getRowIndex(int grpIndex, int tabIndex)
grpIndex
- the group index of the specified componenttabIndex
- the overall index of the specified component
public java.util.Vector getGroup(int index)
index
- index of the group to get the components from.
public int getGroupCount()
public java.util.Vector getAllGroups()
public int getRowCount(int grpIndex)
grpIndex
- the index of the specified group
public int getRowHeight()
public int getRowSpacing()
setRowSpacing(int)
public java.util.Vector getRowStartPositions()
public int getRowStyle()
setRowStyle(int)
public int getSizing()
setSizing(int)
public int getSpacing()
setSpacing(int)
public java.awt.Dimension setComponentSize(java.awt.Dimension newSize)
newSize
- the new component size when UNIFORM sizing
getComponentSize()
public void setFillFrom(int fill)
fill
- a Direction to fill the rows from.getFillFrom()
,
Direction
public void setTopMargin(int margin)
getTopMargin()
public void setBottomMargin(int margin)
getBottomMargin()
public void setRightMargin(int margin)
getRightMargin()
public void setLeftMargin(int margin)
getLeftMargin()
public void setJustification(int just)
just
- the justification layout the components withgetJustification()
public void setOrientation(int orient)
orient
- the orientation: TOP, BOTTOM, LEFT, or RIGHTgetOrientation()
public void setRowStyle(int style)
style
- the row style: MULTIROW(1) or SINGLEROW(0)getRowStyle()
public void setRowSpacing(int gap)
the
- pixel spacing between the rowsgetRowSpacing()
public void setFirstGroup(int index)
index
- the index of first group.public void setFirstRow(int index)
index
- the index of the group to layout first.public void setSizing(int sizing)
sizing
- either PROPORTIONAL or UNIFORM sizinggetSizing()
public void setSpacing(int gap)
gap
- the pixel spacing amountgetSpacing()
public boolean isDecrementable()
isIncrementable()
,
decrementStartIndex()
public boolean isIncrementable()
isDecrementable()
,
incrementStartIndex()
public void incrementStartIndex()
public void incrementEndIndex()
public void decrementStartIndex()
public void setStartIndex(int index)
public void reorderComponents(java.awt.Container parent)
public void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
addLayoutComponent
in interface java.awt.LayoutManager2
comp
- the component to be addedconstraints
- where/how the component is added to the layout.public void addLayoutComponent(java.lang.String group, java.awt.Component comp)
addLayoutComponent
in interface java.awt.LayoutManager
name
- the String of the index of the componentcomp
- the component to be addedpublic void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager
comp
- the component to be removedpublic java.awt.Dimension maximumLayoutSize(java.awt.Container target)
maximumLayoutSize
in interface java.awt.LayoutManager2
target
- the component which needs to be laid outContainer
,
minimumLayoutSize(java.awt.Container)
,
preferredLayoutSize(java.awt.Container)
public float getLayoutAlignmentX(java.awt.Container parent)
getLayoutAlignmentX
in interface java.awt.LayoutManager2
public float getLayoutAlignmentY(java.awt.Container parent)
getLayoutAlignmentY
in interface java.awt.LayoutManager2
public void invalidateLayout(java.awt.Container target)
invalidateLayout
in interface java.awt.LayoutManager2
public int getThresholdCount()
public void setThresholdCount(int number)
number
- the number of tabs used from the 1st group to calculate the preferredSize of the containerpublic java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize
in interface java.awt.LayoutManager
parent
- the component which needs to be laid outminimumLayoutSize(java.awt.Container)
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize
in interface java.awt.LayoutManager
parent
- the component which needs to be laid outpreferredLayoutSize(java.awt.Container)
public void layoutContainer(java.awt.Container parent)
layoutContainer
in interface java.awt.LayoutManager
parent
- the specified component being laid outContainer
public java.lang.String toString()
toString
in class java.lang.Object
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |