Package jmri.util.swing
Class VerticalLabelUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.LabelUI
javax.swing.plaf.basic.BasicLabelUI
jmri.util.swing.VerticalLabelUI
- All Implemented Interfaces:
PropertyChangeListener,EventListener
Allows a JLabel to be displayed vertically, with a defined orientation. Usage
(for a vertical label with anti-clockwise orientation):
This file is part of JMRI.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefine Anti-Clockwise rotation (-90 degrees from horizontal)static final intDefine Clockwise rotation (+90 degrees from horizontal)Fields inherited from class javax.swing.plaf.basic.BasicLabelUI
labelUI -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor which provides a vertical label with anti-clockwise orientationVerticalLabelUI(int rotation) Constructor used to provide a vertical label of the specified orientation -
Method Summary
Modifier and TypeMethodDescriptiongetPreferredSize(JComponent component) voidpaint(Graphics graphics, JComponent component) 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, uninstallUIMethods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
-
Field Details
-
CLOCKWISE
Define Clockwise rotation (+90 degrees from horizontal)- See Also:
-
ANTICLOCKWISE
Define Anti-Clockwise rotation (-90 degrees from horizontal)- See Also:
-
-
Constructor Details
-
VerticalLabelUI
public VerticalLabelUI()Default constructor which provides a vertical label with anti-clockwise orientation -
VerticalLabelUI
Constructor used to provide a vertical label of the specified orientation- Parameters:
rotation- defines the rotation:CLOCKWISEorANTICLOCKWISE
-
-
Method Details
-
getPreferredSize
- Overrides:
getPreferredSizein classBasicLabelUI
-
paint
- Overrides:
paintin classBasicLabelUI
-