public class Plot
extends javax.swing.JComponent
implements java.awt.event.ActionListener
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
Plot()
Instantiates a new plot.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Action performed.
|
void |
addErrorBars(double[] x,
double[] y,
double[] error,
java.awt.Color c,
float lineWidth)
Adds the error bars.
|
void |
addHistogram(double[] y,
int bins,
java.awt.Color c,
float lineWidth)
Adds the histogram.
|
void |
addHistogram(double[] y,
int from,
int to,
int bins,
java.awt.Color c,
float lineWidth)
Adds the histogram.
|
void |
addLinePlot(double[] x,
double[] y,
java.awt.Color c,
float lineWidth)
Adds the line plot.
|
void |
addLinePlot(double[] x,
double[] y,
int from,
int to,
java.awt.Color c,
float lineWidth)
Adds the line plot.
|
void |
addScatterPlot(double[] x,
double[] y,
java.awt.Color c,
float lineWidth)
Adds the scatter plot.
|
void |
addScatterPlot(double[] x,
double[] y,
int from,
int to,
java.awt.Color c,
float lineWidth)
Adds the scatter plot.
|
void |
adjustAxis()
Adjust axis.
|
void |
clear()
Clear.
|
void |
copyPlot()
Copy plot.
|
void |
exportData()
Export data.
|
void |
exportData(java.io.File file)
Export data.
|
static void |
main(java.lang.String[] args)
The main method.
|
void |
paint(java.awt.Graphics g)
Paint.
|
void |
paintAxis(java.awt.Graphics g)
Paint axis.
|
void |
paintPlot(java.awt.Graphics g)
Paint plot.
|
void |
resetBounds()
Reset bounds.
|
void |
savePlot()
Save plot.
|
void |
savePlot(java.io.File file)
Save plot.
|
void |
setBounds(double x,
double y,
double width,
double height)
Sets the bounds.
|
void |
setCaption(java.lang.String caption)
Sets the caption.
|
void |
setFont(java.awt.Font font)
Sets the font.
|
void |
setOriginalBounds(double x,
double y,
double width,
double height)
Sets the original bounds.
|
void |
setxAxisLabel(java.lang.String xAxisLabel)
Sets the x axis label.
|
void |
setyAxisLabel(java.lang.String yAxisLabel)
Sets the y axis label.
|
void |
showPlot(java.lang.String title)
Show plot.
|
void |
zoom(double factor)
Zoom.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIadd, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic void setBounds(double x,
double y,
double width,
double height)
x - the xy - the ywidth - the widthheight - the heightpublic void setOriginalBounds(double x,
double y,
double width,
double height)
x - the xy - the ywidth - the widthheight - the heightpublic void resetBounds()
public void addLinePlot(double[] x,
double[] y,
int from,
int to,
java.awt.Color c,
float lineWidth)
x - the xy - the yfrom - the fromto - the toc - the clineWidth - the line widthpublic void addScatterPlot(double[] x,
double[] y,
int from,
int to,
java.awt.Color c,
float lineWidth)
x - the xy - the yfrom - the fromto - the toc - the clineWidth - the line widthpublic void addHistogram(double[] y,
int from,
int to,
int bins,
java.awt.Color c,
float lineWidth)
y - the yfrom - the fromto - the tobins - the binsc - the clineWidth - the line widthpublic void addLinePlot(double[] x,
double[] y,
java.awt.Color c,
float lineWidth)
x - the xy - the yc - the clineWidth - the line widthpublic void addErrorBars(double[] x,
double[] y,
double[] error,
java.awt.Color c,
float lineWidth)
x - the xy - the yerror - the errorc - the clineWidth - the line widthpublic void addScatterPlot(double[] x,
double[] y,
java.awt.Color c,
float lineWidth)
x - the xy - the yc - the clineWidth - the line widthpublic void addHistogram(double[] y,
int bins,
java.awt.Color c,
float lineWidth)
y - the ybins - the binsc - the clineWidth - the line widthpublic void clear()
public void setxAxisLabel(java.lang.String xAxisLabel)
xAxisLabel - the new x axis labelpublic void setyAxisLabel(java.lang.String yAxisLabel)
yAxisLabel - the new y axis labelpublic void setCaption(java.lang.String caption)
caption - the new captionpublic void setFont(java.awt.Font font)
setFont in class javax.swing.JComponentfont - the new fontpublic void paintAxis(java.awt.Graphics g)
g - the gpublic void paintPlot(java.awt.Graphics g)
g - the gpublic void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentg - the gpublic void showPlot(java.lang.String title)
title - the titlepublic void zoom(double factor)
factor - the factorpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenere - the epublic void savePlot()
public void savePlot(java.io.File file)
file - the filepublic void copyPlot()
public void adjustAxis()
public void exportData()
public void exportData(java.io.File file)
file - the filepublic static void main(java.lang.String[] args)
args - the arguments