com.smartgwt.client.widgets.drawing
Class DrawCurve

java.lang.Object
  extended by com.smartgwt.client.core.BaseClass
      extended by com.smartgwt.client.widgets.drawing.DrawItem
          extended by com.smartgwt.client.widgets.drawing.DrawCurve
All Implemented Interfaces:
HasHandlers, HasClickHandlers, HasDragMoveHandlers, HasDragStartHandlers, HasDragStopHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMovedHandlers, HasResizedHandlers, HasShowContextMenuHandlers

public class DrawCurve
extends DrawItem

DrawItem that renders cubic bezier curves.


Field Summary
 
Fields inherited from class com.smartgwt.client.core.BaseClass
config, id, scClassName
 
Constructor Summary
DrawCurve()
           
DrawCurve(JavaScriptObject jsObj)
           
 
Method Summary
 JavaScriptObject create()
           
 Point getControlPoint1()
          First cubic bezier control point.
 Point getControlPoint2()
          Second cubic bezier control point.
 Point getEndPoint()
          End point of the curve
 LineCap getLineCap()
          Style of drawing the endpoints of a line.
static DrawCurve getOrCreateRef(JavaScriptObject jsObj)
           
 Point getStartPoint()
          Start point of the curve
 void moveBy(int x, int y)
          Increment start, end and control points of this curve
 void moveTo(int x, int y)
          Sets start, end and control points of this curve
 void setControlPoint1(Point controlPoint1)
          First cubic bezier control point.
 void setControlPoint2(Point controlPoint2)
          Second cubic bezier control point.
 void setEndPoint(Point endPoint)
          End point of the curve

If this method is called after the component has been drawn/initialized: Update the endPoint
 void setJavaScriptObject(JavaScriptObject jsObj)
           
 void setLineCap(LineCap lineCap)
          Style of drawing the endpoints of a line.
 void setStartPoint(Point startPoint)
          Start point of the curve

If this method is called after the component has been drawn/initialized: Update the startPoint
 
Methods inherited from class com.smartgwt.client.widgets.drawing.DrawItem
addClickHandler, addDragMoveHandler, addDragStartHandler, addDragStopHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMovedHandler, addResizedHandler, addShowContextMenuHandler, computeAngle, convertToDrawItemArray, destroy, draw, erase, getAttributeAsIntArray, getBoundingBox, getCanDrag, getCenter, getContextMenu, getDestroyed, getDestroying, getDragStartDistance, getDrawGroup, getDrawPane, getEndArrow, getFillColor, getFillGradient, getFillOpacity, getKnobs, getLineColor, getLineOpacity, getLinePattern, getLineWidth, getMoveKnobOffset, getMoveKnobPoint, getPageLeft, getPageTop, getRef, getResizeKnobPoints, getRotation, getScale, getShadow, getStartArrow, getSvgString, hide, hideKnobs, isInBounds, isPointInPath, resizeBy, resizeTo, rotateBy, rotateTo, scaleBy, scaleTo, setCanDrag, setContextMenu, setDragStartDistance, setDrawGroup, setDrawPane, setEndArrow, setFillColor, setFillGradient, setFillOpacity, setKnobs, setLineColor, setLineOpacity, setLinePattern, setLineWidth, setMoveKnobOffset, setMoveKnobPoint, setResizeKnobPoints, setRotation, setScale, setShadow, setStartArrow, show, showKnobs
 
Methods inherited from class com.smartgwt.client.core.BaseClass
doAddHandler, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getConfig, getHandlerCount, getID, getJsObj, getOrCreateJsObj, getScClassName, isCreated, onInit, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setID, setProperty, setProperty, setProperty, setProperty, setScClassName
 
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

DrawCurve

public DrawCurve()

DrawCurve

public DrawCurve(JavaScriptObject jsObj)
Method Detail

getOrCreateRef

public static DrawCurve getOrCreateRef(JavaScriptObject jsObj)

setJavaScriptObject

public void setJavaScriptObject(JavaScriptObject jsObj)
Overrides:
setJavaScriptObject in class DrawItem

create

public JavaScriptObject create()
Overrides:
create in class DrawItem

setControlPoint1

public void setControlPoint1(Point controlPoint1)
First cubic bezier control point.

If this method is called after the component has been drawn/initialized: Update the first cubic bezier control point

Parameters:
controlPoint1 - left coordinate for control point, in pixels. Default value is [100,0]

getControlPoint1

public Point getControlPoint1()
First cubic bezier control point.

Returns:
Point

setControlPoint2

public void setControlPoint2(Point controlPoint2)
Second cubic bezier control point.

If this method is called after the component has been drawn/initialized: Update the second cubic bezier control point

Parameters:
controlPoint2 - left coordinate for control point, in pixels. Default value is [0,100]

getControlPoint2

public Point getControlPoint2()
Second cubic bezier control point.

Returns:
Point

setEndPoint

public void setEndPoint(Point endPoint)
End point of the curve

If this method is called after the component has been drawn/initialized: Update the endPoint

Parameters:
endPoint - left coordinate for end point, in pixels. Default value is [100,100]

getEndPoint

public Point getEndPoint()
End point of the curve

Returns:
Point

setLineCap

public void setLineCap(LineCap lineCap)
Style of drawing the endpoints of a line.

Note that for dashed and dotted lines, the lineCap style affects each dash or dot.

Overrides:
setLineCap in class DrawItem
Parameters:
lineCap - lineCap Default value is "butt"

getLineCap

public LineCap getLineCap()
Style of drawing the endpoints of a line.

Note that for dashed and dotted lines, the lineCap style affects each dash or dot.

Overrides:
getLineCap in class DrawItem
Returns:
LineCap

setStartPoint

public void setStartPoint(Point startPoint)
Start point of the curve

If this method is called after the component has been drawn/initialized: Update the startPoint

Parameters:
startPoint - left coordinate for start point, in pixels. Default value is [0,0]

getStartPoint

public Point getStartPoint()
Start point of the curve

Returns:
Point

moveBy

public void moveBy(int x,
                   int y)
Increment start, end and control points of this curve

Overrides:
moveBy in class DrawItem
Parameters:
x - new x coordinate in pixels
y - new y coordinate in pixels

moveTo

public void moveTo(int x,
                   int y)
Sets start, end and control points of this curve

Parameters:
x - new x coordinate in pixels
y - new y coordinate in pixels