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

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.EditingLayer
All Implemented Interfaces:
ITimelineObjectEditorListener, java.awt.event.MouseListener, java.util.EventListener

public class EditingLayer
extends AbstractSystemLayer
implements java.awt.event.MouseListener, ITimelineObjectEditorListener

The editing layer manages the editing of timeline objects via editors that implement the ITimelineObjectEditor interface. Editors can be registered in the AbstractGanttChart. The layer will manage the editors in such a way that always only one editor is visible at any time.

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
EditingLayer(LayerContainer lc)
          Constructs a new editing layer.
 
Method Summary
 void editingCanceled(javax.swing.event.ChangeEvent e)
          Callback method that gets invoked if the user canceled the editing of a timeline object.
 void editingStopped(javax.swing.event.ChangeEvent e)
          Callback method that gets invoked if the user stopped the editing of a timeline object.
 java.awt.Component getEditorComponent()
          Returns the user interface component that is currently being used to edit a timeline object.
 ITimelineObjectEditor getTimelineObjectEditor()
          Returns the currently used timeline object editor.
 boolean isEditing()
          Returns TRUE if a timeline object is currently being edited.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void removeEditor()
          Discards the editor object and frees the real estate.
 
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, paintLayer, 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

EditingLayer

public EditingLayer(LayerContainer lc)
Constructs a new editing layer.

Parameters:
lc - the layer container to which the editing layer belongs
Since:
1.0
Method Detail

mouseEntered

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

mouseExited

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

mousePressed

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

mouseReleased

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

mouseClicked

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

removeEditor

public void removeEditor()
Discards the editor object and frees the real estate.

Since:
1.0
See Also:
getTimelineObjectEditor()

getEditorComponent

public java.awt.Component getEditorComponent()
Returns the user interface component that is currently being used to edit a timeline object.

Returns:
the editor user interface component
Since:
1.0

isEditing

public boolean isEditing()
Returns TRUE if a timeline object is currently being edited.

Returns:
TRUE if the user is currently editing a timeline object
Since:
1.0

getTimelineObjectEditor

public ITimelineObjectEditor getTimelineObjectEditor()
Returns the currently used timeline object editor. This is the editor that the layer seemed most appropriate to use for editing the user selected timeline object. The editor was chosen based on the object type of the current timeline object.

Returns:
the timeline object editor that is currently being used
Since:
1.0

editingStopped

public void editingStopped(javax.swing.event.ChangeEvent e)
Description copied from interface: ITimelineObjectEditorListener
Callback method that gets invoked if the user stopped the editing of a timeline object.

Specified by:
editingStopped in interface ITimelineObjectEditorListener
Parameters:
e - the change event with information about the source of the callback call

editingCanceled

public void editingCanceled(javax.swing.event.ChangeEvent e)
Description copied from interface: ITimelineObjectEditorListener
Callback method that gets invoked if the user canceled the editing of a timeline object.

Specified by:
editingCanceled in interface ITimelineObjectEditorListener
Parameters:
e - the change event with information about the source of the callback call