Package com._1c.g5.v8.dt.md.ui
Class FormattedStringSettings
java.lang.Object
com._1c.g5.v8.dt.md.ui.FormattedStringSettings
The settings for formatted text.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Possible css size-oriented units. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FormattedStringSettings
Default formatted text settings.static final int
Common DPI value (100% scaling in Windows). -
Constructor Summary
ConstructorsConstructorDescriptionFormattedStringSettings
(Font font, Color color, Color backgroundColor, int scale) The constructor.FormattedStringSettings
(Font font, Color color, Color backgroundColor, int scale, FormattedStringSettings.Unit fontSizeUnit, double margin, FormattedStringSettings.Unit marginUnit, double padding, FormattedStringSettings.Unit paddingUnit, double letterSpacing, FormattedStringSettings.Unit letterSpacingUnit, double lineHeight, FormattedStringSettings.Unit lineHeightUnit) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns background color.getColor()
Returns color.static final double
getDpiFontScaleFactor
(org.eclipse.swt.graphics.Device device) Experimentally selected font scale factor for DPI that differ from default (96dpi)getFont()
Returns font.Returns formatted text font size units.double
Returns formatted text letter spacing.Returns formatted text letter spacing units.double
Returns formatted text line height.Returns formatted text line height units.double
Returns formatted text margin.Returns formatted text margin units.double
Returns formatted text padding.Returns formatted text padding units.int
getScale()
Returns scale factor.static String
removeFormatTags
(String stringWithTags) Removes format tags from given string.
-
Field Details
-
DEFAULT_DPI
public static final int DEFAULT_DPICommon DPI value (100% scaling in Windows).- See Also:
-
DEFAULT
Default formatted text settings.
-
-
Constructor Details
-
FormattedStringSettings
The constructor.- Parameters:
font
- the formatted text font, cannot benull
color
- the formatted text color, cannot benull
background
- color the formatted text color, can benull
scale
- the form scale factor
-
FormattedStringSettings
public FormattedStringSettings(Font font, Color color, Color backgroundColor, int scale, FormattedStringSettings.Unit fontSizeUnit, double margin, FormattedStringSettings.Unit marginUnit, double padding, FormattedStringSettings.Unit paddingUnit, double letterSpacing, FormattedStringSettings.Unit letterSpacingUnit, double lineHeight, FormattedStringSettings.Unit lineHeightUnit) The constructor.- Parameters:
font
- the formatted text font, cannot benull
color
- the formatted text color, cannot benull
background
- color the formatted text color, can benull
scale
- the form scale factorfontSizeUnit
- the formatted text size unitsmargin
- the formatted text marginmarginUnit
- the formatted text margin unitspadding
- the formatted text paddingpaddingUnit
- the formatted text padding unitsletterSpacing
- the formatted text letter spacingletterSpacingUnit
- the formatted text letter spacing unitslineHeight
- the formatted text line heightlineHeightUnit
- the formatted text line height units
-
-
Method Details
-
getFont
Returns font.- Returns:
- font, cannot be
null
-
getColor
Returns color.- Returns:
- color, cannot be
null
-
getBackgroundColor
Returns background color.- Returns:
- background color, can be
null
-
getScale
public int getScale()Returns scale factor.- Returns:
- scale factor
-
getPadding
public double getPadding()Returns formatted text padding.- Returns:
- formatted text padding
-
getMargin
public double getMargin()Returns formatted text margin.- Returns:
- formatted text margin
-
getLineHeight
public double getLineHeight()Returns formatted text line height.- Returns:
- formatted text line height
-
getLetterSpacing
public double getLetterSpacing()Returns formatted text letter spacing.- Returns:
- formatted text letter spacing
-
getPaddingUnit
Returns formatted text padding units.- Returns:
- formatted text padding units
-
getMarginUnit
Returns formatted text margin units.- Returns:
- formatted text margin units
-
getLineHeightUnit
Returns formatted text line height units.- Returns:
- formatted text line height units
-
getLetterSpacingUnit
Returns formatted text letter spacing units.- Returns:
- formatted text letter spacing units
-
getFontSizeUnit
Returns formatted text font size units.- Returns:
- formatted text font size units
-
getDpiFontScaleFactor
public static final double getDpiFontScaleFactor(org.eclipse.swt.graphics.Device device) Experimentally selected font scale factor for DPI that differ from default (96dpi)- Parameters:
device
- the device where DPI is requested, cannot benull
.- Returns:
- font scale factor number
-
removeFormatTags
Removes format tags from given string.- Parameters:
stringWithTags
- the string with tags, can benull
.- Returns:
- the string without tags, can be
null
.
-