MindFusion.Java Package Programmer's Guide
ItemLabel Members
Constructors Methods
 


The base class for node and link labels.

The following tables list the members exposed by the ItemLabel type.

 Public Constructors

  Name Description

ItemLabel

Overloaded. Initializes a new instance of the ItemLabel class.

 Public Methods

  Name Description

cancel

Called when drag operation is canceled.

getBrush

Gets the brush used to draw the label's background.

getContentPadding

Gets the distance between Image and Text when both are specified.

getEditRect

Implements InplaceEditable.getEditRect. Returns the rectangle where the in-place edit text box should appear (in document coordinates).

getEnableWrap

Gets whether the text should wrap to multiple lines.

getFont

Gets the font of the label's text.

getHorizontalAlign

Gets label's horizontal alignment relative to the pin point.

getHorizontalOffset

Gets label's horizontal offset from its pin point.

getImage

Gets the image displayed by this label.

getImageAlign

Gets the alignment of label's image relative to text.

getImageSize

Gets a size that overrides the native image size.

getImageUrl

Gets a URL used to load an image into this label.

getIndex

Gets the index of an edge or point this label is relative to.

getLocked

Gets a value indicating whether users are allowed to edit this label.

getMargin

Gets the text margins size.

getMaxWidth

Gets the maximal width that when reached should cause text to wrap to a new line.

getText

Gets the label's text.

getTextColor

Gets the color of the label's text.

getTextToEdit

Implements InplaceEditable.getTextToEdit. Returns the text that should be displayed initially when this label is edited in-place.

getVerticalAlign

Gets label's vertical alignment relative to the pin point.

getVerticalOffset

Gets label's vertical offset from its pin point.

onPointerDown

Called when the left mouse button is pressed while the pointer is over this label.

onPointerMove

Called when the mouse is moved while this label tracks the mouse events.

onPointerUp

Called when the left mouse button is released while this label tracks the mouse events.

setBrush

Sets the brush used to draw the label's background.

setContentPadding

Sets the distance between Image and Text when both are specified.

setEditedText

Implements InplaceEditable.setEditedText. Assigns the edited text to the label after in-place edit operation completes successfully

setEnableWrap

Sets whether the text should wrap to multiple lines.

setFont

Sets the font of the label's text.

setHorizontalAlign

Sets label's horizontal alignment relative to the pin point.

setHorizontalOffset

Sets label's horizontal offset from its pin point.

setImage

Sets the image displayed by this label.

setImageAlign

Sets the alignment of label's image relative to text.

setImageSize

Sets a size that overrides the native image size.

setImageUrl

Sets a URL used to load an image into this label.

setIndex

Sets the index of an edge or point this label is relative to.

setLocked

Sets a value indicating whether users are allowed to edit this label.

setMargin

Sets the text margins size.

setMaxWidth

Sets the maximal width that when reached should cause text to wrap to a new line.

setMouseCursor

Indicates what cursor to display for interactive labels.

setText

Sets the label's text.

setTextColor

Sets the color of the label's text.

setVerticalAlign

Sets label's vertical alignment relative to the pin point.

setVerticalOffset

Sets label's vertical offset from its pin point.

 Protected Methods

  Name Description

draw

Draws this label on the specified Graphics2D surface.

getItem

Returns the DiagramItem that displays this label.

getLayoutRect

Gets the label's layout rectangle calculated from text length, font and alignment.

loadFromJson

Loads the label from a JSON object.

loadFromXml

Loads the label from the specified XML element.

saveToJson

Saves the label as a JSON object.

saveToXml

Saves the label into the specified XML element.

 See Also

ItemLabel Class
com.mindfusion.diagramming Namespace