ch.tatool.core.display.swing.matrix
Class RotatedLabelUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.LabelUI
          extended by javax.swing.plaf.basic.BasicLabelUI
              extended by 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

Field Summary
protected  boolean mirrorHorizontally
           
protected  boolean mirrorVertically
           
protected  boolean rotateByNinty
           
 
Fields inherited from class javax.swing.plaf.basic.BasicLabelUI
labelUI
 
Constructor Summary
RotatedLabelUI()
           
RotatedLabelUI(boolean mirrorHorizontally, boolean mirrorVertically, boolean rotateByNinty)
           
 
Method Summary
 Dimension getPreferredSize(JComponent c)
          Get the preferred size for this component.
 boolean isMirrorHorizontally()
           
 boolean isMirrorVertically()
           
 boolean isRotateByNinty()
           
static void main(String[] args)
           
 void paint(Graphics g, JComponent c)
          Paint the component
 void setMirrorHorizontally(boolean mirrorHorizontally)
           
 void setMirrorVertically(boolean mirrorVertically)
           
 void setRotateByNinty(boolean rotateByNinty)
           
 
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 javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mirrorHorizontally

protected boolean mirrorHorizontally

mirrorVertically

protected boolean mirrorVertically

rotateByNinty

protected boolean rotateByNinty
Constructor Detail

RotatedLabelUI

public RotatedLabelUI()

RotatedLabelUI

public RotatedLabelUI(boolean mirrorHorizontally,
                      boolean mirrorVertically,
                      boolean rotateByNinty)
Method Detail

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.