Oculus Layout System API Documentation
November 25, 2002

com.oculustech.layout
Interface OculusLayoutInfo

All Known Implementing Classes:
OculusGrid, OculusBox, OculusLayout, OculusLayoutConstraints

public interface OculusLayoutInfo

This interface provides a collection of set and get methods for a constraints object that allows OculusGrid, OculusBox, and other containers using OculusLayout to know the associated component's stretching preferences and other sizing constraints.

If no constraints are specified for a given component, reasonable defaults will be used, which defaults depend on the component type. Constraints may be specified by adding a constraints object along-side the component using AWT's add(Component,Object) method. Alternatively, if the Component itself implements OculusLayoutInfo, it will be queried for the stretching and sizing preferences in lieu of any other associated constraints object being present. This provides a means of users defining reasonable default stretching preferences for their own custom components.


Field Summary
static int ALIGNED_COMPONENT_SPACING
          Constraint that the component will only be stretched insofar as its necessary in order to enforce a component-alignment constraint, and no other higher-priority stretching is available.
static int ALIGNMENT_SPACE_STRETCHING
          Second lowest priority stretching.
static int CAN_BE_STRETCHED
          Medium priority stretching.
static int LOW_PRIORITY_ALIGNMENT_SPACE_STRETCHING
          Lowest priority stretching.
static int MAX_STRETCHING_PREFERENCE
          Defines the maximum legal stretching preference.
static int NO_STRETCH
          Constraint that the component's dimension will remain constant regardless of parents reshaping.
static int START_NON_POINT_ALIGNMENT_STRETCHING_HERE
          this final int reflects the priority at or above which stretching will begin that isn't to do with aligning specific edges/points of components.
static int START_NORMAL_STRETCHING
          This will equal the stretching priority at which normal (non-special case, e.g.
static int START_STRETCHING_HERE
          This final int reflects the priority at or above which stretching will begin that isn't 'special' in that it is only sometimes applied.
static int STRETCH_ONLY_TO_ALIGN
          Constraint that the component will only be stretched so as to align with the boundaries of the box it is in and no more.
static int WANT_STRETCHED
          Highest priority stretching.
 
Method Summary
 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()
          Gets the horizontal preference according to one of the fields.
 int getYPreference()
          Gets the vertical preference according to one of the fields.
 

Field Detail

NO_STRETCH

public static final int NO_STRETCH
Constraint that the component's dimension will remain constant regardless of parents reshaping.

STRETCH_ONLY_TO_ALIGN

public static final int STRETCH_ONLY_TO_ALIGN
Constraint that the component will only be stretched so as to align with the boundaries of the box it is in and no more. Only applies to the auxillary dimension of the component in a box (i.e., the opposite of the box's orientation). Can apply to either direction in a grid.

START_STRETCHING_HERE

public static final int START_STRETCHING_HERE
This final int reflects the priority at or above which stretching will begin that isn't 'special' in that it is only sometimes applied. For now, equal to ALIGNED_COMPONENT_SPACING.

ALIGNED_COMPONENT_SPACING

public static final int ALIGNED_COMPONENT_SPACING
Constraint that the component will only be stretched insofar as its necessary in order to enforce a component-alignment constraint, and no other higher-priority stretching is available. Used primarily for AlignedComponentSpacing and AlignmentPointSpacing instances.

START_NON_POINT_ALIGNMENT_STRETCHING_HERE

public static final int START_NON_POINT_ALIGNMENT_STRETCHING_HERE
this final int reflects the priority at or above which stretching will begin that isn't to do with aligning specific edges/points of components.

LOW_PRIORITY_ALIGNMENT_SPACE_STRETCHING

public static final int LOW_PRIORITY_ALIGNMENT_SPACE_STRETCHING
Lowest priority stretching. Used primarily for filler-spaces that eat up extra area (i.e., AlignmentSpacing instances, only lower priority still). In an OculusBox, AlignmentSpacing instances with this is priority will only be stretched along the primary axis of the box; they is not stretched along the box's auxillary axis.

ALIGNMENT_SPACE_STRETCHING

public static final int ALIGNMENT_SPACE_STRETCHING
Second lowest priority stretching. Used primarily for filler-spaces that eat up extra area (i.e., AlignmentSpacing instances). In an OculusBox, AlignmentSpacing instances with this is priority will only be stretched along the primary axis of the box; they is not stretched along the box's auxillary axis.

START_NORMAL_STRETCHING

public static final int START_NORMAL_STRETCHING
This will equal the stretching priority at which normal (non-special case, e.g. Alignment) stretching should begin. Defaults to CAN_BE_STRETCHED.

CAN_BE_STRETCHED

public static final int CAN_BE_STRETCHED
Medium priority stretching. Given component will be stretched in given direction where possible if there is nothing of higher priority vying for the space.

WANT_STRETCHED

public static final int WANT_STRETCHED
Highest priority stretching. Given component will be stretched in a given direction where possible. (Space will be proportionally split between components of equal priority).

MAX_STRETCHING_PREFERENCE

public static final int MAX_STRETCHING_PREFERENCE
Defines the maximum legal stretching preference. Since stretching preferences start at 0, and range up to MAX_STRETCHING_PREFERENCE, inclusive, there are MAX_STRETCHING_PREFERENCE + 1 total stretching preferences.
Method Detail

getXPreference

public int getXPreference()
Gets the horizontal preference according to one of the fields.
Returns:
One of stretching preference final ints defined in OculusLayoutInfo

getYPreference

public int getYPreference()
Gets the vertical preference according to one of the fields.
Returns:
One of stretching preference final ints defined in OculusLayoutInfo

getSameWidthAs

public java.awt.Component getSameWidthAs()
Gets the component whose height is being matched.
Returns:
The component whose height is being matched, or null if not applicable.

getSameHeightAs

public java.awt.Component getSameHeightAs()
Gets the component whose height is being matched.
Returns:
The component whose height is being matched, or null if not applicable.

Oculus Layout System API Documentation
November 25, 2002

Copyright 2001-2002 Oculus Technologies Corporation. 103 Broad Street, 5th Floor,
Boston, Massachusetts, 02110, U.S.A. All Rights Reserved.