jmri.util.swing
Class VerticalLabelUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.LabelUI
          extended by javax.swing.plaf.basic.BasicLabelUI
              extended by jmri.util.swing.VerticalLabelUI
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class VerticalLabelUI
extends BasicLabelUI

Allows a JLabel to be displayed vertically, with a defined orientation. Usage (for a vertical label with anti-clockwise orientation):
JLabel label = new JLabel("Vertical Label");
label.setUI(new VerticalLabelUI(VerticalLabelUI.ANTICLOCKWISE));


This file is part of JMRI.

JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Author:
Matthew Harris copyright (c) 2010

Field Summary
static int ANTICLOCKWISE
          Define Anti-Clockwise rotation (-90 degrees from horizontal)
static int CLOCKWISE
          Define Clockwise rotation (+90 degrees from horizontal)
 
Fields inherited from class javax.swing.plaf.basic.BasicLabelUI
labelUI
 
Constructor Summary
VerticalLabelUI()
          Default constructor which provides a vertical label with anti-clockwise orientation
VerticalLabelUI(int rotation)
          Constructor used to provide a vertical label of the specified orientation
 
Method Summary
static ComponentUI createUI(JComponent component)
          Return default VerticalLabelUI instance
 Dimension getPreferredSize(JComponent component)
           
 void paint(Graphics graphics, JComponent component)
           
 
Methods inherited from class javax.swing.plaf.basic.BasicLabelUI
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

CLOCKWISE

public static final int CLOCKWISE
Define Clockwise rotation (+90 degrees from horizontal)

See Also:
Constant Field Values

ANTICLOCKWISE

public static final int ANTICLOCKWISE
Define Anti-Clockwise rotation (-90 degrees from horizontal)

See Also:
Constant Field Values
Constructor Detail

VerticalLabelUI

public VerticalLabelUI()
Default constructor which provides a vertical label with anti-clockwise orientation


VerticalLabelUI

public VerticalLabelUI(int rotation)
Constructor used to provide a vertical label of the specified orientation

Parameters:
rotation - defines the rotation:
CLOCKWISE or
ANTICLOCKWISE
Method Detail

getPreferredSize

public Dimension getPreferredSize(JComponent component)
Overrides:
getPreferredSize in class BasicLabelUI

paint

public void paint(Graphics graphics,
                  JComponent component)
Overrides:
paint in class BasicLabelUI

createUI

public static ComponentUI createUI(JComponent component)
Return default VerticalLabelUI instance

Parameters:
component -
Returns:
default VerticalLabelUI instance


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads