|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.PingOO.DLAI.lib.graph.Markers
This class installs, manipulates and draws markers. Markers are stroked using the line drawing method of the class Graph. This means that any stroked figure can become a marker.
| Field Summary | |
protected int |
last
index of the last marker loaded |
protected int |
max
maximum number of markers allowed |
protected java.util.Vector[] |
vert
An array of vectors. |
| Constructor Summary | |
Markers()
The class contructor |
|
Markers(java.net.URL file)
Instantiate the Marker class and load marker definitions from the parsed URL. |
|
| Method Summary | |
void |
AddMarker(int n,
boolean[] draw,
int[] x,
int[] y)
Add the definition of a new marker. |
void |
AddMarker(int m,
int n,
boolean[] draw,
int[] x,
int[] y)
Add the definition of a new marker. |
void |
ClearMarkers()
Clear All markers. |
void |
DeleteMarker(int n)
Delete the marker with the given index. the first marker has index 1. |
void |
draw(java.awt.Graphics g,
int m,
double scale,
int x,
int y)
draw the marker |
void |
LoadMarkers(java.net.URL file)
This method reads the marker file and loads the marker definitions. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected int last
protected int max
protected java.util.Vector[] vert
| Constructor Detail |
public Markers()
public Markers(java.net.URL file)
throws java.io.IOException
file - The URL of the data file to read| Method Detail |
public void AddMarker(int m,
int n,
boolean[] draw,
int[] x,
int[] y)
m - The index of the marker. The first marker has index 1.n - The number of vertices required to stroke the marker.draw - Boolean array containing relative move/draw instructions.
"true" is a draw.x - Integer array containing the pixel x position of the vertices.
All positions are relative to the center of the marker.y - Integer array containing the pixel y postions of the vertices.
public void AddMarker(int n,
boolean[] draw,
int[] x,
int[] y)
n - number of move/draw commandsdraw - true if the point is to drawn to, false if
the point is to be moved to.x - X pixel to move/draw to.x - Y pixel to move/draw to.public void DeleteMarker(int n)
n - The index of the marker to delete. Markers start at index 1.public void ClearMarkers()
public void LoadMarkers(java.net.URL file)
throws java.io.IOException
file - URL of file to load
public void draw(java.awt.Graphics g,
int m,
double scale,
int x,
int y)
g - Graphics contextm - Index of the marker to drawscale - scale factor. All coordinates are multiplied by this factor.x - Coordinate where to draw the markery - Coordinate where to draw the marker
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||