public interface INodeDefaults
IGraph
and the like to declare and obtain the defaults for nodes and their labels or ports.
Note that changing these defaults does not change properties of already created model items. Rather, only items created after the change are affected.
Modifier and Type | Method and Description |
---|---|
ILabelDefaults |
getLabelDefaults()
Gets the defaults for labels at nodes.
|
IPortDefaults |
getPortDefaults()
Gets the defaults for ports at nodes.
|
SizeD |
getSize()
Gets the default node size.
|
INodeStyle |
getStyle()
Gets the style to use for nodes.
|
INodeStyle |
getStyleInstance()
Factory method that returns a style instance for use with newly created nodes.
|
boolean |
isStyleInstanceSharingEnabled()
Gets a value indicating whether the
Style instance should be shared referentially or cloned
upon a call to getStyleInstance() . |
void |
setLabelDefaults(ILabelDefaults value)
Sets the defaults for labels at nodes.
|
void |
setPortDefaults(IPortDefaults value)
Sets the defaults for ports at nodes.
|
void |
setSize(SizeD value)
Sets the default node size.
|
void |
setStyle(INodeStyle value)
Sets the style to use for nodes.
|
void |
setStyleInstanceSharingEnabled(boolean value)
Sets a value indicating whether the
Style instance should be shared referentially or cloned
upon a call to getStyleInstance() . |
ILabelDefaults getLabelDefaults()
setLabelDefaults(ILabelDefaults)
IPortDefaults getPortDefaults()
setPortDefaults(IPortDefaults)
SizeD getSize()
The values of this size will be used by the IGraph.createNode(com.yworks.yfiles.geometry.PointD, INodeStyle, java.lang.Object)
and IGraph.createNode(com.yworks.yfiles.geometry.PointD, INodeStyle, java.lang.Object)
methods.
setSize(SizeD)
INodeStyle getStyle()
Depending on the setting of StyleInstanceSharingEnabled
, the getStyleInstance()
method should return a clone
of this instance or the very same
instance.
isStyleInstanceSharingEnabled()
,
setStyle(INodeStyle)
INodeStyle getStyleInstance()
Most implementations will yield either, a clone
of or the Style
property, if StyleInstanceSharingEnabled
is enabled, but they might use more
complicated logic, too.
clone
of
or the Style
property, if StyleInstanceSharingEnabled
is
enabled.boolean isStyleInstanceSharingEnabled()
Style
instance should be shared referentially or cloned
upon a call to getStyleInstance()
.true
if the reference should be shared; false
otherwise.getStyleInstance()
,
getStyle()
,
setStyleInstanceSharingEnabled(boolean)
void setLabelDefaults(ILabelDefaults value)
value
- The label defaults.getLabelDefaults()
void setPortDefaults(IPortDefaults value)
value
- The port defaults.getPortDefaults()
void setSize(SizeD value)
The values of this size will be used by the IGraph.createNode(com.yworks.yfiles.geometry.PointD, INodeStyle, java.lang.Object)
and IGraph.createNode(com.yworks.yfiles.geometry.PointD, INodeStyle, java.lang.Object)
methods.
value
- The default size of newly created nodes.getSize()
void setStyle(INodeStyle value)
Depending on the setting of StyleInstanceSharingEnabled
, the getStyleInstance()
method should return a clone
of this instance or the very same
instance.
value
- The style to use as a template.isStyleInstanceSharingEnabled()
,
getStyle()
void setStyleInstanceSharingEnabled(boolean value)
Style
instance should be shared referentially or cloned
upon a call to getStyleInstance()
.value
- true
if the reference should be shared; false
otherwise.getStyleInstance()
,
getStyle()
,
isStyleInstanceSharingEnabled()