Class BasePolygonShaper
java.lang.Object
org.pushingpixels.radiance.theming.extras.api.shaperpack.BasePolygonShaper
- All Implemented Interfaces:
RadianceButtonShaper
,RadianceTrait
- Direct Known Subclasses:
ButterflyButtonShaper
,DolphinButtonShaper
,FishButtonShaper
,FootButtonShaper
,IceCreamButtonShaper
,RaceCarButtonShaper
,RhinoButtonShaper
,StegosaurusButtonShaper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double
private CanonicalPath
private double
private double
private double
-
Constructor Summary
ConstructorsConstructorDescriptionBasePolygonShaper
(String resourceName, double topCoef, double leftCoef, double bottomCoef, double rightCoef) -
Method Summary
Modifier and TypeMethodDescriptiongetButtonBorder
(Dimension preferredSize) getButtonBorder
(AbstractButton button) Returns the border for the specified button.getButtonOutline
(AbstractButton button, float extraInsets, float width, float height, double scaleFactor, boolean isInner) Returns the outline path for the specified button.getPreferredSize
(AbstractButton button, Dimension uiPreferredSize) Returns the preferred size for the specified button.boolean
Returns the boolean indication whether the shaper should maintain button proportions on the resize.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.pushingpixels.radiance.theming.api.trait.RadianceTrait
getDisplayName
-
Field Details
-
canonicalPath
-
topCoef
private double topCoef -
leftCoef
private double leftCoef -
bottomCoef
private double bottomCoef -
rightCoef
private double rightCoef
-
-
Constructor Details
-
BasePolygonShaper
public BasePolygonShaper(String resourceName, double topCoef, double leftCoef, double bottomCoef, double rightCoef)
-
-
Method Details
-
getPreferredSize
Description copied from interface:RadianceButtonShaper
Returns the preferred size for the specified button.- Specified by:
getPreferredSize
in interfaceRadianceButtonShaper
- 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.
-
getButtonBorder
Description copied from interface:RadianceButtonShaper
Returns the border for the specified button.- Specified by:
getButtonBorder
in interfaceRadianceButtonShaper
- Parameters:
button
- A button.- Returns:
- The border for the specified button.
-
getButtonBorder
-
getButtonOutline
public Shape getButtonOutline(AbstractButton button, float extraInsets, float width, float height, double scaleFactor, boolean isInner) Description copied from interface:RadianceButtonShaper
Returns the outline path for the specified button.- Specified by:
getButtonOutline
in interfaceRadianceButtonShaper
- Parameters:
button
- A button.extraInsets
- Button insets.width
- Button width.height
- Button height.scaleFactor
- Scale factor.isInner
- Indication whether the returned outline is used for the inner contour.- Returns:
- The outline path for the specified button.
-
isProportionate
public boolean isProportionate()Description copied from interface:RadianceButtonShaper
Returns 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:
isProportionate
in interfaceRadianceButtonShaper
- Returns:
true
ifthis
shaper should maintain button proportions on the resize,false
otherwise.
-