Class PillButtonShaper
- java.lang.Object
-
- org.pushingpixels.substance.api.shaper.PillButtonShaper
-
- All Implemented Interfaces:
RectangularButtonShaper,SubstanceButtonShaper,SubstanceTrait
public class PillButtonShaper extends java.lang.Object implements SubstanceButtonShaper, RectangularButtonShaper
Button shaper that returns buttons with completely rounded corners (ala Mac 10.4). This class is part of officially supported API.
-
-
Constructor Summary
Constructors Constructor Description PillButtonShaper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.border.BordergetButtonBorder(javax.swing.AbstractButton button)Returns the border for the specified button.java.awt.ShapegetButtonOutline(javax.swing.AbstractButton button, float extraInsets, float width, float height, boolean isInner)Returns the outline path for the specified button.floatgetCornerRadius(javax.swing.AbstractButton button, float insets)Returns the corner radius of the specified button.java.lang.StringgetDisplayName()Returns the display name ofthistrait.java.awt.DimensiongetPreferredSize(javax.swing.AbstractButton button, java.awt.Dimension uiPreferredSize)Returns the preferred size for the specified button.booleanisProportionate()Returns the boolean indication whether the shaper should maintain button proportions on the resize.static booleanisRoundButton(javax.swing.AbstractButton button)Returns indication whether the specified button should be drawn with completely round corners.
-
-
-
Method Detail
-
getDisplayName
public java.lang.String getDisplayName()
Description copied from interface:SubstanceTraitReturns the display name ofthistrait. This method is part of officially supported API.- Specified by:
getDisplayNamein interfaceSubstanceTrait- Returns:
- The display name of
thistrait.
-
getButtonOutline
public java.awt.Shape getButtonOutline(javax.swing.AbstractButton button, float extraInsets, float width, float height, boolean isInner)Description copied from interface:SubstanceButtonShaperReturns the outline path for the specified button.- Specified by:
getButtonOutlinein interfaceSubstanceButtonShaper- Parameters:
button- A button.extraInsets- 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
public javax.swing.border.Border getButtonBorder(javax.swing.AbstractButton button)
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
public java.awt.Dimension getPreferredSize(javax.swing.AbstractButton button, java.awt.Dimension uiPreferredSize)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.
-
isRoundButton
public static boolean isRoundButton(javax.swing.AbstractButton button)
Returns indication whether the specified button should be drawn with completely round corners.- Parameters:
button- A button.- Returns:
trueif the specified button should be drawn with completely round corners,falseotherwise.
-
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
public float getCornerRadius(javax.swing.AbstractButton button, float insets)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.
-
-