All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class crw.awt.Plot

java.lang.Object
   |
   +----crw.awt.Plot

public class Plot
extends Object
A utility class for drawing commonly used lines, etc.

Version:
1.0, 1998/2/4
Author:
C. R. Wie

Constructor Index

 o Plot()

Method Index

 o drawArrow(Graphics, int, int, char)
Draws a solid arrow, vertical or horizontal.
 o drawArrow(Graphics, int, int, char, int)
Draws a solid arrow, vertical or horizontal.
 o drawArrow(Graphics, int, int, String)
Draws a solid arrow oriented 45 degrees.
 o drawArrow(Graphics, int, int, String, int)
Draws a solid arrow oriented 45 degrees.
 o drawArrowDown(int, int, int, Graphics)
Draws an arrow head at the arrow-tip location.
 o drawArrowLeft(int, int, int, Graphics)
Draws an arrow head at the arrow-tip location.
 o drawArrowRight(int, int, int, Graphics)
Draws an arrow head at the arrow-tip location.
 o drawArrowUp(int, int, int, Graphics)
Draws an arrow head at the arrow-tip location.
 o drawHDashedLine(int, int, int, Graphics)
Draws a horizontal dashed line with gap and line legths of width 3.
 o drawHDashedLine(int, int, int, Graphics, int)
Draws a horizontal dashed line.
 o drawVDashedLine(int, int, int, Graphics, int)
Draws a vertical dashed line.
 o drawVStrikeArrow(int, int, int, Graphics)
Draws an arrowed vertical line having a strike point, at 1/4 from the initial y-position and with a 6-pixels length.
 o drawVStrikeArrow(int, int, int, Graphics, double, int, int)
Draws an arrowed vertical line having a strike point, at the specified position and with a specified length.
 o drawVStrikeLine(int, int, int, Graphics)
Draws a vertical line with a strike at 1/4 distance from initial position.
 o drawVStrikeLine(int, int, int, Graphics, double)
Draws a vertical line having a strike point at the specified point.
 o drawVStrikeLine(int, int, int, Graphics, double, int)
Draws the vertical line having a STRIKE point at the specified position and specified strike line length.
 o imgRectHori(int, int, Color, Color, Component)
Creates a retangular image with its Color graded linearly in the horizontal direction.
 o imgRectVert(int, int, Color, Color, Component)
Creates a retangular image with its Color graded linearly in vertical direction.
 o makeArrow(int, int, char, int)
Creates the arrow-shaped polygon.
 o makeArrow(int, int, String, int)
Creates the arrow-shaped polygon.

Constructors

 o Plot
 public Plot()

Methods

 o drawArrow
 public static void drawArrow(Graphics g,
                              int x0,
                              int y0,
                              char orient,
                              int size)
Draws a solid arrow, vertical or horizontal.

Parameters:
g - the Graphics context.
x0 - the x-coordinate of the arrow tip.
y0 - the y-coordinate of the arrow tip.
orient - the orientation: 'N', 'S', 'E', or 'W'.
size - the arrow size: ranges 3 to 12.
 o drawArrow
 public static void drawArrow(Graphics g,
                              int x0,
                              int y0,
                              char orient)
Draws a solid arrow, vertical or horizontal. Size is 5.

Parameters:
g - the Graphics context.
x0 - the x-coordinate of the arrow tip.
y0 - the y-coordinate of the arrow tip.
orient - the orientation: 'N', 'S', 'E', or 'W'.
 o drawArrow
 public static void drawArrow(Graphics g,
                              int x0,
                              int y0,
                              String orient,
                              int size)
Draws a solid arrow oriented 45 degrees.

Parameters:
g - the Graphics context.
x0 - the x-coordinate of the arrow tip.
y0 - the y-coordinate of the arrow tip.
orient - the orientation: "NW", "NE", "SE", or "SW".
size - the arrow size: ranges 3 to 15.
 o drawArrow
 public static void drawArrow(Graphics g,
                              int x0,
                              int y0,
                              String orient)
Draws a solid arrow oriented 45 degrees. Size is 7.

Parameters:
g - the Graphics context.
x0 - the x-coordinate of the arrow tip.
y0 - the y-coordinate of the arrow tip.
orient - the orientation: "NW", "NE", "SE", or "SW".
 o makeArrow
 public static Polygon makeArrow(int x0,
                                 int y0,
                                 char orient,
                                 int size)
Creates the arrow-shaped polygon. The Graphics.fillPolygon(Polygon) will draw a solid arrow. An ArrowBlinker object uses it too.

Parameters:
x0 - the x-coordinate of the arrow tip.
y0 - the y-coordinate of the arrow tip.
orient - the orientation: 'N', 'S', 'E', or 'W'.
size - the arrow size: ranges 3 to 12.
 o makeArrow
 public static Polygon makeArrow(int x0,
                                 int y0,
                                 String orient,
                                 int size)
Creates the arrow-shaped polygon. The Graphics.fillPolygon(Polygon) will draw a solid arrow. An ArrowBlinker object uses it too.

Parameters:
x0 - the x-coordinate of the arrow tip.
y0 - the y-coordinate of the arrow tip.
orient - the orientation: "NW", "NE", "SE", or "SW".
size - the arrow size: ranges 3 to 12.
 o drawArrowRight
 public static void drawArrowRight(int x,
                                   int y,
                                   int size,
                                   Graphics g)
Draws an arrow head at the arrow-tip location.

Parameters:
x - the x-coordinate of the arrow tip.
y - the y-coordinate of the arrow-tip.
size - the length of arrow head in pixels.
g - the Graphics context to draw in.
 o drawArrowLeft
 public static void drawArrowLeft(int x,
                                  int y,
                                  int size,
                                  Graphics g)
Draws an arrow head at the arrow-tip location.

Parameters:
x - the x-coordinate of the arrow tip.
y - the y-coordinate of the arrow-tip.
size - the length of arrow head in pixels.
g - the Graphics context to draw in.
 o drawArrowUp
 public static void drawArrowUp(int x,
                                int y,
                                int size,
                                Graphics g)
Draws an arrow head at the arrow-tip location.

Parameters:
x - the x-coordinate of the arrow tip.
y - the y-coordinate of the arrow-tip.
size - the length of arrow head in pixels.
g - the Graphics context to draw in.
 o drawArrowDown
 public static void drawArrowDown(int x,
                                  int y,
                                  int size,
                                  Graphics g)
Draws an arrow head at the arrow-tip location.

Parameters:
x - the x-coordinate of the arrow tip.
y - the y-coordinate of the arrow-tip.
size - the length of arrow head in pixels.
g - the Graphics context to draw in.
 o drawVStrikeLine
 public static void drawVStrikeLine(int x,
                                    int yi,
                                    int yf,
                                    Graphics g)
Draws a vertical line with a strike at 1/4 distance from initial position.

Parameters:
x - the x-coordinate of the vertical line.
yi - the initial y-coordinate.
yf - the final y-coordinate.
g - the Graphics context.
 o drawVStrikeLine
 public static void drawVStrikeLine(int x,
                                    int yi,
                                    int yf,
                                    Graphics g,
                                    double r)
Draws a vertical line having a strike point at the specified point.

Parameters:
x - the x-coordinate of the vertical line.
yi - the initial y-coordinate.
yf - the final y-coordinate.
g - the Graphics context to draw the line in.
r - the relative position of the STRIKE point from the initial yi.
 o drawVStrikeLine
 public static void drawVStrikeLine(int x,
                                    int yi,
                                    int yf,
                                    Graphics g,
                                    double r,
                                    int dy)
Draws the vertical line having a STRIKE point at the specified position and specified strike line length.

Parameters:
x - the x-coordinate of the vertical line.
yi - the initial y-coordinate.
yf - the final y-coordinate.
g - the Graphics context to draw the line in.
r - the relative position of the STRIKE point from the initial yi.
dy - the length of the strike-line.
 o drawVStrikeArrow
 public static void drawVStrikeArrow(int x,
                                     int yi,
                                     int yf,
                                     Graphics g,
                                     double r,
                                     int dy,
                                     int dy2)
Draws an arrowed vertical line having a strike point, at the specified position and with a specified length. Length of the arrow-line is also specified.

Parameters:
x - the x-coordinate of the vertical line.
yi - initial y-coordinate.
yf - final y-coordinate.
g - Graphics context to draw the line in.
r - relative position of the STRIKE point from the initial yi.
dy - length of the strike-line.
dy2 - length of the arrow-line.
 o drawVStrikeArrow
 public static void drawVStrikeArrow(int x,
                                     int yi,
                                     int yf,
                                     Graphics g)
Draws an arrowed vertical line having a strike point, at 1/4 from the initial y-position and with a 6-pixels length. The arrow-line length is 3pixels long.

Parameters:
x - the x-coordinate of the vertical line.
yi - initial y-coordinate.
yf - final y-coordinate.
g - Graphics context to draw the line in.
r - relative position of the STRIKE point from the initial yi.
dy - length of the strike-line.
dy2 - length of the arrow-line.
 o drawHDashedLine
 public static void drawHDashedLine(int x1,
                                    int x2,
                                    int y,
                                    Graphics g,
                                    int dx)
Draws a horizontal dashed line.

Parameters:
x1 - the beginning x-coordinate.
x2 - the ending x-coordinate.
y - the y-coordinate.
g - the Graphics context.
dx - the line and gap widths.
 o drawHDashedLine
 public static void drawHDashedLine(int x1,
                                    int x2,
                                    int y,
                                    Graphics g)
Draws a horizontal dashed line with gap and line legths of width 3.

Parameters:
x1 - the beginning x-coordinate.
x2 - the ending x-coordinate.
y - the y-coordinate.
g - the Graphics context.
 o drawVDashedLine
 public static void drawVDashedLine(int x,
                                    int y1,
                                    int y2,
                                    Graphics g,
                                    int dy)
Draws a vertical dashed line.

Parameters:
x - the x-coordinate.
y1 - the beginning y-coordinate.
y2 - the ending y-coordinate.
g - the Graphics context.
dy - the line and gap widths.
 o imgRectVert
 public static Image imgRectVert(int width,
                                 int height,
                                 Color top,
                                 Color bottom,
                                 Component comp)
Creates a retangular image with its Color graded linearly in vertical direction.

Parameters:
width - the width of the image rectangle.
height - the height of the image rectangle.
top - the Color of the top side.
bottom - the Color of the bottom side.
Returns:
the rectangular image of size width x height.
 o imgRectHori
 public static Image imgRectHori(int width,
                                 int height,
                                 Color left,
                                 Color right,
                                 Component comp)
Creates a retangular image with its Color graded linearly in the horizontal direction.

Parameters:
width - the width of the image rectangle.
height - the height of the image rectangle.
left - the Color of the left edge.
right - the Color of the right edge.
Returns:
the rectangular image of size width x height.

All Packages  Class Hierarchy  This Package  Previous  Next  Index