|
Oculus Layout System API Documentation November 25, 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.oculustech.layout.OculusLayout
For a detailed explanation of using the Oculus Layout system, see the docs for OculusLayoutHelper.
OculusLayout implements a Layout Manager that uses a nested boxes system of layout similar to javax.swing.Box, but with more control over how things are stretched, and the ability to align components that reside at different points in the box tree structure.
Invoke the static method OculusLayout.setLicenseNumber()
with
a valid license key to avoid the regular appearance of warning dialog boxes
and to operate in registed mode. Visit
www.javalayout.com to
purchase a license key.
Field Summary | |
java.io.PrintStream |
debugOut
|
Fields inherited from interface com.oculustech.layout.OculusLayoutConstants |
BOTTOM_JUSTIFY, CENTER, HORIZONTAL, INFINITY, JUSTIFY_BOTTOM, JUSTIFY_CENTER, JUSTIFY_LEFT, JUSTIFY_RIGHT, JUSTIFY_TOP, LEFT_JUSTIFY, RIGHT_JUSTIFY, TOP_JUSTIFY, VERTICAL |
Fields inherited from interface com.oculustech.layout.OculusLayoutInfo |
ALIGNED_COMPONENT_SPACING, ALIGNMENT_SPACE_STRETCHING, CAN_BE_STRETCHED, LOW_PRIORITY_ALIGNMENT_SPACE_STRETCHING, MAX_STRETCHING_PREFERENCE, NO_STRETCH, START_NON_POINT_ALIGNMENT_STRETCHING_HERE, START_NORMAL_STRETCHING, START_STRETCHING_HERE, STRETCH_ONLY_TO_ALIGN, WANT_STRETCHED |
Constructor Summary | |
OculusLayout()
Default constructor here for Forte's sake. |
|
OculusLayout(java.awt.Container target,
int orientation)
Same as above, but with default justification of LEFT for vertical boxes, and TOP for horizontal ones. |
|
OculusLayout(java.awt.Container target,
int orientation,
int justification)
Creates a layout manager that will lay out components either left to right, top to bottom, opposite to its parent. |
|
OculusLayout(java.awt.Container target,
int orientation,
int justification,
java.io.PrintStream debugOut)
Same as above, but allows one to specify a debugging output stream. |
Method Summary | |
void |
addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
Called by Container when a new component is added to it. |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Not used by this class. |
static int |
arrayMax(int[] values)
|
static int |
arrayMax(int[] values,
int startIndex,
int endIndex)
|
static int |
arraySum(javax.swing.SizeRequirements[] values,
int field)
|
static int |
arraySum(javax.swing.SizeRequirements[] values,
int field,
int startIndex,
int endIndex)
|
protected void |
clearDesiredAlignmentPointPositions()
Resets the cached info on desired alignment point positions for this layout's container |
void |
clearSizePreferencesCache()
Clears the cached sizing computations for this layout manager, prior to its having been stretched. |
protected void |
debugOutput(java.lang.String s)
|
protected void |
debugOutput(java.lang.String s,
boolean p_newline)
|
java.awt.Point |
getAbsoluteComponentPosition(java.awt.Component c)
This function does its best to return the absolute position of a given component relative to its top-level container based on what is thus far known of the layout. |
protected int[] |
getAlignmentPointPositions()
Returns an array of the predicted/current positions of the alignment points in this layout's container. |
protected javax.swing.SizeRequirements[] |
getAlignmentRegionExtents()
Returns a list of SizeRequirements denoting the min/max/preferred sizes of each of the regions that this layout's container's alignment points divide it into |
protected int[] |
getAlignmentRegionStretchings()
Returns a list of stretching prefs of each of the regions that this layout's container's alignment points divide it into |
int |
getComponentHeight(java.awt.Component c)
Returns the anticipated height of a given component in this container or another container, taking into account under-way OculusLayout computations. |
static int |
getComponentIndex(java.awt.Component x)
Returns the index of the given component in its containers components list. |
int |
getComponentWidth(java.awt.Component c)
Returns the anticipated width of a given component in this container or another container, taking into account under-way OculusLayout computations. |
int |
getInterComponentSpacing()
Returns this layout manager's intercomponent spacing. |
int |
getJustification()
Returns this layout manager's justification. |
float |
getLayoutAlignmentX(java.awt.Container target)
This layout always center things, unless forced to do otherwise. |
float |
getLayoutAlignmentY(java.awt.Container target)
This layout always centers things, unless forced to do otherwise. |
static java.lang.String |
getLicenseNumber()
Returns the license number for the OculusLayout system previously set by setLicenseNumber. |
int |
getNonce()
Returns a unique integer identifying this OculusLayout instance. |
protected int |
getNumberAlignmentPoints()
Returns the number of AlignmentPointSpacings in this layout's container. |
static int |
getOppositeOrientation(int orientation)
If orientation is horizontal, returns vertical, otherwise returns horizontal |
int |
getOrientation()
Get the orientation for this layout |
protected int |
getRegionEndIndex(int regionIndex)
Returns the ending component index of the region given by regionIndex. |
protected int |
getRegionStartIndex(int regionIndex)
Returns the starting component index of the region given by regionIndex. |
java.awt.Point |
getRelativeComponentPosition(java.awt.Component x)
returns the given component's position relative to the container associated with this layout manager. |
java.awt.Component |
getSameHeightAs()
Gets the component whose height is being matched. |
java.awt.Component |
getSameWidthAs()
Gets the component whose height is being matched. |
int |
getXPreference()
returns the X-Stretching preferences for this layout. |
int |
getXPreference(java.awt.Container target)
returns the X-Stretching preferences for this layout. |
int |
getYPreference()
returns the Y-Stretching preferences for this layout. |
int |
getYPreference(java.awt.Container target)
returns the Y-Stretching preferences for this layout. |
protected void |
invalidateDescendentsSizePreferences()
Invalidates cached size/layout computations in all descendents of this layout's container (but not this container itself). |
void |
invalidateLayout(java.awt.Container target)
Indicates that a child has changed its layout related information, and thus any cached calculations should be flushed. |
protected void |
invalidateOthersSizePreferences()
This function clears the size preferences cache for all containers that come later than this one in a depth-first ordering of the tree starting from this containers root. |
void |
layoutContainer(java.awt.Container target)
Called by the AWT when the specified container needs to be laid out. |
java.awt.Dimension |
maximumLayoutSize(java.awt.Container target)
Returns the maximum dimensions the target container can use to lay out the components it contains. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container target)
Returns the minimum dimensions needed to lay out the components contained in the specified target container. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container target)
Returns the preferred dimensions for this layout, given the components in the specified target container. |
void |
removeLayoutComponent(java.awt.Component comp)
Called by Container when a component is removed. |
protected void |
setContainsAlignToComponent(boolean pContainsAlignToComponent)
Inform Layout manager that it contains a component to which another component is aligned. |
void |
setDebugOutStream(java.io.PrintStream x)
Sets the PrintStream to output debugging information to. |
protected void |
setDesiredAlignmentPointPosition(int index,
int pcoord)
Sets the desired position for the specified alignment point. |
void |
setInterComponentSpacing(int icspacing)
Sets this layout manager's intercomponent spacing. |
void |
setJustification(int newJustification)
Sets this layout manager's justification. |
static void |
setLicenseNumber(java.lang.String ln)
Sets license number for OculusLayout System. |
void |
setOrientation(int orientation)
Sets the orientation for this layout. |
static void |
storeMaximums(int[] destination,
int[] other)
For every value in destination, stores the maximum of the value in destination or the corresponding value in other into destination |
static void |
storeMaximums(int[] destination,
int[] other,
int startIndex,
int endIndex)
For every value in destination within given index range, stores the maximum of the value in destination or the corresponding value in other into destination |
static void |
storeMaximums(javax.swing.SizeRequirements[] destination,
javax.swing.SizeRequirements[] other)
For each of preferred, minimum, and maximum (independently), for every value in destination, stores the maximum of the value in destination or the corresponding value in other into destination |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public transient java.io.PrintStream debugOut
Constructor Detail |
public OculusLayout()
public OculusLayout(java.awt.Container target, int orientation, int justification)
axis
parameter.target
- the container that needs to be laid outorientation
- the axis to lay out components along.
For left-to-right layout,
specify OculusLayout.HORIZONTAL
;
for top-to-bottom layout,
specify OculusLayout.VERTICAL
;
for opposite-of-parent layout,
specify OculusLayout.OPPOSITE
(opposite not yet implemented);java.awt.AWTError
- if the value of axis
is invalidpublic OculusLayout(java.awt.Container target, int orientation)
public OculusLayout(java.awt.Container target, int orientation, int justification, java.io.PrintStream debugOut)
dbg
- the stream to which debugging messages should be sent,
null if noneMethod Detail |
public int getNonce()
public void setDebugOutStream(java.io.PrintStream x)
public void setOrientation(int orientation)
public int getOrientation()
protected void debugOutput(java.lang.String s)
protected void debugOutput(java.lang.String s, boolean p_newline)
public void setInterComponentSpacing(int icspacing)
public int getInterComponentSpacing()
public void setJustification(int newJustification)
public int getJustification()
public void invalidateLayout(java.awt.Container target)
invalidateLayout
in interface java.awt.LayoutManager2
target
- the affected containerjava.awt.AWTError
- if the target isn't the container specified to the
BoxLayout constructorpublic void addLayoutComponent(java.lang.String name, java.awt.Component comp)
addLayoutComponent
in interface java.awt.LayoutManager
name
- the name of the componentcomp
- the componentpublic void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager
comp
- the componentpublic void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
addLayoutComponent
in interface java.awt.LayoutManager2
comp
- the componentconstraints
- constraintspublic java.awt.Dimension preferredLayoutSize(java.awt.Container target)
preferredLayoutSize
in interface java.awt.LayoutManager
target
- the container that needs to be laid outjava.awt.AWTError
- if the target isn't the container specified to the
BoxLayout constructorContainer
,
minimumLayoutSize(java.awt.Container)
,
maximumLayoutSize(java.awt.Container)
public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
minimumLayoutSize
in interface java.awt.LayoutManager
target
- the container that needs to be laid outjava.awt.AWTError
- if the target isn't the container specified to the
BoxLayout constructorpreferredLayoutSize(java.awt.Container)
,
maximumLayoutSize(java.awt.Container)
public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
maximumLayoutSize
in interface java.awt.LayoutManager2
target
- the container that needs to be laid outjava.awt.AWTError
- if the target isn't the container specified to the
BoxLayout constructorpreferredLayoutSize(java.awt.Container)
,
minimumLayoutSize(java.awt.Container)
public float getLayoutAlignmentX(java.awt.Container target)
getLayoutAlignmentX
in interface java.awt.LayoutManager2
target
- the containerpublic float getLayoutAlignmentY(java.awt.Container target)
getLayoutAlignmentY
in interface java.awt.LayoutManager2
target
- the containerpublic int getXPreference(java.awt.Container target)
public int getXPreference()
getXPreference
in interface OculusLayoutInfo
com.oculustech.layout.OculusLayoutInfo
public int getYPreference(java.awt.Container target)
public int getYPreference()
getYPreference
in interface OculusLayoutInfo
com.oculustech.layout.OculusLayoutInfo
public java.awt.Component getSameHeightAs()
getSameHeightAs
in interface OculusLayoutInfo
public java.awt.Component getSameWidthAs()
getSameWidthAs
in interface OculusLayoutInfo
public void layoutContainer(java.awt.Container target)
layoutContainer
in interface java.awt.LayoutManager
target
- the container to lay outjava.awt.AWTError
- if the target isn't the container specified to the
BoxLayout constructorpublic static int getComponentIndex(java.awt.Component x)
public int getComponentWidth(java.awt.Component c)
public int getComponentHeight(java.awt.Component c)
public java.awt.Point getAbsoluteComponentPosition(java.awt.Component c)
public java.awt.Point getRelativeComponentPosition(java.awt.Component x)
protected void setContainsAlignToComponent(boolean pContainsAlignToComponent)
public void clearSizePreferencesCache()
protected void invalidateOthersSizePreferences()
protected void invalidateDescendentsSizePreferences()
protected int[] getAlignmentPointPositions()
protected int getNumberAlignmentPoints()
protected void setDesiredAlignmentPointPosition(int index, int pcoord)
protected void clearDesiredAlignmentPointPositions()
protected javax.swing.SizeRequirements[] getAlignmentRegionExtents()
protected int getRegionEndIndex(int regionIndex)
protected int getRegionStartIndex(int regionIndex)
protected int[] getAlignmentRegionStretchings()
public static int getOppositeOrientation(int orientation)
public static void storeMaximums(int[] destination, int[] other, int startIndex, int endIndex)
public static void storeMaximums(int[] destination, int[] other)
public static void storeMaximums(javax.swing.SizeRequirements[] destination, javax.swing.SizeRequirements[] other)
public static int arrayMax(int[] values, int startIndex, int endIndex)
public static int arrayMax(int[] values)
public static int arraySum(javax.swing.SizeRequirements[] values, int field)
public static int arraySum(javax.swing.SizeRequirements[] values, int field, int startIndex, int endIndex)
public static void setLicenseNumber(java.lang.String ln)
public static java.lang.String getLicenseNumber()
|
Oculus Layout System API Documentation November 25, 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |