|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.YLabel
public abstract class YLabel
This class encapsulates a multi-line text label. There are specialized classes handling labels for nodes and edges.
Nested Class Summary | |
---|---|
static interface |
YLabel.BoundsProvider
The interface that is used by a specific label configuration that calculates the union bounds of a label and a given rectangle. |
static class |
YLabel.Factory
This class is used for managing the different configurations for YLabel
instances. |
static interface |
YLabel.Layout
The interface that is used by a specific label configuration that calculates the layout size and determines whether a given point is contained in a label's geometry. |
static interface |
YLabel.Painter
The interface that is used by a specific label configuration that performs the painting. |
static interface |
YLabel.SelectionChangeHandler
This interface is used by YLabel to notify interested
parties of selection state changes. |
static interface |
YLabel.UserDataHandler
This interface is used during YGF serialization to delegate the copying and serialization/deserialization of any user-defined data to. |
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 byte |
AUTOSIZE_CONTENT
Automatic size calculation policy specifier. |
static byte |
AUTOSIZE_NONE
Automatic size calculation policy specifier. |
static byte |
BOTTOM_TEXT_POSITION
Vertical text position specifier that places text below the icon. |
static byte |
CENTER_TEXT_POSITION
Vertical and horizontal text position specifier that aligns the center of text and icon either vertically or horizontally. |
protected double |
contentHeight
(including icons, text, etc, rotation not included!) |
protected double |
contentWidth
(including icons, text, etc, rotation not included!) |
static java.awt.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 (including icons, text, etc, rotation considered) |
static byte |
LEFT_ALIGNED_TEXT_POSITION
Horizontal text position specifier that aligns the left border of the icon and the text. |
static byte |
LEFT_TEXT_POSITION
Horizontal text position specifier that places text to the left of the icon. |
protected byte |
model
The model constant for the label model. |
protected boolean |
offsetDirty
Whether the offset of the label is up to date or not. |
protected OrientedRectangle |
offsetRectangle
The relative, oriented label bounds. |
protected byte |
placement
The placement constant for the label model. |
static byte |
RIGHT_ALIGNED_TEXT_POSITION
Horizontal text position specifier that aligns the right border of the icon and the text. |
static byte |
RIGHT_TEXT_POSITION
Horizontal text position specifier that places text to the right of the icon. |
protected boolean |
sizeDirty
Whether the size of the label is up to date or not. |
static byte |
TOP_TEXT_POSITION
Vertical text position specifier that places text above the icon. |
protected double |
width
the width of this label. |
Constructor Summary | |
---|---|
protected |
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(java.awt.font.FontRenderContext frc)
Calculates the size of this label with the help of the given FontRenderContext. |
void |
calcUnionRect(java.awt.geom.Rectangle2D r)
Enlarges the given rectangle such that it will contain the bounding box of this label. |
boolean |
contains(double x,
double y)
Determines whether the given point in world coordinates is contained within the label's graphics. |
byte |
getAlignment()
Returns the currently set alignment style for multiple lines of label text. |
byte |
getAutoSizePolicy()
Returns the currently set automatic size calculation policy for this label. |
java.awt.Color |
getBackgroundColor()
Returns the background color to be used for painting this label. |
abstract java.lang.Object |
getBestModelParameterForBounds(OrientedRectangle bounds)
Returns the best model parameter for this label such that the label's oriented bounds will match the specified bounds
as closely as possible within the label's current label model. |
YRectangle |
getBox()
Returns the bounding box of this label. |
java.lang.String |
getConfiguration()
Returns the string identifier of the current configuration this label is in. |
OrientedRectangle |
getContentBox()
Returns the label's content box. |
double |
getContentHeight()
Gets the height of the content area. |
double |
getContentWidth()
Gets the width of the content area. |
java.awt.Font |
getFont()
Returns the font used for this label. |
java.lang.String |
getFontName()
Returns the name of the label's font. |
int |
getFontSize()
Returns the point size of the label's font |
int |
getFontStyle()
Returns the font style for this label. |
double |
getHeight()
Returns the height of the bounding box of this label. |
byte |
getHorizontalTextPosition()
Returns the horizontal position of text relative to the icon. |
javax.swing.Icon |
getIcon()
Returns the icon that is displayed by this label and If no icon is associated with this label null is returned. |
OrientedRectangle |
getIconBox()
Returns the oriented bounds of the label's icon in the coordinate space of the label's content box . |
YPoint |
getIconLocation()
Returns the absolute coordinate of the upper left corner of the label icon's paraxial bounding box. |
byte |
getIconTextGap()
Returns the gap between text and icon |
java.awt.Insets |
getInsets()
Returns the insets for this label. |
java.awt.Color |
getLineColor()
Returns the color used to draw a border around the bounding box of this label. |
YPoint |
getLocation()
Returns the absolute coordinate of the upper left corner of this label's paraxial bounding box. |
byte |
getModel()
Returns the model specifier for this label. |
OrientedRectangle |
getOffset()
Determines the oriented offset rectangle of this label. |
double |
getOffsetX()
Returns the x-coordinate of the offset of the label's paraxial bounding box. |
double |
getOffsetY()
Returns the y-coordinate of the offset of the label's paraxial bounding box. |
abstract OrientedRectangle |
getOrientedBox()
Returns the label's oriented bounding box as determined by its label model before applying the label's inherent rotation . |
byte |
getPosition()
Returns the position specifier for this label. |
double |
getRotationAngle()
Returns the rotation angle for this label. |
java.lang.String |
getText()
Returns the text of this label |
OrientedRectangle |
getTextBox()
Returns the oriented bounds of the label's text in the coordinate space of the label's content box . |
java.awt.Color |
getTextColor()
Returns the text color of this label. |
YPoint |
getTextLocation()
Returns the absolute coordinate of the upper left corner of the label text's paraxial bounding box. |
java.lang.Object |
getUserData()
Retrieves the user data object that can be used by the configurations . |
byte |
getVerticalTextPosition()
Returns the vertical position of text relative ot the icon. |
double |
getWidth()
Returns the width of the bounding box of this label. |
void |
internalSetAutoSizePolicy(byte autoSize)
This method is for internal use only and shall not be used by developers. |
void |
internalSetOffsetDirty(boolean dirty)
This method is for internal use only and shall not be used by developers. |
void |
internalSetSizeDirty(boolean dirty)
This method is for internal use only and shall not be used by developers. |
boolean |
intersects(double x,
double y,
double width,
double height)
Returns true iff the bounding box of this label
intersects with the given box. |
static boolean |
isFractionMetricsForSizeCalculationEnabled()
Returns whether or not fractional font metrics shall be used to calculate the size of the label text. |
boolean |
isOffsetDirty()
Returns true if the label offset is
not valid yet. |
boolean |
isSelected()
Whether or not this label is in a selected state. |
boolean |
isSizeDirty()
Returns true if the label size is
not valid yet. |
boolean |
isUnderlinedTextEnabled()
Returns whether or not the text of the label should be underlined. |
boolean |
isVisible()
Whether of not this label is visible. |
void |
paint(java.awt.Graphics2D gfx)
Paints the YLabel on the given graphics object. |
protected void |
paintBox(java.awt.Graphics2D gfx,
double x,
double y,
double width,
double height)
Paints the background of the label into the graphics context. |
protected void |
paintContent(java.awt.Graphics2D gfx,
double x,
double y,
double width,
double height)
Paints the contents of the label into the graphics context. |
protected void |
paintImpl(java.awt.Graphics2D gfx,
double x,
double y,
double width,
double height)
Called by paint(java.awt.Graphics2D)
Calls paintBox(java.awt.Graphics2D, double, double, double, double)
and paintContent(java.awt.Graphics2D, double, double, double, double)
in order. |
void |
read(java.io.ObjectInputStream in)
Deprecated. Use the GraphML format instead. |
abstract void |
repaint()
Triggers a repaint of the bounds in the views for this label. |
void |
setAlignment(byte a)
Sets the vertical alignment style for label text that spreads over multiple lines. |
void |
setAutoSizePolicy(byte autoSize)
Sets the automatic size calculation policy for this label. |
void |
setBackgroundColor(java.awt.Color bgColor)
Sets the background color to be used. |
abstract void |
setConfiguration(java.lang.String name)
Configures this instance to use the configuration specified by the given name. |
void |
setContentHeight(double contentHeight)
Sets the height of the content area. |
void |
setContentSize(double width,
double height)
Sets the size of the content area of this label and updates the width and height properties according
to the current rotation angle . |
void |
setContentWidth(double contentWidth)
Sets the width of the content area. |
void |
setFont(java.awt.Font f)
Sets the font in which the text of this label gets displayed. |
void |
setFontName(java.lang.String name)
Sets a new font with the specified name for the label. |
void |
setFontSize(int s)
Sets the point size for the label's font. |
void |
setFontStyle(int s)
Sets the font style for this label. |
static void |
setFractionMetricsForSizeCalculationEnabled(boolean fractionalFontMetricsEnabled)
Sets whether or not fractional font metrics shall be used to calculate the size of the label text. |
void |
setHorizontalTextPosition(byte pos)
Sets the horizontal position of text relative to the icon. |
static void |
setHTMLRenderingEnabled(boolean enabled)
Whether or not to enable HTML rendering for labels whose text starts with the html tag <html>. |
void |
setIcon(javax.swing.Icon icon)
Sets the icon that is displayed by this label. |
void |
setIconTextGap(byte gap)
Sets the size of the gap between text and icon |
void |
setInsets(java.awt.Insets insets)
Sets the insets for this label. |
void |
setLineColor(java.awt.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 for this label. |
abstract void |
setModelParameter(java.lang.Object value)
Sets the current parameters for the label model implementation. |
void |
setOffset(double x,
double y)
Deprecated. Client code should not set a label's offset directly, but rather use getBestModelParameterForBounds(y.geom.OrientedRectangle) and
setModelParameter(Object) to create and specify a parameter that
represents the desired label position in the label's model. |
void |
setOffset(OrientedRectangle offsetRectangle)
Sets the oriented offset rectangle for this label. |
void |
setOffsetDirty()
Marks the label offsets as dirty. |
void |
setOffsetX(double x)
Deprecated. Client code should not set a label's offset directly, but rather use getBestModelParameterForBounds(y.geom.OrientedRectangle) and
setModelParameter(Object) to create and specify a parameter that
represents the desired label position in the label's model. |
void |
setOffsetY(double y)
Deprecated. Client code should not set a label's offset directly, but rather use getBestModelParameterForBounds(y.geom.OrientedRectangle) and
setModelParameter(Object) to create and specify a parameter that
represents the desired label position in the label's model. |
void |
setPosition(byte b)
Sets a position specifier for this label. |
void |
setRotationAngle(double angle)
Sets the rotation angle for this label. |
void |
setSelected(boolean s)
Sets the selected state of this label. |
void |
setSizeDirty()
Marks the size of the label as dirty |
void |
setText(java.lang.String text)
Sets the text being displayed by this label. |
void |
setTextColor(java.awt.Color c)
Sets the text color of this label. |
void |
setUnderlinedTextEnabled(boolean u)
Sets whether or not to underline the text of the label |
void |
setUserData(java.lang.Object userData)
Sets the user data object that can be used by the configurations . |
void |
setVerticalTextPosition(byte pos)
Sets the vertical position of text relative to the icon. |
void |
setVisible(boolean vis)
Sets the visibility state of this label. |
java.lang.String |
toString()
Returns a string representation of this label. |
OrientedRectangle |
transformCTW(OrientedRectangle box)
Transforms the specified rectangle from the coordinate space of this label's content box into world/graph coordinates. |
void |
write(java.io.ObjectOutputStream out)
Deprecated. Use the GraphML format instead. |
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
public static final byte TOP_TEXT_POSITION
setVerticalTextPosition(byte)
,
Constant Field Valuespublic static final byte CENTER_TEXT_POSITION
setVerticalTextPosition(byte)
,
setHorizontalTextPosition(byte)
,
Constant Field Valuespublic static final byte BOTTOM_TEXT_POSITION
setVerticalTextPosition(byte)
,
Constant Field Valuespublic static final byte LEFT_TEXT_POSITION
setHorizontalTextPosition(byte)
,
Constant Field Valuespublic static final byte RIGHT_TEXT_POSITION
setHorizontalTextPosition(byte)
,
Constant Field Valuespublic static final byte LEFT_ALIGNED_TEXT_POSITION
setHorizontalTextPosition(byte)
,
Constant Field Valuespublic static final byte RIGHT_ALIGNED_TEXT_POSITION
setHorizontalTextPosition(byte)
,
Constant Field Valuesprotected OrientedRectangle offsetRectangle
protected double width
protected double height
protected double contentWidth
protected double contentHeight
protected byte model
protected byte placement
protected boolean sizeDirty
protected boolean offsetDirty
public static final byte AUTOSIZE_CONTENT
YLabel.Layout
implementation should use its own logic to
determine the content size
.
getAutoSizePolicy()
,
setAutoSizePolicy(byte)
,
Constant Field Valuespublic static final byte AUTOSIZE_NONE
setContentSize(double, double)
method to
specify the desired size of the content of the label.
In that case the YLabel.Layout
implementation should use the getContentWidth()
and getContentHeight()
to determine the size.
getAutoSizePolicy()
,
setAutoSizePolicy(byte)
,
Constant Field Valuespublic static final java.awt.Insets defaultInsets
Constructor Detail |
---|
protected YLabel()
Method Detail |
---|
public java.lang.Object getUserData()
configurations
.
YLabel.UserDataHandler
public void setUserData(java.lang.Object userData)
configurations
.
userData
- the new user data objectYLabel.UserDataHandler
public double getContentWidth()
getWidth()
public void setContentWidth(double contentWidth)
YLabel.Layout
implementation for this label
if auto size policy
is set to AUTOSIZE_NONE
.
contentWidth
- the new width of the contentpublic OrientedRectangle getContentBox()
contentWidth
and contentHeight
, and
whose orientation is calculated by rotating the label's oriented box
orientation according to the label's rotation angle.
getOrientedBox()
,
getRotationAngle()
,
getContentWidth()
,
getContentHeight()
public boolean isSelected()
false
.
public void setSelected(boolean s)
false
.
isSelected()
public double getContentHeight()
getHeight()
public void setContentHeight(double contentHeight)
YLabel.Layout
implementation for this label
if auto size policy
is set to AUTOSIZE_NONE
.
contentHeight
- the new height of the contentpublic void setContentSize(double width, double height)
width
and height
properties according
to the current rotation angle
.
Calling this method without specifying the AUTOSIZE_NONE
value for the
auto size policy
will not result in the desired effect.
This method will be called by implementations of the YLabel.Layout
interface as
a response to the YLabel.Layout.calculateContentSize(YLabel, java.awt.font.FontRenderContext)
method.
width
- the width of the content areaheight
- the height of the content areaAUTOSIZE_NONE
public void paint(java.awt.Graphics2D gfx)
configuration
to perform the actual painting in YLabel.Painter.paint(YLabel, java.awt.Graphics2D)
.
The default implementation
will then configure the graphics context to consider rotation
and call paintImpl(java.awt.Graphics2D, double, double, double, double)
.
gfx
- the context to paint intoprotected void paintBox(java.awt.Graphics2D gfx, double x, double y, double width, double height)
paintImpl(java.awt.Graphics2D, double, double, double, double)
, which
itself gets called by paint(java.awt.Graphics2D)
This implementation delegates to the configuration
to perform the actual painting in YLabel.Painter.paintBox(YLabel, java.awt.Graphics2D, double, double, double, double)
.
gfx
- the graphics context (pre-configured to consider rotationx
- the top left x-coordinate of the drawing areay
- the top left y-coordinate of the drawing areawidth
- the width of the drawing areaheight
- the height of the drawing areapublic boolean contains(double x, double y)
getBox()
.
This implementation delegates to the configuration
to perform the check in YLabel.Layout.contains(YLabel, double, double)
.
x
- the x world coordinate to checky
- the x world coordinate to check
protected void paintContent(java.awt.Graphics2D gfx, double x, double y, double width, double height)
paintImpl(java.awt.Graphics2D, double, double, double, double)
, which
itself gets called by paint(java.awt.Graphics2D)
This implementation delegates to the configuration
to perform the actual painting in YLabel.Painter.paintContent(YLabel, java.awt.Graphics2D, double, double, double, double)
.
gfx
- the graphics context (pre-configured to consider rotationx
- the top left x-coordinate of the drawing areay
- the top left y-coordinate of the drawing areawidth
- the width of the drawing areaheight
- the height of the drawing areaprotected void paintImpl(java.awt.Graphics2D gfx, double x, double y, double width, double height)
paint(java.awt.Graphics2D)
Calls paintBox(java.awt.Graphics2D, double, double, double, double)
and paintContent(java.awt.Graphics2D, double, double, double, double)
in order.
gfx
- the graphics context (pre-configured to consider rotation)x
- the top left x-coordinate of the drawing areay
- the top left y-coordinate of the drawing areawidth
- the width of the drawing areaheight
- the height of the drawing areapublic static void setHTMLRenderingEnabled(boolean enabled)
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 final void internalSetSizeDirty(boolean dirty)
setSizeDirty()
instead.
public void setOffsetDirty()
public final void internalSetOffsetDirty(boolean dirty)
setOffsetDirty()
instead.
public abstract void calculateOffset()
public void calculateSize()
public void calculateSize(java.awt.font.FontRenderContext frc)
public final YRectangle getBox()
public abstract OrientedRectangle getOrientedBox()
rotation
.
The oriented box is given in absolute world coordinates.
getContentBox()
public abstract void repaint()
getBox()
,
View.updateView(double, double, double, double)
public void setVerticalTextPosition(byte pos)
pos
- one of TOP_TEXT_POSITION
, CENTER_TEXT_POSITION
and BOTTOM_TEXT_POSITION
.public byte getVerticalTextPosition()
setVerticalTextPosition(byte)
public void setHorizontalTextPosition(byte pos)
pos
- one of LEFT_TEXT_POSITION
, CENTER_TEXT_POSITION
and RIGHT_TEXT_POSITION
.public byte getHorizontalTextPosition()
setHorizontalTextPosition(byte)
public void setIconTextGap(byte gap)
public byte getIconTextGap()
public void setUnderlinedTextEnabled(boolean u)
public boolean isUnderlinedTextEnabled()
public void setRotationAngle(double angle)
public double getRotationAngle()
setRotationAngle(double)
public void setInsets(java.awt.Insets insets)
public java.awt.Insets getInsets()
null
will
be returned. In this case the default insets defaultInsets
will be used.
public void setIcon(javax.swing.Icon icon)
public javax.swing.Icon getIcon()
null
is returned.
public void setTextColor(java.awt.Color c)
public java.awt.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 setBackgroundColor(java.awt.Color bgColor)
public java.awt.Color getBackgroundColor()
public void setLineColor(java.awt.Color lineColor)
null
is given as an argument.
By default no border will be drawn.
public java.awt.Color getLineColor()
setLineColor(Color)
public void setText(java.lang.String text)
public java.lang.String getText()
public void setOffset(OrientedRectangle offsetRectangle)
Note:
Client code should not set a label's offset directly, but rather use
getBestModelParameterForBounds(y.geom.OrientedRectangle)
and
setModelParameter(Object)
to create and specify a parameter that
represents the desired label position in the label's model.
offsetRectangle
- the new relative, oriented bounds of the rectangle.
Must not be null
!getOffset()
public OrientedRectangle getOffset()
setOffset(y.geom.OrientedRectangle)
public double getOffsetX()
public double getOffsetY()
public void setOffsetX(double x)
getBestModelParameterForBounds(y.geom.OrientedRectangle)
and
setModelParameter(Object)
to create and specify a parameter that
represents the desired label position in the label's model.
x
- the x-coordinate of the paraxial offset box.public void setOffsetY(double y)
getBestModelParameterForBounds(y.geom.OrientedRectangle)
and
setModelParameter(Object)
to create and specify a parameter that
represents the desired label position in the label's model.
y
- the y-coordinate of the paraxial offset box.public void setOffset(double x, double y)
getBestModelParameterForBounds(y.geom.OrientedRectangle)
and
setModelParameter(Object)
to create and specify a parameter that
represents the desired label position in the label's model.
setOffset(new OrientedRectangle(x, y + height, width, height));
x
- the x-offset of the upper left corner of a paraxial rectangle.y
- the y-offset of the upper left corner of a paraxial rectangle.public YPoint getLocation()
public void setAlignment(byte a)
ALIGN_CENTER
is set.
ALIGN_LEFT
,
ALIGN_CENTER
,
ALIGN_RIGHT
public byte getAlignment()
setAlignment(byte)
public YPoint getTextLocation()
return transformCTW(getTextBox()).getBoundingBox().getLocation();
public OrientedRectangle getTextBox()
content box
. The origin of said
coordinate space is the content box's anchor point, the x-direction is
(-uy, ux)
and the y-direction is -(ux, uy)
with the content box's up vector (ux, uy)
.
Use transformCTW(y.geom.OrientedRectangle)
to determine the
text bounds in (absolute) world coordinates.
Note: This method is not used to calculate the text placement in the label, but rather provides a means to query the label for text position and orientation.
getContentBox()
,
transformCTW(y.geom.OrientedRectangle)
public YPoint getIconLocation()
return transformCTW(getIconBox()).getBoundingBox().getLocation();
public OrientedRectangle getIconBox()
content box
. The origin of said
coordinate space is the content box's anchor point, the x-direction is
(-uy, ux)
and the y-direction is -(ux, uy)
with the content box's up vector (ux, uy)
.
Use transformCTW(y.geom.OrientedRectangle)
to determine the
icon bounds in (absolute) world coordinates.
Note: This method is not used to calculate the icon placement in the label, but rather provides a means to query the label for icon position and orientation.
getContentBox()
,
transformCTW(y.geom.OrientedRectangle)
public OrientedRectangle transformCTW(OrientedRectangle box)
content box
into world/graph coordinates.
box
- an oriented rectangle whose anchor point and up vector are
interpreted in the coordinate space of this label's content box. I.e.
the origin of said coordinate space is the content box's anchor point,
the x-direction is (-uy, ux)
and the y-direction is
(-ux, -uy)
with the content box's up vector
(ux, uy)
.
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(java.awt.geom.Rectangle2D r)
YLabel.BoundsProvider
instance
registered with this instance's configuration
.
public abstract void setModelParameter(java.lang.Object value)
public abstract java.lang.Object getBestModelParameterForBounds(OrientedRectangle bounds)
oriented bounds
will match the specified bounds
as closely as possible within the label's current label model. This method
will return null
if no suitable parameter can be determined.
bounds
- the desired label bounds in absolute world coordinates.
null
if no suitable model parameter could
be determined.public double getWidth()
getContentWidth()
yields the width of the content area of the label.
public double getHeight()
getContentHeight()
yields the height of the content area of the label.
public java.lang.String toString()
toString
in class java.lang.Object
public java.awt.Font getFont()
public void setFont(java.awt.Font f)
public java.lang.String getFontName()
public void setFontName(java.lang.String name)
name
- the name of the label's new font. This can be a logical font
name or a font face name.Font.Font(String, int, int)
public int getFontSize()
public void setFontSize(int s)
s
- the point size of the label's font.Font.Font(String, int, int)
public int getFontStyle()
Font.PLAIN
, or a bitwise union of
Font.BOLD
and/or Font.ITALIC
.
Font.Font(String, int, int)
public void setFontStyle(int s)
s
- the style mask for the label's font.
The style argument is an integer bit mask that may be
Font.PLAIN
, or a bitwise union of
Font.BOLD
and/or Font.ITALIC
.Font.Font(String, int, int)
public void adoptValues(YLabel label)
public void write(java.io.ObjectOutputStream out) throws java.io.IOException
GraphML format
instead.
java.io.IOException
public void read(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
GraphML format
instead.
write(ObjectOutputStream)
method.
java.io.IOException
java.lang.ClassNotFoundException
public abstract void setConfiguration(java.lang.String name)
NodeLabel.getFactory()
and EdgeLabel.getFactory()
respectively.
name
- the name of the configuration as it has been specified in YLabel.Factory.addConfiguration(String, java.util.Map)
YLabel.Factory
,
YLabel.Factory.addConfiguration(String, java.util.Map)
public java.lang.String getConfiguration()
null
if no specific configuration is used.setConfiguration(String)
,
YLabel.Factory
public void setAutoSizePolicy(byte autoSize)
AUTOSIZE_CONTENT
is set.
autoSize
- one of the specifiers AUTOSIZE_CONTENT
or
AUTOSIZE_NONE
.public void internalSetAutoSizePolicy(byte autoSize)
setAutoSizePolicy(byte)
instead.
public byte getAutoSizePolicy()
setAutoSizePolicy(byte).
public static void setFractionMetricsForSizeCalculationEnabled(boolean fractionalFontMetricsEnabled)
Graph2DView
.
By default, this feature is turned off.
Graph2DView.getRenderingHints()
,
RenderingHints.KEY_FRACTIONALMETRICS
public static boolean isFractionMetricsForSizeCalculationEnabled()
Graph2DView
.
By default, this feature is turned off.
Graph2DView.getRenderingHints()
,
RenderingHints.KEY_FRACTIONALMETRICS
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |