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
  • Constructor Details

    • ScaledFontUIResource

      public ScaledFontUIResource​(String name, int style, int size)
  • 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