|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.view.YLabel
This class encapsulates a multi-line text label. There are specialized classes handling labels for nodes and edges.
Field Summary | |
static byte |
ALIGN_CENTER
Vertical text alignment constant. |
static byte |
ALIGN_LEFT
Vertical text alignment constant. |
static byte |
ALIGN_RIGHT
Vertical text alignment constant. |
static Insets |
defaultInsets
Default insets that define the distance between the bounding box of the label and its content. |
protected double |
height
The height of this label |
protected byte |
model
|
protected boolean |
offsetDirty
|
protected double |
offsetX
The x-coordinate of the label offset. |
protected double |
offsetY
The y-coordinate of the label offset. |
protected byte |
placement
|
protected boolean |
sizeDirty
|
protected double |
width
the width of this label. |
Constructor Summary | |
YLabel()
Instantiates a new YLabel. |
Method Summary | |
void |
adoptValues(YLabel label)
Adopts the values from the given label. |
abstract void |
calculateOffset()
Calculates the offset of this label. |
void |
calculateSize()
Calculates the size of this label |
void |
calculateSize(FontRenderContext frc)
Calculates the size of this label with the help of the given FontRenderContext. |
void |
calcUnionRect(Rectangle2D r)
Enlarges the given rectangle such that it will contain the bounding box of this label |
byte |
getAlignment()
Returns the currently set alignment style for multiple lines of label text. |
Color |
getBackgroundColor()
Returns the background color to be used for painting this label. |
abstract YRectangle |
getBox()
Returns the bounding box of this label. |
Font |
getFont()
Returns the font used for this label. |
String |
getFontName()
Returns the font name of this label. |
int |
getFontSize()
Returns the font size of this label. |
int |
getFontStyle()
Sets the font style for this label. |
double |
getHeight()
Returns the height of this label. |
Icon |
getIcon()
Returns the icon that is displayed by this label and If no icon is associated with this label null is returned. |
Insets |
getInsets()
Returns the insets for this label. |
Color |
getLineColor()
Returns the color used to draw a border around the bounding box of this label. |
abstract YPoint |
getLocation()
Returns the absolute coordinates of the labels location. |
byte |
getModel()
Returns the model specifier for this label. |
double |
getOffsetX()
Returns the x-coord of the positional offset for this label. |
double |
getOffsetY()
Returns the y-coord of the positional offset for this label. |
byte |
getPosition()
Returns the position specifier for this label. |
String |
getText()
Returns the text of this label |
Color |
getTextColor()
Returns the text color of this label. |
YPoint |
getTextLocation()
Returns the absolute coordinate of the label text. |
double |
getWidth()
Returns the with of this label. |
boolean |
intersects(double x,
double y,
double width,
double height)
Returns true iff the bounding box of this label
intersects with the given box. |
boolean |
isBackgroundOn()
Deprecated. use YLabel.getBackgroundColor() } instead |
boolean |
isBackgroundPainted()
Deprecated. use YLabel.getBackgroundColor() } instead |
boolean |
isOffsetDirty()
Returns true if the label offset is
not valid yet. |
boolean |
isSizeDirty()
Returns true if the label size is
not valid yet. |
boolean |
isVisible()
Whether of not this label is visible. |
void |
paint(Graphics2D gfx)
Paints the YLabel on the given graphics object. |
void |
read(ObjectInputStream in)
Reads in the serialized form of this label. |
void |
setAlignment(byte a)
Sets the vertical alignment style for label text that spreads over multiple lines. |
void |
setBackground(boolean b)
Deprecated. use YLabel.setBackgroundColor(Color) instead |
void |
setBackgroundColor(Color bgColor)
Sets the background color to be used. |
void |
setBackgroundPainted(boolean b)
Deprecated. use YLabel.setBackgroundColor(Color) instead |
void |
setFont(Font f)
Sets the font in which the text of this label gets displayed. |
void |
setFontName(String name)
Sets the font name of this label. |
void |
setFontSize(int s)
Sets the font size for this label. |
void |
setFontStyle(int s)
Sets the font style for this label. |
void |
setIcon(Icon icon)
Sets the icon that is displayed by this label. |
void |
setInsets(Insets insets)
Sets the insets for this label. |
void |
setLineColor(Color lineColor)
Sets the color used to draw a border around the bounding box of this label. |
void |
setModel(byte m)
Sets a model specifier fo this label. |
abstract void |
setModelParameter(Object value)
|
void |
setOffset(double x,
double y)
Sets the positional offset for this label. |
void |
setOffsetDirty()
Marks the label offsets as dirty. |
void |
setOffsetX(double x)
Sets the x-coord of the positional offset for this label. |
void |
setOffsetY(double y)
Sets the y-coord of the positional offset for this label. |
static void |
setOldStyleDrawer(boolean old)
Whether or not to use the old style drawer which was the default before yFiles version 1.3.0.2. |
void |
setPosition(byte b)
Sets a position specifier for this label. |
void |
setSize(double w,
double h)
Sets the size of this label. |
void |
setSizeDirty()
Marks the size of the label as dirty |
void |
setText(String text)
Sets the text being displayed by this label. |
void |
setTextColor(Color c)
Sets the text color of this label. |
void |
setVisible(boolean vis)
Sets the visibility state of this label. |
String |
toString()
Returns a string representation of this label. |
void |
write(ObjectOutputStream out)
Writes out this label in a serialized form. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte ALIGN_LEFT
public static final byte ALIGN_CENTER
public static final byte ALIGN_RIGHT
protected double offsetX
protected double offsetY
protected double width
protected double height
protected byte model
protected byte placement
protected boolean sizeDirty
protected boolean offsetDirty
public static final Insets defaultInsets
Constructor Detail |
public YLabel()
Method Detail |
public void paint(Graphics2D gfx)
public static void setOldStyleDrawer(boolean old)
public boolean isSizeDirty()
true
if the label size is
not valid yet.
public boolean isOffsetDirty()
true
if the label offset is
not valid yet.
public void setSizeDirty()
public void setOffsetDirty()
public abstract void calculateOffset()
public void calculateSize()
public void calculateSize(FontRenderContext frc)
public abstract YRectangle getBox()
public void setInsets(Insets insets)
public Insets getInsets()
null
will
be returned. In this case the default insets YLabel.defaultInsets
.
public void setIcon(Icon icon)
public Icon getIcon()
null
is returned.
public void setTextColor(Color c)
public Color getTextColor()
public boolean isVisible()
public void setVisible(boolean vis)
public byte getPosition()
public void setPosition(byte b)
public byte getModel()
public void setModel(byte m)
public void setBackground(boolean b)
YLabel.setBackgroundColor(Color)
instead
public void setBackgroundPainted(boolean b)
YLabel.setBackgroundColor(Color)
instead
public boolean isBackgroundOn()
YLabel.getBackgroundColor()
} instead
public boolean isBackgroundPainted()
YLabel.getBackgroundColor()
} instead
public void setBackgroundColor(Color bgColor)
public Color getBackgroundColor()
public void setLineColor(Color lineColor)
null
is given as an argument.
By default no border will be drawn.
public Color getLineColor()
YLabel.setLineColor(Color)
public void setText(String text)
public String getText()
public void setOffset(double x, double y)
public void setOffsetX(double x)
public void setOffsetY(double y)
public double getOffsetX()
public double getOffsetY()
public void setAlignment(byte a)
ALIGN_CENTER
is set.
YLabel.ALIGN_LEFT
,
YLabel.ALIGN_CENTER
,
YLabel.ALIGN_RIGHT
public byte getAlignment()
YLabel.setAlignment(byte)
public abstract YPoint getLocation()
public YPoint getTextLocation()
public boolean intersects(double x, double y, double width, double height)
true
iff the bounding box of this label
intersects with the given box.
public void calcUnionRect(Rectangle2D r)
public abstract void setModelParameter(Object value)
public void setSize(double w, double h)
public double getWidth()
public double getHeight()
public String toString()
toString
in class Object
public Font getFont()
public void setFont(Font f)
public void setFontName(String name)
public String getFontName()
public int getFontSize()
public void setFontSize(int s)
public int getFontStyle()
public void setFontStyle(int s)
public void adoptValues(YLabel label)
public void write(ObjectOutputStream out) throws IOException
IOException
public void read(ObjectInputStream in) throws IOException, ClassNotFoundException
YLabel.write(ObjectOutputStream)
method.
IOException
ClassNotFoundException
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |