public class Graph
extends javax.swing.JPanel
implements java.beans.PropertyChangeListener
The class Graph creates decoration labels around an actual (BareGraph) graph.
All the configurations of the BareGraph can be done from this class.
BareGraph
,
GraphDataSet
,
Serialized Formjavax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
Graph()
The default constructor.
|
Graph(GraphDataSet d)
The constructor with the data set.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addToGridBag(java.awt.GridBagLayout grid,
java.awt.Container cont,
java.awt.Component comp,
int x,
int y,
double wx,
double wy) |
protected void |
addToGridBag(java.awt.GridBagLayout grid,
java.awt.Container cont,
java.awt.Component comp,
int x,
int y,
double wx,
double wy,
int fill) |
protected void |
addToGridBag(java.awt.GridBagLayout grid,
java.awt.Container cont,
java.awt.Component comp,
int x,
int y,
double wx,
double wy,
int fill,
int anchor) |
protected void |
addToGridBag(java.awt.GridBagLayout grid,
java.awt.Container cont,
java.awt.Component comp,
int x,
int y,
double wx,
double wy,
int gw,
int gh,
int fill,
int anchor) |
java.awt.Color |
getAxisColour()
Returns the colour of the axes of the graph.
|
float |
getAxisPercent()
Returns the per cent size of the axes in respect to the graph.
|
GraphDataSet |
getDataSet()
Returns the data set that the graph displays.
|
java.awt.Font |
getFont()
Returns the font of the labels around the graph.
|
java.awt.Color |
getGraphColour()
Returns the colour of the line of the graph.
|
int |
getMax()
Returns the maximum value that is displayed in the graph.
|
int |
getMin()
Returns the minimum value that is displayed in the graph.
|
boolean |
isAxes()
Returns the axes mode of the graph.
|
boolean |
isLog()
Returns the log mode of the graph.
|
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Implements the PropertyChangeListener.
|
void |
setAxes(boolean b)
Makes the graph draw the axes or not.
|
void |
setAxisColour(java.awt.Color c)
Sets the colour of the axes of the graph.
|
void |
setAxisPercent(float x)
Sets the per cent size of the axes in respect to the graph.
|
void |
setDataSet(GraphDataSet d)
Sets the data set that the graph displays.
|
void |
setFont(java.awt.Font f)
Sets the font of the labels around the graph.
|
void |
setGraphColour(java.awt.Color c)
Sets the colour of the line of the graph.
|
void |
setLog(boolean b)
Makes the graph draw the 10log() of the values or not.
|
void |
setMax(int m)
Sets the maximum value that is displayed in the graph.
|
void |
setMin(int m)
Sets the minimum value that is displayed in the graph.
|
void |
setName(java.lang.String n)
Sets the name (title) of the graph.
|
void |
setUnit(java.lang.String u)
Sets the units value of the graph.
|
void |
setXRange(java.lang.String x)
Sets the xrange value of the graph.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public Graph()
public Graph(GraphDataSet d)
d
- the data setpublic void setLog(boolean b)
b
- set the 10log() version on or notisLog()
public boolean isLog()
setLog(boolean)
public void setAxes(boolean b)
Makes the graph draw the axes or not. The default is true.
If the axes are off only the line, with above the name, value and units are displayed.
If the axes are on the graph will have the axes, max, min and xrange displayed also.
b
- set the axes or notisAxes()
public boolean isAxes()
setAxes(boolean)
public int getMin()
setMin(int)
public void setMin(int m)
m
- the minimum valuegetMin()
,
setAxes(boolean)
public int getMax()
setMax(int)
public void setMax(int m)
m
- the maximumgetMax()
,
setAxes(boolean)
public void setXRange(java.lang.String x)
x
- the xrange stringsetAxes(boolean)
public void setUnit(java.lang.String u)
u
- the units stringpublic void setName(java.lang.String n)
setName
in class java.awt.Component
n
- the name stringpublic void setFont(java.awt.Font f)
setFont
in class javax.swing.JComponent
f
- the fontgetFont()
public java.awt.Font getFont()
getFont
in interface java.awt.MenuContainer
getFont
in class java.awt.Component
setFont(java.awt.Font)
public java.awt.Color getAxisColour()
setAxisColour(java.awt.Color)
public void setAxisColour(java.awt.Color c)
c
- the axes' colourgetAxisColour()
public java.awt.Color getGraphColour()
setGraphColour(java.awt.Color)
public void setGraphColour(java.awt.Color c)
c
- the line's colourgetGraphColour()
public float getAxisPercent()
setAxisPercent(float)
public void setAxisPercent(float x)
x
- the size (%) of axesgetAxisPercent()
public void setDataSet(GraphDataSet d)
d
- the data set.getDataSet()
public GraphDataSet getDataSet()
setDataSet(uk.co.westhawk.visual.GraphDataSet)
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
evt
- the property change eventPropertyChangeListener
protected void addToGridBag(java.awt.GridBagLayout grid, java.awt.Container cont, java.awt.Component comp, int x, int y, double wx, double wy)
protected void addToGridBag(java.awt.GridBagLayout grid, java.awt.Container cont, java.awt.Component comp, int x, int y, double wx, double wy, int fill)
protected void addToGridBag(java.awt.GridBagLayout grid, java.awt.Container cont, java.awt.Component comp, int x, int y, double wx, double wy, int fill, int anchor)
protected void addToGridBag(java.awt.GridBagLayout grid, java.awt.Container cont, java.awt.Component comp, int x, int y, double wx, double wy, int gw, int gh, int fill, int anchor)