Package org.vanted.scaling.resources
Class ScaledFontUIResource
java.lang.Object
java.awt.Font
javax.swing.plaf.FontUIResource
org.vanted.scaling.resources.ScaledFontUIResource
- All Implemented Interfaces:
Serializable
,UIResource
public class ScaledFontUIResource extends FontUIResource
Customized
FontUIResource
class.- Author:
- D. Garkov
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class java.awt.Font
BOLD, CENTER_BASELINE, DIALOG, DIALOG_INPUT, HANGING_BASELINE, ITALIC, LAYOUT_LEFT_TO_RIGHT, LAYOUT_NO_LIMIT_CONTEXT, LAYOUT_NO_START_CONTEXT, LAYOUT_RIGHT_TO_LEFT, MONOSPACED, PLAIN, ROMAN_BASELINE, SANS_SERIF, SERIF, TRUETYPE_FONT, TYPE1_FONT
-
Constructor Summary
Constructors Constructor Description ScaledFontUIResource(String name, int style, int size)
-
Method Summary
Modifier and Type Method Description int
getDPI()
The corresponding DPI of the scaled resource.boolean
isScaledWith(float currentFactor)
Checks whether the resource has already been rescaled with the provided scaling factor.void
setDPI(int dpi)
Methods inherited from class java.awt.Font
canDisplay, canDisplay, canDisplayUpTo, canDisplayUpTo, canDisplayUpTo, createFont, createFont, createFonts, createFonts, createGlyphVector, createGlyphVector, createGlyphVector, createGlyphVector, decode, deriveFont, deriveFont, deriveFont, deriveFont, deriveFont, deriveFont, equals, getAttributes, getAvailableAttributes, getBaselineFor, getFamily, getFamily, getFont, getFont, getFont, getFontName, getFontName, getItalicAngle, getLineMetrics, getLineMetrics, getLineMetrics, getLineMetrics, getMaxCharBounds, getMissingGlyphCode, getName, getNumGlyphs, getPSName, getSize, getSize2D, getStringBounds, getStringBounds, getStringBounds, getStringBounds, getStyle, getTransform, hashCode, hasLayoutAttributes, hasUniformLineMetrics, isBold, isItalic, isPlain, isTransformed, layoutGlyphVector, textRequiresLayout, toString
-
Constructor Details
-
ScaledFontUIResource
-
-
Method Details
-
setDPI
public void setDPI(int dpi) -
getDPI
public int getDPI()The corresponding DPI of the scaled resource.- Returns:
- current DPI or -1, if not set
-
isScaledWith
public boolean isScaledWith(float currentFactor)Checks whether the resource has already been rescaled with the provided scaling factor.- Parameters:
currentFactor
- factor for comparison- Returns:
- true if already rescaled
-