|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Canvas
|
+--edu.davidson.graph.Graph2D
|
+--edu.davidson.display.SGraph
A plotting bean based on the graph package by Leigh Brookshaw. SDataListener added 1/1/99
| Fields inherited from class edu.davidson.graph.Graph2D |
borderBottom,
borderLeft,
borderRight,
borderTop,
clearAll,
datarect,
drawgrid,
drawzero,
frame,
framecolor,
gridcolor,
lastText,
loadingData,
paintAll,
square,
zerocolor |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
| Constructor Summary | |
SGraph()
|
|
SGraph(SApplet applet)
|
|
| Method Summary | |
int |
addCursor(int diameter,
double x,
double y)
Add a dragable cursor |
void |
addData(int sid,
double[] x,
double[] y)
Add data to the graph using arrays. |
void |
addData(int sid,
double[] x,
double[] y,
int num)
|
void |
addData(SDataSource ds,
int sid,
double[] x,
double[] y)
|
edu.davidson.graph.DataSet |
addDataSet(double[] points,
int np)
Add a data set to the graph. |
void |
addDatum(int sid,
double x,
double y)
Add a datum to the graph. |
void |
addDatum(SDataSource ds,
int id,
double x,
double y)
|
int |
addFunction(java.lang.String str)
|
int |
addFunction(java.lang.String indVar,
java.lang.String str)
Add an analytic function to the graph. |
int |
addThing(Thing t)
Add a drawable thing. |
void |
adjustScale()
Use this method to make some last minute scale adjustments. |
void |
clearAllData()
Clear the data from all series. |
void |
clearAllThings()
Remove all dragable objects for the graph. |
void |
clearSeries(int s)
Clear the data from a series. |
void |
clearSeriesData(int sid)
Delete the data from a series. |
java.lang.Object |
clone()
|
edu.davidson.display.SGraph.Series |
createSeries(int sid)
Create an empty series so that styles, color, and other properites can be set. |
void |
deleteAllFunctions()
Delete all functions. |
void |
deleteAllNonSeriesData()
Remove any Data that is not part of a series. |
void |
deleteAllSeries()
Delete all series from the graph. |
void |
deleteFunction(int id)
Delete a function from the plot. |
void |
deleteSeries(int id)
Delete one series from the graph. |
void |
deleteSeries(int id,
boolean willRepaint)
|
void |
drawCoords(java.awt.Graphics g,
int xPix,
int yPix)
|
void |
drawCoords(int xPix,
int yPix)
|
java.lang.String |
getBorders()
Get the margins. |
edu.davidson.display.SGraph.MathFunction |
getFunction(int id)
Get the function object from the id. |
java.lang.String |
getFunctionString(int id)
Get the function that is being graphed. |
int |
getID()
Get the ID for this object. |
int |
getIDFromSID(int val)
|
java.lang.String |
getLabelX()
|
java.lang.String |
getLabelY()
|
double |
getMaxX()
Get the x axis maximum . |
double |
getMaxY()
Get the y axis maximum . |
double |
getMinX()
Get the x axis minimum . |
double |
getMinY()
Get the y axis minimum . |
SApplet |
getOwner()
|
Thing |
getThing(int id)
Get the ID for a Thing object from the hashcode. |
java.lang.String |
getTitle()
|
boolean |
isAutoRefresh()
|
boolean |
isAutoscaleX()
|
boolean |
isAutoscaleY()
|
boolean |
isDrawGrid()
Will the graph have a grid? |
boolean |
isDrawZero()
|
boolean |
isEnableMouse()
|
boolean |
isSampleData()
Will the graph show sample data when it is initialized? |
void |
paintFunctions(java.awt.Graphics g,
java.awt.Rectangle r)
A hook into the Graph2D.paint method. |
void |
paintLast(java.awt.Graphics g,
java.awt.Rectangle r)
A hook into the Graph2D.paint method. |
void |
paintOffScreen()
|
void |
paintOffScreen(java.awt.Graphics g)
Paint the graph offscreen into an image and then blast the image onto the screen |
int |
pixFromX(double x)
Get the pixel value corresponding to an x value. |
int |
pixFromY(double y)
|
int |
plotRegression(int sid)
|
void |
repaint()
|
void |
run()
|
void |
setAddRepeatedDatum(int sid,
boolean add)
Set the addRepeatedDataum property. |
void |
setAutoRefresh(boolean auto)
Set the autoRefresh property. |
void |
setAutoReplaceData(int sid,
boolean auto)
|
void |
setAutoscaleX(boolean as)
Set the autoscaleX property. |
void |
setAutoscaleY(boolean as)
Set the autoscaleY property. |
void |
setBorders(java.lang.String s)
Set the margins. |
void |
setDrawGrid(boolean dg)
Set the draw grid property. |
void |
setDrawZero(boolean dz)
Have the graph draw x=0 and y=0 lines. |
void |
setEnableMouse(boolean em)
Enable the graph to respond to mouse actionions. |
void |
setFormat(java.lang.String str)
Change the display format for mouse actions. |
void |
setFunctionRange(int id,
double xmin,
double xmax,
int n)
|
boolean |
setFunctionString(int id,
java.lang.String str)
Change the function that is being graphed without adding a new function. |
boolean |
setFunctionVariable(int id,
java.lang.String str)
Change the function's independent variable. |
void |
setGutters(int g1,
int g2,
int g3,
int g4)
Set the gutters. |
void |
setLabelX(java.lang.String s)
Set the x axis label. |
void |
setLabelX(java.lang.String s,
java.awt.Color c)
|
void |
setLabelY(java.lang.String s)
Set the y axis label. |
void |
setLabelY(java.lang.String s,
java.awt.Color c)
|
void |
setLastPointMarker(int sid,
boolean lpm)
|
void |
setMarkerSize(double scale)
Set the default marker size. |
void |
setMarkerSize(int sid,
double scale)
Set the marker size. |
void |
setMinMaxX(double min,
double max)
Set the x axis minimum and maximum values. |
void |
setMinMaxY(double min,
double max)
Set the y axis minimum and maximum values. |
void |
setObjectColor(int id,
java.awt.Color c)
set the color of the object from the id. |
void |
setOwner(SApplet owner)
|
void |
setParentSApplet(SApplet p)
|
void |
setSampleData(boolean sd)
Create sample data when it is initialized. |
void |
setSeriesColor(int sid,
java.awt.Color c)
|
void |
setSeriesLegend(int sid,
java.awt.Color c,
int xpix,
int ypix,
java.lang.String legend)
Set the series legend. |
void |
setSeriesLegend(int sid,
int xpix,
int ypix,
java.lang.String legend)
|
void |
setSeriesLegendColor(int sid,
java.awt.Color c)
|
void |
setSeriesStyle(int sid,
boolean conPts,
int m)
|
void |
setSeriesStyle(int sid,
java.awt.Color c,
boolean conPts,
int m)
Set the series style. |
void |
setShowAxes(boolean sa)
Show or hide the the X and Y axes on the graph. |
void |
setSquare(boolean isSquare)
Set the aspect ratio=1 so that both axes have the same pixels per unit. |
void |
setTitle(java.lang.String str)
|
void |
sGraph_mouseEntered(java.awt.event.MouseEvent e)
|
void |
sGraph_mouseExited(java.awt.event.MouseEvent e)
|
void |
sGraph_mouseMoved(java.awt.event.MouseEvent e)
|
double |
xFromPix(int x)
Get the value on the x axis from the pixel value. |
double |
yFromPix(int y)
|
| Methods inherited from class edu.davidson.graph.Graph2D |
attachAxis,
attachDataSet,
createAxis,
detachAxes,
detachAxis,
detachDataSet,
detachDataSets,
finishedloading,
getDataBackground,
getMarkers,
getXmax,
getXmin,
getYmax,
getYmin,
isShowAxis,
loadDataSet,
loadFile,
loadmessage,
paint,
paint,
paintBeforeData,
paintFirst,
setDataBackground,
setGraphBackground,
setMarkers,
setShowAxis,
startedloading,
update |
| Methods inherited from class java.awt.Canvas |
addNotify,
getAccessibleContext |
| Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addHierarchyBoundsListener,
addHierarchyListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
contains,
contains,
createImage,
createImage,
deliverEvent,
disable,
dispatchEvent,
doLayout,
enable,
enable,
enableInputMethods,
getAlignmentX,
getAlignmentY,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentAt,
getComponentAt,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getGraphicsConfiguration,
getHeight,
getInputContext,
getInputMethodRequests,
getListeners,
getLocale,
getLocation,
getLocation,
getLocationOnScreen,
getMaximumSize,
getMinimumSize,
getName,
getParent,
getPeer,
getPreferredSize,
getSize,
getSize,
getToolkit,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
hide,
imageUpdate,
inside,
invalidate,
isDisplayable,
isDoubleBuffered,
isEnabled,
isFocusTraversable,
isLightweight,
isOpaque,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
layout,
list,
list,
list,
list,
list,
locate,
location,
lostFocus,
minimumSize,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
preferredSize,
prepareImage,
prepareImage,
print,
printAll,
remove,
removeComponentListener,
removeFocusListener,
removeHierarchyBoundsListener,
removeHierarchyListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
requestFocus,
reshape,
resize,
resize,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setCursor,
setDropTarget,
setEnabled,
setFont,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
setVisible,
show,
show,
size,
toString,
transferFocus,
validate |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public SGraph()
public SGraph(SApplet applet)
| Method Detail |
public void setSampleData(boolean sd)
sd - Create the sample data?.public boolean isSampleData()
public void setDrawGrid(boolean dg)
dg - Draw the grid?.public boolean isDrawGrid()
public void setAutoRefresh(boolean auto)
auto - AutoRefresh the graph?.public boolean isAutoRefresh()
public void setAutoscaleX(boolean as)
as - Autoscale the x axis?.public boolean isAutoscaleX()
public void setAutoscaleY(boolean as)
as - Autoscale the y axis?.public boolean isAutoscaleY()
public void setDrawZero(boolean dz)
dz - Draw the lines?public boolean isDrawZero()
public void setSeriesLegend(int sid,
java.awt.Color c,
int xpix,
int ypix,
java.lang.String legend)
sid - The series id.c - The legend color.xpix - The x postion in pixels.ypix - The y postion in pixels.legend - The legend.
public void setSeriesLegend(int sid,
int xpix,
int ypix,
java.lang.String legend)
public void setSeriesLegendColor(int sid,
java.awt.Color c)
public void setSeriesStyle(int sid,
java.awt.Color c,
boolean conPts,
int m)
sid - The series id.c - The series color.conPts - Connect the points?m - Marker style. (m=1 is cross; m=2 is square, m=3 is circle)
public void setSeriesStyle(int sid,
boolean conPts,
int m)
public void setSeriesColor(int sid,
java.awt.Color c)
public void setShowAxes(boolean sa)
sa - Show the axis?public void setSquare(boolean isSquare)
isSquare? - public java.lang.String getBorders()
public int getID()
public Thing getThing(int id)
public void setBorders(java.lang.String s)
s - The gutter sizes: left, top, right, bottom.
public void setGutters(int g1,
int g2,
int g3,
int g4)
g1 - The gutter sizes: left, top, right, bottom.public void setLabelX(java.lang.String s)
The - label value.
public void setLabelX(java.lang.String s,
java.awt.Color c)
public java.lang.String getLabelX()
public void setLabelY(java.lang.String s)
The - label value.
public void setLastPointMarker(int sid,
boolean lpm)
public void setAutoReplaceData(int sid,
boolean auto)
public void setAddRepeatedDatum(int sid,
boolean add)
add - Added repeated data values to the graph?
public void setLabelY(java.lang.String s,
java.awt.Color c)
public java.lang.String getLabelY()
public void setMarkerSize(double scale)
size - Marker size.
public void setMarkerSize(int sid,
double scale)
id - Series id.size - Marker size.
public void setMinMaxX(double min,
double max)
min - Minumum value.max - Maximum value.public double getMinX()
public double getMaxX()
public void setMinMaxY(double min,
double max)
min - Minumum value.max - Maximum value.public double getMinY()
public double getMaxY()
public edu.davidson.display.SGraph.MathFunction getFunction(int id)
id - The id of the function.public java.lang.String getTitle()
public void setTitle(java.lang.String str)
public int getIDFromSID(int val)
public void setObjectColor(int id,
java.awt.Color c)
id - The id of the function.c - The colorpublic void setOwner(SApplet owner)
public SApplet getOwner()
public void deleteAllFunctions()
public void deleteFunction(int id)
id - The id of the function;public void deleteAllSeries()
public void deleteAllNonSeriesData()
public void deleteSeries(int id)
id - The id of the series to remove.
public void deleteSeries(int id,
boolean willRepaint)
public void setFunctionRange(int id,
double xmin,
double xmax,
int n)
public boolean setFunctionString(int id,
java.lang.String str)
str - The function f(x).public java.lang.String getFunctionString(int id)
id - The id of the function.
public boolean setFunctionVariable(int id,
java.lang.String str)
str - The new variablepublic java.lang.Object clone()
public edu.davidson.display.SGraph.Series createSeries(int sid)
public void clearAllData()
public void clearSeries(int s)
s - Series IDpublic void clearSeriesData(int sid)
id - The id of the series.public void adjustScale()
public void paintFunctions(java.awt.Graphics g,
java.awt.Rectangle r)
public void repaint()
public void run()
public void paintOffScreen(java.awt.Graphics g)
public void paintOffScreen()
public void paintLast(java.awt.Graphics g,
java.awt.Rectangle r)
public int pixFromX(double x)
x - The value along the x axis.public int pixFromY(double y)
public double xFromPix(int x)
x - The pixel inside the canvas.public double yFromPix(int y)
public edu.davidson.graph.DataSet addDataSet(double[] points,
int np)
points - The data.np - The number of points.
public void addDatum(int sid,
double x,
double y)
id - The series id.x - The x value of the datum.y - The y value of the datum.
public void addDatum(SDataSource ds,
int id,
double x,
double y)
public void clearAllThings()
public int addCursor(int diameter,
double x,
double y)
int - diameter The diameter.double - x The initial x position.double - y The initial y position.public int addThing(Thing t)
t - the ting to be added.
public void addData(int sid,
double[] x,
double[] y)
id - The series id.x - The x array of the data.y - The y array of the data.
public void addData(SDataSource ds,
int sid,
double[] x,
double[] y)
public void addData(int sid,
double[] x,
double[] y,
int num)
public int addFunction(java.lang.String indVar,
java.lang.String str)
str - The function f(x).public int addFunction(java.lang.String str)
public int plotRegression(int sid)
public void drawCoords(java.awt.Graphics g,
int xPix,
int yPix)
public void drawCoords(int xPix,
int yPix)
public boolean isEnableMouse()
public void setEnableMouse(boolean em)
em - Enable the coordinate display when the mouse is pressed.public void setParentSApplet(SApplet p)
public void setFormat(java.lang.String str)
str - The format for cooridinate display.public void sGraph_mouseEntered(java.awt.event.MouseEvent e)
public void sGraph_mouseExited(java.awt.event.MouseEvent e)
public void sGraph_mouseMoved(java.awt.event.MouseEvent e)
|
Copyright Wolfgang Christian | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||