public class DrawLabel extends DrawItem
config, id, scClassName
Constructor and Description |
---|
DrawLabel() |
DrawLabel(com.google.gwt.core.client.JavaScriptObject jsObj) |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.core.client.JavaScriptObject |
create() |
java.lang.String |
getAlignment()
Sets the text alignment from the x position.
|
java.lang.String |
getContents()
This is the content that will exist as the label.
|
java.lang.String |
getFontFamily()
Font family name, similar to the CSS font-family attribute.
|
int |
getFontSize()
Font size in pixels, similar to the CSS font-size attribute.
|
java.lang.String |
getFontStyle()
Font style, similar to the CSS font-style attribute, eg "normal", "italic".
|
java.lang.String |
getFontWeight()
Font weight, similar to the CSS font-weight attribute, eg "normal", "bold".
|
KnobType[] |
getKnobs()
NOTE: DrawLabels do not support knobs.
|
int |
getLeft()
Sets the amount from the left of its positioning that the element should be placed.
|
java.lang.String |
getLineColor()
The text color of the label.
|
static DrawLabel |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
float |
getRotation()
Rotation in degrees.
|
int |
getTop()
Sets the amount from the top of its positioning that the element should be placed.
|
void |
moveBy(int left,
int top)
Move both the start and end points of the line by a relative amount.
|
void |
moveTo(int left,
int top)
Move the label to the absolute x, y coordinates
|
void |
rotateTo(double degrees)
Rotate the label by the absolute rotation in degrees
|
void |
rotateTo(float degrees)
Rotate the label by the absolute rotation in degrees
|
void |
setAlignment(java.lang.String alignment)
Sets the text alignment from the x position.
|
void |
setContents(java.lang.String contents)
This is the content that will exist as the label.
|
static void |
setDefaultProperties(DrawLabel drawLabelProperties)
Class level method to set the default properties of this class.
|
void |
setFontFamily(java.lang.String fontFamily)
Font family name, similar to the CSS font-family attribute.
|
void |
setFontSize(int fontSize)
Font size in pixels, similar to the CSS font-size attribute.
|
void |
setFontStyle(java.lang.String fontStyle)
Font style, similar to the CSS font-style attribute, eg "normal", "italic".
|
void |
setFontWeight(java.lang.String fontWeight)
Font weight, similar to the CSS font-weight attribute, eg "normal", "bold".
|
void |
setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj) |
void |
setKnobs(KnobType... knobs)
NOTE: DrawLabels do not support knobs.
|
void |
setLeft(int left)
Sets the amount from the left of its positioning that the element should be placed.
|
void |
setLineColor(java.lang.String lineColor)
The text color of the label.
|
void |
setRotation(float rotation)
Rotation in degrees.
|
void |
setTop(int top)
Sets the amount from the top of its positioning that the element should be placed.
|
addClickHandler, addDragMoveHandler, addDragResizeMoveHandler, addDragStartHandler, addDragStopHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMovedHandler, addResizedHandler, addShowContextMenuHandler, computeAngle, computeAngleAsDouble, dragResizeMove, draw, erase, getAttributeAsIntArray, getBoundingBox, getCanDrag, getCanHover, getCenter, getContextMenu, getCursor, getDestroyed, getDestroying, getDragStartDistance, getDrawGroup, getDrawPane, getEndArrow, getFillColor, getFillGradient, getFillOpacity, getHoverHTML, getKeepInParentRect, getLineCap, getLineOpacity, getLinePattern, getLineWidth, getMoveKnobOffset, getMoveKnobPoint, getPageLeft, getPageTop, getPrompt, getRef, getResizeKnobPoints, getScale, getShadow, getShowHover, getStartArrow, getSvgString, hide, hideKnobs, hover, isInBounds, isPointInPath, resizeBy, resizeTo, rotateBy, rotateBy, scaleBy, scaleBy, scaleTo, scaleTo, setAttribute, setCanDrag, setCanHover, setContextMenu, setCursor, setDefaultProperties, setDragStartDistance, setDrawGroup, setDrawPane, setEndArrow, setFillColor, setFillGradient, setFillOpacity, setKeepInParentRect, setKeepInParentRect, setLineCap, setLineOpacity, setLinePattern, setLineWidth, setMoveKnobOffset, setMoveKnobPoint, setPrompt, setResizeKnobPoints, setScale, setShadow, setShowHover, setStartArrow, show, showKnobs
asSGWTComponent, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getJsObj, getOrCreateJsObj, getScClassName, internalSetID, internalSetID, isCreated, onBind, onInit, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setID, setProperty, setProperty, setProperty, setProperty, setScClassName
public DrawLabel()
public DrawLabel(com.google.gwt.core.client.JavaScriptObject jsObj)
public static DrawLabel getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
setJavaScriptObject
in class DrawItem
public com.google.gwt.core.client.JavaScriptObject create()
public void setAlignment(java.lang.String alignment) throws java.lang.IllegalStateException
alignment
- . See String
. Default value is "start"java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getAlignment()
String
public void setContents(java.lang.String contents) throws java.lang.IllegalStateException
contents
- . See String
. Default value is nulljava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getContents()
String
public void setFontFamily(java.lang.String fontFamily) throws java.lang.IllegalStateException
fontFamily
- . See String
. Default value is "Tahoma"java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getFontFamily()
String
public void setFontSize(int fontSize) throws java.lang.IllegalStateException
fontSize
- fontSize Default value is 18java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic int getFontSize()
public void setFontStyle(java.lang.String fontStyle) throws java.lang.IllegalStateException
fontStyle
- . See String
. Default value is "normal"java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getFontStyle()
String
public void setFontWeight(java.lang.String fontWeight) throws java.lang.IllegalStateException
fontWeight
- . See String
. Default value is "bold"java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getFontWeight()
String
public void setKnobs(KnobType... knobs)
public KnobType[] getKnobs()
public void setLeft(int left) throws java.lang.IllegalStateException
left
- left Default value is 0java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic int getLeft()
public void setLineColor(java.lang.String lineColor)
setLineColor
in class DrawItem
lineColor
- new text color.. See CSSColor
. Default value is "#808080"public java.lang.String getLineColor()
getLineColor
in class DrawItem
CSSColor
public void setRotation(float rotation) throws java.lang.IllegalStateException
NOTE: For best results, only use rotation values 0, 90, 180, and 270 with DrawLabels.
setRotation
in class DrawItem
rotation
- rotation Default value is 0.0java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic float getRotation()
NOTE: For best results, only use rotation values 0, 90, 180, and 270 with DrawLabels.
getRotation
in class DrawItem
public void setTop(int top) throws java.lang.IllegalStateException
top
- top Default value is 0java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic int getTop()
public void moveBy(int left, int top)
public void moveTo(int left, int top)
left
- new startLeft coordinate in pixelstop
- new startTop coordinate in pixelspublic void rotateTo(float degrees)
public void rotateTo(double degrees)
public static void setDefaultProperties(DrawLabel drawLabelProperties)
Note: This method is intended for setting default attributes only and will effect 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.
drawLabelProperties
- properties that should be used as new defaults when instances of this class are created