|
||||||||||
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 com.dlsc.flexgantt.swing.layer.system.AbstractSystemLayer com.dlsc.flexgantt.swing.layer.system.LassoLayer
public class LassoLayer
A layer that focuses on visualizing a lasso / selection rectangle.
Nested Class Summary | |
---|---|
static class |
LassoLayer.LassoMode
A selection mode enumerator that can be used to instruct the lasso layer what to select when a lasso operation finishes. |
Field Summary |
---|
Fields inherited from class com.dlsc.flexgantt.swing.layer.AbstractLayer |
---|
alpha, changeSupport, ganttChart, layerContainer, PROPERTY_ALPHA, PROPERTY_VISIBLE |
Constructor Summary | |
---|---|
LassoLayer(LayerContainer lc)
Constructs a new lasso layer. |
Method Summary | |
---|---|
protected java.awt.Cursor |
createLassoCursor(LassoLayer.LassoMode mode,
boolean multi)
Creates a cursor that will be used for the given lasso mode. |
boolean |
dispatchKeyEvent(java.awt.event.KeyEvent e)
Intercepts key events from the KeyboardFocusManager in order to
temporarily change the edit mode. |
LassoLayer.LassoMode |
getLassoMode()
Returns the lasso mode used by the lasso layer (selecting timeline objects or selecting time spans). |
java.awt.Color |
getLinkingLineColor()
Returns the color used for the line drawn while linking two timeline objects / creating a relationship. |
java.awt.Color |
getSelectionColor()
Returns the color used for filling the selection color. |
LassoLayer.LassoMode[] |
getSupportedLassoModes()
Returns the supported lasso modes. |
boolean |
isSelecting()
Determines if a selection / lasso operation is currently taking place. |
boolean |
isSingleRowObjectCreation()
Determines whether the layer only supports the creation of timeline objects on a single row or several rows at the same time. |
boolean |
isSupportedLassoMode(LassoLayer.LassoMode mode)
Checks whether the given lasso mode is supported by the lasso layer. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
protected void |
paintFocusedBounds(java.awt.Graphics g,
ObjectBounds bounds)
Adds focus feedback to the given object bounds. |
protected void |
paintLasso(java.awt.Graphics g,
int x1,
int y1,
int x2,
int y2)
Draws the actual lasso. |
protected void |
paintLayer(java.awt.Graphics g)
|
protected void |
paintLinking(java.awt.Graphics g)
Renders visual feedback when two timeline objects are being linked together by the user. |
void |
setLassoMode(LassoLayer.LassoMode mode)
Sets the lasso mode so that the layer can switch between selecting timeline objects and selecting time spans and creating timeline objects. |
void |
setLinkingLineColor(java.awt.Color color)
Sets the color used for the line drawn while linking two timeline objects / creating a relationship. |
void |
setSelectionColor(java.awt.Color color)
Sets the color used for filling the selection rectangle. |
void |
setSingleRowObjectCreation(boolean single)
Specifies whether the layer only supports the creation of timeline objects on a single row or several rows at the same time. |
void |
setSupportedLassoModes(LassoLayer.LassoMode... modes)
Sets the supported lasso modes. |
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 |
---|
public LassoLayer(LayerContainer lc)
lc
- the layer container to which the layer belongsMethod Detail |
---|
public boolean isSelecting()
protected void paintLayer(java.awt.Graphics g)
paintLayer
in class AbstractLayer
protected void paintLinking(java.awt.Graphics g)
g
- the graphics context into which to drawprotected void paintFocusedBounds(java.awt.Graphics g, ObjectBounds bounds)
IconRegistry
via the following IDs:
g
- the graphics context into which to drawbounds
- the focused object boundsprotected void paintLasso(java.awt.Graphics g, int x1, int y1, int x2, int y2)
g
- the graphics context into which to drawx1
- the x-coordinate of the upper left cornery1
- the y-coordinate of the upper left cornerx2
- the x-coordinate of the lower right cornery2
- the y-coordinate of the lower right cornerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public java.awt.Color getSelectionColor()
public void setSelectionColor(java.awt.Color color)
color
- the color used for filling the selection rectanglepublic LassoLayer.LassoMode getLassoMode()
public void setLassoMode(LassoLayer.LassoMode mode)
mode
- the mode to use for the next lasso operationpublic boolean isSingleRowObjectCreation()
public void setSingleRowObjectCreation(boolean single)
single
- if TRUE timeline objects can only be created one row at a timepublic java.awt.Color getLinkingLineColor()
public void setLinkingLineColor(java.awt.Color color)
color
- the line color used for linkingprotected java.awt.Cursor createLassoCursor(LassoLayer.LassoMode mode, boolean multi)
IconRegistry
with the following IDs:
IconId.CURSOR_SELECT_TIMELINE_OBJECTS
IconId.CURSOR_SELECT_TIMELINE_OBJECTS_MULTI
IconId.CURSOR_SELECT_TIME_SPANS
IconId.CURSOR_SELECT_TIME_SPANS_MULTI
IconId.CURSOR_CREATE_RELATIONSHIPS
IconId.CURSOR_CREATE_TIMELINE_OBJECTS
mode
- the lasso mode for which to create a cursormulti
- determines if the cursor is needed for a 'multi' operation
(multi timeline object selection, multi time span selection)
public boolean dispatchKeyEvent(java.awt.event.KeyEvent e)
KeyboardFocusManager
in order to
temporarily change the edit mode. Pressing the SHIFT
key
will turn on the multi selection mode. Pressing the
CTRL
key will change from timeline object selection
to time span selection. Pressing the ALT key will switch to the
timeline object creation mode. Key events will only be processed
if the mouse cursor is currently on top of the layer container.
dispatchKeyEvent
in interface java.awt.KeyEventDispatcher
public LassoLayer.LassoMode[] getSupportedLassoModes()
LassoLayer.LassoMode
.
setSupportedLassoModes(LassoMode[])
public void setSupportedLassoModes(LassoLayer.LassoMode... modes)
LassoLayer.LassoMode
.
modes
- the supported lasso modesgetSupportedLassoModes()
public boolean isSupportedLassoMode(LassoLayer.LassoMode mode)
mode
- the mode to check
setSupportedLassoModes(com.dlsc.flexgantt.swing.layer.system.LassoLayer.LassoMode[])
,
getSupportedLassoModes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |