|
||||||||||
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.JGoControl
The parent of any class that defines a JGoObject represented by an SWT Control. Subclasses of JGoControl allow standard Controls to be used in a view with other JGoObjects, with some restrictions.
Normally JGoControls should be used as part of a view, not part of a document. If the JGoControl is part of a document it will have to create a separate, independent SWT Control for each view, and each view will have to resize, reposition, and repaint them.
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 | |
JGoControl()
Construct a new JGoControl. |
|
JGoControl(org.eclipse.swt.graphics.Point location,
Dimension size)
Construct a JGoControl at a given location with a given size. |
|
JGoControl(org.eclipse.swt.graphics.Rectangle rect)
Construct a JGoControl with a bounding rectangle. |
Method Summary | |
abstract org.eclipse.swt.widgets.Control |
createControl(JGoView view)
Each JGoControl subclass is responsible for representing the JGoControl with a Control that will be added to the JGoView's canvas. |
protected void |
geometryChange(org.eclipse.swt.graphics.Rectangle prevRect)
If the object has been moved or resized, adjust the SWT Controls in all views accordingly. |
org.eclipse.swt.widgets.Control |
getControl(JGoView view)
Returns an SWT Control associated with the JGoControl. |
java.util.Iterator |
getIterator()
Return an iterator for getting all the known JGoView/Control mappings. |
protected void |
ownerChange(JGoObjectCollection oldOwner,
JGoObjectCollection newOwner,
JGoObject mainObject)
We need to remove the SWT Control from the all of this document's JGoViews when this JGoControl is removed from the document. |
void |
paint(Graphics2D g,
JGoView view)
Cause the SWT Control associated with this JGoControl, as returned by getComponent(), to be drawn on the screen. |
void |
setVisible(boolean bFlag)
If this JGoObject becomes visible, we need to make sure the SWT Control is created and is visible. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JGoControl()
public JGoControl(org.eclipse.swt.graphics.Rectangle rect)
rect
- the bounding rectanglepublic JGoControl(org.eclipse.swt.graphics.Point location, Dimension size)
location
- the upper left corner, in document coordinatessize
- the dimensions of the rectangle, in document coordinatesMethod Detail |
protected void ownerChange(JGoObjectCollection oldOwner, JGoObjectCollection newOwner, JGoObject mainObject)
We need to remove the SWT Control from the JGoView's canvas when this JGoControl is removed from the view. When it is added to a view, we need to make sure the SWT Control exists, if this object is visible.
ownerChange
in class JGoObject
oldOwner
- the previous owner objectnewOwner
- the new owner objectmainObject
- the object being inserted or removed from the document or viewpublic org.eclipse.swt.widgets.Control getControl(JGoView view)
view
- the view for which this control should be found or created
public abstract org.eclipse.swt.widgets.Control createControl(JGoView view)
You may wish to return null when no Control is desired for this JGoControl, perhaps just for the given view.
view
- the view for which this control should be created
public void setVisible(boolean bFlag)
setVisible
in class JGoObject
bFlag
- true if visible, false if notprotected void geometryChange(org.eclipse.swt.graphics.Rectangle prevRect)
geometryChange
in class JGoObject
public void paint(Graphics2D g, JGoView view)
Subclasses will need to override this to handle the scaling issues involved with positioning and sizing the component. Painting should not be done with JGo's translated/scaled Graphics2D but later with the normal GC when this view's Control children are painted.
paint
in class JGoObject
g
- this Graphics should be ignored, because it is transformedview
- the view in which this control should be displayedpublic java.util.Iterator getIterator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |