|
Spreadsheet Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--corpus.doodle.AbstractVisualisationPane
Used as a super class for a basic range of visualisations.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected int |
cellHeight
The pixel height of a single cell in the visualisation |
protected int |
cellWidth
The pixel width of a single cell in the visualisation |
protected java.awt.Color[] |
colorLookup
A fairly evenly distributed range of colors. |
protected int |
colorMax
The maximum number of colors |
protected java.awt.Graphics2D |
g
The graphics object for drawing to the pane. |
protected static Grid |
grid
A grid of MathVectors that contains the data to be displayed |
protected int |
headsize
The size of the mark at the head of the vector |
protected double |
maxX
The largest X value found |
protected double |
maxY
The largest Y value found |
protected double |
maxZ
The largest Z value found |
protected double |
minX
The smallest X value found |
protected double |
minY
The smallest Y value found |
protected double |
minZ
The smallest Z value found |
protected boolean |
ROYGBIV
Color order for lookup table |
protected double |
scaleX
The scale factor for X values |
protected double |
scaleY
The scale factor for Y values |
protected double |
scaleZ
The scale factor for Z values |
protected boolean |
square
Use squares(true) or circles(false) when drawing integers |
protected corpus.doodle.ClassifyStatusBar |
status
Info on whats happening |
protected int |
tailsize
The size of the mark at the tail of the vector |
protected java.util.Vector |
toDraw
A Vector of MathVectors that will be drawn. |
protected int |
xcorrect
|
protected int |
xoff
X offset from left edge |
protected int |
xoff_
X offset from right edge |
protected int |
ycorrect
|
protected int |
yoff
Y offset from top edge |
protected int |
yoff_
Y offset from bottom edge |
protected int |
zcorrect
|
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 | |
AbstractVisualisationPane(Grid grid,
corpus.doodle.ClassifyStatusBar status)
|
Method Summary | |
protected double |
calculateCol(int x)
Convert from a x pixel back to the x coordinate. |
protected double |
calculateRow(int y)
Convert from a y pixel back to the y coordinate. |
protected double |
calculateX(double x)
Convert a x coordinate into a pixel coordinate. |
protected double |
calculateY(double y)
Convert a y coordinate into a pixel coordinate. |
protected double |
calculateZ(int z)
Convert a z coordinate into a pixel coordinate. |
protected void |
checkPoints(double newX1,
double newY1,
double newZ1)
Records the largest and smallest x,y,z values seen |
protected void |
checkPoints(double newX1,
double newX2,
double newY1,
double newY2,
double newZ1,
double newZ2)
Records the largest and smallest x,y,z values seen |
protected void |
colorBar(java.awt.Color[] c)
Dumps the ColorCodeTable at the bottom of the screen. |
protected void |
colorBar(int N)
Creates and then dumps the ColorCodeTable for N to the screen. |
protected java.awt.geom.GeneralPath |
computeArrowHead(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Calculate the points used to represent the arrowhead. |
static java.lang.String |
contents(int col,
int row)
Returns a String about the element at the given coordinates. |
protected java.awt.Color[] |
createColorCodeTable(int numColors,
boolean ROYGBIV)
Generates a series of colors such that the distribution of the colors is (fairly) evenly spaced throughout the color spectrum. |
protected abstract void |
draw(java.lang.Object o)
draw the passed object on the grid. |
protected void |
drawArrow(int cx,
int cy,
int cx2,
int cy2)
Draw an arrow from (cx,cy) to (cx2,cy2) with the head at the latter end. |
double |
getMaxX()
|
double |
getMaxY()
|
java.awt.Dimension |
getMinimumSize()
The Smallest size to render this pane at. |
double |
getMinX()
|
double |
getMinY()
|
void |
paintComponent(java.awt.Graphics comp)
Draw Grid and Vectors |
protected abstract void |
process(Grid grid,
java.util.Vector toDraw)
Process incomming data grid and add the required elements to the toDraw vector. |
protected double |
round(double d,
int n)
Round the parameter double to n decimal places. |
void |
set(double minX,
double maxX,
double minY,
double maxY)
Changes the maximum and minimum values and redraws the screen. |
protected void |
update(java.lang.String text)
Dump text in the status element. |
protected java.awt.Color |
valueToColor(int v)
http://www.dgp.toronto.edu/~mjmcguff/learn/java/03-color/ |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 |
protected int xoff
protected int yoff
protected int xoff_
protected int yoff_
protected double minX
protected double maxX
protected double scaleX
protected int xcorrect
protected double minY
protected double maxY
protected double scaleY
protected int ycorrect
protected double minZ
protected double maxZ
protected double scaleZ
protected int zcorrect
protected int cellWidth
protected int cellHeight
protected int colorMax
protected java.awt.Color[] colorLookup
protected boolean ROYGBIV
protected static Grid grid
protected java.awt.Graphics2D g
protected int headsize
protected int tailsize
protected java.util.Vector toDraw
protected corpus.doodle.ClassifyStatusBar status
protected boolean square
Constructor Detail |
public AbstractVisualisationPane(Grid grid, corpus.doodle.ClassifyStatusBar status)
Method Detail |
protected abstract void process(Grid grid, java.util.Vector toDraw)
grid
- The incomming Grid datatoDraw
- A vector that will be used to draw the required elements on the screen.public static java.lang.String contents(int col, int row)
col
- The Columnrow
- The Row
protected void update(java.lang.String text)
protected double round(double d, int n)
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public void paintComponent(java.awt.Graphics comp)
paintComponent
in class javax.swing.JComponent
protected void drawArrow(int cx, int cy, int cx2, int cy2)
cx
- start X pixel coordinatecy
- start Y pixel coordinatecx2
- end X pixel coordinatecy2
- end Y pixel coordinatecomputeArrowHead(Point2D, Point2D)
protected java.awt.geom.GeneralPath computeArrowHead(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
protected abstract void draw(java.lang.Object o)
protected double calculateX(double x)
protected double calculateY(double y)
protected double calculateZ(int z)
protected double calculateRow(int y)
calculateY(double)
protected double calculateCol(int x)
calculateX(double)
protected void checkPoints(double newX1, double newX2, double newY1, double newY2, double newZ1, double newZ2)
protected void checkPoints(double newX1, double newY1, double newZ1)
protected java.awt.Color valueToColor(int v)
protected void colorBar(int N)
protected void colorBar(java.awt.Color[] c)
protected java.awt.Color[] createColorCodeTable(int numColors, boolean ROYGBIV)
numColors
- the number of colors to generateROYGBIV
- if true the table will go from red to violet, else reversed. Added by Daniel.
public double getMinX()
public double getMaxX()
public double getMinY()
public double getMaxY()
public void set(double minX, double maxX, double minY, double maxY)
|
Spreadsheet Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |