public class IlvMakePrototypeInstanceInteractor extends IlvDragRectangleInteractor implements IlvPermanentInteractorInterface
IlvDragRectangleInteractor
that is
used to interactively create prototype instances.
IlvPrototype
,
IlvPrototypeInstance
,
IlvGroupBag
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected IlvPrototypeInstance |
instance
The last prototype instance created by the interactor.
|
Constructor and Description |
---|
IlvMakePrototypeInstanceInteractor(IlvPrototype prototype)
Creates a new prototype instance interactor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createInstance(double x,
double y)
Deprecated.
You should override the new method
createInstance(double, double, double, double) instead
of this one. This method (with only the position) is called
only if the user clicks without dragging, whereas the new
method (with the position and the size) is called in all cases. |
protected void |
createInstance(double x,
double y,
double width,
double height)
Creates the prototype instance and adds it to the group bag associated with
the manager to which this interactor is attached.
|
protected void |
drawGhost(Graphics g)
Draws the created Prototype instance during interaction.
|
protected void |
fireRectangleDraggedEvent(IlvRect rectangle,
MouseEvent event)
Calls the
createInstance method to create the prototype
instance at the location and with the size specified by the dragged
rectangle. |
IlvPrototype |
getPrototype()
Returns the prototype for which this interactor will create an instance.
|
boolean |
isPermanent()
Returns
false if the interactor is removed from the view once
the object has been created. |
protected void |
processMouseEvent(MouseEvent event)
Processes mouse events.
|
protected void |
processMouseMotionEvent(MouseEvent event)
Processes mouse motion events.
|
void |
setPermanent(boolean permanent)
Specifies whether the interactor is removed from the view once the object
has been created.
|
void |
setPrototype(IlvPrototype prototype)
Sets the prototype for which this interactor will create an instance.
|
addRectangleDraggedListener, attach, detach, dragscroll, getCursor, getDraggedRectangle, getLineStyle, getRectangleAspectRatio, getStartDragModifier, getStartPoint, handleButtonDown, handleButtonDragged, handleButtonUp, isGridMode, isOpaqueMode, isRotationAllowed, isStartDragModifierDown, isXORGhost, removeRectangleDraggedListener, setCursor, setGridMode, setLineStyle, setOpaqueMode, setRectangleAspectRatio, setRotationAllowed, setStartDragModifier
adjustPointIfOutsideView, doAutoScroll, getMaximumScrollDistance, getScrollTiming, isProgressiveScroll, setMaximumScrollDistance, setProgressiveScroll, setScrollTiming, startDraggingScrollTimer, stopDraggingScrollTimer
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, disableEvents, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, handleExpose, processEvent, processFocusEvent, processKeyEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhost
protected IlvPrototypeInstance instance
public IlvMakePrototypeInstanceInteractor(IlvPrototype prototype)
prototype
- the prototype to be instantiated.public IlvPrototype getPrototype()
public void setPrototype(IlvPrototype prototype)
public final boolean isPermanent()
false
if the interactor is removed from the view once
the object has been created. The default value is false
.isPermanent
in interface IlvPermanentInteractorInterface
public final void setPermanent(boolean permanent)
false
.setPermanent
in interface IlvPermanentInteractorInterface
permanent
- the new mode.protected void processMouseEvent(MouseEvent event)
processMouseEvent
in class IlvDragRectangleInteractor
event
- The event.IlvManagerViewInteractor.addMouseListener(java.awt.event.MouseListener)
protected void processMouseMotionEvent(MouseEvent event)
processMouseMotionEvent
in class IlvDragRectangleInteractor
event
- The event.IlvManagerViewInteractor.addMouseMotionListener(java.awt.event.MouseMotionListener)
protected void drawGhost(Graphics g)
drawGhost
in class IlvDragRectangleInteractor
g
- The Graphics.IlvManagerViewInteractor.handleExpose(java.awt.Graphics)
,
IlvManagerViewInteractor.setXORGhost(boolean)
protected void fireRectangleDraggedEvent(IlvRect rectangle, MouseEvent event)
createInstance
method to create the prototype
instance at the location and with the size specified by the dragged
rectangle. This method also notifies all the listeners that a rectangle has
been dragged.fireRectangleDraggedEvent
in class IlvDragRectangleInteractor
rectangle
- the rectangle that was dragged.event
- the mouse-released event that generates this event.createInstance(double, double, double,
double)
protected void createInstance(double x, double y, double width, double height)
IlvGraphicGroup
.x
- the x coordinate of the point where the user clicked.y
- the y coordinate of the point where the user clicked.width
- the width of the rectangle that the user dragged, or 0 if the user
just clicked (without dragging).height
- the height of the rectangle that the user dragged, or 0 if the
user just clicked (without dragging).IlvGraphicGroup
@Deprecated protected void createInstance(double x, double y)
createInstance(double, double, double, double)
instead
of this one. This method (with only the position) is called
only if the user clicks without dragging, whereas the new
method (with the position and the size) is called in all cases.IlvGraphicGroup
.x
- the x coordinate of the point where the user clicked.y
- the y coordinate of the point where the user clicked.IlvGraphicGroup
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.