|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.smartgwt.client.core.BaseClass
com.smartgwt.client.widgets.drawing.DrawItem
com.smartgwt.client.widgets.drawing.DrawGroup
public class DrawGroup
DrawItem subclass to manage a group of other DrawItem instances.
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 drawGroup set to a drawGroup, or by calling addItem.
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.
| Field Summary |
|---|
| Fields inherited from class com.smartgwt.client.core.BaseClass |
|---|
config, id, scClassName |
| Constructor Summary | |
|---|---|
DrawGroup()
|
|
DrawGroup(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
| Method Summary | |
|---|---|
java.lang.Boolean |
click()
Executed when the left mouse is clicked (pressed and then released) on this widget. |
com.google.gwt.core.client.JavaScriptObject |
create()
|
void |
erase()
Erases all DrawItems in the DrawGroup. |
int[] |
getBoundingBox()
Returns the top, left, top+height, left+width |
int[] |
getCenter()
Get the center coordinates of the 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. |
int |
getHeight()
Height of the group rectangle in pixels relative to
the DrawPane. |
int |
getLeft()
Left coordinate of the group rectangle in pixels
relative to the DrawPane. |
static DrawGroup |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
|
int |
getTop()
Top coordinate of the group rectangle in pixels
relative to the DrawPane. |
int |
getWidth()
Width of the group rectangle in pixels relative to
the DrawPane. |
java.lang.Boolean |
mouseDown()
Executed when the left mouse down is pressed on this widget. |
java.lang.Boolean |
mouseMove()
Executed when the mouse moves within this widget. |
java.lang.Boolean |
mouseOut()
Executed when the mouse leaves this widget. |
java.lang.Boolean |
mouseOver()
Executed when mouse enters this widget. |
java.lang.Boolean |
mouseUp()
Executed when the left mouse is released on this widget. |
void |
moveBy(int left,
int top)
Move all member drawItems by the specified number of pixels. |
void |
moveTo(int left,
int top)
Set both the left and top coordinate of this drawGroup 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(float x,
float y)
Scale all drawItem[] shapes by the x, y multipliers |
void |
scaleTo(float x,
float y)
Scale the each item in the drawGroup by the x, y multipliers |
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. |
void |
setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
|
void |
setLeft(int left)
Left coordinate of the group rectangle in pixels
relative to the DrawPane. |
void |
setTop(int top)
Top coordinate of the group rectangle in pixels
relative to the DrawPane. |
void |
setWidth(int width)
Width of the group rectangle in pixels relative to
the DrawPane. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
public DrawGroup()
public DrawGroup(com.google.gwt.core.client.JavaScriptObject jsObj)
| Method Detail |
|---|
public static DrawGroup getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
setJavaScriptObject in class DrawItempublic com.google.gwt.core.client.JavaScriptObject create()
create in class DrawItempublic void setHeight(int height)
group rectangle in pixels relative to
the DrawPane.
group rectangle. Note that setting this attribute will not move or resize the drawItems in this group.
height - new height for the event rect. Default value is 1public int getHeight()
group rectangle in pixels relative to
the DrawPane.
public void setLeft(int left)
group rectangle in pixels
relative to the DrawPane.
group rectangle. Note that setting this attribute will not move the drawItems in this group.
left - new left coordinate in pixels. Default value is 0public int getLeft()
group rectangle in pixels
relative to the DrawPane.
public void setTop(int top)
group rectangle in pixels
relative to the DrawPane.
group rectangle. Note that setting this attribute will not move the drawItems in this group.
top - new top coordinate in pixels. Default value is 0public int getTop()
group rectangle in pixels
relative to the DrawPane.
public void setWidth(int width)
group rectangle in pixels relative to
the DrawPane.
group rectangle. Note that setting this attribute will not move or resize the drawItems in this group.
width - new width for the event rect. Default value is 1public int getWidth()
group rectangle in pixels relative to
the DrawPane.
public java.lang.Boolean click()
Canvas.getOffsetX(),
Canvas.getOffsetY()public void erase()
erase in class DrawItempublic java.lang.Boolean mouseDown()
Canvas.getOffsetX(),
Canvas.getOffsetY()public java.lang.Boolean mouseMove()
Canvas.getOffsetX(),
Canvas.getOffsetY(),
Mouse events Examplepublic java.lang.Boolean mouseOut()
public java.lang.Boolean mouseOver()
Canvas.getOffsetX(),
Canvas.getOffsetY()public java.lang.Boolean mouseUp()
Canvas.getOffsetX(),
Canvas.getOffsetY(),
Mouse events Example
public void moveBy(int left,
int top)
group rectangle, moving it by the same offset.
moveBy in class DrawItemleft - change to left coordinate in pixelstop - change to top coordinate in pixels
public void moveTo(int left,
int top)
group rectangle. Unlike DrawGroup.moveBy, this will not
move the drawItems in this group.
left - new left coordinate in pixelstop - new top coordinate in pixels
public void scaleBy(float x,
float y)
scaleBy in class DrawItemx - scale in the x directiony - scale in the y direction
public void scaleTo(float x,
float y)
scaleTo in class DrawItemx - scale in the x directiony - scale in the y directionpublic void rotateBy(java.lang.String degrees)
degrees - public void rotateTo(java.lang.String degrees)
degrees - public int[] getBoundingBox()
getBoundingBox in class DrawItempublic int[] getCenter()
getCenter in class DrawItem
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 null
java.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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||