|
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.DynamicallyPropertiedComponentHelper
Can be used as basis for implementation of DynamicallyPropertiedComponent by simply passing calls through to its functions. Note that this implementation does no caching of property values at nodes, making a tree walk necessary on every call to get. This simplifies the implementation (at the expense of performance), and is probably OK given that we use this code very little at the moment.
The object methods provided here are generic and could be used to implement the DynamicallyPropertiedComponent interface in any context. In addition, static methods for implementing the DynamicallyPropertiedComponent tree-functions in the context of AWT component trees are provided. These functions will collapse nodes of the AWT component tree that do not implement the DynamicallyPropertiedComponent interface, reducing the tree to a much smaller DynamicallyPropertiedComponent tree. The implementations of these functions are inefficient (a complete tree walk may be up to O(n^2 * ln n)); caching of tree structure information at nodes should probably be implemented to speed things along. On the other hand, this code is used sparingly enough its inefficiency doesn't matter.
Field Summary | |
java.io.PrintStream |
debugOut
|
Constructor Summary | |
DynamicallyPropertiedComponentHelper(DynamicallyPropertiedComponent component)
|
Method Summary | |
static void |
addDebugProperty(java.lang.String prop)
Turn on debugging information related to the given property name. |
java.lang.Object |
aggregateDynamicPropertyValues(java.lang.String prop,
java.lang.Object value1,
java.lang.Object value2)
Implements inherited aggregateDynamicPropertyValues implementation, as per spec in interface. |
void |
clearNodeDynamicallyAccumulatedProperties()
|
void |
clearNodeDynamicallyInheritedProperties()
|
protected void |
debugOutput(java.lang.String s)
|
protected void |
debugOutput(java.lang.String prop,
int indent,
java.lang.String s)
|
protected void |
debugOutput(java.lang.String prop,
java.lang.String s)
|
static void |
debugOutputDynamicallyPropertiedComponentTreeOfAWTContainer(java.awt.Container container)
|
void |
debugOutputNodesDefiningProperty(java.lang.String prop)
|
static java.lang.Object |
defaultAggregateDynamicPropertiesAlgorithm(java.lang.String prop,
java.lang.Object value1,
java.lang.Object value2)
Implements the algorithm used by default in aggregateDynamicPropertyValues. |
void |
dynamicallyAccumulatedPropertyChanged(java.lang.String prop)
|
void |
dynamicallyInheritedPropertyChanged(java.lang.String prop)
|
java.lang.Object |
getDynamicallyAccumulatedProperty(java.lang.String prop)
|
java.lang.Object |
getDynamicallyAccumulatedPropertyFromRoot(java.lang.String prop)
Get the value of the accumulated property as seen from the root of the tree. |
java.lang.Object |
getDynamicallyInheritedProperty(java.lang.String prop)
|
static DynamicallyPropertiedComponent |
getDynamicallyPropertiedChildOfAWTContainer(java.awt.Container container,
int index)
Provides parent routine that collapses an AWT component tree into a tree consisting only of DynamicallyPropertiedComponent nodes. |
static int |
getDynamicallyPropertiedChildrenCountOfAWTComponent(java.awt.Component comp)
Provides parent routine that collapses an AWT component tree into a tree consisting only of DynamicallyPropertiedComponent nodes. |
static DynamicallyPropertiedComponent |
getDynamicallyPropertiedParentOfAWTComponent(java.awt.Component comp)
Provides parent routine that collapses an AWT component tree into a tree consisting only of DynamicallyPropertiedComponent nodes. |
DynamicallyPropertiedComponent |
getDynamicallyPropertiedRoot()
|
java.lang.Object |
getLocalDynamicallyAccumulatedProperty(java.lang.String prop)
|
java.lang.Object |
getLocalDynamicallyInheritedProperty(java.lang.String prop)
|
static void |
removeDebugProperty(java.lang.String prop)
Turn off debugging information related to the given property name. |
static void |
setDebugAll(boolean on)
turn on/off debugging information for all properties. |
void |
setDebugOutStream(java.io.PrintStream x)
Set the PrintStream to which to output debugging information. |
static void |
setDefaultDebugOutStream(java.io.PrintStream x)
Set the PrintStream to which to output debugging information for all new DynamicallyPropertiedComponentHelper instances. |
void |
setDynamicallyAccumulatedProperty(java.lang.String prop,
java.lang.Object value)
|
void |
setDynamicallyInheritedProperty(java.lang.String prop,
java.lang.Object value)
|
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 DynamicallyPropertiedComponentHelper(DynamicallyPropertiedComponent component)
Method Detail |
public void setDebugOutStream(java.io.PrintStream x)
public static void setDefaultDebugOutStream(java.io.PrintStream x)
public static void addDebugProperty(java.lang.String prop)
public static void removeDebugProperty(java.lang.String prop)
public static void setDebugAll(boolean on)
protected void debugOutput(java.lang.String prop, int indent, java.lang.String s)
protected void debugOutput(java.lang.String prop, java.lang.String s)
protected void debugOutput(java.lang.String s)
public void setDynamicallyAccumulatedProperty(java.lang.String prop, java.lang.Object value)
public void clearNodeDynamicallyAccumulatedProperties()
public void clearNodeDynamicallyInheritedProperties()
public java.lang.Object getDynamicallyAccumulatedProperty(java.lang.String prop)
public java.lang.Object getLocalDynamicallyAccumulatedProperty(java.lang.String prop)
public void dynamicallyAccumulatedPropertyChanged(java.lang.String prop)
public java.lang.Object aggregateDynamicPropertyValues(java.lang.String prop, java.lang.Object value1, java.lang.Object value2)
Root level default aggregation technique adds numbers, ORs booleans, concatenates Strings and Lists, and causes SelectionActions to inherit from one another corresponding to component tree structure, and passes up the least-derived (parent) SelectionActions instance. (Note that Concatenated strings will be separated by newline).
If properties are of different types, or are of a type unknown to this function, root level default returns value1.
public static java.lang.Object defaultAggregateDynamicPropertiesAlgorithm(java.lang.String prop, java.lang.Object value1, java.lang.Object value2)
Aggregation technique adds numbers, ORs booleans, concatenates Strings and Lists, combines Maps with childrens' items taking precedence over parents', and causes SelectionActions to inherit from one another corresponding to component tree structure, and passes up the least-derived (parent) SelectionActions instance. (Note that Concatenated strings will be separated by newline).
If properties are of different types, or are of a type unknown to this function, root level default returns value1.
public void setDynamicallyInheritedProperty(java.lang.String prop, java.lang.Object value)
public java.lang.Object getDynamicallyInheritedProperty(java.lang.String prop)
public java.lang.Object getLocalDynamicallyInheritedProperty(java.lang.String prop)
public void dynamicallyInheritedPropertyChanged(java.lang.String prop)
public DynamicallyPropertiedComponent getDynamicallyPropertiedRoot()
public java.lang.Object getDynamicallyAccumulatedPropertyFromRoot(java.lang.String prop)
public static DynamicallyPropertiedComponent getDynamicallyPropertiedParentOfAWTComponent(java.awt.Component comp)
public static int getDynamicallyPropertiedChildrenCountOfAWTComponent(java.awt.Component comp)
public static DynamicallyPropertiedComponent getDynamicallyPropertiedChildOfAWTContainer(java.awt.Container container, int index)
public void debugOutputNodesDefiningProperty(java.lang.String prop)
public static void debugOutputDynamicallyPropertiedComponentTreeOfAWTContainer(java.awt.Container container)
|
Oculus Layout System API Documentation November 25, 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |