public class Markers extends Object
Constructor and Description |
---|
Markers()
The class contructor
|
Markers(URL file)
Instantiate the Marker class and load marker definitions from the parsed URL.
|
Modifier and Type | Method and Description |
---|---|
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(Graphics g,
int m,
double scale,
int x,
int y)
draw the marker
|
void |
LoadMarkers(URL file)
This method reads the marker file and loads the marker definitions.
|
public Markers()
public Markers(URL file) throws IOException
file
- The URL of the data file to readIOException
- if there is an error with the IO stream.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(URL file) throws IOException
file
- URL of file to loadIOException
- If there is an IO errorpublic void draw(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 markerJas4pp 1.5 © Java Analysis Studio for Particle Physics