public class Transformation
extends java.lang.Object
Rectangle
defining a (virtual)
paper which is placed in the canvas according to an anchor point.
Depending on the aspect ratio of the canvas the paper width or
height occupies the canvas width or height.Constructor and Description |
---|
Transformation(int width,
int height,
ClippingRectangle paper,
Anchor horizontalAnchor,
Anchor verticalAnchor)
Creates an instance for the specified canvas size, paper size,
and anchor points of the paper.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(java.awt.Graphics2D g) |
java.lang.String |
toString() |
GraphPoint |
transformBack(int x,
int y)
Transforms a point in Java coordinates back into device-independent
coordinates.
|
int |
transformHeight(double height)
Transforms the device-independent height into Java height.
|
int |
transformWidth(double width)
Transforms the device-independent width into Java width.
|
int |
transformX(double x)
Transforms the device-independent x coordinate into Java coordinates.
|
int |
transformY(double y)
Transforms the device-independent y coordinate into Java coordinates.
|
public Transformation(int width, int height, ClippingRectangle paper, Anchor horizontalAnchor, Anchor verticalAnchor)
width
- Width of the canvas.height
- Height of the canvas.paper
- Rectangle defining the paper in device-independent
coordinates.horizontalAnchor
- Horizontal anchor of the paper in the canvas.verticalAnchor
- Vertical anchor of the paper in the canvas.public java.lang.String toString()
toString
in class java.lang.Object
public int transformX(double x)
public int transformY(double y)
public int transformWidth(double width)
public int transformHeight(double height)
public GraphPoint transformBack(int x, int y)
public void apply(java.awt.Graphics2D g)
Copyright © 2020. All Rights Reserved.