|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttwaver.core.network.BaseUI<T>
twaver.network.UI<java.lang.String>
twaver.network.LabelUI
public class LabelUI
文本标签元素,用于显示文字,默认用于网元文本标签和告警冒泡的显示,也可以用于LabelAttachment的呈现 支持文字换行,旋转时能保持文字正立
LabelAttachment
Field Summary |
---|
Fields inherited from class twaver.network.UI |
---|
elementUI |
Fields inherited from class twaver.core.network.BaseUI |
---|
anchorPoint, bodyOffsetX, bodyOffsetY, bounds, data, invalidateAnchorPointFlag, invalidateLocationFlag, invalidateRenderFlag, invalidateSizeFlag, location, stateOutline, stateOutlineColor, visible |
Constructor Summary | |
---|---|
LabelUI(ElementUI<?> elementUI)
文本标签元素,用于显示文字,默认用于网元文本标签和告警冒泡的显示,也可以用于LabelAttachment的呈现 支持文字换行,旋转时能保持文字正立 |
Method Summary | |
---|---|
protected void |
drawBodySelection(Canvas canvas,
Paint paint)
绘制主体选中效果 |
protected void |
drawText(Canvas canvas,
Paint paint)
绘制文本,支持换行,旋转时能保持文字正立 |
int |
getColor()
文本颜色 |
Typeface |
getFont()
文字字体,默认字体为 Defaults.FONT |
float |
getFontSize()
文字字体大小,默认大小为 Defaults.FONT_SIZE |
boolean |
isFitNodeHeight()
|
boolean |
isFitNodeWidth()
|
void |
measure()
|
protected void |
onDrawBody(Canvas canvas,
Paint paint,
boolean drawSelectionOnBody,
boolean drawStateOutlineOnBody)
绘制主体 |
void |
setColor(int color)
文本颜色 |
boolean |
setFitNodeHeight(boolean isFitNodeHeight)
是否适应网元的高度,该属性为true时,将使用网元高度与文本原始高度的最大值,作为文本UI的高度 |
boolean |
setFitNodeWidth(boolean isFitNodeWidth)
是否适应网元的宽度,该属性为true时,将使用网元宽度与文本原始宽度中的最大值,作为文本UI的宽度 |
boolean |
setFont(Typeface font)
设置文字字体,默认字体为 Defaults.FONT |
boolean |
setFontSize(float fontSize)
设置文字字体大小,默认大小为 Defaults.FONT_SIZE |
Methods inherited from class twaver.network.UI |
---|
drawBodyStateOutline, drawBodyStateOutline, getElementUI, getPosition, intersect, intersect, invalidateSize, isSendToBottom, resetPaint, setPosition, setSendToBottom |
Methods inherited from class twaver.core.network.BaseUI |
---|
checkBackground, checkOutline, draw, drawBackgroundAndBorder, drawBody, drawStateOutline, drawStateOutline, getAnchorPoint, getAnchorPosition, getAngle, getBackgroundColor, getBounds, getCornerRadius, getData, getLocation, getMeasuredHeight, getMeasuredWidth, getOffset, getOutlineColor, getOutlineWidth, getRenderColor, getSelectionBorder, getSelectionBorderColor, getStateOutline, getStateOutlineColor, intersectPointer, invalidateAnchorPoint, invalidateLocation, invalidatePointer, invalidateRender, isDrawBackground, isDrawOutline, isDrawStateOutline, isInvalidate, isInvalidateAnchorPoint, isInvalidateLocation, isInvalidateSize, isLayoutByAnchorPoint, isRelativeLocation, isRotatable, isSelected, isShowOnTop, isVisible, measureAnchorPosition, onDraw, onDrawBackgroundAndBorder, perLocation, resetShape, setAnchorPosition, setBackgroundColor, setBackgroundShader, setBounds, setBounds, setCornerRadius, setData, setLayoutByAnchorPoint, setLocation, setLocation, setMeasuredSize, setOffset, setOutline, setOutlineColor, setPadding, setPointerVisible, setPointerWidth, setRenderColor, setRotatable, setSelected, setSelectionBorder, setSelectionBorderColor, setShowOnTop, setStateOutline, setStateOutlineColor, setVisible, styleSelectionPaint, toAbsoluteRect, toLocalPoint, toLocalRect, validate, validateLocation, validatePointer, validateRender |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LabelUI(ElementUI<?> elementUI)
elementUI
- LabelAttachment
Method Detail |
---|
public int getColor()
setColor(int)
public void setColor(int color)
color
- getColor()
public boolean setFitNodeHeight(boolean isFitNodeHeight)
isFitNodeHeight
-
setFitNodeWidth(boolean)
,
isFitNodeHeight()
public boolean isFitNodeHeight()
setFitNodeHeight(boolean)
public boolean setFitNodeWidth(boolean isFitNodeWidth)
isFitNodeWidth
-
isFitNodeWidth()
public boolean isFitNodeWidth()
setFitNodeWidth(boolean)
public Typeface getFont()
Defaults.FONT
public boolean setFont(Typeface font)
Defaults.FONT
font
-
getFont()
public float getFontSize()
Defaults.FONT_SIZE
setFontSize(float)
public boolean setFontSize(float fontSize)
Defaults.FONT_SIZE
fontSize
-
getFontSize()
public void measure()
measure
in class twaver.core.network.BaseUI<java.lang.String>
protected void onDrawBody(Canvas canvas, Paint paint, boolean drawSelectionOnBody, boolean drawStateOutlineOnBody)
UI
onDrawBody
in class UI<java.lang.String>
drawSelectionOnBody
- 是否绘制选中效果drawStateOutlineOnBody
- 是否绘制边框UI.drawBodySelection(Canvas, Paint)
,
UI.drawBodyStateOutline(Canvas, Paint)
protected void drawBodySelection(Canvas canvas, Paint paint)
UI
drawBodySelection
in class UI<java.lang.String>
protected void drawText(Canvas canvas, Paint paint)
canvas
- paint
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |