|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectgraph.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.lang.String path)
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. |
void |
draw(java.awt.Graphics g,
int m,
double scale,
int x,
int y)
draw the marker |
void |
LoadMarkers(java.lang.String path)
This method reads the marker file and loads the marker definitions. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int last
protected int max
protected java.util.Vector[] vert
| Constructor Detail |
public Markers()
public Markers(java.lang.String path)
throws java.io.IOException
java.io.IOException - if there is an error with the IO stream.| 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.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.lang.String path)
throws java.io.IOException
java.io.IOException - If there is an IO error
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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||