GL (myutil): This class provides a 2D graphics environment in which the coordinate system has the "normal" orientation, namely, the all-positive quadrant lies in the upper right-hand corner of the system; furthermore, the coordinates are specified in (double) floating point values. This class follows the SINGLETON pattern. Author: Robert Vanderbei (extended by Hugo Simao) Methods: /** Initializes the new graphics context */ static public synchronized void ginit(Graphics gg, int w, int h, Component cc) /** Initializes the new graphics context */ static public synchronized void ginit(Graphics gg, int w, int h, Component cc, boolean dblBuffer) /** Displays the image currently drawn in the 'hidden' graphics context */ static public synchronized void swapbuffers() /** Defines the boundaries of the new orthogonal coordinate system */ static public synchronized void ortho2(double xmin1, double xmax1, double ymin1, double ymax1) /** Returns the redefined x-coordinate value corresponding to the given original x-coordinate value */ static public synchronized double xi( int x) /** Returns the redefined y-coordinate value corresponding to the given original y-coordinate value */ static public synchronized double yi( int y) /** Returns the redefined delta-x value corresponding to the given original delta-x value */ static public synchronized double dltXi( int dltX) /** Returns the redefined delta-y value corresponding to the given original delta-y value */ static public synchronized double dltYi( int dltY) /** Returns the original x-coordinate value corresponding to the given redefined x-coordinate value */ static public synchronized int x( double x) /** Returns the original y-coordinate value corresponding to the given redefined y-coordinate value */ static public synchronized int y( double y) /** Returns the original delta-x value corresponding to the given redefined delta-x value */ static public synchronized int dltX( double dltX) /** Returns the original delta-y value corresponding to the given redefined delta-y value */ static public synchronized int dltY( double dltY) /** Resets the "current" color of the graphics context to the given one */ static public synchronized void setColor(Color c) static public synchronized void color(Color c) /** Repaints the whole area of the graphics context with the "current" color */ static public synchronized void clear() /** Returns the (x, y) position where the given mouse event occurred */ static public synchronized Point2D.Double mouseLoc( MouseEvent event) /** Draws a filled square with a 3-pixel side at the given (x, y) position */ static public synchronized void pnt2(double x, double y) /** Moves the drawing "pen" to the given (x, y) position */ static public synchronized void move2(double xx, double yy) /** Draws a line from the current "pen" position to the given (x, y) position; afterwards, the "pen" will rest at the new position */ static public synchronized void draw2(double xx, double yy) /** Initializes the drawing of a filled polygon at the given (x, y) position */ static public synchronized void pmv2(double xx, double yy) /** Adds the given (x, y) position as a vertex of the filled polygon being drawn */ static public synchronized void pdr2(double xx, double yy) /** Finishes the filled polygon being drawn */ static public synchronized void pclos() /** Draws an unfilled rectangle with upper left hand corner at the given (x, y) position and the given width and height */ static public synchronized void drawRect(double x1, double y1, double width, double height) /** Draws a filled rectangle with upper left hand corner at the given (x, y) position and the given width and height */ static public synchronized void fillRect(double x1, double y1, double width, double height) /** Draws an unfilled rectangle bounded by the given coordinates */ static public synchronized void rect(double x1, double y1, double x2, double y2) /** Draws a filled rectangle bounded by the given coordinates */ static public synchronized void rectf(double x1, double y1, double x2, double y2) /** Draws an unfilled oval bounded by a rectangle with upper left hand corner at the given (x, y) position and the given width and height */ static public synchronized void drawOval(double x1, double y1, double width, double height) /** Draws a filled oval bounded by a rectangle with upper left hand corner at the given (x, y) position and the given width and height */ static public synchronized void fillOval(double x1, double y1, double width, double height) /** Draws an unfilled arc centered at the center of a rectangle with upper left hand corner at the given (x, y) position and the given width and height, starting at the given start angle (in degrees) and for as long as the given arc angle */ static public synchronized void drawArc(double x1, double y1, double width, double height, double startAngle, double arcAngle) /** Draws a filled arc centered at the center of a rectangle with upper left hand corner at the given (x, y) position and the given width and height, starting at the given start angle (in degrees) and for as long as the given arc angle */ static public synchronized void fillArc(double x1, double y1, double width, double height, double startAngle, double arcAngle) /** Draws an unfilled circle centered at the given (x, y) position and with the given radius r */ static public synchronized void circ(double x, double y, double r) /** Draws a filled circle centered at the given (x, y) position and with the given radius r */ static public synchronized void circf(double x, double y, double r) /** Draws the given string, with the default Font, so that the given (x, y) position is located relatively to the string according to the given specifications (LEFT/CENTER/RIGHT, TOP/CENTER/BOTTOM) */ static public synchronized void drawString(String str, double xx, double yy, String xpos, String ypos) /** Draws the given string, with the given Font size, so that the given (x, y) position is located relatively to the string according to the given specifications (LEFT/CENTER/RIGHT, TOP/CENTER/BOTTOM) */ static public synchronized void drawString(String str, double xx, double yy, String xpos, String ypos, int fntSize) /** Draws the given string, with the default Font, from the (x, y) position of the rightmost character of the last string drawn */ static public synchronized void drawString(String str) /** Draws the given image, with the given dimensions, so that the given (x, y) position is located relatively to the image according to the given specifications (LEFT/CENTER/RIGHT, TOP/CENTER/BOTTOM) */ static public synchronized void drawImage(Image img, double x0, double y0, int w, int h, String xpos, String ypos, ImageObserver io)