public class VerticalTextIcon extends Object implements Icon, PropertyChangeListener
Modifier and Type | Field and Description |
---|---|
static int |
ROTATE_DEFAULT |
static int |
ROTATE_LEFT |
static int |
ROTATE_NONE |
static int |
ROTATE_RIGHT |
Constructor and Description |
---|
VerticalTextIcon(Component component,
String label)
Creates a
VTextIcon for the specified component
with the specified label . |
VerticalTextIcon(Component component,
String label,
int rotateHint)
Creates a
VTextIcon for the specified component
with the specified label . |
Modifier and Type | Method and Description |
---|---|
int |
getIconHeight()
Returns the icon's height.
|
int |
getIconWidth()
Returns the icon's width.
|
void |
paintIcon(Component c,
Graphics g,
int x,
int y)
Draw the icon at the specified location.
|
void |
propertyChange(PropertyChangeEvent e)
Checks for changes to the font on the fComponent
so that it can invalidate the layout if the size changes
|
void |
setLabel(String label)
sets the label to the given string, updating the orientation as needed
and invalidating the layout if the size changes
|
static int |
verifyRotation(String label,
int rotateHint)
verifyRotation
returns the best rotation for the string (ROTATE_NONE, ROTATE_LEFT, ROTATE_RIGHT)
This is public static so you can use it to test a string without creating a VTextIcon
from http://www.unicode.org/unicode/reports/tr9/tr9-3.html
When setting text using the Arabic script in vertical lines,
it is more common to employ a horizontal baseline that
is rotated by 90� counterclockwise so that the characters
are ordered from top to bottom.
|
public static final int ROTATE_DEFAULT
public static final int ROTATE_NONE
public static final int ROTATE_LEFT
public static final int ROTATE_RIGHT
public VerticalTextIcon(Component component, String label)
VTextIcon
for the specified component
with the specified label
.
It sets the orientation to the default for the stringverifyRotation(java.lang.String, int)
public VerticalTextIcon(Component component, String label, int rotateHint)
VTextIcon
for the specified component
with the specified label
.
It sets the orientation to the provided value if it's legal for the stringverifyRotation(java.lang.String, int)
public void setLabel(String label)
verifyRotation(java.lang.String, int)
public void propertyChange(PropertyChangeEvent e)
propertyChange
in interface PropertyChangeListener
public void paintIcon(Component c, Graphics g, int x, int y)
public int getIconWidth()
getIconWidth
in interface Icon
public int getIconHeight()
getIconHeight
in interface Icon
public static int verifyRotation(String label, int rotateHint)
Copyright © 2024 GATE. All rights reserved.