Search this API

y.layout
Class DefaultNodeLabelLayout

java.lang.Object
  extended by y.layout.DefaultNodeLabelLayout
All Implemented Interfaces:
LabelLayout, NodeLabelLayout

public class DefaultNodeLabelLayout
extends java.lang.Object
implements NodeLabelLayout

DefaultNodeLabelLayout is a default implementation of NodeLabelLayout which holds layout information about a node label.

 

Constructor Summary
DefaultNodeLabelLayout(NodeLabelModel model, java.lang.Object param, OrientedRectangle orientedBox, Node node)
          Creates a new DefaultNodeLabelLayout instance describing the layout information of a rotated node label.
DefaultNodeLabelLayout(NodeLabelModel model, java.lang.Object param, YRectangle box, Node node)
          Creates a new DefaultNodeLabelLayout instance describing the layout information of a node label.
 
Method Summary
 YRectangle getBox()
          Returns the bounding box of the label.
 NodeLabelModel getLabelModel()
          Returns the label model that describes the valid locations for this label.
 java.lang.Object getModelParameter()
          Returns the label model parameter that describes the position of this label.
 Node getNode()
          Returns the node which is associated with this layout.
 OrientedRectangle getOrientedBox()
          Returns the box of the label.
 void setModelParameter(java.lang.Object parameter)
          Specifies the label model parameter that describes the position of this label.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNodeLabelLayout

public DefaultNodeLabelLayout(NodeLabelModel model,
                              java.lang.Object param,
                              YRectangle box,
                              Node node)
Creates a new DefaultNodeLabelLayout instance describing the layout information of a node label.

Parameters:
model - the label model for this LabelLayout
param - the model parameter that describes the current position of the LabelLayout
box - the bounds of this LabelLayout
node - the node associated with this LabelLayout

DefaultNodeLabelLayout

public DefaultNodeLabelLayout(NodeLabelModel model,
                              java.lang.Object param,
                              OrientedRectangle orientedBox,
                              Node node)
Creates a new DefaultNodeLabelLayout instance describing the layout information of a rotated node label.

Parameters:
model - the label model for this LabelLayout
param - the model parameter that describes the current position of the LabelLayout
orientedBox - the oriented bounds of this LabelLayout
node - the node associated with this LabelLayout
Method Detail

getBox

public YRectangle getBox()
Description copied from interface: LabelLayout
Returns the bounding box of the label. The bounding box is the smallest, paraxial rectangle that contains the whole label.

Specified by:
getBox in interface LabelLayout
Returns:
the bounding box of the label

getOrientedBox

public OrientedRectangle getOrientedBox()
Description copied from interface: LabelLayout
Returns the box of the label. This box matches the area that is covered by the label. The up vector of the rectangle encodes the orientation of the label.

Specified by:
getOrientedBox in interface LabelLayout
Returns:
the oriented box of the label

getLabelModel

public NodeLabelModel getLabelModel()
Description copied from interface: NodeLabelLayout
Returns the label model that describes the valid locations for this label.

Specified by:
getLabelModel in interface NodeLabelLayout
Returns:
the NodeLabelModel associated with this NodeLabelLayout

setModelParameter

public void setModelParameter(java.lang.Object parameter)
Description copied from interface: LabelLayout
Specifies the label model parameter that describes the position of this label. The model parameter must fit the according label model.

Specified by:
setModelParameter in interface LabelLayout
Parameters:
parameter - the label model parameter

getModelParameter

public java.lang.Object getModelParameter()
Description copied from interface: LabelLayout
Returns the label model parameter that describes the position of this label. The model parameter must fit the according label model.

Specified by:
getModelParameter in interface LabelLayout
Returns:
the label model parameter
See Also:
LabelLayout.setModelParameter(Object)

getNode

public Node getNode()
Returns the node which is associated with this layout.

Returns:
the associated node

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.