|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
Plotter
public class Plotter
Plot datasets
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, 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 |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
Plotter()
Constructs a new Plotter |
|
Plotter(java.lang.String name)
Constructs a new Plotter with the given name |
Method Summary | |
---|---|
void |
add(double y)
Add a point to the current data set, use index as x coordinate |
void |
add(double x,
double y)
Add a point to the current data set |
void |
add(java.lang.String key,
double x,
double y)
Add a point to the specified data set |
void |
clearPlotVector()
remove all data sets |
double |
getHalfBarWidth()
Get the value of half the width of the boxes in plot mode HISTOGRAM |
LineStyle |
getPlotMode()
|
java.lang.String |
getStatusLine()
Returns a string with status information |
int |
getSymbolSize()
|
void |
nextVector()
Switch to next data set. |
void |
paint(java.awt.Graphics g)
|
boolean |
removeText(java.lang.String string)
Remove the first text object that matches the given string. |
void |
setAutoXgrid(double autoXgrid)
|
void |
setAutoYgrid(double autoYgrid)
|
void |
setDataColor(java.lang.String key,
java.awt.Color c)
Set the color for the specified data set. |
void |
setDataLineStyle(LineStyle lineStyle)
Set the plot mode. |
void |
setDataLineStyle(java.lang.String key,
LineStyle lineStyle)
|
void |
setHalfBarWidth(double halfBarWidth)
Set the half the width of the boxes in plot mode HISTOGRAM |
void |
setSymbolSize(int symbolSize)
Set the size of the symbols used in some plotting styles |
TextObject |
setText(java.lang.String s,
double x,
double y)
Write text at the specified position |
void |
setXGrid(double[] x,
double xmax)
|
void |
setXLabel(java.lang.String[] label)
|
void |
setXLabelFormat(java.lang.String labelFormat)
Define the formatting of the labels of the x-axis. |
void |
setXLine(double x)
Draw a vertical line |
void |
setXrange(double min,
double max)
Set the x range for plotting |
void |
setYGrid(double[] y)
|
void |
setYLabelFormat(java.lang.String labelFormat)
Define the formatting of the labels of the y-axis. |
void |
setYLine(double y)
Draw a horizontal line |
void |
setYrange(double min,
double max)
Set the y range for plotting |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, 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, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, 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, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, 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, 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, hide, 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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Plotter()
Plotter
public Plotter(java.lang.String name)
Plotter
with the given name
name
- the name of the new Plotter
objectMethod Detail |
---|
public void clearPlotVector()
public void add(double x, double y)
x
- x coordinatey
- y coordinatepublic void add(java.lang.String key, double x, double y)
key
- key for the data setx
- x coordinatey
- y coordinatepublic void setDataColor(java.lang.String key, java.awt.Color c)
key
- key for the data setc
- colorpublic void add(double y)
y
- y coordinatepublic TextObject setText(java.lang.String s, double x, double y)
s
- text to writex
- x coordinatey
- y coordinatepublic void setYLine(double y)
y
- where to draw the linepublic void setXLine(double x)
x
- where to draw the linepublic void setXGrid(double[] x, double xmax)
public void setXLabel(java.lang.String[] label)
public void setYGrid(double[] y)
public void setXrange(double min, double max)
min
- Minimum value to plotmax
- Maximuma value to plotpublic void setYrange(double min, double max)
min
- Minimum value to plotmax
- Maximuma value to plotpublic void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
public void nextVector()
add
.
public void setAutoXgrid(double autoXgrid)
autoXgrid
- the autoXgrid to setpublic void setAutoYgrid(double autoYgrid)
autoYgrid
- the autoYgrid to setpublic LineStyle getPlotMode()
public void setDataLineStyle(LineStyle lineStyle)
lineStyle
- the plotMode to setpublic void setDataLineStyle(java.lang.String key, LineStyle lineStyle)
key
- lineStyle
- setDataLineStyle
public int getSymbolSize()
public void setSymbolSize(int symbolSize)
symbolSize
- the symbolSize to setpublic java.lang.String getStatusLine()
public boolean removeText(java.lang.String string)
true
if this plotter contained the specified element.
string
- element to be removed from this plotter, if present
true
if this plotter contained the specified elementpublic double getHalfBarWidth()
public void setHalfBarWidth(double halfBarWidth)
halfBarWidth
- the halfBarWidth to setpublic void setYLabelFormat(java.lang.String labelFormat)
String.format(labelFormat, y)
to format a value
y
. For example "%f.2%%"
will print numbers with
two decimal place and a %-symbol.
Default is null
, i. e. the label is converted directly into a String.
labelFormat
- the yLabelFormat to setpublic void setXLabelFormat(java.lang.String labelFormat)
String.format(labelFormat, x)
to format a value
x
. For example "%f.2%%"
will print numbers with
two decimal place and a %-symbol.
Default is null
, i. e. the label is converted directly into a String.
labelFormat
- the xLabelFormat to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |