Package edu.cnu.mdi.splot.plot
Class VerticalLabelUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.LabelUI
javax.swing.plaf.basic.BasicLabelUI
edu.cnu.mdi.splot.plot.VerticalLabelUI
- All Implemented Interfaces:
PropertyChangeListener,EventListener
A UI delegate for JLabel that rotates the label 90 deg
Extends BasicLabelUI.
-
Field Summary
Fields inherited from class javax.swing.plaf.basic.BasicLabelUI
labelUI -
Constructor Summary
ConstructorsConstructorDescriptionConstructs aVerticalLabelUIwith the default anticlockwise rotationVerticalLabelUI(boolean clockwise) Constructs aVerticalLabelUIwith the desired rotation. -
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentUIintgetBaseline(JComponent c, int width, int height) Overridden to always return -1, since a vertical label does not have a meaningful baseline.Overridden to always return Component.BaselineResizeBehavior.OTHER, since a vertical label does not have a meaningful baselineReturns a Dimension appropriate for vertical renderingReturns a Dimension appropriate for vertical renderingReturns a Dimension appropriate for vertical renderingprotected StringlayoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR) Transposes the view rectangles as appropriate for a vertical view before invoking the super method and copies them after they have been altered bySwingUtilities.layoutCompoundLabel(FontMetrics, String, Icon, int, int, int, int, Rectangle, Rectangle, Rectangle, int)voidpaint(Graphics g, JComponent c) Transforms the Graphics for vertical rendering and invokes the super method.Methods inherited from class javax.swing.plaf.basic.BasicLabelUI
installComponents, installDefaults, installKeyboardActions, installListeners, installUI, paintDisabledText, paintEnabledText, propertyChange, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUIMethods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
-
Constructor Details
-
VerticalLabelUI
public VerticalLabelUI()Constructs aVerticalLabelUIwith the default anticlockwise rotation -
VerticalLabelUI
public VerticalLabelUI(boolean clockwise) Constructs aVerticalLabelUIwith the desired rotation.- Parameters:
clockwise- true to rotate clockwise, false for anticlockwise
-
-
Method Details
-
createUI
- See Also:
-
getBaseline
Overridden to always return -1, since a vertical label does not have a meaningful baseline.- Overrides:
getBaselinein classBasicLabelUI- See Also:
-
getBaselineResizeBehavior
Overridden to always return Component.BaselineResizeBehavior.OTHER, since a vertical label does not have a meaningful baseline- Overrides:
getBaselineResizeBehaviorin classBasicLabelUI- See Also:
-
layoutCL
protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR) Transposes the view rectangles as appropriate for a vertical view before invoking the super method and copies them after they have been altered bySwingUtilities.layoutCompoundLabel(FontMetrics, String, Icon, int, int, int, int, Rectangle, Rectangle, Rectangle, int)- Overrides:
layoutCLin classBasicLabelUI
-
paint
Transforms the Graphics for vertical rendering and invokes the super method.- Overrides:
paintin classBasicLabelUI
-
getPreferredSize
Returns a Dimension appropriate for vertical rendering- Overrides:
getPreferredSizein classBasicLabelUI- See Also:
-
getMaximumSize
Returns a Dimension appropriate for vertical rendering- Overrides:
getMaximumSizein classBasicLabelUI- See Also:
-
getMinimumSize
Returns a Dimension appropriate for vertical rendering- Overrides:
getMinimumSizein classBasicLabelUI- See Also:
-