Search this API

y.view.tabular
Class TableGroupNodeRealizer.ColumnNodeLabelModel

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

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

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

 

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

Constructor Detail

TableGroupNodeRealizer.ColumnNodeLabelModel

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

See Also:
TableGroupNodeRealizer.ColumnNodeLabelModel(double)

TableGroupNodeRealizer.ColumnNodeLabelModel

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

Parameters:
offset - the minimum vertical distance between node label bounds and column bounds.
Method Detail

getDefaultParameter

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

Client code should not use default parameters for column labels. Labels should be bound to columns either using TableNodeRealizer.configureColumnLabel or by explicitly setting a parameter created by ColumnNodeLabelModel.createParameter.

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

getColumn

public static TableGroupNodeRealizer.Column getColumn(NodeLabel label)
Determines the column to which the specified label is associated or null if there is no associated column (e.g. if the specified label's model is not a ColumnNodeLabelModel).

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

getColumn

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

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

findLabels

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

Parameters:
column - the Column whose labels are to be retrieved.
Returns:
all labels associated to the specified column.

getVerticalPosition

public static double getVerticalPosition(java.lang.Object modelParameter)
Returns the top-to-bottom ratio represented by the specified model parameter.

Parameters:
modelParameter - a model parameter associated to a column of a TableGroupNodeRealizer.
Returns:
the top-to-bottom ratio represented by the specified model parameter.
See Also:
TableGroupNodeRealizer.configureColumnLabel(y.view.NodeLabel, y.view.tabular.TableGroupNodeRealizer.Column, boolean, double)

createParameter

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

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

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