com.dlsc.flexgantt.swing.layer.system
Class RowLayer

java.lang.Object
  extended by com.dlsc.flexgantt.swing.layer.AbstractLayer
      extended by com.dlsc.flexgantt.swing.layer.system.AbstractSystemLayer
          extended by com.dlsc.flexgantt.swing.layer.system.RowLayer
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class RowLayer
extends AbstractSystemLayer
implements java.awt.event.MouseMotionListener, java.awt.event.MouseListener

The row layer is responsible for looking up and invoking IRowRenderer implementations for the Gantt chart nodes. The renderers draw extra information for each row on the right-hand side of the Gantt chart.

Since:
1.0
Author:
Dirk Lemmermann

Field Summary
 
Fields inherited from class com.dlsc.flexgantt.swing.layer.AbstractLayer
alpha, changeSupport, ganttChart, layerContainer, PROPERTY_ALPHA, PROPERTY_VISIBLE
 
Constructor Summary
RowLayer(LayerContainer lc)
          Constructs a new row layer.
 
Method Summary
 IRowRenderer getRowRenderer(java.lang.Class treeNodeType)
          Returns a row renderer for an object (tree node).
 java.util.Map<java.lang.Class,IRowRenderer> getRowRendererMap()
          Returns the map, which is storing the mapping between node types and renderer implementations.
 boolean isPaintingFocus()
          Determines whether the layer will visualize whether a row has the focus or not.
 void mouseClicked(java.awt.event.MouseEvent evt)
           
 void mouseDragged(java.awt.event.MouseEvent evt)
           
 void mouseEntered(java.awt.event.MouseEvent evt)
           
 void mouseExited(java.awt.event.MouseEvent evt)
           
 void mouseMoved(java.awt.event.MouseEvent evt)
           
 void mousePressed(java.awt.event.MouseEvent evt)
           
 void mouseReleased(java.awt.event.MouseEvent evt)
           
protected  void paintLayer(java.awt.Graphics g)
           
 void setPaintingFocus(boolean paintingFocus)
          Specifies whether the layer will visualize whether a row has the focus or not.
 void setRowRenderer(java.lang.Class treeNodeType, IRowRenderer renderer)
          Maps the implementation of a row renderer to a class definition, where the class is the type of a tree tree node.
 void setRowRendererMap(java.util.Map<java.lang.Class,IRowRenderer> map)
          Sets the map, which is storing the mapping between node types and renderer implementations.
 
Methods inherited from class com.dlsc.flexgantt.swing.layer.AbstractLayer
addPropertyChangeListener, getAlpha, getDateline, getEventline, getGanttChart, getLayerContainer, getLayerPolicyProvider, getModel, getName, getStartRow, getTimeAt, getTimeline, getTimeLocation, getTimeSpanUsed, getToolTipText, getTreeTable, getTreeTablePolicyProvider, isVisible, removePropertyChangeListener, repaint, repaint, repaint, setAlpha, setVisible, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowLayer

public RowLayer(LayerContainer lc)
Constructs a new row layer.

Parameters:
lc - the parent layer container
Since:
1.0
Method Detail

paintLayer

protected void paintLayer(java.awt.Graphics g)
Overrides:
paintLayer in class AbstractLayer

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent evt)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent evt)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent evt)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent evt)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

setRowRenderer

public void setRowRenderer(java.lang.Class treeNodeType,
                           IRowRenderer renderer)
Maps the implementation of a row renderer to a class definition, where the class is the type of a tree tree node.

Parameters:
treeNodeType - the type of the tree node shown in the row
renderer - an implementation that will be used to renderer the row background of instances of the given object type
Since:
1.0
See Also:
DefaultRowRenderer, getRowRenderer(Class)

getRowRenderer

public IRowRenderer getRowRenderer(java.lang.Class treeNodeType)
Returns a row renderer for an object (tree node). The lookup of the renderer is based on the object type of the given object. This method will return the default row renderer if no other renderer was explicitly assigned to the type or any supertype of the given object.

Parameters:
treeNodeType - the type of the tree node shown in the row
Returns:
a matching row renderer implementation
Since:
1.0
See Also:
setRowRenderer(Class, IRowRenderer), DefaultRowRenderer

getRowRendererMap

public java.util.Map<java.lang.Class,IRowRenderer> getRowRendererMap()
Returns the map, which is storing the mapping between node types and renderer implementations.

Returns:
the row renderer map
Since:
1.0

setRowRendererMap

public void setRowRendererMap(java.util.Map<java.lang.Class,IRowRenderer> map)
Sets the map, which is storing the mapping between node types and renderer implementations.

Parameters:
map - the row renderer map
Since:
1.0

isPaintingFocus

public boolean isPaintingFocus()
Determines whether the layer will visualize whether a row has the focus or not.

Returns:
TRUE if the 'row focus' feature is supported
Since:
1.0

setPaintingFocus

public void setPaintingFocus(boolean paintingFocus)
Specifies whether the layer will visualize whether a row has the focus or not.

Parameters:
paintingFocus - if TRUE the 'row focus' feature will be supported
Since:
1.0