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

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.BackgroundLayer

public class BackgroundLayer
extends AbstractSystemLayer

The background layer is responsible for drawing the background of 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
BackgroundLayer(LayerContainer lc)
          Constructs a new background layer.
 
Method Summary
 java.awt.Image getTexture()
          Returns an image that will be used as a texture to fill the background of the layer container.
protected  void paintLayer(java.awt.Graphics g)
           
 void setTexture(java.awt.Image texture)
          Sets an image that will be used as a texture to fill the background of the layer container.
 
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

BackgroundLayer

public BackgroundLayer(LayerContainer lc)
Constructs a new background 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

getTexture

public java.awt.Image getTexture()
Returns an image that will be used as a texture to fill the background of the layer container.

Returns:
the image that will be used for filling the background
Since:
1.0
See Also:
setTexture(Image)

setTexture

public void setTexture(java.awt.Image texture)
Sets an image that will be used as a texture to fill the background of the layer container. The given image will be repeatedly painted horizontally and vertically until the entire background is covered. Textures should make sure that their edges connect seamlessly. A texture is purely optional. If a texture is not provided the background layer will fill itself with the current background color. Additionally if an alternating background color is specified the layer will use that color for every row with an odd row number (assuming row numbers start with 0).

Parameters:
texture - the image that will be used for filling the background
Since:
1.0
See Also:
getTexture()