|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
org.mbari.siam.moos.utils.chart.graph.Graph2D
org.mbari.siam.moos.utils.chart.graph.G2Dint
org.mbari.siam.moos.utils.chart.graph.Contour
public class Contour
This class extends the interactive graphics class G2Dint to incorporate contouring.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Canvas |
|---|
java.awt.Canvas.AccessibleAWTCanvas |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected boolean |
autoLabels
If true the labels will be calculated for each contour level. |
protected boolean |
autoLevels
If set the class calculates the contour levels based on the data minimum and maximum. |
protected java.awt.Color |
contourColor
Color to draw non labelled contour line |
protected java.util.Vector[] |
curves
Vector array containing the Contour curves. |
protected boolean |
drawlabels
If false labels are not drawn |
protected double[] |
grid
The data grid, a 2D array stored in linear form. |
protected boolean |
gridLimits
|
protected java.awt.Color |
labelcolor
Color to use in drawing Labels |
protected java.awt.Font |
labelfont
Font to use in drawing Labels |
protected java.awt.Color |
labelledColor
Color to draw labelled contour line |
protected int |
labelLevels
Which levels will get labels. |
protected int |
labelPrecision
Precision to use in drawing Labels. |
protected TextLine[] |
labels
The label for each contour level |
protected int |
labelSignificant
Number of Significant figures to use in drawing Labels. |
protected int |
labelStyle
Style to use in drawing Labels. |
protected double[] |
levels
|
protected boolean |
logLevels
|
boolean |
noContours
Boolean value if true Contours will not be calculated |
protected int |
nx
Dimension of the contour grid in the X direction |
protected int |
ny
Dimension of the contour grid in the Y direction |
protected double |
xmax
The X maximum limit of the data grid |
protected double |
xmin
The X minimum limit of the data grid |
protected double |
ymax
The Y maximum limit of the data grid |
protected double |
ymin
The Y minimum limit of the data grid |
protected double |
zmax
The maximum value of the grid values |
protected double |
zmin
The minimum value of the grid values |
| Fields inherited from class org.mbari.siam.moos.utils.chart.graph.G2Dint |
|---|
drag, userlimits, xaxis, yaxis |
| Fields inherited from class org.mbari.siam.moos.utils.chart.graph.Graph2D |
|---|
axis, borderBottom, borderLeft, borderRight, borderTop, clearAll, DataBackground, datarect, dataset, drawgrid, drawzero, frame, framecolor, gridcolor, lastText, load_thread, loadingData, markers, paintAll, square, zerocolor |
| 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 | |
|---|---|
Contour()
Instantaite the class |
|
| Method Summary | |
|---|---|
void |
attachContours()
Attach contours so that they will be plotted. |
protected void |
calculateCurves()
|
void |
deleteContours()
Delete all the Contours |
void |
detachContours()
Detach contours so that they will not be plotted. |
int[] |
getDim()
return the dimensions of the grid |
double[] |
getGrid()
Return the grid |
int |
getLabelPrecision()
Get the label precision. |
int |
getLabelSignificance()
Get the number of significant figures for labels. |
int |
getLabelStyle()
Get the label style, either TextLine.SCIENTIFIC or TextLine.ALGEBRAIC. |
double[] |
getLevels()
Return the contour levels. |
double[] |
getRange()
Return the range of the grid |
boolean |
keyDown(java.awt.Event e,
int key)
Add extra events to the G2Dint event handler. |
boolean |
loadGrid(java.net.URL file)
Load the grid to contour from a URL. |
void |
paintFirst(java.awt.Graphics g,
java.awt.Rectangle r)
A hook into the Graph2D.paint method. |
void |
paintLast(java.awt.Graphics g,
java.awt.Rectangle rect)
A hook into the Graph2D.paint method. |
void |
setAutoLevels(boolean b)
If true contour levels are calculated automatically. |
void |
setContourColor(java.awt.Color c)
Set the contour's color. |
void |
setDrawLabels(boolean b)
If true contour levels are not labeled. |
void |
setGrid(double[] grid,
int nx,
int ny)
Set the grid to be contoured. |
void |
setLabelColor(java.awt.Color c)
Set the Color to be used with all the labels. |
void |
setLabelFont(java.awt.Font f)
Set the font to be used with All the labels |
void |
setLabelledContourColor(java.awt.Color c)
Set the labelled contour's color. |
void |
setLabelLevels(int i)
Set the contour levels that are to have labels. |
void |
setLabelPrecision(int p)
Set the label precision. |
void |
setLabels(TextLine[] labels,
int nl)
Manually set the Contour labels. |
void |
setLabelSignificance(int s)
Set the label significant figures. |
void |
setLabelStyle(int s)
Set the label style, either TextLine.SCIENTIFIC or TextLine.ALGEBRAIC. |
void |
setLevels(double[] levels,
int nl)
Manually set the contour levels. |
void |
setLimitsToGrid(boolean b)
If true the limits of the plot will be the grid limits. |
void |
setLogLevels(boolean b)
If true contour levels are calculated on a log scale. |
void |
setNLevels(int l)
Set the number of contour levels. |
void |
setRange(double xmin,
double xmax,
double ymin,
double ymax)
Set the range of the grid |
| Methods inherited from class org.mbari.siam.moos.utils.chart.graph.G2Dint |
|---|
action, attachAxis, createXAxis, createYAxis, getClosestPoint, mouseDown, mouseDrag, mouseMove, mouseUp, update |
| Methods inherited from class org.mbari.siam.moos.utils.chart.graph.Graph2D |
|---|
attachDataSet, createAxis, detachAxes, detachAxis, detachDataSet, detachDataSets, drawAxis, drawFrame, finishedloading, ForceSquare, getDataRectangle, getMarkers, getXmax, getXmin, getYmax, getYmin, loadDataSet, loadFile, loadmessage, paint, paintBeforeData, setDataBackground, setGraphBackground, setMarkers, startedloading |
| Methods inherited from class java.awt.Canvas |
|---|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
| Methods inherited from class java.awt.Component |
|---|
add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, 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, 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, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, 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, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseEnter, mouseExit, 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, 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, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int nx
protected int ny
protected java.util.Vector[] curves
protected boolean autoLevels
protected boolean logLevels
protected boolean gridLimits
protected double[] levels
protected TextLine[] labels
protected java.awt.Font labelfont
protected java.awt.Color labelcolor
protected int labelStyle
protected int labelPrecision
protected int labelSignificant
protected int labelLevels
protected boolean drawlabels
protected boolean autoLabels
protected java.awt.Color contourColor
protected java.awt.Color labelledColor
protected double[] grid
protected double xmin
protected double xmax
protected double ymin
protected double ymax
protected double zmin
protected double zmax
public boolean noContours
| Constructor Detail |
|---|
public Contour()
| Method Detail |
|---|
public boolean loadGrid(java.net.URL file)
The expected format of the data
1st Number: nx
2nd Number: ny
nx*ny numbers following
Optionally
1st Number: nx
2nd Number: ny
3rd Number: xmin
4th Number: xmax
5th Number: ymin
6th Number: ymax
nx*ny numbers following
file - URL of the file to load
public void setRange(double xmin,
double xmax,
double ymin,
double ymax)
xmin - Minimum X valuexmax - Maximum X valueymin - Minimum Y valueymax - Maximum Y valuepublic double[] getRange()
public int[] getDim()
public double[] getGrid()
public void setLevels(double[] levels,
int nl)
levels - An array containing the contour levelsnl - The number of contour levels in the arrray
public void setLabels(TextLine[] labels,
int nl)
labels - An array containing the labels.nl - Number of labels in the Array.public void setLabelFont(java.awt.Font f)
f - Fontpublic void setLabelColor(java.awt.Color c)
c - Color
public void setGrid(double[] grid,
int nx,
int ny)
grid - Array of valuesnx - Number of columnsny - Number of rowspublic void deleteContours()
public void detachContours()
public void attachContours()
public void setContourColor(java.awt.Color c)
c - Colorpublic void setLabelledContourColor(java.awt.Color c)
c - Colorpublic double[] getLevels()
public void setLimitsToGrid(boolean b)
b - booleanpublic void setLabelLevels(int i)
if 0 no labels are drawn
if 1 every level gets a label
If 2 every 2nd level gets a label
etc.
public void setLogLevels(boolean b)
b - booleanpublic void setNLevels(int l)
l - Number of contour levelspublic void setAutoLevels(boolean b)
b - booleanpublic void setDrawLabels(boolean b)
b - booleanpublic void setLabelStyle(int s)
s - Stylepublic int getLabelStyle()
public void setLabelPrecision(int p)
p - Precisionpublic int getLabelPrecision()
public void setLabelSignificance(int s)
s - number of significant figurespublic int getLabelSignificance()
public boolean keyDown(java.awt.Event e,
int key)
keyDown in class G2Dint
public void paintFirst(java.awt.Graphics g,
java.awt.Rectangle r)
Graph2D
paintFirst in class Graph2Dg - Graphics stater - Rectangle containing the graph
public void paintLast(java.awt.Graphics g,
java.awt.Rectangle rect)
Graph2D
paintLast in class Graph2Dg - Graphics staterect - Rectangle containing the dataprotected void calculateCurves()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||