public class Display
extends java.lang.Object
Triana uses this class extensively when creating its graphical user interface.
This class also provides some sueful routines which Triana uses. For example there is a function here which displays Triana's title screen.Modifier and Type | Field and Description |
---|---|
static double |
ratioX
The ratio to scale the screen in the X direction.
|
static double |
ratioY
The ratio to scale the screen in the Y direction.
|
static int |
screenX
The size of the screen (in pixels) in the X direction.
|
static int |
screenY
The size of the screen (in pixels) in the Y direction.
|
Constructor and Description |
---|
Display() |
Modifier and Type | Method and Description |
---|---|
static void |
centralise(java.awt.Window fr)
Puts the window in the middle of the screen.
|
static void |
clipFrameToScreen(java.awt.Component fr) |
static java.awt.Point |
clipFrameToScreen(java.awt.Component fr,
int x,
int y)
Makes sure that the specified JFrame doesn't dissappear off the screen by checking the x and y coordinates of its
desired position and clipping them so that it fits onto the particular screen.
|
static java.awt.Point |
clipFrameToScreen(java.awt.Component fr,
java.awt.Point p) |
static java.awt.Point |
clipFrameToScreen(java.awt.Window fr,
int x,
int y) |
static java.awt.Point |
clipFrameToScreen(java.awt.Window fr,
java.awt.Point p)
Makes sure that the specified JFrame doesn't dissappear off the screen by checking the x and y coordinates of its
desired position and clipping them so that it fits onto the particular screen.
|
static java.awt.Point |
getAnchorPoint(java.lang.Object anchor,
java.awt.Component comp) |
static javax.swing.JPanel |
getTrianaLogo() |
static javax.swing.JWindow |
showTitleScreen() |
static int |
x(int size)
This routine calibrates the X size or coordinate sent to it, so that things look the same no matter what computer
you are on i.e.
|
static int |
y(int size)
This routine calibrates the Y size or coordinate sent to it, so that things look the same no matter what computer
you are on i.e.
|
public static double ratioX
public static double ratioY
public static int screenX
public static int screenY
public static int x(int size)
public static int y(int size)
public static java.awt.Point clipFrameToScreen(java.awt.Component fr, int x, int y)
fr
- the frame to be clipped into the screen sizex
- the desired x coordinatey
- the desired y coordinatepublic static void clipFrameToScreen(java.awt.Component fr)
public static java.awt.Point clipFrameToScreen(java.awt.Window fr, java.awt.Point p)
fr
- the frame to be clipped into the screen sizepublic static java.awt.Point clipFrameToScreen(java.awt.Component fr, java.awt.Point p)
public static java.awt.Point clipFrameToScreen(java.awt.Window fr, int x, int y)
public static void centralise(java.awt.Window fr)
fr
- the frame to be placed in the middle of the screenpublic static java.awt.Point getAnchorPoint(java.lang.Object anchor, java.awt.Component comp)
public static javax.swing.JWindow showTitleScreen()
public static javax.swing.JPanel getTrianaLogo()