public class DrawGroup extends DrawItem
A DrawGroup has no local visual representation other than that of its drawItems. Adding items to a drawGroup allows for central event handling, and allows them to be manipulated (drawn, scaled, etc) together.
DrawItems are added to a DrawGroup by creating the DrawItems with DrawItem.drawGroup
set to the DrawGroup, or by creating a
DrawGroup with drawItems
.
DrawGroups handle
events by having an explicitly specified group rectangle (see getGroupRect()
). This rectangle has no visual representation
within the draw pane (is not visible) but any user-interactions within the specified coordinates will trigger group
level events.
DrawGroups may contain other DrawGroups.
config, configOnly, factoryCreated, factoryProperties, id, nativeObject, scClassName
Constructor and Description |
---|
DrawGroup() |
DrawGroup(com.google.gwt.core.client.JavaScriptObject jsObj) |
Modifier and Type | Method and Description |
---|---|
static void |
changeAutoChildDefaults(java.lang.String autoChildName,
Canvas defaults)
Changes the defaults for Canvas AutoChildren named
autoChildName . |
static void |
changeAutoChildDefaults(java.lang.String autoChildName,
DrawItem defaults)
Changes the defaults for DrawItem AutoChildren named
autoChildName . |
static void |
changeAutoChildDefaults(java.lang.String autoChildName,
FormItem defaults)
Changes the defaults for FormItem AutoChildren named
autoChildName . |
java.lang.Boolean |
click()
Notification fired when the user clicks on this DrawGroup.
|
protected com.google.gwt.core.client.JavaScriptObject |
create() |
boolean |
dragMove()
Notification fired for every mouseMove event triggered while the user is dragging this DrawGroup.
|
boolean |
dragStart()
Notification fired when the user starts to drag this DrawGroup.
|
boolean |
dragStop()
Notification fired when the user stops dragging this DrawGroup.
|
void |
erase()
Erases all DrawItems in the DrawGroup.
|
Point |
getCenter()
Get the center point of the
group rectangle . |
DrawItem[] |
getDrawItems()
Initial list of DrawItems for this DrawGroup.
|
Rectangle |
getGroupRect()
This method will return an array of integers mapping out the coordinates (left, top, width, height) of the "group
rectangle" for the group.
|
DrawRect |
getGroupRectOutline()
If this group is showing a
KnobType.MOVE control knob , the groupRectOutline is a DrawRect AutoChild that identifies the group's group rect (see useGroupRect ). |
int |
getHeight()
Height of the
group rectangle in pixels relative to
the DrawPane (the "drawing coordinate system"). |
KnobType[] |
getKnobs()
DrawGroup only supports the
KnobType.MOVE knob type. |
int |
getLeft()
Left coordinate of the
group rectangle in pixels
relative to the DrawPane (the "drawing coordinate system"). |
com.smartgwt.logicalstructure.core.LogicalStructureObject |
getLogicalStructure()
Getter implementing the
LogicalStructure interface,
which supports Eclipse's logical structure debugging facility. |
java.lang.Boolean |
getMoveItemsWithGroup()
Should dragging the group (when
canDrag is true) or
dragging the move knob also move the items within this DrawGroup ? |
static DrawGroup |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
java.lang.Boolean |
getShowGroupRectOutline()
If the
KnobType.MOVE control knob is shown for this group and useGroupRect is true, should the groupRectOutline be shown? |
int |
getTop()
Top coordinate of the
group rectangle in pixels
relative to the DrawPane (the "drawing coordinate system"). |
boolean |
getUseGroupRect()
When should this drawGroup receive event notifications? If set to
true , the developer can specify an
explicit set of coordinates . |
int |
getWidth()
Width of the
group rectangle in pixels relative to
the DrawPane (the "drawing coordinate system"). |
java.lang.Boolean |
mouseDown()
Notification fired when the user presses the left mouse button on this DrawGroup.
|
java.lang.Boolean |
mouseMove()
Notification fired when the user moves the mouse over this DrawGroup.
|
java.lang.Boolean |
mouseOut()
Notification fired when the mouse leaves this DrawGroup.
|
java.lang.Boolean |
mouseOver()
Notification fired when the mouse enters this DrawGroup.
|
java.lang.Boolean |
mouseUp()
Notification fired when the user releases the left mouse button on this DrawGroup.
|
void |
moveBy(int dX,
int dY)
Updates the
DrawGroup 's left coordinate by dX and the top coordinate by dY . |
void |
moveTo(java.lang.Integer left,
java.lang.Integer top)
Sets both the left and top coordinates of this
DrawGroup 's group rectangle . |
void |
rotateBy(java.lang.String degrees)
Rotate the group by degrees.
|
void |
rotateTo(java.lang.String degrees)
Rotate the group to degrees.
|
void |
scaleBy(double x,
double y)
Scale all drawItem[] shapes by the x, y multipliers
|
void |
scaleBy(float x,
float y)
Deprecated.
|
void |
scaleTo(double x,
double y)
Scale the each item in the drawGroup by the x, y multipliers
|
void |
scaleTo(float x,
float y)
Deprecated.
|
static void |
setDefaultProperties(DrawGroup drawGroupProperties)
Class level method to set the default properties of this class.
|
void |
setDrawItems(DrawItem... drawItems)
Initial list of DrawItems for this DrawGroup.
|
void |
setHeight(int height)
Height of the
group rectangle in pixels relative to
the DrawPane (the "drawing coordinate system"). |
void |
setKnobs(KnobType... knobs)
DrawGroup only supports the
KnobType.MOVE knob type. |
void |
setLeft(int left)
Left coordinate of the
group rectangle in pixels
relative to the DrawPane (the "drawing coordinate system"). |
com.smartgwt.logicalstructure.core.LogicalStructureObject |
setLogicalStructure(com.smartgwt.logicalstructure.widgets.drawing.DrawGroupLogicalStructure s)
Setter implementing the
LogicalStructure interface,
which supports Eclipse's logical structure debugging facility. |
void |
setMoveItemsWithGroup(java.lang.Boolean moveItemsWithGroup)
Should dragging the group (when
canDrag is true) or
dragging the move knob also move the items within this DrawGroup ? |
void |
setShowGroupRectOutline(java.lang.Boolean showGroupRectOutline)
If the
KnobType.MOVE control knob is shown for this group and useGroupRect is true, should the groupRectOutline be shown? |
void |
setTop(int top)
Top coordinate of the
group rectangle in pixels
relative to the DrawPane (the "drawing coordinate system"). |
void |
setUseGroupRect(boolean useGroupRect)
When should this drawGroup receive event notifications? If set to
true , the developer can specify an
explicit set of coordinates . |
void |
setWidth(int width)
Width of the
group rectangle in pixels relative to
the DrawPane (the "drawing coordinate system"). |
addClickHandler, addDragMoveHandler, addDragResizeMoveHandler, addDragResizeStartHandler, addDragResizeStopHandler, addDragStartHandler, addDragStopHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMovedHandler, addResizedHandler, addShowContextMenuHandler, bringToFront, computeAngle, computeAngleAsDouble, dragResizeMove, draw, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getBoundingBox, getBoundingBoxAsDouble, getCanDrag, getCanHover, getCanvasAutoChild, getContextMenu, getCornerResizeKnob, getCursor, getDestroyed, getDestroying, getDragStartDistance, getDrawGroup, getDrawItemAutoChild, getDrawPane, getEditProxyConstructor, getEndArrow, getEndKnob, getEventOpaque, getFillColor, getFillGradient, getFillGradientAsString, getFillOpacity, getFormItemAutoChild, getHoverDelay, getHoverHTML, getKeepInParentRect, getLineCap, getLineColor, getLineOpacity, getLinePattern, getLineWidth, getMoveKnob, getMoveKnobOffset, getMoveKnobPoint, getPageLeft, getPageTop, getPrompt, getProportionalResizeModifiers, getProportionalResizing, getRef, getResizeBoundingBox, getResizeBoundingBoxAsDouble, getResizeKnobPoints, getResizeOutline, getResizeViaLocalTransformOnly, getRotation, getRotationAsDouble, getScale, getShadow, getShowHover, getShowResizeOutline, getShowTitleLabelBackground, getSideResizeKnob, getStartArrow, getStartKnob, getSvgString, getTitle, getTitleLabel, getTitleLabelBackground, getTitleLabelPadding, getTitleRotationMode, getTranslate, getXShearFactor, getYShearFactor, getZIndex, hide, hideAllKnobs, hideKnobs, hideKnobs, hover, isInBounds, isPointInPath, resizeBy, resizeTo, rotateBy, rotateTo, sendToBack, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setCanDrag, setCanHover, setCenterPoint, setContextMenu, setCursor, setDefaultProperties, setDragStartDistance, setDrawGroup, setDrawPane, setEditProxyConstructor, setEndArrow, setEventOpaque, setFillColor, setFillGradient, setFillGradient, setFillOpacity, setHoverDelay, setKeepInParentRect, setKeepInParentRect, setLineCap, setLineColor, setLineOpacity, setLinePattern, setLineWidth, setLogicalStructure, setMoveKnobOffset, setMoveKnobPoint, setPrompt, setPropertyValue, setProportionalResizeModifiers, setProportionalResizing, setResizeKnobPoints, setResizeViaLocalTransformOnly, setRotation, setRotation, setScale, setShadow, setShapeData, setShowHover, setShowResizeOutline, setShowTitleLabelBackground, setStartArrow, setTitle, setTitleLabelPadding, setTitleRotationMode, setTranslate, setXShearFactor, setYShearFactor, setZIndex, show, showAllKnobs, showKnobs, showKnobs, supportsEndArrow, supportsStartArrow
addDrawHandler, applyFactoryProperties, completeCreation, destroy, doAddHandler, doInit, doOnRender, equals, error, errorIfNotCreated, getAttribute, getAttributeAsDateArray, getAttributeAsFloatArray, getAttributeAsIntArray, getAttributeAsRecord, getAttributeAsStringArray, getById, getByJSObject, getClassName, getConfig, getDOM, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getScClassName, hasAutoAssignedID, hashCode, initNativeObject, internalSetID, internalSetID, isConfigOnly, isCreated, isDrawn, isFactoryCreated, onBind, onDestroy, onDraw, onInit, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setDefaultProperties, setDragTracker, setFactoryCreated, setHtmlElement, setID, setJavaScriptObject, setLogicalStructure, setLogicalStructure, setNullProperty, setPosition, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setScClassName, toString
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, setVisible, setWidth, sinkBitlessEvent
public DrawGroup()
public DrawGroup(com.google.gwt.core.client.JavaScriptObject jsObj)
public static DrawGroup getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public static void changeAutoChildDefaults(java.lang.String autoChildName, Canvas defaults)
autoChildName
.autoChildName
- name of an AutoChild to customize the defaults for.defaults
- Canvas defaults to apply. These defaults override any existing properties
without destroying or wiping out non-overridden properties. For usage tips on this
param, see SGWTProperties
.AutoChildUsage
public static void changeAutoChildDefaults(java.lang.String autoChildName, FormItem defaults)
autoChildName
.autoChildName
- name of an AutoChild to customize the defaults for.defaults
- FormItem defaults to apply. These defaults override any existing properties
without destroying or wiping out non-overridden properties. For usage tips on this
param, see SGWTProperties
.AutoChildUsage
public static void changeAutoChildDefaults(java.lang.String autoChildName, DrawItem defaults)
autoChildName
.autoChildName
- name of an AutoChild to customize the defaults for.defaults
- DrawItem defaults to apply. These defaults override any existing properties
without destroying or wiping out non-overridden properties. For usage tips on this
param, see SGWTProperties
.AutoChildUsage
protected com.google.gwt.core.client.JavaScriptObject create()
public DrawRect getGroupRectOutline() throws java.lang.IllegalStateException
KnobType.MOVE
control knob
, the groupRectOutline
is a DrawRect
AutoChild that identifies the group's group rect (see useGroupRect
). useGroupRect
must be true
and the KnobType.MOVE
control knob must be showing for the
groupRectOutline
AutoChild to be created and shown.
This component is an AutoChild named "groupRectOutline". For an overview of how to use and
configure AutoChildren, see Using AutoChildren
.
java.lang.IllegalStateException
- if this widget has not yet been rendered.public void setHeight(int height)
group rectangle
in pixels relative to
the DrawPane
(the "drawing coordinate system").
DrawGroup
's group rectangle
. Note that setting the height will not move or resize the items in this DrawGroup
.height
- new height for the group rectangle. Default value is 1public int getHeight()
group rectangle
in pixels relative to
the DrawPane
(the "drawing coordinate system").public void setKnobs(KnobType... knobs) throws java.lang.IllegalStateException
KnobType.MOVE
knob type.setKnobs
in class DrawItem
knobs
- Default value is nulljava.lang.IllegalStateException
- this property cannot be changed after the component has been createdDrawItem.setKnobs(com.smartgwt.client.types.KnobType...)
,
setMoveItemsWithGroup(java.lang.Boolean)
public KnobType[] getKnobs()
KnobType.MOVE
knob type.getKnobs
in class DrawItem
DrawItem.getKnobs()
,
getMoveItemsWithGroup()
public void setLeft(int left)
group rectangle
in pixels
relative to the DrawPane
(the "drawing coordinate system").
DrawGroup
's group rectangle
. Note that setting the left coordinate will not move the items in this DrawGroup
.left
- new left coordinate. Default value is 0public int getLeft()
group rectangle
in pixels
relative to the DrawPane
(the "drawing coordinate system").public void setMoveItemsWithGroup(java.lang.Boolean moveItemsWithGroup)
canDrag
is true) or
dragging the move knob also move the items within this DrawGroup
?
Note : This is an advanced setting
moveItemsWithGroup
- Default value is truepublic java.lang.Boolean getMoveItemsWithGroup()
canDrag
is true) or
dragging the move knob also move the items within this DrawGroup
?public void setShowGroupRectOutline(java.lang.Boolean showGroupRectOutline)
KnobType.MOVE
control knob
is shown for this group and useGroupRect
is true, should the groupRectOutline
be shown? Set to false to disable showing the groupRectOutline
.
showGroupRectOutline
- Default value is nullpublic java.lang.Boolean getShowGroupRectOutline()
KnobType.MOVE
control knob
is shown for this group and useGroupRect
is true, should the groupRectOutline
be shown? Set to false to disable showing the groupRectOutline
.
public void setTop(int top)
group rectangle
in pixels
relative to the DrawPane
(the "drawing coordinate system").
DrawGroup
's group rectangle
. Note that setting the top coordinate will not move the items in this DrawGroup
.top
- new top coordinate in pixels. Default value is 0public int getTop()
group rectangle
in pixels
relative to the DrawPane
(the "drawing coordinate system").public void setUseGroupRect(boolean useGroupRect) throws java.lang.IllegalStateException
true
, the developer can specify an
explicit set of coordinates
. Whenever the user
interacts with this rectangle, the drawGroup will be notified and the appropriate event handlers will be fired. Note
that rectangle need not contain all DrawItems within the group, and is manually managed by the developer.false
, the event rectangle
coordinates
are unused - instead as a user interacts with specific drawItems within this group, the appropriate event handler would
be fired on the item, then the event would "bubble" to the drawGroup, firing the appropriate event handler at the group
level as well.useGroupRect
- Default value is falsejava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic boolean getUseGroupRect()
true
, the developer can specify an
explicit set of coordinates
. Whenever the user
interacts with this rectangle, the drawGroup will be notified and the appropriate event handlers will be fired. Note
that rectangle need not contain all DrawItems within the group, and is manually managed by the developer.false
, the event rectangle
coordinates
are unused - instead as a user interacts with specific drawItems within this group, the appropriate event handler would
be fired on the item, then the event would "bubble" to the drawGroup, firing the appropriate event handler at the group
level as well.public void setWidth(int width)
group rectangle
in pixels relative to
the DrawPane
(the "drawing coordinate system").
DrawGroup
's group rectangle
. Note that setting the width will not move or resize the items in this DrawGroup
.width
- new width for the group rectangle. Default value is 1public int getWidth()
group rectangle
in pixels relative to
the DrawPane
(the "drawing coordinate system").public java.lang.Boolean click()
Note that if useGroupRect
is true, this notification will be triggered
by the user interacting with the specified group
rectangle
for the group. If useGroupRect
is
false, the notification will bubble up from interactions with individual items within the group.
Canvas.getOffsetX()
,
Canvas.getOffsetY()
public boolean dragMove()
canDrag
is true for this group. Note that if useGroupRect
is true, this notification will be triggered
by the user interacting with the specified group
rectangle
for the group. If useGroupRect
is
false, the notification will bubble up from interactions with individual items within the group.
Default drag behavior will be to reposition all items in the group (and update the group rectangle).
Canvas.getOffsetX()
,
Canvas.getOffsetY()
,
Drag pan Examplepublic boolean dragStart()
canDrag
is true for this group. Note that if useGroupRect
is true, this notification will be triggered
by the user interacting with the specified group
rectangle
for the group. If useGroupRect
is
false, the notification will bubble up from interactions with individual items within the group.
Default drag behavior will be to reposition all items in the group (and update the group rectangle).
Canvas.getOffsetX()
,
Canvas.getOffsetY()
,
Drag pan Examplepublic boolean dragStop()
canDrag
is true for this group. Note that if useGroupRect
is true, this notification will be triggered
by the user interacting with the specified group
rectangle
for the group. If useGroupRect
is
false, the notification will bubble up from interactions with individual items within the group.
Canvas.getOffsetX()
,
Canvas.getOffsetY()
public Point getCenter()
group rectangle
.public java.lang.Boolean mouseDown()
Note that if useGroupRect
is true, this notification will be triggered
by the user interacting with the specified group
rectangle
for the group. If useGroupRect
is
false, the notification will bubble up from interactions with individual items within the group.
Canvas.getOffsetX()
,
Canvas.getOffsetY()
public java.lang.Boolean mouseMove()
Note that if useGroupRect
is true, this notification will be triggered
by the user interacting with the specified group
rectangle
for the group. If useGroupRect
is
false, the notification will bubble up from interactions with individual items within the group.
Canvas.getOffsetX()
,
Canvas.getOffsetY()
,
Mouse events Examplepublic java.lang.Boolean mouseOut()
Note that if useGroupRect
is true, this notification will be triggered
by the user interacting with the specified group
rectangle
for the group. If useGroupRect
is
false, the notification will bubble up from interactions with individual items within the group.
public java.lang.Boolean mouseOver()
Note that if useGroupRect
is true, this notification will be triggered
by the user interacting with the specified group
rectangle
for the group. If useGroupRect
is
false, the notification will bubble up from interactions with individual items within the group.
Canvas.getOffsetX()
,
Canvas.getOffsetY()
public java.lang.Boolean mouseUp()
Note that if useGroupRect
is true, this notification will be triggered
by the user interacting with the specified group
rectangle
for the group. If useGroupRect
is
false, the notification will bubble up from interactions with individual items within the group.
Canvas.getOffsetX()
,
Canvas.getOffsetY()
,
Mouse events Examplepublic void moveBy(int dX, int dY)
DrawGroup
's left coordinate by dX
and the top coordinate by dY
. Note
that this does not move or resize the items in this DrawGroup
.public void moveTo(java.lang.Integer left, java.lang.Integer top)
DrawGroup
's group rectangle
. Note that this does not move or resize the
items in this DrawGroup
.public void scaleBy(float x, float y)
GwtFloatVsDouble
x
- scale in the x directiony
- scale in the y directionpublic void scaleBy(double x, double y)
public void scaleTo(float x, float y)
GwtFloatVsDouble
x
- scale in the x directiony
- scale in the y directionpublic void scaleTo(double x, double y)
public static void setDefaultProperties(DrawGroup drawGroupProperties)
Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.
drawGroupProperties
- properties that should be used as new defaults when instances of this class are createdSGWTProperties
public void rotateBy(java.lang.String degrees)
degrees
- public void rotateTo(java.lang.String degrees)
degrees
- public void setDrawItems(DrawItem... drawItems) throws java.lang.IllegalStateException
DrawItems can be added to a DrawGroup after initialization by setting
drawGroup
.
drawItems
- drawItems Default value is nulljava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic DrawItem[] getDrawItems()
DrawItems can be added to a DrawGroup after initialization by setting
drawGroup
.
public Rectangle getGroupRect()
Developers may also use left
, top
, width
and height
to manage each coordinate directly.
public com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.drawing.DrawGroupLogicalStructure s)
LogicalStructure
interface,
which supports Eclipse's logical structure debugging facility.public com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
LogicalStructure
interface,
which supports Eclipse's logical structure debugging facility.getLogicalStructure
in interface LogicalStructure
getLogicalStructure
in class DrawItem