public class BareGraph
extends java.awt.Component
implements java.beans.PropertyChangeListener
The class BareGraph makes a graphical respresentation of a set of integer values. The values are provided by the GraphDataSet class.
The line that this class draws can be set to the 10log() representation of the values.
Graph
,
GraphDataSet
,
Serialized FormConstructor and Description |
---|
BareGraph()
The default constructor.
|
BareGraph(GraphDataSet d)
The constructor with the data set
|
Modifier and Type | Method and Description |
---|---|
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.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.
|
java.awt.Dimension |
getMinimumSize()
Returns the minimum size.
|
java.awt.Dimension |
getPreferredSize()
Returns the preferred size.
|
boolean |
isLog()
Returns the log mode of the graph.
|
void |
paint(java.awt.Graphics g) |
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 |
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.
|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
public BareGraph()
public BareGraph(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)
b
- set the axes or notpublic int getMax()
setMax(int)
public void setMax(int m)
m
- the maximumgetMax()
public int getMin()
setMin(int)
public void setMin(int m)
m
- the minimum valuegetMin()
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 java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Component
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Component
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
public void paint(java.awt.Graphics g)
paint
in class java.awt.Component