|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.essex.common.gui.util.VTextIcon
public class VTextIcon
uk.ac.essex.common.gui.util.VTextIcon is an Icon implementation which draws a short string vertically.
It's useful for JTabbedPanes with LEFT or RIGHT tabs but can be used in any
component which supports Icons, such as JLabel or JButton
You can provide a hint to indicate whether to rotate the string
to the left or right, or not at all, and it checks to make sure
that the rotation is legal for the given string
(for example, Chinese/Japanese/Korean scripts have special rules when
drawn vertically and should never be rotated)
Created Date: 20-Dec-2003
Field Summary | |
---|---|
static int |
ROTATE_DEFAULT
|
static int |
ROTATE_LEFT
|
static int |
ROTATE_NONE
|
static int |
ROTATE_RIGHT
|
Constructor Summary | |
---|---|
VTextIcon(java.awt.Component component,
java.lang.String label)
Creates a uk.ac.essex.common.gui.util.VTextIcon for the specified component
with the specified buttonLabel . |
|
VTextIcon(java.awt.Component component,
java.lang.String label,
int rotateHint)
Creates a uk.ac.essex.common.gui.util.VTextIcon for the specified component
with the specified buttonLabel . |
Method Summary | |
---|---|
int |
getIconHeight()
Returns the icon's height. |
int |
getIconWidth()
Returns the icon's width. |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Draw the icon at the specified location. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Checks for changes to the font on the fComponent so that it can invalidate the layout if the size changes |
void |
setLabel(java.lang.String label)
sets the buttonLabel to the given string, updating the orientation as needed and invalidating the layout if the size changes |
static int |
verifyRotation(java.lang.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 uk.ac.essex.common.gui.util.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ROTATE_DEFAULT
public static final int ROTATE_NONE
public static final int ROTATE_LEFT
public static final int ROTATE_RIGHT
Constructor Detail |
---|
public VTextIcon(java.awt.Component component, java.lang.String label)
uk.ac.essex.common.gui.util.VTextIcon
for the specified component
with the specified buttonLabel
.
It sets the orientation to the default for the string
verifyRotation(java.lang.String, int)
public VTextIcon(java.awt.Component component, java.lang.String label, int rotateHint)
uk.ac.essex.common.gui.util.VTextIcon
for the specified component
with the specified buttonLabel
.
It sets the orientation to the provided value if it's legal for the string
verifyRotation(java.lang.String, int)
Method Detail |
---|
public void setLabel(java.lang.String label)
verifyRotation(java.lang.String, int)
public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange
in interface java.beans.PropertyChangeListener
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public static int verifyRotation(java.lang.String label, int rotateHint)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |