RectangularButtonShaper
, SubstanceButtonShaper
, SubstanceTrait
public class ClassicButtonShaper extends Object implements SubstanceButtonShaper, RectangularButtonShaper
Modifier and Type | Field | Description |
---|---|---|
static ClassicButtonShaper |
INSTANCE |
Reusable instance of this shaper.
|
Constructor | Description |
---|---|
ClassicButtonShaper() |
Modifier and Type | Method | Description |
---|---|---|
Border |
getButtonBorder(AbstractButton button) |
Returns the border for the specified button.
|
GeneralPath |
getButtonOutline(AbstractButton button,
Insets insets,
int width,
int height,
boolean isInner) |
Returns the outline path for the specified button.
|
float |
getCornerRadius(AbstractButton button,
Insets insets) |
Returns the corner radius of the specified button.
|
String |
getDisplayName() |
Returns the display name of
this trait. |
Dimension |
getPreferredSize(AbstractButton button,
Dimension uiPreferredSize) |
Returns the preferred size for the specified button.
|
boolean |
isProportionate() |
Returns the boolean indication whether the shaper should maintain button
proportions on the resize.
|
public static final ClassicButtonShaper INSTANCE
public String getDisplayName()
SubstanceTrait
this
trait. This method is part
of officially supported API.getDisplayName
in interface SubstanceButtonShaper
getDisplayName
in interface SubstanceTrait
this
trait.public GeneralPath getButtonOutline(AbstractButton button, Insets insets, int width, int height, boolean isInner)
SubstanceButtonShaper
getButtonOutline
in interface SubstanceButtonShaper
button
- A button.insets
- Button insets.width
- Button width.height
- Button height.isInner
- Indication whether the returned outline is used for the inner
contour.public Border getButtonBorder(AbstractButton button)
SubstanceButtonShaper
getButtonBorder
in interface SubstanceButtonShaper
button
- A button.public Dimension getPreferredSize(AbstractButton button, Dimension uiPreferredSize)
SubstanceButtonShaper
getPreferredSize
in interface SubstanceButtonShaper
button
- A button.uiPreferredSize
- Preferred size of the button under the regular conditions
(plain rectangular button).public boolean isProportionate()
SubstanceButtonShaper
isProportionate
in interface SubstanceButtonShaper
true
if this
shaper should maintain
button proportions on the resize, false
otherwise.public float getCornerRadius(AbstractButton button, Insets insets)
RectangularButtonShaper
getCornerRadius
in interface RectangularButtonShaper
button
- Button.insets
- Button insets.