SPV_graphics
Class SPVGrint

java.lang.Object
  |
  +--SPV_graphics.SPVGrint

public class SPVGrint
extends java.lang.Object

This class initializes the graphics process.


Constructor Summary
SPVGrint(int width, int height)
           
 
Method Summary
 void box(java.awt.Graphics g, double xmin, double ymin, double xmax, double ymax)
          DrawRect that uses world coordinates rather than pixel coordinates.
 double ph2wh(int ph)
          pixel height to world coordinate height
 double pw2ww(int pw)
          pixel width to world coordinate width
 void setdiff(double xdiff, double ydiff)
          This method sets the width and height of the world coordinate system.
 void setMarkerSize(double size)
          setdiff must be called before setMarkerSize.
 void setmin(double xmin, double ymin)
          This method sets the minimum x and y values for the world coordinate system.
 void spvDrawLine(java.awt.Graphics g, double x1, double y1, double x2, double y2)
          DrawLine that uses world coordinates rather than pixel coordinates.
 int wh2ph(double wh)
          world height to pixel height
 int ww2pw(double ww)
          world width to pixel width
 double xp2xw(int xpc)
          x pixel coordinates to world coordinates
 int xw2xp(double xwc)
          x world coordinates to pixel coordinates
 double yp2yw(int ypc)
          y pixel coordinates to world coordinates
 int yw2yp(double ywc)
          y world coordinates to pixel coordinates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPVGrint

public SPVGrint(int width,
                int height)
Parameters:
width - Width of the graphics component in pixels
height - Height of the graphics component in pixels
Method Detail

setmin

public void setmin(double xmin,
                   double ymin)
This method sets the minimum x and y values for the world coordinate system. (xmin,ymin) is the lower left point in the world coordinate system.

Parameters:
xmin - Minimum x value in the world coordinate system
ymin - Minimum y value in the world coordinate system.

setdiff

public void setdiff(double xdiff,
                    double ydiff)
This method sets the width and height of the world coordinate system. (xmin+xdiff,ymin+ydiff) is the upper right point in the world coordinate system.

Parameters:
xdiff - Difference between the maximum and minimum x values in the world coordinate system
ydiff - Difference between the maximum and minimum y values in the world coordinate system

setMarkerSize

public void setMarkerSize(double size)
setdiff must be called before setMarkerSize.


xw2xp

public int xw2xp(double xwc)
x world coordinates to pixel coordinates


xp2xw

public double xp2xw(int xpc)
x pixel coordinates to world coordinates


yw2yp

public int yw2yp(double ywc)
y world coordinates to pixel coordinates


yp2yw

public double yp2yw(int ypc)
y pixel coordinates to world coordinates


ww2pw

public int ww2pw(double ww)
world width to pixel width


wh2ph

public int wh2ph(double wh)
world height to pixel height


pw2ww

public double pw2ww(int pw)
pixel width to world coordinate width


ph2wh

public double ph2wh(int ph)
pixel height to world coordinate height


spvDrawLine

public void spvDrawLine(java.awt.Graphics g,
                        double x1,
                        double y1,
                        double x2,
                        double y2)
DrawLine that uses world coordinates rather than pixel coordinates.

Parameters:
g - The graphics context
x1 - The (world) x coordinate of the starting point
y1 - The (world) y coordinate of the starting point
x2 - The (world) x coordinate of the ending point
y2 - The (world) y coordinate of the ending point

box

public void box(java.awt.Graphics g,
                double xmin,
                double ymin,
                double xmax,
                double ymax)
DrawRect that uses world coordinates rather than pixel coordinates.

Parameters:
g - Graphics context
xmin - x coordinate of lower left corner
ymin - y coordinate of lower left corner
xmax - x coordinate of upper right corner
ymax - y coordinate of upper right corner