public class LabelDefaults extends Object implements ILabelDefaults
ILabelDefaults
interface.Constructor and Description |
---|
LabelDefaults()
Initializes a new instance of the
LabelDefaults class using a trivial parameter. |
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
ILabelDefaults.getLayoutParameterInstance(ILabelOwner) . |
boolean |
isStyleInstanceSharingEnabled()
Gets a value indicating whether the
Style instance should be shared referentially or cloned
upon a call to ILabelDefaults.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
ILabelDefaults.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 ILabelDefaults.getStyleInstance(ILabelOwner) . |
public LabelDefaults()
LabelDefaults
class using a trivial parameter.public final ILabelModelParameter getLayoutParameter()
ILabelDefaults
Depending on the setting of LayoutParameterInstanceSharingEnabled
,
the ILabelDefaults.getLayoutParameterInstance(ILabelOwner)
method should return a clone
of this instance or the very same instance.
getLayoutParameter
in interface ILabelDefaults
ILabelDefaults.isLayoutParameterInstanceSharingEnabled()
,
ILabelDefaults.getLayoutParameterInstance(ILabelOwner)
,
ILabelDefaults.setLayoutParameter(ILabelModelParameter)
public ILabelModelParameter getLayoutParameterInstance(ILabelOwner owner)
ILabelDefaults
Most implementations will yield either, a clone
of or the LayoutParameter
property, if LayoutParameterInstanceSharingEnabled
is enabled, but
they might use more complicated logic, too.
getLayoutParameterInstance
in interface ILabelDefaults
owner
- The owner of the label that will be created.clone
of or the LayoutParameter
property, if LayoutParameterInstanceSharingEnabled
is enabled.public final ILabelStyle getStyle()
ILabelDefaults
Depending on the setting of StyleInstanceSharingEnabled
, the ILabelDefaults.getStyleInstance(ILabelOwner)
method should return a clone
of this instance or the very same
instance.
getStyle
in interface ILabelDefaults
ILabelDefaults.isStyleInstanceSharingEnabled()
,
ILabelDefaults.setStyle(ILabelStyle)
public ILabelStyle getStyleInstance(ILabelOwner owner)
ILabelDefaults
Most implementations will yield either, a clone
of or the Style
property, if StyleInstanceSharingEnabled
is enabled, but they might use more
complicated logic, too.
getStyleInstance
in interface ILabelDefaults
owner
- The owner of the label that will be created.clone
of
or the Style
property, if StyleInstanceSharingEnabled
is
enabled.public final boolean isAutoAdjustingPreferredSizeEnabled()
ILabelDefaults
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.
isAutoAdjustingPreferredSizeEnabled
in interface ILabelDefaults
ILabelStyleRenderer.getPreferredSize(com.yworks.yfiles.graph.ILabel, ILabelStyle)
,
ILabelDefaults.setAutoAdjustingPreferredSizeEnabled(boolean)
public final boolean isLayoutParameterInstanceSharingEnabled()
ILabelDefaults
LayoutParameter
instance should be shared
referentially or cloned
upon a call to
ILabelDefaults.getLayoutParameterInstance(ILabelOwner)
.isLayoutParameterInstanceSharingEnabled
in interface ILabelDefaults
true
if the reference should be shared; false
otherwise.ILabelDefaults.getLayoutParameterInstance(ILabelOwner)
,
ILabelDefaults.getLayoutParameter()
,
ILabelDefaults.setLayoutParameterInstanceSharingEnabled(boolean)
public final boolean isStyleInstanceSharingEnabled()
ILabelDefaults
Style
instance should be shared referentially or cloned
upon a call to ILabelDefaults.getStyleInstance(ILabelOwner)
.isStyleInstanceSharingEnabled
in interface ILabelDefaults
true
if the reference should be shared; false
otherwise.ILabelDefaults.getStyleInstance(ILabelOwner)
,
ILabelDefaults.getStyle()
,
ILabelDefaults.setStyleInstanceSharingEnabled(boolean)
public final void setAutoAdjustingPreferredSizeEnabled(boolean value)
ILabelDefaults
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.
setAutoAdjustingPreferredSizeEnabled
in interface ILabelDefaults
value
- The AutoAdjustingPreferredSizeEnabled to set.ILabelStyleRenderer.getPreferredSize(com.yworks.yfiles.graph.ILabel, ILabelStyle)
,
ILabelDefaults.isAutoAdjustingPreferredSizeEnabled()
public final void setLayoutParameter(ILabelModelParameter value)
ILabelDefaults
Depending on the setting of LayoutParameterInstanceSharingEnabled
,
the ILabelDefaults.getLayoutParameterInstance(ILabelOwner)
method should return a clone
of this instance or the very same instance.
setLayoutParameter
in interface ILabelDefaults
value
- The parameter to use as a template.ILabelDefaults.isLayoutParameterInstanceSharingEnabled()
,
ILabelDefaults.getLayoutParameterInstance(ILabelOwner)
,
ILabelDefaults.getLayoutParameter()
public final void setLayoutParameterInstanceSharingEnabled(boolean value)
ILabelDefaults
LayoutParameter
instance should be shared
referentially or cloned
upon a call to
ILabelDefaults.getLayoutParameterInstance(ILabelOwner)
.setLayoutParameterInstanceSharingEnabled
in interface ILabelDefaults
value
- true
if the reference should be shared; false
otherwise.ILabelDefaults.getLayoutParameterInstance(ILabelOwner)
,
ILabelDefaults.getLayoutParameter()
,
ILabelDefaults.isLayoutParameterInstanceSharingEnabled()
public final void setStyle(ILabelStyle value)
ILabelDefaults
Depending on the setting of StyleInstanceSharingEnabled
, the ILabelDefaults.getStyleInstance(ILabelOwner)
method should return a clone
of this instance or the very same
instance.
setStyle
in interface ILabelDefaults
value
- The style to use as a template.ILabelDefaults.isStyleInstanceSharingEnabled()
,
ILabelDefaults.getStyle()
public final void setStyleInstanceSharingEnabled(boolean value)
ILabelDefaults
Style
instance should be shared referentially or cloned
upon a call to ILabelDefaults.getStyleInstance(ILabelOwner)
.setStyleInstanceSharingEnabled
in interface ILabelDefaults
value
- true
if the reference should be shared; false
otherwise.ILabelDefaults.getStyleInstance(ILabelOwner)
,
ILabelDefaults.getStyle()
,
ILabelDefaults.isStyleInstanceSharingEnabled()