public interface ILabelDefaults
IGraph
and the like to declare and obtain the defaults for labels.
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 |
---|---|
ILabelModelParameter |
getLayoutParameter()
Gets the label model parameter to use for labels.
|
ILabelModelParameter |
getLayoutParameterInstance(ILabelOwner owner)
Factory method that returns a label model parameter instance for use with newly created labels.
|
ILabelStyle |
getStyle()
Gets the style to use for labels.
|
ILabelStyle |
getStyleInstance(ILabelOwner owner)
Factory method that returns a style instance for use with newly created labels.
|
boolean |
isAutoAdjustingPreferredSizeEnabled()
Gets a property that determines whether to automatically adjust the preferred size of a label.
|
boolean |
isLayoutParameterInstanceSharingEnabled()
Gets a value indicating whether the
LayoutParameter instance should be shared
referentially or cloned upon a call to
getLayoutParameterInstance(ILabelOwner) . |
boolean |
isStyleInstanceSharingEnabled()
Gets a value indicating whether the
Style instance should be shared referentially or cloned
upon a call to getStyleInstance(ILabelOwner) . |
void |
setAutoAdjustingPreferredSizeEnabled(boolean value)
Sets a property that determines whether to automatically adjust the preferred size of a label.
|
void |
setLayoutParameter(ILabelModelParameter value)
Sets the label model parameter to use for labels.
|
void |
setLayoutParameterInstanceSharingEnabled(boolean value)
Sets a value indicating whether the
LayoutParameter instance should be shared
referentially or cloned upon a call to
getLayoutParameterInstance(ILabelOwner) . |
void |
setStyle(ILabelStyle value)
Sets the style to use for labels.
|
void |
setStyleInstanceSharingEnabled(boolean value)
Sets a value indicating whether the
Style instance should be shared referentially or cloned
upon a call to getStyleInstance(ILabelOwner) . |
ILabelModelParameter getLayoutParameter()
Depending on the setting of LayoutParameterInstanceSharingEnabled
,
the getLayoutParameterInstance(ILabelOwner)
method should return a clone
of this instance or the very same instance.
isLayoutParameterInstanceSharingEnabled()
,
getLayoutParameterInstance(ILabelOwner)
,
setLayoutParameter(ILabelModelParameter)
ILabelModelParameter getLayoutParameterInstance(ILabelOwner owner)
Most implementations will yield either, a clone
of or the LayoutParameter
property, if LayoutParameterInstanceSharingEnabled
is enabled, but
they might use more complicated logic, too.
owner
- The owner of the label that will be created.clone
of or the LayoutParameter
property, if LayoutParameterInstanceSharingEnabled
is enabled.ILabelStyle getStyle()
Depending on the setting of StyleInstanceSharingEnabled
, the getStyleInstance(ILabelOwner)
method should return a clone
of this instance or the very same
instance.
isStyleInstanceSharingEnabled()
,
setStyle(ILabelStyle)
ILabelStyle getStyleInstance(ILabelOwner owner)
Most implementations will yield either, a clone
of or the Style
property, if StyleInstanceSharingEnabled
is enabled, but they might use more
complicated logic, too.
owner
- The owner of the label that will be created.clone
of
or the Style
property, if StyleInstanceSharingEnabled
is
enabled.boolean isAutoAdjustingPreferredSizeEnabled()
On a call to IGraph.setLabelText(com.yworks.yfiles.graph.ILabel, java.lang.String)
or
IGraph.setStyle(com.yworks.yfiles.graph.ILabel, ILabelStyle)
, the preferred size of
the label will automatically be adjusted to the preferred size that is suggested by the label's style renderer, if this
property is set to true.
ILabelStyleRenderer.getPreferredSize(com.yworks.yfiles.graph.ILabel, ILabelStyle)
,
setAutoAdjustingPreferredSizeEnabled(boolean)
boolean isLayoutParameterInstanceSharingEnabled()
LayoutParameter
instance should be shared
referentially or cloned
upon a call to
getLayoutParameterInstance(ILabelOwner)
.true
if the reference should be shared; false
otherwise.getLayoutParameterInstance(ILabelOwner)
,
getLayoutParameter()
,
setLayoutParameterInstanceSharingEnabled(boolean)
boolean isStyleInstanceSharingEnabled()
Style
instance should be shared referentially or cloned
upon a call to getStyleInstance(ILabelOwner)
.true
if the reference should be shared; false
otherwise.getStyleInstance(ILabelOwner)
,
getStyle()
,
setStyleInstanceSharingEnabled(boolean)
void setAutoAdjustingPreferredSizeEnabled(boolean value)
On a call to IGraph.setLabelText(com.yworks.yfiles.graph.ILabel, java.lang.String)
or
IGraph.setStyle(com.yworks.yfiles.graph.ILabel, ILabelStyle)
, the preferred size of
the label will automatically be adjusted to the preferred size that is suggested by the label's style renderer, if this
property is set to true.
value
- The AutoAdjustingPreferredSizeEnabled to set.ILabelStyleRenderer.getPreferredSize(com.yworks.yfiles.graph.ILabel, ILabelStyle)
,
isAutoAdjustingPreferredSizeEnabled()
void setLayoutParameter(ILabelModelParameter value)
Depending on the setting of LayoutParameterInstanceSharingEnabled
,
the getLayoutParameterInstance(ILabelOwner)
method should return a clone
of this instance or the very same instance.
value
- The parameter to use as a template.isLayoutParameterInstanceSharingEnabled()
,
getLayoutParameterInstance(ILabelOwner)
,
getLayoutParameter()
void setLayoutParameterInstanceSharingEnabled(boolean value)
LayoutParameter
instance should be shared
referentially or cloned
upon a call to
getLayoutParameterInstance(ILabelOwner)
.value
- true
if the reference should be shared; false
otherwise.getLayoutParameterInstance(ILabelOwner)
,
getLayoutParameter()
,
isLayoutParameterInstanceSharingEnabled()
void setStyle(ILabelStyle value)
Depending on the setting of StyleInstanceSharingEnabled
, the getStyleInstance(ILabelOwner)
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(ILabelOwner)
.value
- true
if the reference should be shared; false
otherwise.getStyleInstance(ILabelOwner)
,
getStyle()
,
isStyleInstanceSharingEnabled()