📄 graph.markers.html
字号:
<!--NewPage--><html><head><!-- Generated by javadoc on Wed Oct 23 13:30:49 EST 1996 --><a name="_top_"></a><title> Class graph.Markers</title></head><body><pre><a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-graph.html">This Package</a> <a href="graph.LoadData.html#_top_">Previous</a> <a href="graph.ParseFunction.html#_top_">Next</a> <a href="AllNames.html">Index</a></pre><hr><h1> Class graph.Markers</h1><pre><a href="java.lang.Object.html#_top_">java.lang.Object</a> | +----graph.Markers</pre><hr><dl> <dt> public class <b>Markers</b> <dt> extends <a href="java.lang.Object.html#_top_">Object</a></dl>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.<dl> <dt> <b>Version:</b> <dd> 1.8, 1996/09/20 00:02:57 <dt> <b>Author:</b> <dd> Leigh Brookshaw</dl><hr><a name="index"></a><h2> <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index"></h2><dl> <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#last"><b>last</b></a> <dd> index of the last marker loaded <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#max"><b>max</b></a> <dd> maximum number of markers allowed <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#vert"><b>vert</b></a> <dd> An array of vectors.</dl><h2> <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index"></h2><dl> <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o "> <a href="#Markers()"><b>Markers</b></a>() <dd> The class contructor <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o "> <a href="#Markers(java.net.URL)"><b>Markers</b></a>(URL) <dd> Instantiate the Marker class and load marker definitions from the parsed URL.</dl><h2> <img src="images/method-index.gif" width=207 height=38 alt="Method Index"></h2><dl> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#AddMarker(int, boolean[], int[], int[])"><b>AddMarker</b></a>(int, boolean[], int[], int[]) <dd> Add the definition of a new marker. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#AddMarker(int, int, boolean[], int[], int[])"><b>AddMarker</b></a>(int, int, boolean[], int[], int[]) <dd> Add the definition of a new marker. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#ClearMarkers()"><b>ClearMarkers</b></a>() <dd> Clear All markers. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#DeleteMarker(int)"><b>DeleteMarker</b></a>(int) <dd> Delete the marker with the given index. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#draw(java.awt.Graphics, int, double, int, int)"><b>draw</b></a>(Graphics, int, double, int, int) <dd> draw the marker <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#LoadMarkers(java.net.URL)"><b>LoadMarkers</b></a>(URL) <dd> This method reads the marker file and loads the marker definitions.</dl><a name="variables"></a><h2> <img src="images/variables.gif" width=153 height=38 alt="Variables"></h2><a name="last"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a><b>last</b><pre> protected int last</pre><dl> <dd> index of the last marker loaded</dl><a name="max"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a><b>max</b><pre> protected int max</pre><dl> <dd> maximum number of markers allowed</dl><a name="vert"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a><b>vert</b><pre> protected <a href="java.util.Vector.html#_top_">Vector</a> vert[]</pre><dl> <dd> An array of vectors. Each element in the array contains the vertex vectors for a marker. Marker 1 is at element vert[0].</dl><a name="constructors"></a><h2> <img src="images/constructors.gif" width=231 height=38 alt="Constructors"></h2><a name="Markers"></a><a name="Markers()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a><b>Markers</b><pre> public Markers()</pre><dl> <dd> The class contructor</dl><a name="Markers(java.net.URL)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a><b>Markers</b><pre> public Markers(<a href="java.net.URL.html#_top_">URL</a> file) throws <a href="java.io.IOException.html#_top_">IOException</a></pre><dl> <dd> Instantiate the Marker class and load marker definitions from the parsed URL.The format of the file is easily worked out from the default marker file <a href="marker.txt">marker.txt</a>. <dl> <dt> <b>Parameters:</b> <dd> file - The URL of the data file to read <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a> <dd> if there is an error with the IO stream. </dl></dl><a name="methods"></a><h2> <img src="images/methods.gif" width=151 height=38 alt="Methods"></h2><a name="AddMarker(int, int, boolean[], int[], int[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="AddMarker"><b>AddMarker</b></a><pre> public void AddMarker(int m, int n, boolean draw[], int x[], int y[])</pre><dl> <dd> Add the definition of a new marker. The arrays contain the vertexpoints of the marker. The boolean array is used to define a relative draw or move to the vertex.The first vertex should always be a move (The boolean array is "true" for a relative draw. <dl> <dt> <b>Parameters:</b> <dd> m - The index of the marker. The first marker has index 1. <dd> n - The number of vertices required to stroke the marker. <dd> draw - Boolean array containing relative move/draw instructions. "true" is a draw. <dd> x - Integer array containing the pixel x position of the vertices. All positions are relative to the center of the marker. <dd> y - Integer array containing the pixel y postions of the vertices. </dl></dl><a name="AddMarker(int, boolean[], int[], int[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="AddMarker"><b>AddMarker</b></a><pre> public void AddMarker(int n, boolean draw[], int x[], int y[])</pre><dl> <dd> Add the definition of a new marker. The new marker is appended onto the marker list. The center of the marker is assumed to be at (0,0). <dl> <dt> <b>Parameters:</b> <dd> n - number of move/draw commands <dd> draw - <i>true</i> if the point is to drawn to, <i>false</i> ifthe point is to be moved to. <dd> x - X pixel to move/draw to. <dd> x - Y pixel to move/draw to. </dl></dl><a name="DeleteMarker(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="DeleteMarker"><b>DeleteMarker</b></a><pre> public void DeleteMarker(int n)</pre><dl> <dd> Delete the marker with the given index. the first marker has index 1. <dl> <dt> <b>Parameters:</b> <dd> n - The index of the marker to delete. Markers start at index 1. </dl></dl><a name="ClearMarkers()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="ClearMarkers"><b>ClearMarkers</b></a><pre> public void ClearMarkers()</pre><dl> <dd> Clear All markers.</dl><a name="LoadMarkers(java.net.URL)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="LoadMarkers"><b>LoadMarkers</b></a><pre> public void LoadMarkers(<a href="java.net.URL.html#_top_">URL</a> file) throws <a href="java.io.IOException.html#_top_">IOException</a></pre><dl> <dd> This method reads the marker file and loads the marker definitions.The format of the file is simple. The following are the keywords.<dl> <dt><b>start</b> <dd> starts a new marker definition. <dt><b>end</b> <dd> ends a marker definition. <dt><b>m x y</b> <dd> move to position x,y <dt><b>l x y</b> <dd> line to position x,y</dl>All line drawing is relative to the previous position. The center of the marker is assumed to be at (0,0).As always blank lines are ignored and comments begin with a # character. <dl> <dt> <b>Parameters:</b> <dd> file - URL of file to load <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a> <dd> If there is an IO error </dl></dl><a name="draw(java.awt.Graphics, int, double, int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="draw"><b>draw</b></a><pre> public void draw(<a href="java.awt.Graphics.html#_top_">Graphics</a> g, int m, double scale, int x, int y)</pre><dl> <dd> draw the marker <dl> <dt> <b>Parameters:</b> <dd> g - Graphics context <dd> m - Index of the marker to draw <dd> scale - scale factor. All coordinates are multiplied by this factor. <dd> x - Coordinate where to draw the marker <dd> y - Coordinate where to draw the marker </dl></dl><hr><pre><a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-graph.html">This Package</a> <a href="graph.LoadData.html#_top_">Previous</a> <a href="graph.ParseFunction.html#_top_">Next</a> <a href="AllNames.html">Index</a></pre></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -