com.yworks.yfiles.server.graphml.flexio.data
Class InteriorStretchLabelModel

java.lang.Object
  extended bycom.yworks.yfiles.server.graphml.flexio.data.InteriorStretchLabelModel
All Implemented Interfaces:
ILabelCandidateDescriptorProvider, ILabelModel, ISharedInstanceProvider

public class InteriorStretchLabelModel
extends java.lang.Object
implements ILabelModel, ILabelCandidateDescriptorProvider, ISharedInstanceProvider

A label model data object for node labels that lie inside of the node's bounds and have been stretched to fit the node's size.


Nested Class Summary
static class InteriorStretchLabelModel.ModelParameter
          Parameter for the interior stretch label model that defines the position of the label using one of the position constants defined in class InteriorStretchLabelModel.
 
Field Summary
static ILabelModelParameter center
          A convenience parameter instance that can be shared between label instances.
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 java.lang.String POSITION_CENTER
          Encodes a position at the center the node interior.
static java.lang.String POSITION_EAST
          Encodes a position at the right side of the node interior.
static java.lang.String POSITION_NORTH
          Encodes a position at the top side of the node interior.
static java.lang.String POSITION_SOUTH
          Encodes a position at the bottom side of the node interior.
static java.lang.String POSITION_WEST
          Encodes a position at the west side of the node interior.
static ILabelModelParameter south
          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 Summary
InteriorStretchLabelModel()
          Creates a new instance with default insets (0,0,0,0).
InteriorStretchLabelModel(Insets insets)
          Creates a new instance using the provided insets.
 
Method Summary
 ILabelModelParameter createDefaultParameter()
          Creates a default parameter that can be used for this model.
 ILabelCandidateDescriptor getDescriptor(Label label, ILabelModelParameter parameter)
          Gets the descriptor for a given combination of label and ILabelModelParameter.
 Insets getInsets()
          Insets for the labels.
 java.util.Collection getSharedInstances()
          Returns an Collection for objects that shall be shared.
 void setInsets(Insets insets)
          Insets for the labels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POSITION_NORTH

public static final java.lang.String POSITION_NORTH
Encodes a position at the top side of the node interior.

See Also:
Constant Field Values

POSITION_EAST

public static final java.lang.String POSITION_EAST
Encodes a position at the right side of the node interior.

See Also:
Constant Field Values

POSITION_SOUTH

public static final java.lang.String POSITION_SOUTH
Encodes a position at the bottom side of the node interior.

See Also:
Constant Field Values

POSITION_WEST

public static final java.lang.String POSITION_WEST
Encodes a position at the west side of the node interior.

See Also:
Constant Field Values

POSITION_CENTER

public static final java.lang.String POSITION_CENTER
Encodes a position at the center the node interior.

See Also:
Constant Field Values

north

public static final ILabelModelParameter north
A convenience parameter instance that can be shared between label instances.

Although the parameter's model can be cast to a InteriorStretchLabelModel, trying to change that instance's insets will raise an UnsupportedOperationException.


east

public static final ILabelModelParameter east
A convenience parameter instance that can be shared between label instances.

Although the parameter's model can be cast to a InteriorStretchLabelModel, trying to change that instance's insets will raise an UnsupportedOperationException.


south

public static final ILabelModelParameter south
A convenience parameter instance that can be shared between label instances.

Although the parameter's model can be cast to a InteriorStretchLabelModel, trying to change that instance's insets will raise an UnsupportedOperationException.


west

public static final ILabelModelParameter west
A convenience parameter instance that can be shared between label instances.

Although the parameter's model can be cast to a InteriorStretchLabelModel, trying to change that instance's insets will raise an UnsupportedOperationException.


center

public static final ILabelModelParameter center
A convenience parameter instance that can be shared between label instances.

Although the parameter's model can be cast to a InteriorStretchLabelModel, trying to change that instance's insets will raise an UnsupportedOperationException.

Constructor Detail

InteriorStretchLabelModel

public InteriorStretchLabelModel()
Creates a new instance with default insets (0,0,0,0).


InteriorStretchLabelModel

public InteriorStretchLabelModel(Insets insets)
Creates a new instance using the provided insets.

Method Detail

getInsets

public Insets getInsets()
Insets for the labels.


setInsets

public void setInsets(Insets insets)
Insets for the labels.


createDefaultParameter

public ILabelModelParameter createDefaultParameter()
Description copied from interface: ILabelModel
Creates a default parameter that can be used for this model.

Specified by:
createDefaultParameter in interface ILabelModel
Returns:
A parameter for this model instance.

getDescriptor

public ILabelCandidateDescriptor getDescriptor(Label label,
                                               ILabelModelParameter parameter)
Gets the descriptor for a given combination of label and ILabelModelParameter.

Specified by:
getDescriptor in interface ILabelCandidateDescriptorProvider
Parameters:
label - The label to possibly assign the parameter.
parameter - The parameter to provide a descriptor for if applied to the given label
Returns:
A descriptor or null.

getSharedInstances

public java.util.Collection getSharedInstances()
Description copied from interface: ISharedInstanceProvider
Returns an Collection for objects that shall be shared.

Specified by:
getSharedInstances in interface ISharedInstanceProvider
Returns:


Copyright © 2000-2013 yWorks GmbH. All rights reserved