Class ClassicButtonShaper
java.lang.Object
org.pushingpixels.substance.api.shaper.ClassicButtonShaper
- All Implemented Interfaces:
RectangularButtonShaper,SubstanceButtonShaper,SubstanceTrait
public class ClassicButtonShaper
extends Object
implements SubstanceButtonShaper, RectangularButtonShaper
Button shaper that returns rectangular buttons with slightly rounded corners
(ala Windows XP). This class is part of officially supported API.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClassicButtonShaperReusable instance of this shaper. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetButtonBorder(AbstractButton button) Returns the border for the specified button.getButtonOutline(AbstractButton button, Insets insets, int width, int height, boolean isInner) Returns the outline path for the specified button.floatgetCornerRadius(AbstractButton button, Insets insets) Returns the corner radius of the specified button.Returns the display name ofthistrait.getPreferredSize(AbstractButton button, Dimension uiPreferredSize) Returns the preferred size for the specified button.booleanReturns the boolean indication whether the shaper should maintain button proportions on the resize.
-
Field Details
-
INSTANCE
Reusable instance of this shaper.
-
-
Constructor Details
-
ClassicButtonShaper
public ClassicButtonShaper()
-
-
Method Details
-
getDisplayName
Description copied from interface:SubstanceTraitReturns the display name ofthistrait. This method is part of officially supported API.- Specified by:
getDisplayNamein interfaceSubstanceButtonShaper- Specified by:
getDisplayNamein interfaceSubstanceTrait- Returns:
- The display name of
thistrait.
-
getButtonOutline
public GeneralPath getButtonOutline(AbstractButton button, Insets insets, int width, int height, boolean isInner) Description copied from interface:SubstanceButtonShaperReturns the outline path for the specified button.- Specified by:
getButtonOutlinein interfaceSubstanceButtonShaper- Parameters:
button- A button.insets- Button insets.width- Button width.height- Button height.isInner- Indication whether the returned outline is used for the inner contour.- Returns:
- The outline path for the specified button.
-
getButtonBorder
Description copied from interface:SubstanceButtonShaperReturns the border for the specified button.- Specified by:
getButtonBorderin interfaceSubstanceButtonShaper- Parameters:
button- A button.- Returns:
- The border for the specified button.
-
getPreferredSize
Description copied from interface:SubstanceButtonShaperReturns the preferred size for the specified button.- Specified by:
getPreferredSizein interfaceSubstanceButtonShaper- Parameters:
button- A button.uiPreferredSize- Preferred size of the button under the regular conditions (plain rectangular button).- Returns:
- The preferred size for the specified button.
-
isProportionate
public boolean isProportionate()Description copied from interface:SubstanceButtonShaperReturns the boolean indication whether the shaper should maintain button proportions on the resize. This may be relevant for vector-based shapers (such as animals / other objects).- Specified by:
isProportionatein interfaceSubstanceButtonShaper- Returns:
trueifthisshaper should maintain button proportions on the resize,falseotherwise.
-
getCornerRadius
Description copied from interface:RectangularButtonShaperReturns the corner radius of the specified button.- Specified by:
getCornerRadiusin interfaceRectangularButtonShaper- Parameters:
button- Button.insets- Button insets.- Returns:
- Corner radius of the specified button.
-