|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--sdt.gui.PlotBox | +--sdt.gui.Plot
Inner classes inherited from class sdt.gui.PlotBox |
PlotBox.DragListener,
PlotBox.ZoomListener |
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
protected int |
_currentdataset
|
protected int |
_marks
|
protected boolean |
_painted
|
protected java.util.Vector |
_points
|
protected java.util.Hashtable |
_pointsb
|
Fields inherited from class sdt.gui.PlotBox |
_background,
_bottomPadding,
_colors,
_documentBase,
_foreground,
_grid,
_height,
_leftPadding,
_LOG10SCALE,
_lrx,
_lry,
_PADDING,
_rightPadding,
_topPadding,
_ulx,
_uly,
_usecolor,
_width,
_xBottom,
_xlog,
_xMax,
_xMin,
_xRangeGiven,
_xscale,
_xTop,
_yBottom,
_ylog,
_yMax,
_yMin,
_yRangeGiven,
_yscale,
_yTop |
Fields inherited from class javax.swing.JComponent |
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
Plot()
|
Method Summary | |
protected void |
_checkDatasetIndex(int dataset)
Check the argument to ensure that it is a valid data set index. |
protected void |
_checkDatasetIndexb(int dataset,
int y)
|
protected void |
_drawBar(java.awt.Graphics graphics,
int dataset,
long xpos,
long ypos,
boolean clip)
Draw bar from the specified point to the y axis. |
protected void |
_drawBar1(java.awt.Graphics graphics,
int dataset,
long xpos,
long ypos,
long prevx,
long prevy,
boolean clip)
|
protected void |
_drawErrorBar(java.awt.Graphics graphics,
int dataset,
long xpos,
long yLowEBPos,
long yHighEBPos,
boolean clip)
Draw an error bar for the specified yLowEB and yHighEB values. |
protected void |
_drawImpulse(java.awt.Graphics graphics,
long xpos,
long ypos,
boolean clip)
Draw a line from the specified point to the y axis. |
protected void |
_drawLine(java.awt.Graphics graphics,
int dataset,
long startx,
long starty,
long endx,
long endy,
boolean clip)
Draw a line from the specified starting point to the specified ending point. |
protected void |
_drawLine1(java.awt.Graphics graphics,
int dataset,
long startx,
long starty,
long endx,
long endy,
boolean clip)
|
protected void |
_drawPlot(java.awt.Graphics graphics,
boolean clearfirst)
Draw the axes and then plot all points. |
protected void |
_drawPlot1(java.awt.Graphics graphics,
boolean clearfirst)
|
protected void |
_drawPoint(java.awt.Graphics graphics,
int dataset,
long xpos,
long ypos,
boolean clip)
Put a mark corresponding to the specified dataset at the specified x and y position. |
protected boolean |
_parseLine(java.lang.String line)
Parse a line that gives plotting information. |
protected void |
_write(java.io.PrintWriter output)
Write plot information to the specified output stream. |
void |
addLegend(int dataset,
java.lang.String legend)
|
void |
addPoint(int dataset,
double x,
double y,
boolean connected)
|
void |
addPointWithErrorBars(int dataset,
double x,
double y,
double yLowEB,
double yHighEB,
boolean connected)
In the specified data set, add the specified x, y point to the plot with error bars. |
void |
clear(boolean format)
Clear the plot of all data points. |
void |
erasePoint(int dataset,
int index)
Erase the point at the given index in the given dataset. |
void |
fillPlot()
Rescale so that the data that is currently plotted just fits. |
java.lang.String |
getCmdLineFilename()
Return the last file name seen on the command-line arguments parsed by parseArgs(). |
int |
getMaxDataSets()
Deprecated. |
void |
paint(java.awt.Graphics graphics)
Start a new thread to paint the component contents. |
int |
parseArgs(java.lang.String[] args)
Parse pxgraph style command line arguments. |
void |
parseFile(java.lang.String filespec,
java.net.URL documentBase)
Deprecated. |
int |
parsePxgraphargs(java.lang.String pxgraphargs)
Split a string containing pxgraph-compatible command-line arguments into an array and call parseArgs() on the array. |
void |
read(java.io.InputStream in)
Override the base class to register that we are reading a new data set. |
void |
readPxgraph(java.io.InputStream inputstream)
Read a pxgraph-compatible binary encoded file. |
void |
setBarGraph(boolean _bargraph)
|
void |
setBars(boolean on)
Turn bars on or off (for bar charts). |
void |
setBars(double width,
double offset)
Turn bars on and set the width and offset. |
void |
setConnected(boolean on)
If the argument is true, then the default is to connect subsequent points with a line. |
void |
setImpulses(boolean on)
If the argument is true, then a line will be drawn from any plotted point down to the x axis. |
void |
setImpulses(boolean on,
int dataset)
If the first argument is true, then a line will be drawn from any plotted point in the specified dataset down to the x axis. |
void |
setMarksStyle(java.lang.String style)
Set the marks style to "none", "points", "dots", or "various". |
void |
setMarksStyle(java.lang.String style,
int dataset)
Set the marks style to "none", "points", "dots", or "various" for the specified dataset. |
void |
setNumSets(int numsets)
Deprecated. |
void |
setPointsPersistence(int persistence)
Calling this method with a positive argument sets the persistence of the plot to the given number of points. |
void |
setStatus(boolean show)
|
void |
setSweepsPersistence(int persistence)
A sweep is a sequence of points where the value of X is increasing. |
void |
update(java.awt.Graphics g)
Override the base class to not clear the component first. |
Methods inherited from class sdt.gui.PlotBox |
_setButtonsVisibility,
_zoom,
_zoomBox,
_zoomStart,
addXTick,
addYTick,
getColorByName,
getDataurl,
getDocumentBase,
getLegend,
getMinimumSize,
getPreferredSize,
init,
parseFile,
setBackground,
setBinary,
setBounds,
setButtons,
setDataurl,
setDocumentBase,
setForeground,
setGrid,
setLabelFont,
setSize,
setTitle,
setTitleFont,
setXLabel,
setXLog,
setXRange,
setYLabel,
setYLog,
setYRange,
write,
zoom |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getNextFocusableComponent,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected int _currentdataset
protected java.util.Vector _points
protected java.util.Hashtable _pointsb
protected int _marks
protected boolean _painted
Constructor Detail |
public Plot()
Method Detail |
public void setStatus(boolean show)
public void setBarGraph(boolean _bargraph)
public void addLegend(int dataset, java.lang.String legend)
public void addPoint(int dataset, double x, double y, boolean connected)
public void addPointWithErrorBars(int dataset, double x, double y, double yLowEB, double yHighEB, boolean connected)
dataset
- The data set index.x
- The X position of the new point.y
- The Y position of the new point.yLowEB
- The low point of the error bar.yHighEB
- The high point of the error bar.connected
- If true, a line is drawn to connect to the previous
point.public void clear(boolean format)
format
- If true, clear the format controls as well.public void erasePoint(int dataset, int index)
dataset
- The data set index.index
- The index of the point to erase.public void fillPlot()
public java.lang.String getCmdLineFilename()
public int getMaxDataSets()
public void paint(java.awt.Graphics graphics)
graphics
- The graphics context.public int parseArgs(java.lang.String[] args) throws CmdLineArgException, java.io.FileNotFoundException, java.io.IOException
args
- A set of command-line arguments.public void parseFile(java.lang.String filespec, java.net.URL documentBase)
public int parsePxgraphargs(java.lang.String pxgraphargs) throws CmdLineArgException, java.io.FileNotFoundException, java.io.IOException
public void read(java.io.InputStream in) throws java.io.IOException
inputstream
- The input stream.public void readPxgraph(java.io.InputStream inputstream) throws java.io.IOException
in
- The input stream.public void setBars(boolean on)
on
- If true, turn bars on.public void setBars(double width, double offset)
width
- The width of the bars.offset
- The offset per data set.public void setConnected(boolean on)
public void setImpulses(boolean on)
on
- If true, draw a stem plot.public void setImpulses(boolean on, int dataset)
on
- If true, draw a stem plot.dataset
- The dataset to which this should apply.public void setMarksStyle(java.lang.String style)
style
- A string specifying the style for points.public void setMarksStyle(java.lang.String style, int dataset)
style
- A string specifying the style for points.dataset
- The dataset to which this should apply.public void setNumSets(int numsets)
numsets
- The number of data sets.public void setPointsPersistence(int persistence)
public void setSweepsPersistence(int persistence)
public void update(java.awt.Graphics g)
graphics
- The graphics context.protected void _checkDatasetIndex(int dataset)
dataset
- The data set index.protected void _checkDatasetIndexb(int dataset, int y)
protected void _drawBar(java.awt.Graphics graphics, int dataset, long xpos, long ypos, boolean clip)
graphics
- The graphics context.dataset
- The index of the dataset.xpos
- The x position.ypos
- The y position.clip
- If true, then do not draw outside the range.protected void _drawBar1(java.awt.Graphics graphics, int dataset, long xpos, long ypos, long prevx, long prevy, boolean clip)
protected void _drawErrorBar(java.awt.Graphics graphics, int dataset, long xpos, long yLowEBPos, long yHighEBPos, boolean clip)
graphics
- The graphics context.dataset
- The index of the dataset.xpos
- The x position.yLowEBPos
- The lower y position of the error bar.yHighEBPos
- The upper y position of the error bar.clip
- If true, then do not draw above the range.protected void _drawImpulse(java.awt.Graphics graphics, long xpos, long ypos, boolean clip)
graphics
- The graphics context.xpos
- The x position.ypos
- The y position.clip
- If true, then do not draw outside the range.protected void _drawLine1(java.awt.Graphics graphics, int dataset, long startx, long starty, long endx, long endy, boolean clip)
protected void _drawLine(java.awt.Graphics graphics, int dataset, long startx, long starty, long endx, long endy, boolean clip)
graphics
- The graphics context.dataset
- The index of the dataset.startx
- The starting x position.starty
- The starting y position.endx
- The ending x position.endy
- The ending y position.clip
- If true, then do not draw outside the range.protected void _drawPlot(java.awt.Graphics graphics, boolean clearfirst)
wait()
to prevent it plotting
points before the axes have been first drawn. If the second
argument is true, clear the display first.
This method is called by paint(). To cause it to be called you
would normally call repaint(), which eventually causes paint() to
be called.graphics
- The graphics context.clearfirst
- If true, clear the plot before proceeding.protected void _drawPlot1(java.awt.Graphics graphics, boolean clearfirst)
protected void _drawPoint(java.awt.Graphics graphics, int dataset, long xpos, long ypos, boolean clip)
graphics
- The graphics context.dataset
- The index of the dataset.xpos
- The x position.ypos
- The y position.clip
- If true, then do not draw outside the range.protected boolean _parseLine(java.lang.String line)
line
- A command line.protected void _write(java.io.PrintWriter output)
output
- A buffered print writer.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |