|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nwoods.jgo.JGoObject
com.nwoods.jgo.JGoDrawable
com.nwoods.jgo.JGoRectangle
com.nwoods.jgo.JGoHandle
Represents a handle used for selecting, resizing, etc. an object. Handles also can define what the mouse cursor looks like when it is over the handle.
Handles are normally only added to views, not to documents. They should not be selected.
Field Summary |
Fields inherited from class com.nwoods.jgo.JGoObject |
Bottom, BottomCenter, BottomLeft, BottomMiddle, BottomRight, Center, CenterLeft, CenterRight, Changed4ResizeHandles, ChangedAutoRescale, ChangedBrush, ChangedDraggable, ChangedDragsNode, ChangedGeometry, ChangedGrabChildSelection, ChangedInitializing, ChangedPen, ChangedResizable, ChangedSelectable, ChangedUpdatePartner, ChangedVisible, ChangedZOrder, LastChangedHint, Left, LeftCenter, NoHandle, NoSpot, NumReservedHandles, RepaintAll, Right, RightCenter, SideLeft, SideRight, Top, TopCenter, TopLeft, TopMiddle, TopRight |
Constructor Summary | |
JGoHandle()
Create a default new handle, with no particular rectangle and for no object. |
|
JGoHandle(org.eclipse.swt.graphics.Rectangle rect,
int cursorType)
Create a new handle with the given rectangle and the given cursor. |
|
JGoHandle(org.eclipse.swt.graphics.Rectangle rect,
int cursorType,
int handleType)
Create a new handle with the given rectangle and the given cursor and handle types. |
Method Summary | |
JGoObject |
copyObject(JGoCopyEnvironment env)
By default, handles are not copied. |
boolean |
doUncapturedMouseMove(int flags,
org.eclipse.swt.graphics.Point dc,
org.eclipse.swt.graphics.Point vc,
JGoView view)
Called when the mouse moves over this handle --- we set the cursor based on what type of handle we are. |
protected void |
gainedSelection(JGoSelection selection)
Handles are not selectable. |
int |
getCursorType()
Get the type of the cursor for this handle. |
static int |
getDefaultHandleHeight()
Return the default height for a handle. |
static int |
getDefaultHandleWidth()
Return the default width for a handle. |
JGoObject |
getHandleFor()
Get the object for which this is a handle. |
int |
getHandleType()
Get the type of this handle. |
JGoObject |
getPartner()
Sometimes it is convenient to be able to associate an object with another object, without any predetermined knowledge about the class. |
protected void |
lostSelection(JGoSelection selection)
Handles are not selectable. |
JGoObject |
redirectSelection()
Handles are not selectable. |
void |
setCursorType(int cursorType)
Set the type of the cursor for this handle. |
static void |
setDefaultHandleHeight(int h)
Change the default height for newly created handles. |
static void |
setDefaultHandleWidth(int w)
Change the default width for newly created handles. |
void |
setHandleFor(JGoObject obj)
Set the object for which this is a handle. |
void |
setHandleType(int type)
Change the type (location) of this handle. |
void |
setPartner(JGoObject obj)
Sometimes it is convenient to be able to associate an object with another object, without any predetermined knowledge about the class. |
Methods inherited from class com.nwoods.jgo.JGoRectangle |
getNearestIntersectionPoint, paint, SVGReadAttributes, SVGReadObject, SVGWriteAttributes, SVGWriteObject |
Methods inherited from class com.nwoods.jgo.JGoDrawable |
changeValue, copyNewValueForRedo, draw3DRect, draw3DRect, drawEllipse, drawEllipse, drawEllipse, drawLine, drawLine, drawPath, drawPolygon, drawPolygon, drawRect, drawRect, drawRect, drawRoundRect, drawRoundRect, expandRectByPenWidth, getBrush, getNearestIntersectionPoint, getPen, setBrush, setPen, SVGAddPathArgs, SVGUpdateReference |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JGoHandle()
public JGoHandle(org.eclipse.swt.graphics.Rectangle rect, int cursorType)
public JGoHandle(org.eclipse.swt.graphics.Rectangle rect, int cursorType, int handleType)
Method Detail |
public JGoObject copyObject(JGoCopyEnvironment env)
copyObject
in class JGoRectangle
env
- the environment for the copy operation - keeps track of copied objects.public boolean doUncapturedMouseMove(int flags, org.eclipse.swt.graphics.Point dc, org.eclipse.swt.graphics.Point vc, JGoView view)
doUncapturedMouseMove
in class JGoObject
flags
- event specific flagsdc
- the point of the click in document coordinatesvc
- the point of the click in view coordinatesview
- the view in which this event occured
JGoView.doUncapturedMouseMove(int, org.eclipse.swt.graphics.Point, org.eclipse.swt.graphics.Point)
protected void gainedSelection(JGoSelection selection)
gainedSelection
in class JGoObject
selection
- the selection into which this object was addedprotected void lostSelection(JGoSelection selection)
lostSelection
in class JGoObject
selection
- the selection from which this object was removedpublic JGoObject redirectSelection()
redirectSelection
in class JGoObject
public JGoObject getPartner()
JGoObject
By default this returns null.
getPartner
in class JGoObject
public void setPartner(JGoObject obj)
JGoObject
By default this is a no-op.
setPartner
in class JGoObject
public final void setHandleFor(JGoObject obj)
obj
- the object for which this is a handlepublic final JGoObject getHandleFor()
public void setHandleType(int type)
type
- the new type for this handlepublic int getHandleType()
public void setCursorType(int cursorType)
cursorType
- the type of the cursor.public int getCursorType()
public static int getDefaultHandleWidth()
public static void setDefaultHandleWidth(int w)
public static int getDefaultHandleHeight()
public static void setDefaultHandleHeight(int h)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |