📄 graph.graph2d.html
字号:
<!--NewPage--><html><head><!-- Generated by javadoc on Wed Oct 23 13:30:49 EST 1996 --><a name="_top_"></a><title> Class graph.Graph2D</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.G2Dint.html#_top_">Previous</a> <a href="graph.IsoCurve.html#_top_">Next</a> <a href="AllNames.html">Index</a></pre><hr><h1> Class graph.Graph2D</h1><pre><a href="java.lang.Object.html#_top_">java.lang.Object</a> | +----<a href="java.awt.Component.html#_top_">java.awt.Component</a> | +----<a href="java.awt.Canvas.html#_top_">java.awt.Canvas</a> | +----graph.Graph2D</pre><hr><dl> <dt> public class <b>Graph2D</b> <dt> extends <a href="java.awt.Canvas.html#_top_">Canvas</a></dl>This is the main plotting class. It partitions the canvas to contain thespecified axes with the remaining space taken with the plotting region.Axes are packed against the walls of the canvas. The <B>paint</B> and<B>update</B> methods of this class handle all the drawing operations of thegraph. This means that independent components like Axis and DataSets must beregistered with this class to be incorporated into the plot.<dl> <dt> <b>Version:</b> <dd> 1.12, 1996/09/24 05:23:41 <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="#axis"><b>axis</b></a> <dd> A vector list of All the axes attached <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#borderBottom"><b>borderBottom</b></a> <dd> The width of the border at the bottom of the canvas. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#borderLeft"><b>borderLeft</b></a> <dd> The width of the border at the left of the canvas. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#borderRight"><b>borderRight</b></a> <dd> The width of the border at the right of the canvas. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#borderTop"><b>borderTop</b></a> <dd> The width of the border at the top of the canvas. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#clearAll"><b>clearAll</b></a> <dd> If set <I>true</I> (the default) the canvas will be set to the background color (erasing the plot) when the update method is called. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#DataBackground"><b>DataBackground</b></a> <dd> The background color for the data window <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#datarect"><b>datarect</b></a> <dd> The rectangle that the data will be plotted within. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#dataset"><b>dataset</b></a> <dd> A vector list of All the DataSets attached <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#drawgrid"><b>drawgrid</b></a> <dd> If set <I>true</I> (the default) a grid will be drawn over the data window. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#drawzero"><b>drawzero</b></a> <dd> If set <I>true</I> (the default) a grid line will be drawn across the data window at the zeros of the innermost axes. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#frame"><b>frame</b></a> <dd> If set <I>true</I> a frame will be drawn around the data window. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#framecolor"><b>framecolor</b></a> <dd> The color of the frame to be drawn <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#gridcolor"><b>gridcolor</b></a> <dd> The color of the grid to be drawn <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#lastText"><b>lastText</b></a> <dd> Text to be painted Last onto the Graph Canvas. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#load_thread"><b>load_thread</b></a> <dd> The blinking "data loading" thread <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#loadingData"><b>loadingData</b></a> <dd> If this is greater than zero it means that data loading threads are active so the message "loading data" is flashed on the plot canvas. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#markers"><b>markers</b></a> <dd> The markers that may have been loaded <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#paintAll"><b>paintAll</b></a> <dd> If set <I>true</I> (the default) everything associated with the plot will be drawn when the update method or paint method are called. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#square"><b>square</b></a> <dd> Modify the position of the axis and the range of the axis so that the aspect ratio of the major tick marks are 1 and the plot is square on the screen <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o "> <a href="#zerocolor"><b>zerocolor</b></a> <dd> The color of the zero grid lines.</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="#Graph2D()"><b>Graph2D</b></a>() <dd> </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="#attachAxis(graph.Axis)"><b>attachAxis</b></a>(Axis) <dd> Attach a previously created Axis. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#attachDataSet(graph.DataSet)"><b>attachDataSet</b></a>(DataSet) <dd> Attach a DataSet to the graph. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#createAxis(int)"><b>createAxis</b></a>(int) <dd> Create and attach an Axis to the graph. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#detachAxes()"><b>detachAxes</b></a>() <dd> Detach All attached Axes. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#detachAxis(graph.Axis)"><b>detachAxis</b></a>(Axis) <dd> Detach a previously attached Axis. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#detachDataSet(graph.DataSet)"><b>detachDataSet</b></a>(DataSet) <dd> Detach the DataSet from the class. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#detachDataSets()"><b>detachDataSets</b></a>() <dd> Detach All the DataSets from the class. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#drawAxis(java.awt.Graphics, java.awt.Rectangle)"><b>drawAxis</b></a>(Graphics, Rectangle) <dd> Draw the Axis. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#drawFrame(java.awt.Graphics, int, int, int, int)"><b>drawFrame</b></a>(Graphics, int, int, int, int) <dd> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#finishedloading()"><b>finishedloading</b></a>() <dd> Decrement the loading Data counter by one. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#ForceSquare(java.awt.Graphics, java.awt.Rectangle)"><b>ForceSquare</b></a>(Graphics, Rectangle) <dd> Force the plot to have an aspect ratio of 1 by forcing the axes to have the same range. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getDataRectangle(java.awt.Graphics, java.awt.Rectangle)"><b>getDataRectangle</b></a>(Graphics, Rectangle) <dd> Calculate the rectangle occupied by the data <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getMarkers()"><b>getMarkers</b></a>() <dd> Get the markers <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getXmax()"><b>getXmax</b></a>() <dd> Get the Maximum X value of all attached DataSets. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getXmin()"><b>getXmin</b></a>() <dd> Get the Minimum X value of all attached DataSets. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getYmax()"><b>getYmax</b></a>() <dd> Get the Maximum Y value of all attached DataSets. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getYmin()"><b>getYmin</b></a>() <dd> Get the Minimum Y value of all attached DataSets. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#keyDown(java.awt.Event, int)"><b>keyDown</b></a>(Event, int) <dd> Handle keyDown events. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#loadDataSet(double[], int)"><b>loadDataSet</b></a>(double[], int) <dd> Load and Attach a DataSet from an array. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#loadFile(java.net.URL)"><b>loadFile</b></a>(URL) <dd> Load and Attach a DataSet from a File. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#loadmessage(java.lang.String)"><b>loadmessage</b></a>(String) <dd> Change the message to be flashed on the canvas <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#paint(java.awt.Graphics)"><b>paint</b></a>(Graphics) <dd> This paints the entire plot. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#paintBeforeData(java.awt.Graphics, java.awt.Rectangle)"><b>paintBeforeData</b></a>(Graphics, Rectangle) <dd> A hook into the Graph2D.paint method. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#paintFirst(java.awt.Graphics, java.awt.Rectangle)"><b>paintFirst</b></a>(Graphics, Rectangle) <dd> A hook into the Graph2D.paint method. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#paintLast(java.awt.Graphics, java.awt.Rectangle)"><b>paintLast</b></a>(Graphics, Rectangle) <dd> A hook into the Graph2D.paint method. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setDataBackground(java.awt.Color)"><b>setDataBackground</b></a>(Color) <dd> Set the background color for the data window. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setGraphBackground(java.awt.Color)"><b>setGraphBackground</b></a>(Color) <dd> Set the background color for the entire canvas. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setMarkers(graph.Markers)"><b>setMarkers</b></a>(Markers) <dd> Set the markers for the plot. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#startedloading()"><b>startedloading</b></a>() <dd> Calling this method pauses the plot and displays a flashing message on the screen. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#update(java.awt.Graphics)"><b>update</b></a>(Graphics) <dd> This method is called via the Graph2D.repaint() method.</dl><a name="variables"></a><h2> <img src="images/variables.gif" width=153 height=38 alt="Variables"></h2><a name="axis"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a><b>axis</b><pre> protected <a href="java.util.Vector.html#_top_">Vector</a> axis</pre><dl> <dd> A vector list of All the axes attached @see Graph2d#attachAxis()</dl><a name="dataset"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a><b>dataset</b><pre> protected <a href="java.util.Vector.html#_top_">Vector</a> dataset</pre><dl> <dd> A vector list of All the DataSets attached @see Graph2d#attachDataSet() @see DataSet</dl><a name="markers"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a><b>markers</b><pre> protected <a href="graph.Markers.html#_top_">Markers</a> markers</pre><dl>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -