|
SmartFrog 3.10.000 | |||||||||
| 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
org.smartfrog.examples.dynamicwebserver.gui.graphpanel.GraphPanel
public class GraphPanel
A panel to display a graph. It uses two arrays, one for x axis, a second one for the y axis.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
boolean |
adjustable
|
java.awt.Color |
axisColor
|
float |
axisPencilWidth
|
float |
axisWidth
|
java.awt.Color |
backgroundColor
|
protected java.awt.Image |
backgroundImage
|
protected java.awt.Image |
bottomBar
|
protected boolean |
dirty
|
boolean |
drawGrid
|
java.awt.Color |
graphColor
|
float |
graphPencilWidth
|
float |
graphWidth
|
java.awt.Color |
gridColor
|
int |
gridStepX
|
int |
gridStepY
|
boolean |
keysAllowed
|
protected java.awt.Image |
middleBar
|
int |
sampleNumber
|
java.awt.Color |
textColor
|
protected java.awt.Image |
topBar
|
static int |
xAxis
|
protected int |
xAxisPixelLength
|
protected int |
xBarOffset
|
int[] |
xData
|
int |
xMax
|
int |
xMin
|
int |
xOffset
|
int |
xOffsetDefault
|
int |
xStep
|
static int |
yAxis
|
protected int |
yAxisPixelLength
|
protected int |
yBarSize
|
int[] |
yData
|
int |
yMax
|
int |
yMin
|
int |
yOffset
|
int |
yOffsetDefault
|
| 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 |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
GraphPanel()
Default constructor |
|
GraphPanel(java.awt.Dimension size)
The constructor to be used : Sets the size, the offsets, the pencils, adds the listeners |
|
| Method Summary | |
|---|---|
void |
componentHidden(java.awt.event.ComponentEvent e)
|
void |
componentMoved(java.awt.event.ComponentEvent e)
|
void |
componentResized(java.awt.event.ComponentEvent e)
Called when the component has been resized |
void |
componentShown(java.awt.event.ComponentEvent e)
|
java.awt.Image |
createImage(java.lang.String SFURL)
|
protected void |
drawAxis(java.awt.Graphics2D g2d)
Draw the two main axis |
protected void |
drawData(java.awt.Graphics2D g2d)
Draw the two data arrays. |
protected void |
drawGrid(java.awt.Graphics2D g2d)
Draw a 2d grid in the background. |
void |
drawPanel(java.awt.Graphics2D g2d)
Overwrite this method to draw the panel differently |
void |
initImages()
|
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
void |
paintComponent(java.awt.Graphics g)
|
protected int |
scaleX(int xData)
Returns a scaled int between 0 and xAxisPixelLength If xData greater than xMax or xData less than xMin the return values are 0 and xAxisPixelLength respectively |
protected int |
scaleY(int yData)
Returns a scaled int between 0 and yAxisPixelLength If yData greater than yMax or yData less than yMin the return values are 0 and yAxisPixelLength respectively |
void |
setAdjustable(boolean adjustable)
Set the graph's adjustability. |
void |
setAxis(int axis,
int min,
int max,
int step)
Set data for one axis : max & min value represented the step is the distance between two samples. |
void |
setCompleteGraphPanel(CompleteGraphPanel cgp)
Set the CompleteGraphPanel surrounding this one. |
void |
setDataDimensions(int xMin,
int xMax,
int xStep,
int yMin,
int yMax)
Set the axis for both dimensions |
void |
setGraphWidth(float graphWidth)
|
void |
setGridDimensions(int gridStepX,
int gridStepY)
Set grid dimensions |
void |
setOffset(int xOffset,
int yOffset)
Set border offsets. |
void |
setPencilColour(java.lang.String pencilColour)
Set the pencil's colour |
void |
setPencils()
Set the pencils size |
void |
setSampleNumber(int samples)
Set the size of the data arrays |
void |
toggleDisplay()
Toggle a different display for the graph. |
void |
toggleDisplay(boolean filled)
Toggle a different display for the graph. |
void |
toggleGrid()
Toggle the grid on the graph. |
void |
update(java.awt.Graphics g)
|
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction |
| Methods inherited from class java.awt.Container |
|---|
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
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, 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, 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, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int xAxis
public static final int yAxis
protected boolean dirty
public int xMin
public int xMax
public int xStep
public int gridStepX
public int yMin
public int yMax
public int gridStepY
public int sampleNumber
public int xOffset
public int xOffsetDefault
public int yOffset
public int yOffsetDefault
protected int xAxisPixelLength
protected int yAxisPixelLength
public java.awt.Color backgroundColor
public java.awt.Color gridColor
public java.awt.Color axisColor
public java.awt.Color textColor
public java.awt.Color graphColor
public float axisWidth
public float graphWidth
public float axisPencilWidth
public float graphPencilWidth
public boolean drawGrid
public boolean keysAllowed
public boolean adjustable
public int[] xData
public int[] yData
protected java.awt.Image topBar
protected java.awt.Image middleBar
protected java.awt.Image bottomBar
protected java.awt.Image backgroundImage
protected int xBarOffset
protected int yBarSize
| Constructor Detail |
|---|
public GraphPanel()
public GraphPanel(java.awt.Dimension size)
size - DOCUMENT ME!| Method Detail |
|---|
public void initImages()
public java.awt.Image createImage(java.lang.String SFURL)
public void setCompleteGraphPanel(CompleteGraphPanel cgp)
cgp - DOCUMENT ME!public void setSampleNumber(int samples)
samples - DOCUMENT ME!public void setGraphWidth(float graphWidth)
public void setPencils()
public void setDataDimensions(int xMin,
int xMax,
int xStep,
int yMin,
int yMax)
xMin - DOCUMENT ME!xMax - DOCUMENT ME!xStep - DOCUMENT ME!yMin - DOCUMENT ME!yMax - DOCUMENT ME!
public void setGridDimensions(int gridStepX,
int gridStepY)
gridStepX - DOCUMENT ME!gridStepY - DOCUMENT ME!
public void setOffset(int xOffset,
int yOffset)
xOffset - DOCUMENT ME!yOffset - DOCUMENT ME!
public void setAxis(int axis,
int min,
int max,
int step)
axis - DOCUMENT ME!min - DOCUMENT ME!max - DOCUMENT ME!step - DOCUMENT ME!public void toggleDisplay()
public void toggleDisplay(boolean filled)
filled - DOCUMENT ME!public void toggleGrid()
public void setPencilColour(java.lang.String pencilColour)
pencilColour - DOCUMENT ME!public void setAdjustable(boolean adjustable)
adjustable - DOCUMENT ME!public void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentpublic void update(java.awt.Graphics g)
update in class javax.swing.JComponentpublic void drawPanel(java.awt.Graphics2D g2d)
g2d - DOCUMENT ME!protected void drawGrid(java.awt.Graphics2D g2d)
g2d - protected void drawAxis(java.awt.Graphics2D g2d)
g2d - DOCUMENT ME!protected void drawData(java.awt.Graphics2D g2d)
g2d - DOCUMENT ME!protected int scaleX(int xData)
xData - DOCUMENT ME!
protected int scaleY(int yData)
yData - DOCUMENT ME!
public void componentHidden(java.awt.event.ComponentEvent e)
componentHidden in interface java.awt.event.ComponentListenerpublic void componentMoved(java.awt.event.ComponentEvent e)
componentMoved in interface java.awt.event.ComponentListenerpublic void componentResized(java.awt.event.ComponentEvent e)
componentResized in interface java.awt.event.ComponentListenere - DOCUMENT ME!public void componentShown(java.awt.event.ComponentEvent e)
componentShown in interface java.awt.event.ComponentListenerpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListener
|
SmartFrog CORE 3.10.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||