Search this API

y.view.tabular
Class TableNodePainter

java.lang.Object
  extended by y.view.tabular.TableNodePainter
All Implemented Interfaces:
GenericNodeRealizer.Painter

public class TableNodePainter
extends java.lang.Object
implements GenericNodeRealizer.Painter

Dedicated painter implementation for tables. The painter works by traversing the table and delegating the actual painting to exchangeable subordinate painters that are responsible for painting

 

Nested Class Summary
static class TableNodePainter.PainterType
          Enumeration type for subordinate painter types of a TableNodePainter.
 
Field Summary
static java.lang.String ALTERNATE_COLUMN_SELECTION_STYLE_ID
          Style property key used by the alternating painter instances when painting an odd-numbered and selected column of a TableGroupNodeRealizer.
static java.lang.String ALTERNATE_COLUMN_STYLE_ID
          Style property key used by the alternating painter instances when painting an odd-numbered, but not selected column of a TableGroupNodeRealizer.
static java.lang.String ALTERNATE_ROW_SELECTION_STYLE_ID
          Style property key used by the alternating painter instances when painting an odd-numbered and selected row of a TableGroupNodeRealizer.
static java.lang.String ALTERNATE_ROW_STYLE_ID
          Style property key used by the alternating painter instances when painting an odd-numbered, but not selected row of a TableGroupNodeRealizer.
static java.lang.String COLUMN_SELECTION_STYLE_ID
          Style property key for the visual style used when painting a selected column of a TableGroupNodeRealizer.
static java.lang.String COLUMN_STYLE_ID
          Style property key for the visual style used when painting an unselected column of a TableGroupNodeRealizer.
static int IGNORE_INSET_ALL
          Bit mask to ignore all inset types.
static int IGNORE_INSET_COLUMN_ALL
          Bit mask to ignore all column related insets types.
static int IGNORE_INSET_COLUMN_BOTTOM
          Type specifier to ignore bottom insets of columns.
static int IGNORE_INSET_COLUMN_LEFT
          Type specifier to ignore left insets of columns.
static int IGNORE_INSET_COLUMN_RIGHT
          Type specifier to ignore right insets of columns.
static int IGNORE_INSET_COLUMN_TOP
          Type specifier to ignore top insets of columns.
static int IGNORE_INSET_NONE
          Type specifier to ignore no inset types.
static int IGNORE_INSET_ROW_ALL
          Bit mask to ignore all row related insets types.
static int IGNORE_INSET_ROW_BOTTOM
          Type specifier to ignore bottom insets of rows.
static int IGNORE_INSET_ROW_LEFT
          Type specifier to ignore left insets of rows.
static int IGNORE_INSET_ROW_RIGHT
          Type specifier to ignore right insets of rows.
static int IGNORE_INSET_ROW_TOP
          Type specifier to ignore top insets of rows.
static TableNodePainter.PainterType PAINTER_COLUMN_BACKGROUND
          Identifier for the subordinate painter instance responsible for painting column backgrounds.
static TableNodePainter.PainterType PAINTER_COLUMN_FOREGROUND
          Identifier for the painter instance responsible for painting column foregrounds.
static TableNodePainter.PainterType PAINTER_ROW_BACKGROUND
          Identifier for the subordinate painter instance responsible for painting row backgrounds.
static TableNodePainter.PainterType PAINTER_ROW_FOREGROUND
          Identifier for the subordinate painter instance responsible for painting row foregrounds.
static TableNodePainter.PainterType PAINTER_TABLE_BACKGROUND
          Identifier for the subordinate painter instance responsible for painting the table background.
static TableNodePainter.PainterType PAINTER_TABLE_FOREGROUND
          Identifier for the subordinate painter instance responsible for painting the table foreground.
static java.lang.String ROW_SELECTION_STYLE_ID
          Style property key for the visual style used when painting a selected row of a TableGroupNodeRealizer.
static java.lang.String ROW_STYLE_ID
          Style property key for the visual style used when painting an unselected row of a TableGroupNodeRealizer.
static java.lang.String TABLE_SELECTION_STYLE_ID
          Style property key for the visual style used when painting the table of a selected TableGroupNodeRealizer.
static java.lang.String TABLE_STYLE_ID
          Style property key for the visual style used when painting the table of an unselected TableGroupNodeRealizer.
 
Constructor Summary
protected TableNodePainter()
          Creates a new TableNodePainter instance without any registered subordinate painter instances.
 
Method Summary
static TableGroupNodeRealizer.Column getColumn(NodeRealizer dummy)
          Returns the Column that is currently being painted by the subordinate painter of a TableNodePainter or null if the painter is not responsible for column painting.
 int getIgnoredInsetTypes()
          Returns a bit mask encoding the ignored inset types of the TableNodePainter.
static TableGroupNodeRealizer getOriginalContext(NodeRealizer dummy)
          Returns the TableGroupNodeRealizer that is being painted by a TableNodePainter.
static TableGroupNodeRealizer.Row getRow(NodeRealizer dummy)
          Returns the Row that is currently being painted by the subordinate painter of a TableNodePainter or null if the painter is not responsible for row painting.
 GenericNodeRealizer.Painter getSubPainter(TableNodePainter.PainterType type)
          Returns the subordinate painter instance for the specified type.
static TableGroupNodeRealizer.Table getTable(NodeRealizer dummy)
          Returns the Table of the TableGroupNodeRealizer that is being painted by a TableNodePainter.
static TableNodePainter newAlternatingColumnsInstance()
          Creates a TableNodePainter that is configured to use subordinate painters that alternate between the default column styles and the styles registered for the ALTERNATE_COLUMN_SELECTION_STYLE_ID and ALTERNATE_COLUMN_STYLE_ID keys.
static TableNodePainter newAlternatingInstance()
          Creates a TableNodePainter that is configured to use subordinate painters that alternate between the default column and row styles and the styles registered for the corresponding ALTERNATE_XXX style keys.
static TableNodePainter newAlternatingRowsInstance()
          Creates a TableNodePainter that is configured to use subordinate painters that alternate between the default row styles and the styles registered for the ALTERNATE_ROW_SELECTION_STYLE_ID and ALTERNATE_ROW_STYLE_ID keys.
static TableNodePainter newBpmnInstance()
          Creates a TableNodePainter that is configured to use subordinate foreground painters (but no background painters) that create a BPMN pool-like visual representation of the table.
static TableNodePainter newDefaultInstance()
          Creates a TableNodePainter that is configured to use default subordinate painters.
 void paint(NodeRealizer context, java.awt.Graphics2D graphics)
          Paints the table node.
protected  void paintBackground(GenericNodeRealizer dummy, java.awt.Graphics2D graphics, boolean sloppy)
          Paints the table node background.
protected  void paintForeground(GenericNodeRealizer dummy, java.awt.Graphics2D graphics, boolean sloppy)
          Paints the table node foreground.
protected  void paintHotSpots(NodeRealizer context, java.awt.Graphics2D graphics)
          Paints the node's hot spots (that is resize handles).
protected  void paintNode(NodeRealizer context, java.awt.Graphics2D graphics, boolean sloppy)
          Paints the actual table node by delegating to methods paintBackground and paintForeground in this order.
protected  void paintPorts(NodeRealizer context, java.awt.Graphics2D graphics)
          Paints the node's ports.
 void paintSloppy(NodeRealizer context, java.awt.Graphics2D graphics)
          Paints the table node in sloppy mode.
protected  void paintText(NodeRealizer context, java.awt.Graphics2D graphics)
          Paints the node's labels.
 void setIgnoredInsetTypes(int ignoredInsetTypes)
          Specifies a bit mask for inset types to ignore.
 void setSubPainter(TableNodePainter.PainterType type, GenericNodeRealizer.Painter painter)
          Sets a subordinate painter for the paint responsibilities represented by the specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TABLE_SELECTION_STYLE_ID

public static final java.lang.String TABLE_SELECTION_STYLE_ID
Style property key for the visual style used when painting the table of a selected TableGroupNodeRealizer.

See Also:
TableStyle, Constant Field Values

TABLE_STYLE_ID

public static final java.lang.String TABLE_STYLE_ID
Style property key for the visual style used when painting the table of an unselected TableGroupNodeRealizer.

See Also:
TableStyle, Constant Field Values

ALTERNATE_COLUMN_SELECTION_STYLE_ID

public static final java.lang.String ALTERNATE_COLUMN_SELECTION_STYLE_ID
Style property key used by the alternating painter instances when painting an odd-numbered and selected column of a TableGroupNodeRealizer. A column is considered to be odd-number, when the index of the column in its container's column list is odd.

See Also:
TableStyle, newAlternatingInstance(), newAlternatingColumnsInstance(), Constant Field Values

ALTERNATE_COLUMN_STYLE_ID

public static final java.lang.String ALTERNATE_COLUMN_STYLE_ID
Style property key used by the alternating painter instances when painting an odd-numbered, but not selected column of a TableGroupNodeRealizer. A column is considered to be odd-number, when the index of the column in its container's column list is odd.

See Also:
TableStyle, newAlternatingInstance(), newAlternatingColumnsInstance(), Constant Field Values

COLUMN_SELECTION_STYLE_ID

public static final java.lang.String COLUMN_SELECTION_STYLE_ID
Style property key for the visual style used when painting a selected column of a TableGroupNodeRealizer.

See Also:
TableStyle, Constant Field Values

COLUMN_STYLE_ID

public static final java.lang.String COLUMN_STYLE_ID
Style property key for the visual style used when painting an unselected column of a TableGroupNodeRealizer.

See Also:
TableStyle, Constant Field Values

ROW_SELECTION_STYLE_ID

public static final java.lang.String ROW_SELECTION_STYLE_ID
Style property key for the visual style used when painting a selected row of a TableGroupNodeRealizer.

See Also:
TableStyle, Constant Field Values

ROW_STYLE_ID

public static final java.lang.String ROW_STYLE_ID
Style property key for the visual style used when painting an unselected row of a TableGroupNodeRealizer.

See Also:
TableStyle, Constant Field Values

ALTERNATE_ROW_SELECTION_STYLE_ID

public static final java.lang.String ALTERNATE_ROW_SELECTION_STYLE_ID
Style property key used by the alternating painter instances when painting an odd-numbered and selected row of a TableGroupNodeRealizer. A row is considered to be odd-number, when the index of the row in its container's row list is odd.

See Also:
TableStyle, newAlternatingInstance(), newAlternatingRowsInstance(), Constant Field Values

ALTERNATE_ROW_STYLE_ID

public static final java.lang.String ALTERNATE_ROW_STYLE_ID
Style property key used by the alternating painter instances when painting an odd-numbered, but not selected row of a TableGroupNodeRealizer. A row is considered to be odd-number, when the index of the row in its container's row list is odd.

See Also:
TableStyle, newAlternatingInstance(), newAlternatingRowsInstance(), Constant Field Values

PAINTER_TABLE_FOREGROUND

public static final TableNodePainter.PainterType PAINTER_TABLE_FOREGROUND
Identifier for the subordinate painter instance responsible for painting the table foreground.

See Also:
getSubPainter(y.view.tabular.TableNodePainter.PainterType), setSubPainter(y.view.tabular.TableNodePainter.PainterType, y.view.GenericNodeRealizer.Painter)

PAINTER_TABLE_BACKGROUND

public static final TableNodePainter.PainterType PAINTER_TABLE_BACKGROUND
Identifier for the subordinate painter instance responsible for painting the table background.

See Also:
getSubPainter(y.view.tabular.TableNodePainter.PainterType), setSubPainter(y.view.tabular.TableNodePainter.PainterType, y.view.GenericNodeRealizer.Painter)

PAINTER_COLUMN_FOREGROUND

public static final TableNodePainter.PainterType PAINTER_COLUMN_FOREGROUND
Identifier for the painter instance responsible for painting column foregrounds.

See Also:
getSubPainter(y.view.tabular.TableNodePainter.PainterType), setSubPainter(y.view.tabular.TableNodePainter.PainterType, y.view.GenericNodeRealizer.Painter)

PAINTER_COLUMN_BACKGROUND

public static final TableNodePainter.PainterType PAINTER_COLUMN_BACKGROUND
Identifier for the subordinate painter instance responsible for painting column backgrounds.

See Also:
getSubPainter(y.view.tabular.TableNodePainter.PainterType), setSubPainter(y.view.tabular.TableNodePainter.PainterType, y.view.GenericNodeRealizer.Painter)

PAINTER_ROW_FOREGROUND

public static final TableNodePainter.PainterType PAINTER_ROW_FOREGROUND
Identifier for the subordinate painter instance responsible for painting row foregrounds.

See Also:
getSubPainter(y.view.tabular.TableNodePainter.PainterType), setSubPainter(y.view.tabular.TableNodePainter.PainterType, y.view.GenericNodeRealizer.Painter)

PAINTER_ROW_BACKGROUND

public static final TableNodePainter.PainterType PAINTER_ROW_BACKGROUND
Identifier for the subordinate painter instance responsible for painting row backgrounds.

See Also:
getSubPainter(y.view.tabular.TableNodePainter.PainterType), setSubPainter(y.view.tabular.TableNodePainter.PainterType, y.view.GenericNodeRealizer.Painter)

IGNORE_INSET_ALL

public static final int IGNORE_INSET_ALL
Bit mask to ignore all inset types.

See Also:
setIgnoredInsetTypes(int), getIgnoredInsetTypes(), Constant Field Values

IGNORE_INSET_NONE

public static final int IGNORE_INSET_NONE
Type specifier to ignore no inset types.

See Also:
setIgnoredInsetTypes(int), getIgnoredInsetTypes(), Constant Field Values

IGNORE_INSET_COLUMN_TOP

public static final int IGNORE_INSET_COLUMN_TOP
Type specifier to ignore top insets of columns.

See Also:
setIgnoredInsetTypes(int), getIgnoredInsetTypes(), Constant Field Values

IGNORE_INSET_COLUMN_LEFT

public static final int IGNORE_INSET_COLUMN_LEFT
Type specifier to ignore left insets of columns.

See Also:
setIgnoredInsetTypes(int), getIgnoredInsetTypes(), Constant Field Values

IGNORE_INSET_COLUMN_BOTTOM

public static final int IGNORE_INSET_COLUMN_BOTTOM
Type specifier to ignore bottom insets of columns.

See Also:
setIgnoredInsetTypes(int), getIgnoredInsetTypes(), Constant Field Values

IGNORE_INSET_COLUMN_RIGHT

public static final int IGNORE_INSET_COLUMN_RIGHT
Type specifier to ignore right insets of columns.

See Also:
setIgnoredInsetTypes(int), getIgnoredInsetTypes(), Constant Field Values

IGNORE_INSET_ROW_TOP

public static final int IGNORE_INSET_ROW_TOP
Type specifier to ignore top insets of rows.

See Also:
setIgnoredInsetTypes(int), getIgnoredInsetTypes(), Constant Field Values

IGNORE_INSET_ROW_LEFT

public static final int IGNORE_INSET_ROW_LEFT
Type specifier to ignore left insets of rows.

See Also:
setIgnoredInsetTypes(int), getIgnoredInsetTypes(), Constant Field Values

IGNORE_INSET_ROW_BOTTOM

public static final int IGNORE_INSET_ROW_BOTTOM
Type specifier to ignore bottom insets of rows.

See Also:
setIgnoredInsetTypes(int), getIgnoredInsetTypes(), Constant Field Values

IGNORE_INSET_ROW_RIGHT

public static final int IGNORE_INSET_ROW_RIGHT
Type specifier to ignore right insets of rows.

See Also:
setIgnoredInsetTypes(int), getIgnoredInsetTypes(), Constant Field Values

IGNORE_INSET_COLUMN_ALL

public static final int IGNORE_INSET_COLUMN_ALL
Bit mask to ignore all column related insets types.

See Also:
setIgnoredInsetTypes(int), getIgnoredInsetTypes(), Constant Field Values

IGNORE_INSET_ROW_ALL

public static final int IGNORE_INSET_ROW_ALL
Bit mask to ignore all row related insets types.

See Also:
setIgnoredInsetTypes(int), getIgnoredInsetTypes(), Constant Field Values
Constructor Detail

TableNodePainter

protected TableNodePainter()
Creates a new TableNodePainter instance without any registered subordinate painter instances.

Method Detail

newDefaultInstance

public static TableNodePainter newDefaultInstance()
Creates a TableNodePainter that is configured to use default subordinate painters.
These default painters work as follows. The painter tries to retrieve a VisualStyle instance from the table realizer's registered style properties using the appropriate key (see below).
If successful, the painter determines whether insets have been set for the table, the column, or the row it is supposed to paint. If so and at least one of is not null, the border area defined by the insets is painted using these colors and stroke. Then, the table's, column's, or row's inner area is painted using the colors and stroke defined by the style's properties.
In the case that either no insets are set or that all border properties are null, the complete table, column, or row area is painted using these latter colors and stroke.
Finally, if there is no style instance registered for the painter's style key, the complete table, column, or row area is painted using the realizer's fillColor, lineColor, and lineType.
Painter type Style key
PAINTER_COLUMN_BACKGROUND, PAINTER_COLUMN_FOREGROUND COLUMN_STYLE_ID, COLUMN_SELECTION_STYLE_ID
PAINTER_ROW_BACKGROUND, PAINTER_ROW_FOREGROUND ROW_STYLE_ID, ROW_SELECTION_STYLE_ID
PAINTER_TABLE_BACKGROUND, PAINTER_TABLE_FOREGROUND TABLE_STYLE_ID, TABLE_SELECTION_STYLE_ID

Returns:
a painter that is configured to use default subordinate painters.
See Also:
TableStyle, GenericNodeRealizer.getStyleProperty(String)

newAlternatingInstance

public static TableNodePainter newAlternatingInstance()
Creates a TableNodePainter that is configured to use subordinate painters that alternate between the default column and row styles and the styles registered for the corresponding ALTERNATE_XXX style keys. The default styles are used for columns and rows with an even index in their container's list of columns or rows and the alternate styles will be used for columns and rows with an odd index. The actual painting behavior is the same as for newDefaultInstance().

Returns:
a painter that uses alternating styles when painting columns and rows.
See Also:
newDefaultInstance(), ALTERNATE_COLUMN_SELECTION_STYLE_ID, ALTERNATE_COLUMN_STYLE_ID, ALTERNATE_ROW_SELECTION_STYLE_ID, ALTERNATE_ROW_STYLE_ID

newAlternatingColumnsInstance

public static TableNodePainter newAlternatingColumnsInstance()
Creates a TableNodePainter that is configured to use subordinate painters that alternate between the default column styles and the styles registered for the ALTERNATE_COLUMN_SELECTION_STYLE_ID and ALTERNATE_COLUMN_STYLE_ID keys. The default styles are used for columns with an even index in their container's list of columns and the alternate styles will be used for columns with an odd index. The actual painting behavior is the same as for newDefaultInstance().

Returns:
a painter that uses alternating styles when painting columns.
See Also:
newDefaultInstance(), ALTERNATE_COLUMN_SELECTION_STYLE_ID, ALTERNATE_COLUMN_STYLE_ID

newAlternatingRowsInstance

public static TableNodePainter newAlternatingRowsInstance()
Creates a TableNodePainter that is configured to use subordinate painters that alternate between the default row styles and the styles registered for the ALTERNATE_ROW_SELECTION_STYLE_ID and ALTERNATE_ROW_STYLE_ID keys. The default styles are used for rows with an even index in their container's list of rows and the alternate styles will be used for rows with an odd index. The actual painting behavior is the same as for newDefaultInstance().

Returns:
a painter that uses alternating styles when painting columns.
See Also:
newDefaultInstance(), ALTERNATE_ROW_SELECTION_STYLE_ID, ALTERNATE_ROW_STYLE_ID

newBpmnInstance

public static TableNodePainter newBpmnInstance()
Creates a TableNodePainter that is configured to use subordinate foreground painters (but no background painters) that create a BPMN pool-like visual representation of the table.

Returns:
a painter configured to create a BPMN pool-like visual representation of the table.

getSubPainter

public GenericNodeRealizer.Painter getSubPainter(TableNodePainter.PainterType type)
Returns the subordinate painter instance for the specified type.

Parameters:
type - the painter type specifying which painter instance to retrieve.
Returns:
the subordinate painter instance for the specified type.

setSubPainter

public void setSubPainter(TableNodePainter.PainterType type,
                          GenericNodeRealizer.Painter painter)
Sets a subordinate painter for the paint responsibilities represented by the specified type.

Parameters:
type - the type representing a specific set of painting responsibilities.
painter - the painter to handle the responsibilities represented by the specified type.

getIgnoredInsetTypes

public int getIgnoredInsetTypes()
Returns a bit mask encoding the ignored inset types of the TableNodePainter.

Defaults to IGNORE_INSET_NONE.

Returns:
a bit mask encoding the ignored inset types of the TableNodePainter
See Also:
setIgnoredInsetTypes(int)

setIgnoredInsetTypes

public void setIgnoredInsetTypes(int ignoredInsetTypes)
Specifies a bit mask for inset types to ignore. Ignoring an inset type means that the geometric bounds that are calculated for the registered subordinate painters do not include position offsets due to corresponding insets.

E.g. suppose you have set the mask to IGNORE_INSET_COLUMN_LEFT. Suppose further there is one top level column, such that

   column.calculateBounds().getX() == 0
   column.getInsets().left == 10
 
Ordinarily, the painters responsible for painting a column's first child would be invoked with a dummy realizer whose x-coordinate equals 10. However, due to left column insets being ignored, the dummy's x-coordinate will equal 0.
Note: This property does not affect the result of calling TableGroupNodeRealizer.Column.calculateBounds() or TableGroupNodeRealizer.Row.calculateBounds(). Consequently, ignoring these insets for painting might result in the visual representation of a table node being out-of-sync with the geometric bounds being used for selecting/resizing/reordering columns and rows using TableSelectionEditor/ TableSizeEditor/ TableOrderEditor.

Defaults to IGNORE_INSET_NONE.

Parameters:
ignoredInsetTypes - the mask for inset types to ignore. Either IGNORE_INSET_NONE, IGNORE_INSET_ALL, or a bit-wise combination of
See Also:
getIgnoredInsetTypes()

paint

public void paint(NodeRealizer context,
                  java.awt.Graphics2D graphics)
Paints the table node. Calls
paintHotSpots(context, graphics);
paintNode(context, graphics, false);
paintText(context, graphics);
.

Specified by:
paint in interface GenericNodeRealizer.Painter

paintHotSpots

protected void paintHotSpots(NodeRealizer context,
                             java.awt.Graphics2D graphics)
Paints the node's hot spots (that is resize handles). This method is invoked from paint(NodeRealizer, Graphics2D) to draw the hot spots of the node if necessary. By default it calls the context's paintHotSpots method if the context is selected.

Parameters:
context - the node realizer for which hot spots may be drawn.
graphics - the graphics to draw on.

paintPorts

protected void paintPorts(NodeRealizer context,
                          java.awt.Graphics2D graphics)
Paints the node's ports. This method is invoked from paint(NodeRealizer, Graphics2D) to draw the ports of the node. By default it calls the context's paintPorts method.

Parameters:
context - the node realizer for which node ports should be drawn.
graphics - the graphics to draw on.

paintText

protected void paintText(NodeRealizer context,
                         java.awt.Graphics2D graphics)
Paints the node's labels. This method is invoked from paint(NodeRealizer, Graphics2D) to draw the labels of the node. By default it calls the context's paintText method if the context has at least one label.

Parameters:
context - the node realizer for which the labels should be drawn.
graphics - the graphics to draw on.

paintSloppy

public void paintSloppy(NodeRealizer context,
                        java.awt.Graphics2D graphics)
Paints the table node in sloppy mode. Calls
paintNode(context, graphics, true);

Specified by:
paintSloppy in interface GenericNodeRealizer.Painter

paintNode

protected void paintNode(NodeRealizer context,
                         java.awt.Graphics2D graphics,
                         boolean sloppy)
Paints the actual table node by delegating to methods paintBackground and paintForeground in this order.

A dummy realizer of type GenericNodeRealizer will be passed to the two aforementioned methods. The bounds of the dummy will be set to be the bounds of the table, column, or row that should be painted. The dummy's GenericNodeRealizer.getUserData() method will return the original TableGroupNodeRealizer's user data. Moreover, methods getOriginalContext(y.view.NodeRealizer), getColumn(y.view.NodeRealizer), getTable(y.view.NodeRealizer), and getRow(y.view.NodeRealizer) can be used to extract useful information from the dummy.

Parameters:
context - the context node to paint.
graphics - the graphics context to paint upon.
sloppy - whether or not to paint the node sloppily.
See Also:
paintBackground(y.view.GenericNodeRealizer, java.awt.Graphics2D, boolean), paintForeground(y.view.GenericNodeRealizer, java.awt.Graphics2D, boolean)

paintBackground

protected void paintBackground(GenericNodeRealizer dummy,
                               java.awt.Graphics2D graphics,
                               boolean sloppy)
Paints the table node background. This method delegates painting to subordinate painters in the following order:
  1. table background
  2. column background (for all columns in preorder)
  3. row background (for all rows in preorder)
The bounds of the given dummy will be set to be the bounds of the table, column, or row the subordinate painter should paint.

See paintNode for how to access context information provided by the dummy.

Called from paintNode(y.view.NodeRealizer, java.awt.Graphics2D, boolean).

Parameters:
dummy - a dummy whose geometry is set to match the table, column, or row that should be painted.
graphics - the graphics context to paint upon.
sloppy - whether or not to paint the node sloppily.
See Also:
paintNode(y.view.NodeRealizer, java.awt.Graphics2D, boolean), paintForeground(y.view.GenericNodeRealizer, java.awt.Graphics2D, boolean)

paintForeground

protected void paintForeground(GenericNodeRealizer dummy,
                               java.awt.Graphics2D graphics,
                               boolean sloppy)
Paints the table node foreground. This method delegates painting to subordinate painters in the following order:
  1. table foreground
  2. column foreground (for all columns in preorder)
  3. row foreground (for all rows in preorder)
The bounds of the given dummy will be set to be the bounds of the table, column, or row the subordinate painter should paint.

See paintNode for how to access context information provided by the dummy.

Called from paintNode(y.view.NodeRealizer, java.awt.Graphics2D, boolean).

Parameters:
dummy - a dummy whose geometry is set to match the table, column, or row that should be painted.
graphics - the graphics context to paint upon.
sloppy - whether or not to paint the node sloppily.
See Also:
paintNode(y.view.NodeRealizer, java.awt.Graphics2D, boolean), paintBackground(y.view.GenericNodeRealizer, java.awt.Graphics2D, boolean)

getOriginalContext

public static TableGroupNodeRealizer getOriginalContext(NodeRealizer dummy)
Returns the TableGroupNodeRealizer that is being painted by a TableNodePainter.

Parameters:
dummy - the dummy GenericNodeRealizer instance that is passed to the paint and paintSloppy methods of a TableNodePainter's subordinate painter.
Returns:
the TableGroupNodeRealizer that is being painted by a TableNodePainter.

getTable

public static TableGroupNodeRealizer.Table getTable(NodeRealizer dummy)
Returns the Table of the TableGroupNodeRealizer that is being painted by a TableNodePainter.

Parameters:
dummy - the dummy GenericNodeRealizer instance that is passed to the paint and paintSloppy methods of a TableNodePainter's subordinate painter.
Returns:
the Table of the TableGroupNodeRealizer that is being painted by a TableNodePainter.

getColumn

public static TableGroupNodeRealizer.Column getColumn(NodeRealizer dummy)
Returns the Column that is currently being painted by the subordinate painter of a TableNodePainter or null if the painter is not responsible for column painting.

Parameters:
dummy - the dummy GenericNodeRealizer instance that is passed to the paint and paintSloppy methods of a TableNodePainter's subordinate painter.
Returns:
the Column that is currently being painted by the subordinate painter of a TableNodePainter or null if the painter is not responsible for column painting.

getRow

public static TableGroupNodeRealizer.Row getRow(NodeRealizer dummy)
Returns the Row that is currently being painted by the subordinate painter of a TableNodePainter or null if the painter is not responsible for row painting.

Parameters:
dummy - the dummy GenericNodeRealizer instance that is passed to the paint and paintSloppy methods of a TableNodePainter's subordinate painter.
Returns:
the Row that is currently being painted by the subordinate painter of a TableNodePainter or null if the painter is not responsible for row painting.

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