public abstract class AbstractPenOwner extends java.lang.Object implements PenOwner
PenOwner.PenManagerHandle| Modifier and Type | Field and Description |
|---|---|
protected PenOwner.PenManagerHandle |
penManagerHandle |
| Constructor and Description |
|---|
AbstractPenOwner() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
draggingOutDisengaged() |
boolean |
enforceSinglePenManager() |
java.lang.Object |
evalPenEventTag(PenEvent ev)
This method is called by the
PenManager's machinary when creating a PenEvent. |
protected Pen |
getPen() |
protected abstract void |
init()
Override this method to do initialization.
|
boolean |
isDraggingOut()
Called by the
PenManager to avoid sending PLevelEvents to clients when the location is outside the PenClip and this method returns false. |
void |
setPenManagerHandle(PenOwner.PenManagerHandle penManagerHandle)
Called once by the
PenManager.PenManager(PenOwner) constructor to allow this PenOwner to access the PenManager through the given PenOwner.PenManagerHandle. |
protected boolean |
startDraggingOut()
Starts a drag-out operation if there are pressed buttons and installs a penListener which automatically stops the drag-out operation when all the buttons are unpressed.
|
protected boolean |
stopDraggingOut()
Force stopping a drag-out operation if it was in progress.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPenClip, getPenProviderConstructorsprotected PenOwner.PenManagerHandle penManagerHandle
public AbstractPenOwner()
protected final boolean stopDraggingOut()
PenClip to stop the drag-out operation if it was still in progress.
This method must be called while holding the PenOwner.PenManagerHandle.getPenSchedulerLock() (See PenOwner.isDraggingOut()).true if a drag-out operation was in progress and was stopped.protected abstract void draggingOutDisengaged()
protected final boolean startDraggingOut()
PenOwner.PenManagerHandle.getPenSchedulerLock() (See PenOwner.isDraggingOut()).true if a drag-out operation was started or was already in progress.public final void setPenManagerHandle(PenOwner.PenManagerHandle penManagerHandle)
PenOwnerPenManager.PenManager(PenOwner) constructor to allow this PenOwner to access the PenManager through the given PenOwner.PenManagerHandle.setPenManagerHandle in interface PenOwnerprotected abstract void init()
penManagerHandle is set.public final boolean isDraggingOut()
PenOwnerPenManager to avoid sending PLevelEvents to clients when the location is outside the PenClip and this method returns false. The PenManager calls this method holding the PenOwner.PenManagerHandle.getPenSchedulerLock() synchronization lock.isDraggingOut in interface PenOwnertrue if this PenOwner is currently in a drag-out operation.public java.lang.Object evalPenEventTag(PenEvent ev)
PenOwnerPenManager's machinary when creating a PenEvent. This method returns a tag to be stored on the given PenEvent or null if no tagging is needed (the PenManager machinary stores this tag on the private PenEvent's penOwnerTag field ). The tag can be later retrieved using PenOwner.PenManagerHandle.retrievePenEventTag(PenEvent).evalPenEventTag in interface PenOwnerpublic boolean enforceSinglePenManager()
enforceSinglePenManager in interface PenOwnertrue if you want to allow only one PenManager per JVM---attempting to create more than one PenManager instance will cause an IllegalStateException to be thrown by the PenManager's constructor.