public class IlvMakeActivityInteractor extends IlvGanttSheetInteractor
IlvMakeActivityInteractor
is an interactor that allows
you to create an IlvActivity
in a Gantt sheet. The
interactor can work in one of two modes:
If the interactor is used in a Gantt chart, it creates a new activity and adds it to the associated Gantt model. If the interactor is used in a Schedule chart, the interactor creates a reservation.
The interactor uses the activity or reservation factory to create the
new activity or reservation. These factories are defined by the class
IlvGanttSheet
.
To install the interactor, call the method setInteractor
of the class
IlvGanttSheet
.
This interactor only works with an IlvGanttSheet
object.
Constructor and Description |
---|
IlvMakeActivityInteractor()
Creates a new
IlvMakeActivityInteractor object. |
Modifier and Type | Method and Description |
---|---|
void |
abort()
This function is called when the user presses the
Esc
key to abort the current interaction. |
protected void |
attach(IlvManagerView v)
This method is invoked when the interactor is attached to the
specified manager view.
|
protected void |
detach()
This method is called when the interactor is detached from its current
manager view.
|
protected void |
drawGhost(Graphics g)
Draws the rectangle while it is dragged.
|
Cursor |
getCursor()
Returns the cursor used to create the activity.
|
float[] |
getLineStyle()
Returns the dash array used when dragging the rectangle.
|
boolean |
isGhostMode()
Checks whether the interactor is working in ghost mode.
|
protected void |
processKeyEvent(KeyEvent e)
Processes the key events.
|
protected void |
processMouseEvent(MouseEvent event)
Processes mouse events.
|
protected void |
processMouseMotionEvent(MouseEvent event)
Processes mouse motion events.
|
void |
setCursor(Cursor cursor)
Changes the cursor used to create the activity.
|
void |
setGhostMode(boolean mode)
Sets the working mode of the interactor.
|
void |
setLineStyle(float[] lineStyle)
Changes the dash array used when dragging the rectangle.
|
getGanttModel, getGanttSheet
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, disableEvents, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, handleExpose, isXORGhost, processEvent, processFocusEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhost
public IlvMakeActivityInteractor()
IlvMakeActivityInteractor
object.protected void attach(IlvManagerView v)
attach
in class IlvManagerViewInteractor
v
- The manager view.IlvManagerViewInteractor.detach()
protected void detach()
detach
in class IlvManagerViewInteractor
IlvManagerViewInteractor.attach(ilog.views.IlvManagerView)
public Cursor getCursor()
Cursor
.setCursor(java.awt.Cursor)
public void setCursor(Cursor cursor)
cursor
- the new cursorgetCursor()
public void setLineStyle(float[] lineStyle)
null
, meaning that the dragged rectangle is
drawn as a solid line.lineStyle
- the new line style, or null
to remove
the line style.getLineStyle()
public float[] getLineStyle()
null
if no line style was specified.setLineStyle(float[])
public boolean isGhostMode()
setGhostMode(boolean)
public void setGhostMode(boolean mode)
mode
- if set to true
, the interactor works in
ghost mode, otherwise, the interactor works in real mode.isGhostMode()
protected void processKeyEvent(KeyEvent e)
Esc
is pressed then the
interaction will be aborted.processKeyEvent
in class IlvManagerViewInteractor
e
- The KeyEvent
.abort()
public void abort()
Esc
key to abort the current interaction.protected void processMouseEvent(MouseEvent event)
processMouseEvent
in class IlvManagerViewInteractor
event
- The MouseEvent
.IlvManagerViewInteractor.addMouseListener(java.awt.event.MouseListener)
protected void processMouseMotionEvent(MouseEvent event)
processMouseMotionEvent
in class IlvManagerViewInteractor
event
- The MouseEvent
.IlvManagerViewInteractor.addMouseMotionListener(java.awt.event.MouseMotionListener)
protected void drawGhost(Graphics g)
drawGhost
in class IlvManagerViewInteractor
g
- the Graphics.IlvManagerViewInteractor.handleExpose(java.awt.Graphics)
,
IlvManagerViewInteractor.setXORGhost(boolean)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.