public class PanelNodeStyle extends Object implements INodeStyle, Cloneable
INodeStyle
that draws a simple floating panel with a slight gradient, a thin border and
optionally a drop shadow.
This style can be used to create the visual representation for group nodes, for example. By default, it a drop shadow by itself.
This style uses the PanelNodeStyleRenderer
to visualize a node.
PanelNodeStyleRenderer
Constructor and Description |
---|
PanelNodeStyle()
Creates a new instance using
PanelNodeStyleRenderer as renderer to share. |
PanelNodeStyle(PanelNodeStyleRenderer renderer)
Creates a new instance using the provided renderer to share.
|
Modifier and Type | Method and Description |
---|---|
PanelNodeStyle |
clone()
Creates a copy of this object and returns it.
|
Color |
getColor()
Gets the base color to use.
|
InsetsD |
getInsets()
Gets the instance to use that provides the insets for this style.
|
Color |
getLabelInsetsColor()
Gets the base color to use for drawing the label insets background.
|
PanelNodeStyleRenderer |
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.
|
void |
setColor(Color value)
Sets the base color to use.
|
void |
setInsets(InsetsD value)
Sets the instance to use that provides the insets for this style.
|
void |
setLabelInsetsColor(Color value)
Sets the base color to use for drawing the label insets background.
|
public PanelNodeStyle()
PanelNodeStyleRenderer
as renderer to share.public PanelNodeStyle(PanelNodeStyleRenderer renderer)
public final PanelNodeStyle clone()
ICloneable
clone
in interface ICloneable
clone
in class Object
Object.clone()
public final Color getColor()
The default value is Color.BLACK
.
setColor(Color)
public final InsetsD getInsets()
The PanelNodeStyleRenderer
will use these insets and return them via an INodeInsetsProvider
if such an instance is queried through the
context lookup
.
The default insets are set to (5,5,5,5).
INodeInsetsProvider
,
setInsets(InsetsD)
public final Color getLabelInsetsColor()
Setting this to null
effectively disables label insets background coloring.
The default value is Color.LIGHTGRAY
.
setLabelInsetsColor(Color)
public final PanelNodeStyleRenderer getRenderer()
INodeStyle
The idiom for retrieving, e.g. an IVisualCreator
implementation for a given style is:
getRenderer
in interface INodeStyle
public final void setColor(Color value)
The default value is Color.BLACK
.
value
- The Color to set.getColor()
public final void setInsets(InsetsD value)
The PanelNodeStyleRenderer
will use these insets and return them via an INodeInsetsProvider
if such an instance is queried through the
context lookup
.
The default insets are set to (5,5,5,5).
value
- The Insets to set.INodeInsetsProvider
,
getInsets()
public final void setLabelInsetsColor(Color value)
Setting this to null
effectively disables label insets background coloring.
The default value is Color.LIGHTGRAY
.
value
- The LabelInsetsColor to set.getLabelInsetsColor()