org.montsuqi.monsia.builders
Class ScreenScale

java.lang.Object
  extended by org.montsuqi.monsia.builders.ScreenScale

final class ScreenScale
extends java.lang.Object

A class to scale frames and components to fit in screen insets.


Constructor Summary
ScreenScale()
           
 
Method Summary
(package private) static void centerWindow(java.awt.Window window)
          Centers a window in the screen insets.
(package private) static java.awt.Dimension getScreenSize()
          Gets the size of the screen.
(package private) static java.awt.Dimension scale(java.awt.Dimension size)
          Scale the given size so a component with that size will fit in the screen insets.
(package private) static java.awt.Font scale(java.awt.Font font)
          Scales the size of the given font.
(package private) static java.awt.Point scale(java.awt.Point pos)
          Translates the given position so a component at that position will fit in the screen insets.
(package private) static java.awt.Dimension scaleFrame(java.awt.Dimension size)
          Scale the given size so a frame with that size will fit in the screen insets.
(package private) static java.awt.Point scaleFrame(java.awt.Point pos)
          Translates the given position so a frame at that position will fit in the screen insets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenScale

ScreenScale()
Method Detail

scaleFrame

static java.awt.Dimension scaleFrame(java.awt.Dimension size)

Scale the given size so a frame with that size will fit in the screen insets.

Parameters:
size - arbitrary size (of a frame)
Returns:
scaled size

scale

static java.awt.Dimension scale(java.awt.Dimension size)

Scale the given size so a component with that size will fit in the screen insets.

Parameters:
size - arbitrary size (of a component)
Returns:
scaled size

scaleFrame

static java.awt.Point scaleFrame(java.awt.Point pos)

Translates the given position so a frame at that position will fit in the screen insets.

Parameters:
pos - arbitrary position (of a frame)
Returns:
translated position

scale

static java.awt.Point scale(java.awt.Point pos)

Translates the given position so a component at that position will fit in the screen insets.

Parameters:
pos - arbitrary position (of a component)
Returns:
translated position

scale

static java.awt.Font scale(java.awt.Font font)

Scales the size of the given font.

Parameters:
font - font to scale.
Returns:
scaled font.

centerWindow

static void centerWindow(java.awt.Window window)

Centers a window in the screen insets.

Parameters:
window - a window to center.

getScreenSize

static java.awt.Dimension getScreenSize()

Gets the size of the screen.