public class ExteriorLabelModel extends Object implements ILabelModel, ILabelModelParameterProvider
Layout
bounds.
This label model supports eight positions outside of the layout's bounds.
Modifier and Type | Class and Description |
---|---|
static class |
ExteriorLabelModel.Position
Enumeration of the possible positions of the
ExteriorLabelModel . |
Modifier and Type | Field and Description |
---|---|
static ILabelModelParameter |
EAST
A convenience parameter instance that can be shared between label instances.
|
static ILabelModelParameter |
NORTH
A convenience parameter instance that can be shared between label instances.
|
static ILabelModelParameter |
NORTH_EAST
A convenience parameter instance that can be shared between label instances.
|
static ILabelModelParameter |
NORTH_WEST
A convenience parameter instance that can be shared between label instances.
|
static ILabelModelParameter |
SOUTH
A convenience parameter instance that can be shared between label instances.
|
static ILabelModelParameter |
SOUTH_EAST
A convenience parameter instance that can be shared between label instances.
|
static ILabelModelParameter |
SOUTH_WEST
A convenience parameter instance that can be shared between label instances.
|
static ILabelModelParameter |
WEST
A convenience parameter instance that can be shared between label instances.
|
Constructor and Description |
---|
ExteriorLabelModel()
Creates a new instance of this model.
|
Modifier and Type | Method and Description |
---|---|
ILabelModelParameter |
createDefaultParameter()
Creates a default parameter that can be used for this model.
|
ILabelModelParameter |
createParameter(ExteriorLabelModel.Position position)
Creates a new parameter that is associated with this instance for the provided position.
|
ILookup |
getContext(ILabel label,
ILabelModelParameter layoutParameter)
Provides a
lookup context for the given combination of label and parameter. |
IOrientedRectangle |
getGeometry(ILabel label,
ILabelModelParameter layoutParameter)
Calculates the
geometry of the given label using the given model parameter. |
InsetsD |
getInsets()
Gets the insets to use by this model.
|
IEnumerable<ILabelModelParameter> |
getParameters(ILabel label,
ILabelModel model)
Returns an enumerator over a set of possible
ILabelModelParameter instances that can be used for the given label
and model. |
<TLookup> TLookup |
lookup(Class<TLookup> type)
Returns an instance that implements the given type or
null . |
void |
setInsets(InsetsD value)
Sets the insets to use by this model.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, safeLookup
public static final ILabelModelParameter EAST
Trying to change that instances' Insets
will raise an IllegalStateException
.
public static final ILabelModelParameter NORTH
Trying to change that instances' Insets
will raise an IllegalStateException
.
public static final ILabelModelParameter NORTH_EAST
Trying to change that instances' Insets
will raise an IllegalStateException
.
public static final ILabelModelParameter NORTH_WEST
Trying to change that instances' Insets
will raise an IllegalStateException
.
public static final ILabelModelParameter SOUTH
Trying to change that instances' Insets
will raise an IllegalStateException
.
public static final ILabelModelParameter SOUTH_EAST
Trying to change that instances' Insets
will raise an IllegalStateException
.
public static final ILabelModelParameter SOUTH_WEST
Trying to change that instances' Insets
will raise an IllegalStateException
.
public static final ILabelModelParameter WEST
Trying to change that instances' Insets
will raise an IllegalStateException
.
public ExteriorLabelModel()
public ILabelModelParameter createDefaultParameter()
ILabelModel
createDefaultParameter
in interface ILabelModel
public ILabelModelParameter createParameter(ExteriorLabelModel.Position position)
position
- The position constant that describes the position of the label.public ILookup getContext(ILabel label, ILabelModelParameter layoutParameter)
ILabelModel
lookup context
for the given combination of label and parameter.getContext
in interface ILabelModel
label
- The label to use in the context.layoutParameter
- The parameter to use for the label in the context.ILookup
interface that can be used to query additional aspects of the label/parameter
combination.ILookup.EMPTY
public final IOrientedRectangle getGeometry(ILabel label, ILabelModelParameter layoutParameter)
ILabelModel
geometry
of the given label using the given model parameter.getGeometry
in interface ILabelModel
label
- The label to calculate the geometry for.layoutParameter
- A parameter that is compatible with this model. Typically, this is a parameter that has been created by this model, and
its property Model
returns this instance.IOrientedRectangle
that describes the geometry of the label. This is typically designed as a flyweight,
therefore clients should not cache the instance but store the values if they need a snapshot for later use.public InsetsD getInsets()
The insets are in fact "outsets", i.e. they are treated as margins. Positive values will increase the distance of the labels to the node.
setInsets(InsetsD)
public IEnumerable<ILabelModelParameter> getParameters(ILabel label, ILabelModel model)
ILabelModelParameterProvider
ILabelModelParameter
instances that can be used for the given label
and model.getParameters
in interface ILabelModelParameterProvider
label
- The label instance to use.model
- The model to provide parameters for.public <TLookup> TLookup lookup(Class<TLookup> type)
ILookup
null
.
Typically, this method will be called in order to obtain a different view or
aspect of the current instance. This is quite similar to casting or using
a super type or interface of this instance, but is not limited to inheritance or
compile time constraints. An instance implementing this method is not
required to return non-null
implementations for the types, nor does it
have to return the same instance any time. Also it depends on the
type and context whether the instance returned stays up to date or needs to
be reobtained for subsequent use.public void setInsets(InsetsD value)
The insets are in fact "outsets", i.e. they are treated as margins. Positive values will increase the distance of the labels to the node.
value
- The Insets to set.getInsets()