|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A CompositeLabel is a multi-line area that displays text.
The CompositeLabel supports different vertical alignment modes.
The follwing table gives an overview of this modes:
| mode (constant) | description |
GraphicConstants.ALIGN_TOP |
The text starts at the top side of the CompositeLabels
bounding box.
|
GraphicConstants.ALIGN_CENTER |
The text is vertically centered whithin the CompositeLabels
bounding box.
|
GraphicConstants.ALIGN_BOTTOM |
The text ends at the bottom side of the CompositeLabels
bounding box.
|
The CompositeLabel supports different horizontal alignment
modes. The follwing table gives an overview of this modes:
| mode (constant) | description |
GraphicConstants.ALIGN_LEFT |
The text starts at the left side of the CompositeLabels
bounding box.
|
GraphicConstants.ALIGN_CENTER |
The text is horizontally centered whithin the CompositeLabels
bounding box.
|
GraphicConstants.ALIGN_RIGHT |
The text ends at the right side of the CompositeLabels
bounding box.
|
The size of the CompositeLabels bounding box can be adjusted
automatically so that it fits to the extensions of the text displayed by the
CompositeLabel. The table below gives an overview of the
different modes that are supported for the bounding box adjustment.
| mode (constant) | description |
GraphicConstants.SIZE_ADJUSTMENT_NONE |
The bounding box of the CompositeLabel is not adjusted. In this
mode the user can change the extensions of the CompositeLabels
bounding box interactively in any direction.
|
GraphicConstants.SIZE_ADJUSTMENT_LINE_COUNT |
The bounding box of the CompositeLabel is adjusted to the count
of lines. In this mode the user can change the extensions of the
CompositeLabels bounding box interactively only in the
horizontal direction.
|
GraphicConstants.SIZE_ADJUSTMENT_LINE_LENGTH |
The bounding box of the CompositeLabel is adjusted to the length
of the longest line of the displayed text. In this mode the user can change
the extensions of the CompositeLabels bounding box interactively
only in the vertical direction.
|
GraphicConstants.SIZE_ADJUSTMENT_LINE_COUNTANDLENGTH |
The bounding box of the CompositeLabel is adjusted to the count
of lines and also to the length of the longest line of the displayed text.
In this mode the user can't change the extensions of the
CompositeLabels bounding box.
|
CompositeLabel is added directly to a
CompositeView or a CompositeGroup that is added
to a CompositeView.
| Field Summary |
| Fields inherited from interface com.tensegrity.composite.BaseComposite |
DELEGATE_INFOVALUE, EVENT_MASK_MOUSE, EVENT_MASK_SELECT, GENERAL_INFOVALUE, NON_INFOVALUE |
| Fields inherited from interface com.tensegrity.generic.attribute.AttributableOnSet |
TREE_SUBSET_POSTFIX |
| Method Summary | |
void |
adjustSize()
Adjusts the size of the CompositeLabel according to the mode
that is currently set.
|
void |
adjustSize(Transform2D xform_context,
ScaleValues scalevalues)
Adjusts the size of the CompositeLabel according to the
size adjustment mode that is currently set and the given transformation
and zoom values. |
void |
enableClipping(boolean enable)
Enables or disables the clipping. |
void |
enableFirstWordCharacterWrap(boolean enable)
Enables or disables the first word character wrap. |
void |
enableLineShortening(boolean enable)
Enables or disables the line shortening. |
void |
enableWordWrap(boolean enable)
Enables or disables the word wrap. |
FontFormat |
getFont()
Returns the FontFormat that is used by the
CompositeLabel to draw text. |
int |
getHorizontalAlignment()
Returns the horizontal alignment mode currently set to the CompositeLabel. |
int |
getMarginBottom()
Returns the value for the margin from the bottom side. |
int |
getMarginLeft()
Returns the value for the margin from the left side. |
int |
getMarginRight()
Returns the value for the margin from the right side. |
int |
getMarginTop()
Returns the value for the margin from the top side. |
PaintFormat |
getPaint()
Returns the PaintFormat that is used by the
CompositeLabel to fill the background. |
int |
getSizeAdjustmentMode()
Returns the size adjustment mode currently set to the CompositeLabel. |
StrokeFormat |
getStroke()
Returns the StrokeFormat that is used by the
Primitive to draw a borders around the background. |
java.lang.String |
getText()
Returns the current text that is currently displayed by the CompositeLabel. |
TextFormatter |
getTextFormatter()
Returns the TextFormatter instance that is used by the
CompositeLabel.
|
int |
getVerticalAlignment()
Returns the vertical alignment mode currently set to the CompositeLabel. |
boolean |
isClippingEnabled()
Returns a boolean that indicates whether the clipping
is enabled or not. |
boolean |
isFirstWordCharacterWrapEnabled()
Returns a boolean that indicates whether first word
character wrap is enabled or not. |
boolean |
isLineShorteningEnabled()
Returns a boolean that indicates whether line shortening
is enabled or not. |
boolean |
isWordWrapEnabled()
Returns a boolean that indicates whether word wrap is
enabled or not. |
void |
setFont(FontFormat font)
Sets the FontFormat for the CompositeLabel. |
void |
setHorizontalAlignment(int hAlignment)
Sets the horizontal alignment mode to the value given by hAlignment. |
void |
setMarginBottom(int marginBottom)
Sets the value for the margin from the bottom side to the value given by marginBottom.
|
void |
setMarginLeft(int marginLeft)
Sets the value for the margin from the left side to the value given by marginLeft.
|
void |
setMarginRight(int marginRight)
Sets the value for the margin from the right side to the value given by marginRight.
|
void |
setMargins(int marginLeft,
int marginTop,
int marginRight,
int marginBottom)
Sets the margins for the CompositeLabel to the values given
by marginLeft, marginTop,
marginRight and marginBottom.
|
void |
setMarginTop(int marginTop)
Sets the value for the margin from the top side to the value given by marginTop.
|
void |
setPaint(PaintFormat paint)
Sets the PaintFormat for the CompositeLabel. |
void |
setSizeAdjustmentMode(int sizeAdjustmentMode)
Sets the size adjustment mode to the value given by sizeAdjustmentMode. |
void |
setStroke(StrokeFormat stroke)
Sets the StrokeFormat for the CompositeLabel. |
void |
setText(java.lang.String text)
Sets the text that is displayed by the CompositeLabel to
the String given by text. |
void |
setVerticalAlignment(int vAlignment)
Sets the vertical alignment mode to the value given by vAlignment. |
| Methods inherited from interface com.tensegrity.generic.attribute.AttributableOnSet |
addAttributableOnSetListener, areAttributableEventsEnabled, disableAttributableEvents, enableAttributableEvents, getAttributes, getAttributesTree, removeAttributableOnSetListener, setAttributes, setAttributesTree |
| Methods inherited from interface com.tensegrity.generic.attribute.Attributable |
getAttribute, getAttributeType, getAttributeValue, setAttribute, setAttributeValue |
| Methods inherited from interface com.tensegrity.graphics.interaction.BaseInteractable |
getBoundingBox, getInteractionDescriptor, getMoveItem, hits, internalEnableSelection, internalSelect, internalSetSelected, isMovable, isSelectable, isSelected, mouseClick, mouseDown, mouseEnter, mouseExit, mouseUp, postActing, preActing, select, setMovable, setSelectable, setSelected, startAction, stopAction |
| Methods inherited from interface com.tensegrity.graphics.interaction.Interactable |
calculateBoundingBox, isResizable, setResizable |
| Method Detail |
public java.lang.String getText()
CompositeLabel.
CompositeLabelpublic void setText(java.lang.String text)
CompositeLabel to
the String given by text.
text - the new text to displaypublic int getVerticalAlignment()
CompositeLabel.
public void setVerticalAlignment(int vAlignment)
vAlignment. Valid values are defined through
constants in
GraphicConstants.
CompositeLabel to
get an overview of the possible values and their meaning.
vAlignment - the new vertical alignment mode to usepublic int getHorizontalAlignment()
CompositeLabel.
public void setHorizontalAlignment(int hAlignment)
hAlignment. Valid values are defined through
constants in
GraphicConstants.
CompositeLabel to
get an overview of the possible values and their meaning.
hAlignment - the new horizontal alignment mode to usepublic int getMarginLeft()
public void setMarginLeft(int marginLeft)
marginLeft.
CompositeLabel.
marginLeft - the value for the margin from the left sidepublic int getMarginTop()
public void setMarginTop(int marginTop)
marginTop.
CompositeLabel.
marginTop - the value for the margin from the top sidepublic int getMarginRight()
public void setMarginRight(int marginRight)
marginRight.
CompositeLabel.
marginRight - the value for the margin from the right sidepublic int getMarginBottom()
public void setMarginBottom(int marginBottom)
marginBottom.
CompositeLabel.
marginBottom - the value for the margin from the bottom side
public void setMargins(int marginLeft,
int marginTop,
int marginRight,
int marginBottom)
CompositeLabel to the values given
by marginLeft, marginTop,
marginRight and marginBottom.
CompositeLabel.
marginLeft - the value for the margin from the left sidemarginTop - the value for the margin from the top sidemarginRight - the value for the margin from the right sidemarginBottom - the value for the margin from the bottom sidepublic StrokeFormat getStroke()
StrokeFormat that is used by the
Primitive to draw a borders around the background.
StrokeFormat used by the
CompositeLabelpublic void setStroke(StrokeFormat stroke)
StrokeFormat for the CompositeLabel.
stroke - the new StrokeFormat to usepublic PaintFormat getPaint()
PaintFormat that is used by the
CompositeLabel to fill the background.
PaintFormat used by the
CompositeLabelpublic void setPaint(PaintFormat paint)
PaintFormat for the CompositeLabel.
paint - the new PaintFormat to usepublic FontFormat getFont()
FontFormat that is used by the
CompositeLabel to draw text.
FontFormat used by the
CompositeLabelpublic void setFont(FontFormat font)
FontFormat for the CompositeLabel.
font - the new FontFormat to usepublic boolean isClippingEnabled()
boolean that indicates whether the clipping
is enabled or not.
public void enableClipping(boolean enable)
CompositeLabel will be
clipped away.
enable - flag that indicates whether to enable or disable the
clippingpublic boolean isLineShorteningEnabled()
boolean that indicates whether line shortening
is enabled or not.
public void enableLineShortening(boolean enable)
CompositeLabel will be truncated and replaced by three dots.
enable - flag that indicates whether to enable or disable the
line shorteningpublic boolean isWordWrapEnabled()
boolean that indicates whether word wrap is
enabled or not.
public void enableWordWrap(boolean enable)
CompositeLabel is to small to display them in the current
row.
enable - flag that indicates whether to enable or disable the
word wrappublic boolean isFirstWordCharacterWrapEnabled()
boolean that indicates whether first word
character wrap is enabled or not.
public void enableFirstWordCharacterWrap(boolean enable)
CompositeLabel is to small to display them all in one row.
enable - flag that indicates whether to enable or disable the first
word character wrappublic int getSizeAdjustmentMode()
CompositeLabel.
public void setSizeAdjustmentMode(int sizeAdjustmentMode)
sizeAdjustmentMode. Valid values are defined through
constants in
GraphicConstants.
CompositeLabel to
get an overview of the possible values and their meaning.
sizeAdjustmentMode - the new size adjustment mode to usepublic void adjustSize()
CompositeLabel according to the mode
that is currently set.
NOTICE:
The correct size can only be calculated when the
CompositeLabel is added directly to a
CompositeView or a CompositeGroup that is added
to a CompositeView.
This belongs to the fact that the correct transformation has to be
build in order to calculate the correct size.
public void adjustSize(Transform2D xform_context,
ScaleValues scalevalues)
CompositeLabel according to the
size adjustment mode that is currently set and the given transformation
and zoom values.
xform_context - the Transform2D to be usedscalevalues - the scale values for the different directions the
CompositeView has been set topublic TextFormatter getTextFormatter()
TextFormatter instance that is used by the
CompositeLabel.
TextFormatter instance used by the
CompositeLabel
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||