ch.tatool.core.display.swing.matrix
Class RotatedLabelUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.LabelUI
javax.swing.plaf.basic.BasicLabelUI
ch.tatool.core.display.swing.matrix.RotatedLabelUI
- All Implemented Interfaces:
- PropertyChangeListener, EventListener
public class RotatedLabelUI
- extends BasicLabelUI
Implementation of a rotated label UI.
Currently the UI allows mirroring the content horizonally and vertically as well as rotating it by 90 degrees.
Note: The code has been inspired by http://www.codeguru.com/java/articles/199.shtml
- Author:
- Michael Ruflin
| Methods inherited from class javax.swing.plaf.basic.BasicLabelUI |
createUI, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, layoutCL, paintDisabledText, paintEnabledText, propertyChange, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mirrorHorizontally
protected boolean mirrorHorizontally
mirrorVertically
protected boolean mirrorVertically
rotateByNinty
protected boolean rotateByNinty
RotatedLabelUI
public RotatedLabelUI()
RotatedLabelUI
public RotatedLabelUI(boolean mirrorHorizontally,
boolean mirrorVertically,
boolean rotateByNinty)
getPreferredSize
public Dimension getPreferredSize(JComponent c)
- Get the preferred size for this component.
- Overrides:
getPreferredSize in class BasicLabelUI
isMirrorHorizontally
public boolean isMirrorHorizontally()
setMirrorHorizontally
public void setMirrorHorizontally(boolean mirrorHorizontally)
isMirrorVertically
public boolean isMirrorVertically()
setMirrorVertically
public void setMirrorVertically(boolean mirrorVertically)
isRotateByNinty
public boolean isRotateByNinty()
setRotateByNinty
public void setRotateByNinty(boolean rotateByNinty)
paint
public void paint(Graphics g,
JComponent c)
- Paint the component
- Overrides:
paint in class BasicLabelUI
main
public static void main(String[] args)
Copyright © 2012. All Rights Reserved.