| java.lang.Object org.eclipse.ui.internal.LayoutTree
All known Subclasses: org.eclipse.ui.internal.LayoutTreeNode,
LayoutTree | public class LayoutTree implements ISizeProvider(Code) | | Implementation of a tree where the node is allways a sash
and it allways has two chidren. If a children is removed
the sash, ie the node, is removed as well and its other children
placed on its parent.
|
Method Summary | |
public static int | add(int a, int b) Adds two positive integers. | public static void | assertValidSize(int toCheck) Asserts that toCheck is a positive integer less than INFINITE / 2 or equal
to INFINITE. | final public int | computeMaximumSize(boolean width, int availablePerpendicular) | final public int | computeMinimumSize(boolean width, int availablePerpendicular) Returns the minimum size for this subtree. | final public int | computePreferredSize(boolean width, int availableParallel, int availablePerpendicular, int preferredParallel) Computes the preferred size for this object. | public LayoutPart | computeRelation(ArrayList relations) Add the relation ship between the children in the list
and returns the left children. | public void | createControl(Composite parent) Creates SWT controls owned by the LayoutTree (ie: the sashes). | public void | describeLayout(StringBuffer buf) Writes a description of the layout to the given string buffer.
This is used for drag-drop test suites to determine if two layouts are the
same. | public void | disposeSashes() | protected int | doComputeMaximumSize(boolean width, int availablePerpendicular) | public int | doComputeMinimumSize(boolean width, int availablePerpendicular) | protected int | doComputePreferredSize(boolean width, int availableParallel, int availablePerpendicular, int preferredParallel) | protected int | doGetSizeFlags(boolean width) Returns the size flags for this tree. | protected void | doSetBounds(Rectangle bounds) Resize the parts on this tree to fit in bounds . | public LayoutTree | find(LayoutPart child) Find a LayoutPart in the tree and return its sub-tree. | public LayoutPart | findBottomRight() Find the part that is in the bottom rigth possition. | public LayoutPart | findPart(Point toFind) | public LayoutTreeNode | findSash(LayoutPartSash sash) Find a sash in the tree and return its sub-tree. | public void | findSashes(PartPane.Sashes sashes) | final public void | flushCache() Flushes all cached information about this node and all of its ancestors. | public void | flushChildren() Flushes all cached information about this node and all of its children. | public void | flushNode() Called to flush any cached information in this tree and its parents. | final public Rectangle | getBounds() Return the bounds of this tree which is the rectangle that
contains all Controls in this tree. | public LayoutTreeNode | getParent() Returns the parent of this tree or null if it is the root. | final public int | getSizeFlags(boolean width) | final public boolean | hasSizeFlag(boolean width, int flag) This is a shorthand method that checks if the tree contains the
given size flag. | public LayoutTree | insert(LayoutPart child, boolean left, LayoutPartSash sash, LayoutPart relative) Inserts a new child on the tree. | public boolean | isCompressible() Returns true if this tree can be compressed and expanded. | public boolean | isVisible() Returns true if this tree has visible parts otherwise returns false. | public static void | printCacheStatistics() For use in benchmarks and test suites only. | public void | recomputeRatio() Recompute the ratios in this tree. | public LayoutTree | remove(LayoutPart child) Find a child in the tree and remove it and its parent. | final public void | setBounds(Rectangle bounds) Sets the bounds of this node. | void | setParent(LayoutTreeNode parent) Set the parent of this tree. | void | setPart(LayoutPart part) | public static int | subtract(int a, int b) Subtracts two integers. | public String | toString() Returns a string representation of this object. |
maxCacheHits | public static int maxCacheHits(Code) | | |
maxCacheMisses | public static int maxCacheMisses(Code) | | |
minCacheHits | public static int minCacheHits(Code) | | |
minCacheMisses | public static int minCacheMisses(Code) | | |
LayoutTree | public LayoutTree(LayoutPart part)(Code) | | Initialize this tree with its part.
|
add | public static int add(int a, int b)(Code) | | Adds two positive integers. Treates INFINITE as positive infinity.
Parameters: a - a positive integer Parameters: b - a positive integer a + b, or INFINITE if a or b are positive infinity since: 3.1 |
assertValidSize | public static void assertValidSize(int toCheck)(Code) | | Asserts that toCheck is a positive integer less than INFINITE / 2 or equal
to INFINITE. Many of the methods of this class use positive integers as sizes,
with INFINITE indicating positive infinity. This picks up accidental addition or
subtraction from infinity.
Parameters: toCheck - integer to validate since: 3.1 |
computeMaximumSize | final public int computeMaximumSize(boolean width, int availablePerpendicular)(Code) | | |
computeMinimumSize | final public int computeMinimumSize(boolean width, int availablePerpendicular)(Code) | | Returns the minimum size for this subtree. Equivalent to calling
computePreferredSize(width, INFINITE, availablePerpendicular, 0).
Returns a cached value if possible or defers to doComputeMinimumSize otherwise.
Subclasses should overload doComputeMinimumSize if they want to specialize the
return value.
Parameters: width - true iff computing the minimum width, false iff computing the minimum height Parameters: availablePerpendicular - available space (pixels) perpendicular to the dimension being computed. This is a height when computing a width, or a width when computing a height. See Also: LayoutPart.computePreferredSize(booleanintintint) |
computePreferredSize | final public int computePreferredSize(boolean width, int availableParallel, int availablePerpendicular, int preferredParallel)(Code) | | Computes the preferred size for this object. The interpretation of the result depends on the flags returned
by getSizeFlags(). If the caller is looking for a maximum or minimum size, this delegates to computeMinimumSize
or computeMaximumSize in order to benefit from caching optimizations. Otherwise, it delegates to
doComputePreferredSize. Subclasses should overload one of doComputeMinimumSize, doComputeMaximumSize, or
doComputePreferredSize to specialize the return value.
See Also: LayoutPart.computePreferredSize(booleanintintint) |
computeRelation | public LayoutPart computeRelation(ArrayList relations)(Code) | | Add the relation ship between the children in the list
and returns the left children.
|
createControl | public void createControl(Composite parent)(Code) | | Creates SWT controls owned by the LayoutTree (ie: the sashes). Does not affect the
LayoutParts that are being arranged by the LayoutTree.
Parameters: parent - since: 3.1 |
describeLayout | public void describeLayout(StringBuffer buf)(Code) | | Writes a description of the layout to the given string buffer.
This is used for drag-drop test suites to determine if two layouts are the
same. Like a hash code, the description should compare as equal iff the
layouts are the same. However, it should be user-readable in order to
help debug failed tests. Although these are english readable strings,
they should not be translated or equality tests will fail.
This is only intended for use by test suites.
Parameters: buf - |
disposeSashes | public void disposeSashes()(Code) | | Dispose all Sashs in this tree
|
doComputeMaximumSize | protected int doComputeMaximumSize(boolean width, int availablePerpendicular)(Code) | | |
doComputeMinimumSize | public int doComputeMinimumSize(boolean width, int availablePerpendicular)(Code) | | |
doGetSizeFlags | protected int doGetSizeFlags(boolean width)(Code) | | Returns the size flags for this tree.
See Also: org.eclipse.ui.presentations.StackPresentation.getSizeFlags(boolean) Parameters: b - indicates whether the caller wants the flags for computing widths (=true) or heights (=false) a bitwise combiniation of flags with the same meaning as StackPresentation.getSizeFlags(boolean) |
doSetBounds | protected void doSetBounds(Rectangle bounds)(Code) | | Resize the parts on this tree to fit in bounds .
|
find | public LayoutTree find(LayoutPart child)(Code) | | Find a LayoutPart in the tree and return its sub-tree. Returns
null if the child is not found.
|
findBottomRight | public LayoutPart findBottomRight()(Code) | | Find the part that is in the bottom rigth possition.
|
findPart | public LayoutPart findPart(Point toFind)(Code) | | Locates the part that intersects the given point
Parameters: toFind - |
findSashes | public void findSashes(PartPane.Sashes sashes)(Code) | | Find the Left,Right,Top and Botton
sashes around this tree and set them
in sashes
|
flushCache | final public void flushCache()(Code) | | Flushes all cached information about this node and all of its ancestors.
This should be called when a single child changes.
since: 3.1 |
flushChildren | public void flushChildren()(Code) | | Flushes all cached information about this node and all of its children.
This should be called if something may have caused all children to become
out of synch with their cached information (for example, if a lot of changes
may have happened without calling flushCache after each change)
since: 3.1 |
flushNode | public void flushNode()(Code) | | Called to flush any cached information in this tree and its parents.
|
getBounds | final public Rectangle getBounds()(Code) | | Return the bounds of this tree which is the rectangle that
contains all Controls in this tree.
|
getParent | public LayoutTreeNode getParent()(Code) | | Returns the parent of this tree or null if it is the root.
|
getSizeFlags | final public int getSizeFlags(boolean width)(Code) | | |
hasSizeFlag | final public boolean hasSizeFlag(boolean width, int flag)(Code) | | This is a shorthand method that checks if the tree contains the
given size flag. For example, hasSizeFlag(false, SWT.MIN) returns
true iff the receiver enforces a minimum height, or
hasSizeFlag(true, SWT.WRAP) returns true iff the receiver needs to
know its height when computing its preferred width.
Parameters: vertical - since: 3.1 |
isCompressible | public boolean isCompressible()(Code) | | Returns true if this tree can be compressed and expanded.
true if springy |
isVisible | public boolean isVisible()(Code) | | Returns true if this tree has visible parts otherwise returns false.
|
printCacheStatistics | public static void printCacheStatistics()(Code) | | For use in benchmarks and test suites only. Displays cache utilization statistics for all
LayoutTree instances.
since: 3.1 |
recomputeRatio | public void recomputeRatio()(Code) | | Recompute the ratios in this tree.
|
remove | public LayoutTree remove(LayoutPart child)(Code) | | Find a child in the tree and remove it and its parent.
The other child of its parent is placed on the parent's parent.
Returns the new root of the tree.
|
setBounds | final public void setBounds(Rectangle bounds)(Code) | | Sets the bounds of this node. If the bounds have changed or any children have
changed then the children will be recursively layed out. This implementation
filters out redundant calls and delegates to doSetBounds to layout the children.
Subclasses should overload doSetBounds to lay out their children.
Parameters: bounds - new bounds of the tree |
subtract | public static int subtract(int a, int b)(Code) | | Subtracts two integers. If a is INFINITE, this is treated as
positive infinity.
Parameters: a - a positive integer or INFINITE indicating positive infinity Parameters: b - a positive integer (may not be INFINITE) a - b, or INFINITE if a == INFINITE since: 3.1 |
toString | public String toString()(Code) | | Returns a string representation of this object.
|
|
|