Package jmri.util
Class PaperUtils
java.lang.Object
jmri.util.PaperUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DimensionReturns the default paper size as a PaperSize enum.static DimensionRetrieves the default printer's paper size in points (1/72"), adjusted for the current default orientation.static DimensionReturns the default paper size as a Dimension object in pointsstatic voidsyncPageAttributesToPrinter(PageAttributes pageAttr) Syncs the PageAttributes object to the default printer's settings.
-
Constructor Details
-
PaperUtils
public PaperUtils()
-
-
Method Details
-
getPaperSizeDimension
Returns the default paper size as a Dimension object in points- Returns:
- The Dimension object representing the default paper size in points
-
getOrientedPaperSizeInPointsIfPossible
Retrieves the default printer's paper size in points (1/72"), adjusted for the current default orientation. If this is not possible, returns null.- Returns:
- The Dimension object representing the default paper size in points, or null if it is not possible to retrieve the paper size.
-
getAutomaticPaperSize
Returns the default paper size as a PaperSize enum. This interrogates the default printer and may be slow if the printer is not available. You should probably usegetPaperSizeDimension()instead as it caches the result.- Returns:
- A Dimension object representing the default paper size in points.
-
syncPageAttributesToPrinter
Syncs the PageAttributes object to the default printer's settings.- Parameters:
pageAttr- The PageAttributes object to sync.
-