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.
|
Point |
getCenter()
Get the center point of the label.
|
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()
Deprecated.
|
double |
getRotationAsDouble()
Rotation in degrees.
|
int |
getTop()
Sets the amount from the top of its positioning that the element should be placed.
|
void |
moveBy(int dX,
int dY)
|
void |
moveTo(int left,
int top)
Move the label to the absolute x, y coordinates
|
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 |
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(double rotation)
Rotation in degrees.
|
void |
setRotation(float rotation)
Deprecated.
|
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, getBoundingBoxAsDouble, getCanDrag, getCanHover, getContextMenu, getCursor, getDestroyed, getDestroying, getDragStartDistance, getDrawGroup, getDrawPane, getEndArrow, getEventOpaque, getFillColor, getFillGradient, getFillGradientAsString, getFillOpacity, getHoverDelay, getHoverHTML, getKeepInParentRect, getLineCap, getLineOpacity, getLinePattern, getLineWidth, getMoveKnobOffset, getMoveKnobPoint, getPageLeft, getPageTop, getPrompt, getRef, getResizeKnobPoints, getScale, getShadow, getShowHover, getStartArrow, getSvgString, hide, hideKnobs, hideKnobs, hover, isInBounds, isPointInPath, resizeBy, resizeTo, rotateBy, rotateTo, scaleBy, scaleTo, setAttribute, setAttribute, setCanDrag, setCanHover, setContextMenu, setCursor, setDefaultProperties, setDragStartDistance, setDrawGroup, setDrawPane, setEndArrow, setEventOpaque, setFillColor, setFillGradient, setFillGradient, setFillOpacity, setHoverDelay, setKeepInParentRect, setKeepInParentRect, setLineCap, setLineOpacity, setLinePattern, setLineWidth, setMoveKnobOffset, setMoveKnobPoint, setPrompt, setResizeKnobPoints, setScale, setShadow, setShowHover, setStartArrow, show, showKnobs, showKnobs, supportsEndArrow, supportsStartArrow
asSGWTComponent, createJsObj, 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, hasAutoAssignedID, internalSetID, internalSetID, isCreated, onBind, onInit, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setID, setJavaScriptObject, 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 com.google.gwt.core.client.JavaScriptObject create()
public void setAlignment(java.lang.String alignment) throws java.lang.IllegalStateException
alignment
- Default value is "start"java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getAlignment()
public void setContents(java.lang.String contents)
contents
.contents
- the new contents.. Default value is nullpublic java.lang.String getContents()
public void setFontFamily(java.lang.String fontFamily) throws java.lang.IllegalStateException
fontFamily
- Default value is "Tahoma"java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getFontFamily()
public void setFontSize(int fontSize)
fontSize
.fontSize
- the new font size in pixels.. Default value is 18public int getFontSize()
public void setFontStyle(java.lang.String fontStyle) throws java.lang.IllegalStateException
fontStyle
- Default value is "normal"java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getFontStyle()
public void setFontWeight(java.lang.String fontWeight) throws java.lang.IllegalStateException
fontWeight
- Default value is "bold"java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getFontWeight()
public void setKnobs(KnobType... knobs) throws java.lang.IllegalStateException
public KnobType[] getKnobs()
public void setLeft(int left) throws java.lang.IllegalStateException
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
GwtFloatVsDouble
NOTE: In Internet Explorer 8 and earlier, only rotation by 0 or 90 degrees is supported.
setRotation
in class DrawItem
rotation
- Default value is 0.0java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic float getRotation()
GwtFloatVsDouble
NOTE: In Internet Explorer 8 and earlier, only rotation by 0 or 90 degrees is supported.
getRotation
in class DrawItem
public void setRotation(double rotation) throws java.lang.IllegalStateException
NOTE: In Internet Explorer 8 and earlier, only rotation by 0 or 90 degrees is supported.
setRotation
in class DrawItem
rotation
- Default value is 0.0java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic double getRotationAsDouble()
NOTE: In Internet Explorer 8 and earlier, only rotation by 0 or 90 degrees is supported.
getRotationAsDouble
in class DrawItem
public void setTop(int top) throws java.lang.IllegalStateException
top
- Default value is 0java.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic int getTop()
public Point getCenter()
public void moveBy(int dX, int dY)
public void moveTo(int left, int top)
left
- new startLeft coordinate in pixelstop
- new startTop coordinate in pixelspublic static void setDefaultProperties(DrawLabel drawLabelProperties)
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.
drawLabelProperties
- properties that should be used as new defaults when instances of this class are created