Package smile.plot.swing
Class Projection
java.lang.Object
smile.plot.swing.Projection
Projection provides methods to map logical coordinates to Java2D coordinates.
Both 2D and 3D logical coordinates are supported.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
reset()
Reset the base coordinates on Java2D screen.int[]
screenProjection
(double... coord) Project logical coordinates to Java2D coordinates.int[]
screenProjectionBaseRatio
(double... coord) Project logical coordinates in base ratio to Java2D coordinates.void
setSize
(int width, int height) Sets the size of physical plot area.
-
Field Details
-
canvas
The canvas associated with this projection. The base object of canvas provides logical coordinate space and the Java2D coordinate space of canvas is the projection target. -
width
protected int widthThe width of canvas in Java2D coordinate space. -
height
protected int heightThe height of canvas in Java2D coordinate space.
-
-
Constructor Details
-
Projection
Constructor.
-
-
Method Details
-
reset
public void reset()Reset the base coordinates on Java2D screen. -
setSize
public void setSize(int width, int height) Sets the size of physical plot area. -
screenProjection
public int[] screenProjection(double... coord) Project logical coordinates to Java2D coordinates. -
screenProjectionBaseRatio
public int[] screenProjectionBaseRatio(double... coord) Project logical coordinates in base ratio to Java2D coordinates.
-