public class CollapsibleNodeStyleDecorator extends Object implements INodeStyle, Cloneable
This style uses the CollapsibleNodeStyleDecoratorRenderer
to adorn an existing INodeStyle
with a Button
that can then be used to trigger the ICommand.TOGGLE_EXPANSION_STATE
.
By default, this handle is rendered as a plus ("+") sign when in collapsed state, and a minus ("-") sign when in expanded state.
CollapsibleNodeStyleDecoratorRenderer
Constructor and Description |
---|
CollapsibleNodeStyleDecorator()
Initializes a new instance of the
CollapsibleNodeStyleDecorator class. |
CollapsibleNodeStyleDecorator(INodeStyle wrapped)
Initializes a new instance of the
CollapsibleNodeStyleDecorator class using the provided style for the Wrapped
property and the provided CollapsibleNodeStyleDecoratorRenderer as renderer. |
CollapsibleNodeStyleDecorator(INodeStyle wrapped,
CollapsibleNodeStyleDecoratorRenderer renderer)
Initializes a new instance of the
CollapsibleNodeStyleDecorator class using the provided style for the Wrapped
property and the provided CollapsibleNodeStyleDecoratorRenderer as renderer. |
Modifier and Type | Method and Description |
---|---|
CollapsibleNodeStyleDecorator |
clone()
Creates a copy of this object and returns it.
|
ILabelModelParameter |
getButtonPlacement()
Gets an
ILabelModelParameter that determines the placement of the button for toggling the expanded state. |
SizeD |
getButtonSize()
Returns the size of the collapse button.
|
InsetsD |
getInsets()
Gets the insets to use for the
INodeInsetsProvider that will be reported by the
CollapsibleNodeStyleDecoratorRenderer 's ILookup . |
CollapsibleNodeStyleDecoratorRenderer |
getRenderer()
Gets the renderer implementation that can be queried for implementations that provide details about the visual
appearance and visual behavior for a given node and this style instance.
|
INodeStyle |
getWrapped()
Gets the wrapped node style that will be used to perform the actual rendering of the node.
|
void |
setButtonPlacement(ILabelModelParameter value)
Sets an
ILabelModelParameter that determines the placement of the button for toggling the expanded state. |
void |
setInsets(InsetsD value)
Sets the insets to use for the
INodeInsetsProvider that will be reported by the
CollapsibleNodeStyleDecoratorRenderer 's ILookup . |
void |
setWrapped(INodeStyle value)
Sets the wrapped node style that will be used to perform the actual rendering of the node.
|
public CollapsibleNodeStyleDecorator()
CollapsibleNodeStyleDecorator
class.
The Wrapped
property will be initialized with a ShapeNodeStyle
.
public CollapsibleNodeStyleDecorator(INodeStyle wrapped)
CollapsibleNodeStyleDecorator
class using the provided style for the Wrapped
property and the provided CollapsibleNodeStyleDecoratorRenderer
as renderer.wrapped
- The decorated style.public CollapsibleNodeStyleDecorator(INodeStyle wrapped, CollapsibleNodeStyleDecoratorRenderer renderer)
CollapsibleNodeStyleDecorator
class using the provided style for the Wrapped
property and the provided CollapsibleNodeStyleDecoratorRenderer
as renderer.wrapped
- The decorated style.renderer
- An instance of CollapsibleNodeStyleDecoratorRenderer
to render this style.public final CollapsibleNodeStyleDecorator clone()
ICloneable
clone
in interface ICloneable
clone
in class Object
Object.clone()
public final ILabelModelParameter getButtonPlacement()
ILabelModelParameter
that determines the placement of the button for toggling the expanded state.
The ILabelModelParameter
should support
labels bound to an INode
because the button will be positioned as if it was an ILabel
owned by the INode
that uses this style.
setButtonPlacement(ILabelModelParameter)
public SizeD getButtonSize()
public final InsetsD getInsets()
INodeInsetsProvider
that will be reported by the
CollapsibleNodeStyleDecoratorRenderer
's ILookup
.
This effectively influences the way the bounds of a group node are being calculated. The default IGroupBoundsCalculator
implementation will use these insets to determine the minimum size of a group node given a set of contained nodes.
setInsets(InsetsD)
public final CollapsibleNodeStyleDecoratorRenderer getRenderer()
INodeStyle
The idiom for retrieving, e.g. an IVisualCreator
implementation for a given style is:
getRenderer
in interface INodeStyle
public final INodeStyle getWrapped()
setWrapped(INodeStyle)
public final void setButtonPlacement(ILabelModelParameter value)
ILabelModelParameter
that determines the placement of the button for toggling the expanded state.
The ILabelModelParameter
should support
labels bound to an INode
because the button will be positioned as if it was an ILabel
owned by the INode
that uses this style.
value
- The ButtonPlacement to set.getButtonPlacement()
public final void setInsets(InsetsD value)
INodeInsetsProvider
that will be reported by the
CollapsibleNodeStyleDecoratorRenderer
's ILookup
.
This effectively influences the way the bounds of a group node are being calculated. The default IGroupBoundsCalculator
implementation will use these insets to determine the minimum size of a group node given a set of contained nodes.
value
- The Insets to set.getInsets()
public final void setWrapped(INodeStyle value)
value
- The Wrapped to set.getWrapped()