Search this API

y.view.tabular
Class TableGroupNodeRealizer.RowNodeLabelModel

java.lang.Object
  extended by y.view.tabular.TableGroupNodeRealizer.RowNodeLabelModel
All Implemented Interfaces:
NodeLabelModel
Enclosing class:
TableGroupNodeRealizer

public static final class TableGroupNodeRealizer.RowNodeLabelModel
extends java.lang.Object

NodeLabelModel that positions a node label relative to a row in a TableGroupNodeRealizer's table model.

 

Constructor Summary
TableGroupNodeRealizer.RowNodeLabelModel()
          Creates a new RowNodeLabelModel using a default offset of 3.
TableGroupNodeRealizer.RowNodeLabelModel(double offset)
          Creates a new RowNodeLabelModel using the specified offset.
 
Method Summary
static java.lang.Object createParameter(TableGroupNodeRealizer.Row row, boolean inside, double leftRightRatio)
          Creates a new model parameter that represents the specified positioning in relation to the specified row.
static java.util.Collection findLabels(TableGroupNodeRealizer.Row row)
          Returns all labels associated to the specified row.
 java.lang.Object getDefaultParameter()
          Returns a model parameter that is not bound to any row.
static double getHorizontalPosition(java.lang.Object modelParameter)
          Returns the left-to-right ratio represented by the specified model parameter.
static TableGroupNodeRealizer.Row getRow(NodeLabel label)
          Determines the row to which the specified label is associated or null if there is no associated row (e.g. if the specified label's model is not a RowNodeLabelModel).
static TableGroupNodeRealizer.Row getRow(TableGroupNodeRealizer realizer, java.lang.Object modelParameter)
          Determines the row in the specified realizer's table model that corresponds to the specified model parameter or null if there is no corresponding row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableGroupNodeRealizer.RowNodeLabelModel

public TableGroupNodeRealizer.RowNodeLabelModel()
Creates a new RowNodeLabelModel using a default offset of 3.

See Also:
TableGroupNodeRealizer.RowNodeLabelModel(double)

TableGroupNodeRealizer.RowNodeLabelModel

public TableGroupNodeRealizer.RowNodeLabelModel(double offset)
Creates a new RowNodeLabelModel using the specified offset.

Parameters:
offset - the minimum horizontal distance between node label bounds and row bounds.
Method Detail

getDefaultParameter

public java.lang.Object getDefaultParameter()
Returns a model parameter that is not bound to any row.

Client code should not use default parameters for row labels. Labels should be bound to rows either using TableNodeRealizer.configureRowLabel or by explicitly setting a parameter created by RowNodeLabelModel.createParameter.

Specified by:
getDefaultParameter in interface NodeLabelModel
Returns:
a model parameter that is not bound to any row.

getRow

public static TableGroupNodeRealizer.Row getRow(NodeLabel label)
Determines the row to which the specified label is associated or null if there is no associated row (e.g. if the specified label's model is not a RowNodeLabelModel).

Parameters:
label - the label whose associated row is to be determined.
Returns:
the row to which the specified label is associated or null if there is no associated row.

getRow

public static TableGroupNodeRealizer.Row getRow(TableGroupNodeRealizer realizer,
                                                java.lang.Object modelParameter)
Determines the row in the specified realizer's table model that corresponds to the specified model parameter or null if there is no corresponding row.

Parameters:
realizer - the TableGroupNodeRealizer whose rows are to be searched.
modelParameter - a model parameter associated to a row in the specified TableGroupNodeRealizer's table model.
Returns:
the row in the specified realizer's table model that corresponds to the specified model parameter or null if there is no corresponding row.

findLabels

public static java.util.Collection findLabels(TableGroupNodeRealizer.Row row)
Returns all labels associated to the specified row.

Parameters:
row - the Row whose labels are to be retrieved.
Returns:
all labels associated to the specified row.

getHorizontalPosition

public static double getHorizontalPosition(java.lang.Object modelParameter)
Returns the left-to-right ratio represented by the specified model parameter.

Parameters:
modelParameter - a model parameter associated to a row of a TableGroupNodeRealizer.
Returns:
the left-to-right ratio represented by the specified model parameter.
See Also:
TableGroupNodeRealizer.configureRowLabel(y.view.NodeLabel, y.view.tabular.TableGroupNodeRealizer.Row, boolean, double)

createParameter

public static java.lang.Object createParameter(TableGroupNodeRealizer.Row row,
                                               boolean inside,
                                               double leftRightRatio)
Creates a new model parameter that represents the specified positioning in relation to the specified row.

Parameters:
row - the associated Row.
inside - if true the label is positioned within the bounds of the specified row; if false the label is positioned to the left or to the right of the specified row according to the specified left to right ratio.
leftRightRatio - a value in [0,1] specifying the horizontal position of the label. If the label is placed within the row bounds, 0 means to the left, 1 means to the right. If the label is placed outside the row, values less than 0.5 result in a "to the left" placement while values equal to or greater than 0.5 result in a "to the right" placement.
Returns:
a new model parameter that represents the specified positioning in relation to the specified row.
See Also:
TableGroupNodeRealizer.configureRowLabel(y.view.NodeLabel, y.view.tabular.TableGroupNodeRealizer.Row, boolean, double)

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