public class SubstanceSizeUtils
extends java.lang.Object
Constructor | Description |
---|---|
SubstanceSizeUtils() |
Modifier and Type | Method | Description |
---|---|---|
static float |
getAdjustedSize(int fontSize,
float baseSize,
int forEachBase,
float toAdjustBy) |
Gets the adjusted size.
|
static int |
getAdjustedSize(int fontSize,
int baseSize,
int forEachBase,
int toAdjustBy,
boolean toRoundAsEven) |
Gets the adjusted size.
|
static float |
getArrowIconHeight(int fontSize) |
Returns the height of arrow icons under the specified font size.
|
static float |
getArrowIconWidth(int fontSize) |
Returns the width of arrow icons under the specified font size.
|
static float |
getArrowStrokeWidth(int fontSize) |
Returns the stroke width of arrow icons under the specified font size.
|
static int |
getBigDragBumpDiameter(int fontSize) |
Returns the diameter of a big drag bump dot under the specified font
size.
|
static float |
getBorderStrokeWidth(int fontSize) |
Returns the stroke width of borders under the specified font size.
|
static java.awt.Insets |
getButtonInsets(int fontSize) |
Returns the list cell renderer insets under the specified font size.
|
static javax.swing.border.Border |
getCheckBoxBorder(int fontSize,
boolean ltr) |
Returns the border for check boxes under the specified font size.
|
static int |
getCheckBoxMarkSize(int fontSize) |
Returns the check mark size for check boxes under the specified font
size.
|
static float |
getClassicButtonCornerRadius(int fontSize) |
Returns the corner radius for
ClassicButtonShaper under the
specified font size. |
static java.awt.Insets |
getComboBorderInsets(int fontSize) |
Returns the combo box border insets under the specified font size.
|
static java.awt.Insets |
getComboLayoutInsets(int fontSize) |
Returns the combo box border insets under the specified font size.
|
static java.awt.Insets |
getComboTextBorderInsets(int fontSize) |
Returns the combo box text border insets under the specified font size.
|
static int |
getComponentFontSize(java.awt.Component c) |
Computes the font size for the specified component.
|
static int |
getControlFontSize() |
Gets the current control font size.
|
static java.awt.Insets |
getDefaultBorderInsets(int fontSize) |
Returns the default border insets under the specified font size.
|
static float |
getDoubleArrowStrokeWidth(int fontSize) |
Returns the stroke width of double arrow icons under the specified font
size.
|
static int |
getDragBumpDiameter(int fontSize) |
Returns the diameter of a drag bump dot under the specified font size.
|
static int |
getExtraPadding(int fontSize) |
Returns the extra padding amount under the specified font size.
|
static int |
getFocusRingPadding(int fontSize) |
Returns the focus ring padding amount under the specified font size.
|
static float |
getFocusStrokeWidth(int fontSize) |
Returns the stroke width of focus rings under the specified font size.
|
static java.awt.Insets |
getListCellRendererInsets(int fontSize) |
Returns the list cell renderer insets under the specified font size.
|
static int |
getMenuCheckMarkSize(int fontSize) |
Returns the check mark size of check box menu items and radio button menu
items under the specified font size.
|
static int |
getMenuItemMargin(int fontSize) |
Returns the margin for menu items under the specified font size.
|
static int |
getMinButtonWidth(int fontSize) |
Returns the maximum button height under the specified font size.
|
static int |
getPasswordDotDiameter(int fontSize) |
Returns the password dot diameter for password fields under the specified
font size.
|
static int |
getPasswordDotGap(int fontSize) |
Returns the password dot gap for password fields under the specified font
size.
|
static double |
getPointsToPixelsRatio() |
Returns the points to pixels ratio of the current font policy.
|
static javax.swing.border.Border |
getRadioButtonBorder(int fontSize,
boolean ltr) |
Returns the border for radio buttons under the specified font size.
|
static int |
getRadioButtonMarkSize(int fontSize) |
Returns the check mark size for radio buttons under the specified font
size.
|
static int |
getScrollBarWidth(int fontSize) |
Returns the width of scroll bars under the specified font size.
|
static int |
getSliderIconSize(int fontSize) |
Returns the slider thumb icon size under the specified font size.
|
static int |
getSliderTickSize(int fontSize) |
Returns the slider tick size under the specified font size.
|
static int |
getSliderTrackSize(int fontSize) |
Returns the slider track size under the specified font size.
|
static float |
getSmallArrowIconHeight(int fontSize) |
Returns the height of small arrow icons under the specified font size.
|
static float |
getSmallArrowIconWidth(int fontSize) |
Returns the width of small arrow icons under the specified font size.
|
static java.awt.Insets |
getSpinnerArrowButtonInsets(int fontSize) |
Returns the spinner arrow button insets under the specified font size.
|
static float |
getSpinnerArrowIconHeight(int fontSize) |
Returns the height of spinner arrow icons under the specified font size.
|
static float |
getSpinnerArrowIconWidth(int fontSize) |
Returns the width of spinner arrow icons under the specified font size.
|
static java.awt.Insets |
getSpinnerBorderInsets(int fontSize) |
Returns the spinner border insets under the specified font size.
|
static java.awt.Insets |
getSpinnerTextBorderInsets(int fontSize) |
Returns the spinner text border insets under the specified font size.
|
static float |
getSplitPaneArrowIconHeight(int fontSize) |
Returns the height of split pane divider arrow icons under the specified
font size.
|
static float |
getSplitPaneArrowIconWidth(int fontSize) |
Returns the width of split pane divider arrow icons under the specified
font size.
|
static int |
getSplitPaneButtonOffset(int fontSize) |
Returns the offset of the first split pane divider button under the
specified font size.
|
static java.awt.Insets |
getTabbedPaneContentInsets(int fontSize) |
Returns the tabbed pane content insets under the specified size.
|
static float |
getTabCloseButtonStrokeWidth(int fontSize) |
Returns the stroke width of tab close buttons under the specified size.
|
static int |
getTabCloseIconSize(int fontSize) |
Returns the icon size of tab close buttons under the specified size.
|
static java.awt.Insets |
getTableCellRendererInsets(int fontSize) |
Returns the table cell renderer insets under the specified font size.
|
static java.awt.Insets |
getTextBorderInsets(int fontSize) |
Returns the text border insets under the specified font size.
|
static int |
getTextButtonLRPadding(int fontSize) |
Returns the text button padding amount on left and right sides under the
specified font size.
|
static int |
getTextIconGap(int fontSize) |
Returns the gap between text and icon in buttons and menu items under the
specified font size.
|
static int |
getTitlePaneIconSize() |
Returns the icon size of title pane buttons under the specified size.
|
static int |
getToolBarDragInset(int fontSize) |
Returns the tool bar drag inset under the specified font size.
|
static java.awt.Insets |
getToolBarInsets(int fontSize) |
Returns the tool bar insets under the specified font size.
|
static java.awt.Insets |
getToolTipBorderInsets(int fontSize) |
Returns the tooltip border insets under the specified font size.
|
static java.awt.Insets |
getTreeCellRendererInsets(int fontSize) |
Returns the tree cell renderer insets under the specified font size.
|
static int |
getTreeIconSize(int fontSize) |
Returns the icon size of tree expand / collapse icons under the specified
size.
|
static void |
resetPointsToPixelsRatio(FontPolicy fontPolicy) |
Resets the points to pixels ratio based on the specified font policy.
|
static void |
setControlFontSize(int size) |
Sets the new value for the control font size.
|
public static int getControlFontSize()
public static void setControlFontSize(int size)
size
- Control font size.public static int getComponentFontSize(java.awt.Component c)
null
or doesn't have font set (Component.getFont()
returns null
), this method returns the default control font
size from getControlFontSize()
.c
- Component.public static float getAdjustedSize(int fontSize, float baseSize, int forEachBase, float toAdjustBy)
baseSize
parameter specifies the base valueforEachBase
and toAdjustBy
specify how
to adjust the resulting value based on the passed fontSize
.baseSize
= 1.2forEachBase
= 1toAdjustBy
= 0.1fontSize
- Font size.baseSize
- The base value.forEachBase
- Base units for computing the adjustment.toAdjustBy
- Adjustment amount for computing the adjustment.public static int getAdjustedSize(int fontSize, int baseSize, int forEachBase, int toAdjustBy, boolean toRoundAsEven)
baseSize
parameter specifies the base valueforEachBase
and toAdjustBy
specify how
to adjust the resulting value based on the passed fontSize
.baseSize
= 4forEachBase
= 3toAdjustBy
= 1fontSize
- Font size.baseSize
- The base value.forEachBase
- Base units for computing the adjustment.toAdjustBy
- Adjustment amount for computing the adjustment.toRoundAsEven
- If true
, the final value will be rounded down to
the closest even value.public static float getArrowIconHeight(int fontSize)
fontSize
- Font size.public static float getArrowIconWidth(int fontSize)
fontSize
- Font size.public static float getArrowStrokeWidth(int fontSize)
fontSize
- Font size.public static float getBorderStrokeWidth(int fontSize)
fontSize
- Font size.public static java.awt.Insets getButtonInsets(int fontSize)
fontSize
- Font size.public static javax.swing.border.Border getCheckBoxBorder(int fontSize, boolean ltr)
fontSize
- Font size.public static int getCheckBoxMarkSize(int fontSize)
fontSize
- Font size.public static float getClassicButtonCornerRadius(int fontSize)
ClassicButtonShaper
under the
specified font size.fontSize
- Font size.ClassicButtonShaper
under the specified
font size.public static java.awt.Insets getComboBorderInsets(int fontSize)
fontSize
- Font size.public static java.awt.Insets getComboLayoutInsets(int fontSize)
fontSize
- Font size.public static java.awt.Insets getComboTextBorderInsets(int fontSize)
fontSize
- Font size.public static java.awt.Insets getDefaultBorderInsets(int fontSize)
fontSize
- Font size.public static float getDoubleArrowStrokeWidth(int fontSize)
fontSize
- Font size.public static int getDragBumpDiameter(int fontSize)
fontSize
- Font size.public static int getBigDragBumpDiameter(int fontSize)
fontSize
- Font size.public static int getExtraPadding(int fontSize)
fontSize
- Font size.public static int getFocusRingPadding(int fontSize)
fontSize
- Font size.public static float getFocusStrokeWidth(int fontSize)
fontSize
- Font size.public static java.awt.Insets getListCellRendererInsets(int fontSize)
fontSize
- Font size.public static int getMenuCheckMarkSize(int fontSize)
fontSize
- Font size.public static int getMenuItemMargin(int fontSize)
fontSize
- Font size.public static int getTextIconGap(int fontSize)
fontSize
- Font size.public static int getMinButtonWidth(int fontSize)
fontSize
- Font size.public static int getPasswordDotDiameter(int fontSize)
fontSize
- Font size.public static int getPasswordDotGap(int fontSize)
fontSize
- Font size.public static javax.swing.border.Border getRadioButtonBorder(int fontSize, boolean ltr)
fontSize
- Font size.public static int getRadioButtonMarkSize(int fontSize)
fontSize
- Font size.public static int getScrollBarWidth(int fontSize)
fontSize
- Font size.public static int getSliderIconSize(int fontSize)
fontSize
- Font size.public static int getSliderTickSize(int fontSize)
fontSize
- Font size.public static int getSliderTrackSize(int fontSize)
fontSize
- Font size.public static float getSmallArrowIconHeight(int fontSize)
fontSize
- Font size.public static float getSmallArrowIconWidth(int fontSize)
fontSize
- Font size.public static float getSpinnerArrowIconHeight(int fontSize)
fontSize
- Font size.public static float getSpinnerArrowIconWidth(int fontSize)
fontSize
- Font size.public static java.awt.Insets getSpinnerBorderInsets(int fontSize)
fontSize
- Font size.public static java.awt.Insets getSpinnerArrowButtonInsets(int fontSize)
fontSize
- Font size.public static java.awt.Insets getSpinnerTextBorderInsets(int fontSize)
fontSize
- Font size.public static float getSplitPaneArrowIconHeight(int fontSize)
fontSize
- Font size.public static float getSplitPaneArrowIconWidth(int fontSize)
fontSize
- Font size.public static int getSplitPaneButtonOffset(int fontSize)
fontSize
- Font size.public static java.awt.Insets getTabbedPaneContentInsets(int fontSize)
SubstanceConstants.TabContentPaneBorderKind.SINGLE_FULL
is
assumed.fontSize
- Font size.public static float getTabCloseButtonStrokeWidth(int fontSize)
fontSize
- Font size.public static int getTabCloseIconSize(int fontSize)
fontSize
- Font size.public static java.awt.Insets getTableCellRendererInsets(int fontSize)
fontSize
- Font size.public static java.awt.Insets getTextBorderInsets(int fontSize)
fontSize
- Font size.public static int getTextButtonLRPadding(int fontSize)
fontSize
- Font size.public static int getTitlePaneIconSize()
public static int getToolBarDragInset(int fontSize)
fontSize
- Font size.public static java.awt.Insets getToolBarInsets(int fontSize)
fontSize
- Font size.public static java.awt.Insets getToolTipBorderInsets(int fontSize)
fontSize
- Font size.public static java.awt.Insets getTreeCellRendererInsets(int fontSize)
fontSize
- Font size.public static int getTreeIconSize(int fontSize)
fontSize
- Font size.public static double getPointsToPixelsRatio()
public static void resetPointsToPixelsRatio(FontPolicy fontPolicy)
fontPolicy
- Font policy.