|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.dlsc.flexgantt.swing.layer.AbstractLayer
public abstract class AbstractLayer
The abstract superclass of all layers inside a layer container. The visual appearance of a layer container is composed of the rendering operations of several layers. The FlexGantt framework differentiates between three different types of layers: system, timeline and custom layers.
IGanttChartModel.getLayers()
,
LayerContainer.getSystemLayer(Class)
,
LayerContainer.getTimelineObjectLayer(com.dlsc.flexgantt.model.gantt.ILayer)
,
LayerContainer.getCustomLayer(com.dlsc.flexgantt.model.gantt.ILayer)
Field Summary | |
---|---|
protected float |
alpha
An alpha channel value used to control the transparency of the layer. |
protected java.beans.PropertyChangeSupport |
changeSupport
A property change support object on which property change event listeners can be registered and property change events can be fired. |
protected AbstractGanttChart |
ganttChart
The parent Gantt chart. |
protected LayerContainer |
layerContainer
The parent container. |
static java.lang.String |
PROPERTY_ALPHA
A constant used for property change events that get fired when the application calls the setAlpha(float) method. |
static java.lang.String |
PROPERTY_VISIBLE
A constant used for property change events that get fired when the application calls the setVisible(boolean) method. |
Constructor Summary | |
---|---|
protected |
AbstractLayer(java.lang.String name,
LayerContainer lc)
Constructs a new layer. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a property change listener to the layer. |
float |
getAlpha()
Returns the alpha channel value used by the layer for rendering operations. |
Dateline |
getDateline()
Returns the timeline's dateline |
Eventline |
getEventline()
Returns the timeline's eventline. |
AbstractGanttChart |
getGanttChart()
Returns the Gantt chart to which the layer belongs. |
LayerContainer |
getLayerContainer()
Returns the parent container, the layer container. |
IPolicyProvider |
getLayerPolicyProvider()
Returns the policy provider of the layer container. |
IGanttChartModel |
getModel()
Returns the Gantt chart model. |
java.lang.String |
getName()
Returns the name of the layer. |
int |
getStartRow()
Returns the start row of the tree table. |
long |
getTimeAt(int x)
Returns the time at the given location. |
Timeline |
getTimeline()
Returns the Gantt chart's timeline. |
int |
getTimeLocation(long time)
Returns the x-coordinate for the given time point. |
ITimeSpan |
getTimeSpanUsed()
Returns the time span that is used by the layer. |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent e)
Returns a tooltip text for the given mouse event (mouse location). |
TreeTable |
getTreeTable()
Returns the tree table that is shown to the left of the layer (container). |
IPolicyProvider |
getTreeTablePolicyProvider()
Returns the policy provider of the tree table. |
boolean |
isVisible()
Determines whether the layer is currently visible or not. |
protected void |
paintLayer(java.awt.Graphics g)
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a property change listener from the layer. |
void |
repaint()
Repaints the layer by repainting the layer container, which will result in all layers been repainted. |
void |
repaint(int x,
int y,
int width,
int height)
Repaints the given bounds of the layer by repainting the same bounds on the layer container, which will result in all layers been repainted. |
void |
repaint(java.awt.Rectangle r)
Repaints the given bounds of the layer by repainting the same bounds on the layer container, which will result in all layers been repainted. |
void |
setAlpha(float alpha)
Sets the alpha channel value used by the layer for rendering operations. |
void |
setVisible(boolean visible)
Specifies whether the layer is visible or not. |
void |
tearDown()
Performs tear down operations when the layer is no longer needed (removing listeners, etc...). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTY_ALPHA
setAlpha(float)
method.
public static final java.lang.String PROPERTY_VISIBLE
setVisible(boolean)
method.
protected LayerContainer layerContainer
protected AbstractGanttChart ganttChart
protected float alpha
setAlpha(float)
protected java.beans.PropertyChangeSupport changeSupport
addPropertyChangeListener(PropertyChangeListener)
,
removePropertyChangeListener(PropertyChangeListener)
Constructor Detail |
---|
protected AbstractLayer(java.lang.String name, LayerContainer lc)
name
- the layer namelc
- the parent containerMethod Detail |
---|
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l
- the listener that will be addedremovePropertyChangeListener(PropertyChangeListener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l
- the listener that will be removedaddPropertyChangeListener(PropertyChangeListener)
public void tearDown()
public ITimeSpan getTimeSpanUsed()
TimeSpan.UNDEFINED
.
public java.lang.String getName()
public LayerContainer getLayerContainer()
public AbstractGanttChart getGanttChart()
public TreeTable getTreeTable()
public int getStartRow()
public IGanttChartModel getModel()
public Timeline getTimeline()
getDateline()
,
getEventline()
public Dateline getDateline()
getTimeline()
,
getEventline()
public Eventline getEventline()
getTimeline()
,
getEventline()
public IPolicyProvider getLayerPolicyProvider()
public IPolicyProvider getTreeTablePolicyProvider()
public long getTimeAt(int x)
x
- the x-coordinate inside the layer (container) for which to
return a time point
Dateline.getTimeAt(int)
public int getTimeLocation(long time)
time
- the time point for which to return a coordinate
protected void paintLayer(java.awt.Graphics g)
g
- public float getAlpha()
TimelineObjectLayer
), the
grid layer (see GridLayer
) and the calendar layer (see
CalendarLayer
).
public void setAlpha(float alpha)
PROPERTY_ALPHA
.
Note: not all layers actually use this value. Layers that do use
it are: the timeline object layer (see TimelineObjectLayer
), the
grid layer (see GridLayer
) and the calendar layer (see
CalendarLayer
).
alpha
- the alpha channel value that controls the transparency of
objects rendered by the layerpublic boolean isVisible()
setVisible(boolean)
public void setVisible(boolean visible)
visible
- if TRUE the layer will be visibleisVisible()
public java.lang.String getToolTipText(java.awt.event.MouseEvent e)
e
- the mouse event for which to return a tooltip text
public void repaint()
Component.repaint()
.
repaint(Rectangle)
,
repaint(int, int, int, int)
public void repaint(int x, int y, int width, int height)
Component.repaint(int, int, int, int)
.
x
- the x-coordinate of the bounds that will be repaintedy
- the y-coordinate of the bounds that will be repaintedwidth
- the width of the bounds that will be repaintedheight
- the height of the bounds that will be repaintedrepaint()
,
repaint(Rectangle)
public void repaint(java.awt.Rectangle r)
JComponent.repaint(Rectangle)
.
r
- the bounds that will be repaintedrepaint()
,
repaint(int, int, int, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |