|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.aeonscope.media.GraphicKit
public class GraphicKit
General graphical user interface utilities.
| Field Summary | |
|---|---|
static int |
DEFAULT_HEIGHT
The default height. |
static int |
DEFAULT_WIDTH
The default width. |
| Constructor Summary | |
|---|---|
GraphicKit()
|
|
| Method Summary | |
|---|---|
static Point2D.Double |
center(Dimension secondary,
Dimension primary)
Centers the secondary dimension relative to the primary dimension using double precision. |
static Point2D.Double |
center(double width1,
double height1,
double width2,
double height2)
Centers the first dimensions (width 1 x height 1) relative to the second dimensions (width 2 x height 2) using double precision. |
static Point2D.Double |
center(Rectangle secondary,
Rectangle primary)
Centers the secondary rectangle relative to the primary rectangle using double precision. |
static Point2D.Double |
centerToScreen(Dimension dimension)
Centers a dimension to the current screen dimension. |
static Point2D.Double |
centerToScreen(double width,
double height)
Centers the a width and height to the current screen dimension. |
static Point2D.Double |
centerToScreen(String text,
FontMetrics metrics)
Centers the text with a specific font to the screen. |
static BufferedImage |
createTransparentImage(int width,
int height)
Creates a transparent buffered image. |
static double |
heightRatio(Dimension dimension)
Calculates the width ratio (width / height) of a dimension using double precision. |
static void |
resizeToScreen(Rectangle rectangle)
Resizes a rectangle to current screen dimensions using double precision.NOTE: Distortion can occur as proportions are not maintained.NOTE: Null input will result in skipped operations. |
static void |
scaleHeight(Dimension inner,
Dimension outer)
Changes the inner dimension so that it fits in the outer dimension based on height (i.e. |
static void |
scaleHeight(Dimension dimension,
double newWidth)
Scales the dimension height proportionally based on the new width using double precision. |
static void |
scaleHeight(Rectangle inner,
Rectangle outer)
A convenience method to handle the fitting of rectangles. |
static void |
scaleHeightToScreen(Rectangle rectangle)
Fits the given rectangle to the current screen by centering and maintaining proportions. |
static void |
scaleWidth(Dimension inner,
Dimension outer)
Changes the inner dimension so that it fits in the outer dimension based on width (i.e. |
static void |
scaleWidth(Dimension dimension,
double newHeight)
Scales the dimension width proportionally based on the new height using double precision. |
static void |
scaleWidth(Rectangle inner,
Rectangle outer)
A convenience method to handle the fitting of rectangles. |
static void |
scaleWidthToScreen(Rectangle rectangle)
Fits the given rectangle to the current screen by centering and maintaining proportions. |
static double |
widthRatio(Dimension dimension)
Calculates the width ratio (width / height) of a dimension using double precision. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
| Constructor Detail |
|---|
public GraphicKit()
| Method Detail |
|---|
public static BufferedImage createTransparentImage(int width,
int height)
width - The image width.height - The image height.
public static Point2D.Double center(double width1,
double height1,
double width2,
double height2)
width1 - The width to be centered.height1 - The height to be centered.width2 - The width to center on.height2 - The height to center on.
public static Point2D.Double center(Dimension secondary,
Dimension primary)
secondary - The dimension to be centered.primary - The reference dimension.
center(double, double, double,
double)
public static Point2D.Double center(Rectangle secondary,
Rectangle primary)
secondary - The rectangle to be centered.primary - The reference rectangle.
center(Dimension, Dimension)public static double widthRatio(Dimension dimension)
dimension - The dimension to calculate.
public static double heightRatio(Dimension dimension)
dimension - The dimension to calculate.
public static Point2D.Double centerToScreen(String text,
FontMetrics metrics)
text - The text to be centered.metrics - The font metrics used to calculate font width and height.
public static Point2D.Double centerToScreen(Dimension dimension)
dimension - The dimension to be centered.
public static Point2D.Double centerToScreen(double width,
double height)
width - The width.height - The height.
public static void scaleWidth(Dimension dimension,
double newHeight)
dimension - The dimension to scale.newHeight - The new height.
public static void scaleWidth(Dimension inner,
Dimension outer)
inner - The dimension to fit.outer - The dimension to fit in.
public static void scaleWidth(Rectangle inner,
Rectangle outer)
inner - The rectangle to fit.outer - The rectangle to fit in.scaleWidth(Dimension, Dimension)public static void scaleWidthToScreen(Rectangle rectangle)
rectangle - The rectangle to fit.scaleWidth(Rectangle, Rectangle)
public static void scaleHeight(Dimension dimension,
double newWidth)
dimension - The dimension to scale.newWidth - The new width.
public static void scaleHeight(Dimension inner,
Dimension outer)
inner - The dimension to fit.outer - The dimension to fit in.
public static void scaleHeight(Rectangle inner,
Rectangle outer)
inner - The rectangle to fit.outer - The rectangle to fit in.scaleHeight(Dimension, Dimension)public static void scaleHeightToScreen(Rectangle rectangle)
rectangle - The rectangle to fit.scaleWidth(Rectangle, Rectangle)public static void resizeToScreen(Rectangle rectangle)
rectangle - The rectangle to resize.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||