jview
Class JDataCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by jview.JNormalizedCanvas
                  extended by jview.JViewportCanvas
                      extended by jview.JFrameCanvas
                          extended by jview.JBoxedCanvas
                              extended by jview.JDataCanvas
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, DataCanvasProviding, NormalizedCoordinates, NormalizedShapes, UserCoordinates, Zoomable, Initializable, PropertyAware, PropertyComposed, Savable
Direct Known Subclasses:
JExpressionCanvas, JGuiderOffsets, JTrackingFrequencies, JWeatherCanvas

public class JDataCanvas
extends JBoxedCanvas
implements DataCanvasProviding

A class that makes the content of a List of VectorGs visible. It is arranged in a way that incomming values are displayed on the canvas until the window is filled. Then only the newer numbers are shown.

See Also:
Serialized Form

Nested Class Summary
static class JDataCanvas.AnimTest
           
static class JDataCanvas.Highlight
           
static class JDataCanvas.Histogram
          A class that shows a histogram of a FITS image.
static class JDataCanvas.Test
           
protected static class JDataCanvas.TestCanvas
          A test class for testing the layout
 
Nested classes/interfaces inherited from class jview.JBoxedCanvas
JBoxedCanvas.Datum
 
Nested classes/interfaces inherited from class jview.JViewportCanvas
JViewportCanvas.ViewportKey
 
Nested classes/interfaces inherited from class jview.JNormalizedCanvas
JNormalizedCanvas.ShowImage
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  Map<String,List<ShapeDraw>> datadraw
          We do not want to remove fixed objects, thus we have another table.
static String DATALOSSPROPERTY
          The name of the data-lost property.
private static boolean DEFCONNECT
          The default connecting behaviour.
private static boolean DEFDATALAST
          The default keep-size-constant.
private static boolean DEFEQUALSCALE
          The default keep-scale-constant.
private static boolean DEFEQUALSTART
          The default keep-scale-constant.
private static boolean DEFERRORALWAYSRED
          The default draw-error-in-my-color behaviour.
private static DrawingInfo DEFERRORCOLOR
          The default error color
private static boolean DEFERRORHAT
          Default we show the little error bars on top/bottom of the raiser.
private static double DEFERRORHATLENGTH
          Default length of the tiny 'hats' on top/b/r/l of the error raiser.
private static boolean DEFERRORINCLUDE
          The default error inclusion behaviour on size determination.
private static boolean DEFERRORSHOW
          The default error showing behaviour.
private static boolean DEFFLIPXAXIS
          The default flipping of the x-axis.
private static boolean DEFFLIPYAXIS
          The default flipping of the y-axis.
private static Shape DEFHIGHLIGHTSHAPE
          The default highlight shape.
private static double DEFLEGENDGAP
          Spacing of legend in x .
private static double DEFLEGENDLENGTH
          Spacing of legend in x .
private static double DEFLEGENDY
          Spacing of legend in y .
private static int DEFPOINTS
          The default maximum number of points, zero for all points.
private static double DEFPRINTFONTSCALE
          Default printer scaling for font.
private static boolean DEFRETAINSIZE
          The default keep-size-constant.
private static ShapeDraw DEFSHAPE
          The default data shape, a circle of diameter 0.01.
private static double DEFSHAPESIZE
          The default zooming factors for data shapes.
private static int DEFXERRORINDEX
          The default error in x index, -1 for unspecified.
private static Shape DEFXERRORSHAPE
          The default error shape in x, a horizontal line length 1.
private static int DEFXINDEX
          The default x index.
private static double DEFXSHRINK
          The default x inset in normalized space.
static double DEFXUSERSPACEMIN
          A minimum plotting size in user space.
private static int DEFYERRORINDEX
          The default error in y index, -1 for unspecified.
private static Shape DEFYERRORSHAPE
          The default error shape in y, a vertical line length 1.
private static int DEFYINDEX
          The default y index.
private static double DEFYSHRINK
          The default y inset in normalized space.
static double DEFYUSERSPACEMIN
          A minimum plotting size in user space.
private static boolean DEFZEROXAXIS
          The default zeroing x-axis.
private static boolean DEFZEROYAXIS
          The default zeroing y-axis.
private  Map<String,List<ShapeDraw>> errordraw
          We do not want to remove fixed objects, thus we have another table.
private  Map<String,List<PointDraw>> errorhats
          The error bars for nice viewing.
private  List<String> joints
          The list of sets that create joined points.
static String KEY_CONNECT
          The key to showing connection lines between data points.
static String KEY_DATALAST
          If true, data is drawn after normalized objects..
static String KEY_EQUALSCALE
          If true, x and y are scaled with same factor in normalized space.
static String KEY_EQUALSTART
          If true, x and y start from the same minimum.
static String KEY_ERRORALWAYSRED
          If true, error shows up always in my error color.
static String KEY_ERRORCOLOR
          The error color.
static String KEY_ERRORHAT
          If true, error shows a little line on top/bootm of raiser.
static String KEY_ERRORHATLENGTH
          Normalized length of the error raiser top/bottom ridge.
static String KEY_ERRORINCLUDE
          If true, errors are included in width calculation.
static String KEY_ERRORSHOW
          If true, errors are shown if available.
static String KEY_FLIPXAXIS
          The key to flipping x-coordinates.
static String KEY_FLIPYAXIS
          The key to flipping x-coordinates.
static String KEY_HIGHLIGHTSHAPE
          The shape for highlighted (active) data cards.
static String KEY_JOINDATA
          Only sets with this name create connected points.
static String KEY_LABELFONT
          If given, use this font for the axis label, otherwise use default.
static String KEY_LEGEND
          If given, the upper left corner of a legend box.
static String KEY_LEGENDGAP
          Defines the length of the gap between the legend line and string.
static String KEY_LEGENDLENGTH
          Defines the length of the legend line.
static String KEY_LEGENDLIST
          If given, the order of the legend entries.
static String KEY_LEGENDMAP
          If given, translates set names to legend displays.
static String KEY_LEGENDY
          Defines the spacing between legend entries.
static String KEY_POINTS
          The maximum number of data points displayed, zero for all points.
static String KEY_POLYGONSHAPE
          The mapping of set names to shape from ShapeFactory.
static String KEY_RETAINSIZE
          If true, size of data symbols is constant under user zooms.
static String KEY_SAVESETS
          A mapping of set names to descriptions used at data save.
static String KEY_SHAPESIZE
          An adjustable scaling factor for the data point shapes.
static String KEY_XAXISDISTANCE
          A distance from the lower box width to the x-axis label.
static String KEY_XAXISLABEL
          If given, a label drawn on the x-axis.
static String KEY_XERRORINDEX
          The index of the x-error, zero means absent.
static String KEY_XERRORSHAPE
          The String used to construct an error shape with ShapeFactory.
static String KEY_XINDEX
          The index of the x-component.
static String KEY_XSHRINK
          The x-span added to the display, normalized coordinates.
static String KEY_XUSERSPACEMIN
          A minimum plotting size in user space x axis.
static String KEY_YAXISDISTANCE
          A distance from the lower box width to the x-axis label.
static String KEY_YAXISLABEL
          If given, a label drawn on the y-axis.
static String KEY_YERRORINDEX
          The index of the y-error, zero means absent.
static String KEY_YERRORSHAPE
          The String used to construct an error shape with ShapeFactory.
static String KEY_YINDEX
          The index of the y-component
static String KEY_YSHRINK
          The y-span added to the display, normalized coordinates.
static String KEY_YUSERSPACEMIN
          A minimum plotting size in user space x axis.
static String KEY_ZEROXAXIS
          If true, x has x=0 in the center of plot.
static String KEY_ZEROYAXIS
          If true, y has y=0 in the center of plot.
private static String LEGEND
          The name of legend lines.
private static String LINE
          The name of legend lines.
private  Map<String,List<ShapeDraw>> linedraw
          We do not want to remove fixed objects, thus we have another table.
private  Map<String,List<DataObserver>> ogle
          The mapping of set names to data observers.
private  Map<String,List<PointDraw>> pointdraw
          We do not want to remove fixed objects, thus we have another table.
static String RESCALEPROPERTY
          The name of the rescale property.
static String SAVEDATA
          The label one the action that save the plot data
private  Map<String,ShapeDraw> setshapes
          The set names mapped to their generic shapes.
private  Map<String,List<DataCard>> userdata
          The mapping of set names to data points in user space.
private  Map<String,VectorG> xminmax
          For each color the current min/max of the x-coordinate.
private  VectorG xspan
          From all coordinates, the current span in x plus error.
private  Map<String,VectorG> yminmax
          For each color the current min/max of the y-coordinate.
private  VectorG yspan
          From all coordinates, the current span in y plus error.
 
Fields inherited from class jview.JBoxedCanvas
AUTODATE, BOTTOM, KEY_FONT, KEY_GRIDCOLOR, KEY_IGNOREFORMAT, KEY_LABELAT, KEY_LABELCOLOR, KEY_LABELXANGLE, KEY_LABELXAUTO, KEY_LABELXEND, KEY_LABELXEXTRA, KEY_LABELXFORMAT, KEY_LABELXINSIDE, KEY_LABELXSTART, KEY_LABELXSTEP, KEY_LABELYANGLE, KEY_LABELYAUTO, KEY_LABELYEND, KEY_LABELYEXTRA, KEY_LABELYFORMAT, KEY_LABELYINSIDE, KEY_LABELYSTART, KEY_LABELYSTEP, KEY_MAXLABELS, KEY_MAXTICKS, KEY_TICKAT, KEY_TICKCOLOR, KEY_TICKSTRETCH, KEY_TICKXAUTO, KEY_TICKXEND, KEY_TICKXGRID, KEY_TICKXINSIDE, KEY_TICKXSIZE, KEY_TICKXSTART, KEY_TICKXSTEP, KEY_TICKYAUTO, KEY_TICKYEND, KEY_TICKYGRID, KEY_TICKYINSIDE, KEY_TICKYSIZE, KEY_TICKYSTART, KEY_TICKYSTEP, KEY_XISDATE, KEY_XLOGARITHMIC, KEY_YISDATE, KEY_YLOGARITHMIC, LEFT, RIGHT, TOP
 
Fields inherited from class jview.JFrameCanvas
KEY_ABSOLUTEHEIGHT, KEY_ABSOLUTEWIDTH, KEY_DRAWBOX, KEY_RELATIVEHEIGHT, KEY_RELATIVEWIDTH, KEY_TITLECOLOR, KEY_TITLEFONT, KEY_TITLEJUSTIFY, KEY_TITLEOFFSET, KEY_TITLETEXT, KEY_TOPCOLOR, KEY_TOPFONT, KEY_TOPJUSTIFY, KEY_TOPOFFSET, KEY_TOPSEPARATOR, KEY_TOPTEXT, KEY_XFRAME, KEY_XINSETABSOLUTE, KEY_XINSETRELATIVE, KEY_YFRAME, KEY_YINSETABSOLUTE, KEY_YINSETRELATIVE
 
Fields inherited from class jview.JViewportCanvas
MAXVIEW, VIEWPORTIMAGEPROPERTY, VIEWPORTPROPERTY
 
Fields inherited from class jview.JNormalizedCanvas
BACKGROUNDIMAGEPROPERTY, EXPORTACTION, GENERIC, inverse, KEY_BACKGROUND, KEY_CANVASNAME, KEY_CANVASTIP, KEY_CURSORCLASSES, KEY_CURSORPROPS, KEY_DRAWINGSETS, KEY_FOREGROUND, KEY_MAXIMUMHEIGHT, KEY_MAXIMUMWIDTH, KEY_MINIMUMHEIGHT, KEY_MINIMUMWIDTH, KEY_PREFERREDHEIGHT, KEY_PREFERREDWIDTH, KEY_PRINTFONT, KEY_PRINTFONTSCALE, KEY_PRINTSHAPESCALE, KEY_RESTORESHAPES, KEY_XFLIPIMAGE, KEY_YFLIPIMAGE, PRINTACTION, SAVEACTION, transform
 
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
JDataCanvas(PropertyBearing prop)
          Constructs a new shelf canvas.
 
Method Summary
 void addDataObserver(DataObserver eye, String setname)
          Adds a new data observer for the given set name.
static void addDelete(JDataCanvas jtf)
          Add a delete cursor to the data canvas.
private  int addDrawData(String color, ShapeDraw shape)
          Adds a shape to the errorbar list of objects.
 Object addDrawingInfo(String stylename, DrawingInfo color)
          We allow adding of a new drawing style anf add the line set
private  int addErrorData(String color, ShapeDraw shape)
          Adds a shape to the errorbar list of objects.
private  int addErrorHat(String color, PointDraw shape)
          Adds a shape to the errorbar list of objects.
 void addJoint(String setname)
          Adds this set to our allowed joints list.
private  int addLineData(String color, ShapeDraw shape)
          Adds a shape to the drawable list of objects.
 int addMeasure(String setname, VectorG onepoint, Object key)
          Add a point specifying the set name instead of the set color.
 int addMeasure(VectorG point)
          Whenever we add a data point, we recalculate the drawable list and the user transform.
private  int addPointData(String color, PointDraw shape)
          Adds a shape to the errorbar list of objects.
static void addZoom(JDataCanvas jtf)
          Add a zoom cursor to the data canvas.
 boolean clearData()
          Clears all accumulated data.
private  ShapeDraw createLine(CoordinateTransforming xy, DataCard p1, DataCard p2)
          Creates a line that connects the two data points.
private  PointDraw createNormalPoint(CoordinateTransforming xy, DataCard point, double scalex, double scaley, Shape generic, boolean filled)
          Creates a shape from a generic shape that is centered on (0,0).
private  ShapeDraw createNormalShape(CoordinateTransforming xy, DataCard point, double scalex, double scaley, Shape generic, boolean filled)
          Creates a shape from a generic shape that is centered on (0,0).
 DataTransfer deleteClosest(Point2D norm, String setname)
          Deletes the data point on the set closest to the normalized screen coordinates.
 List<DataTransfer> deleteInside(Rectangle2D norm, String setname)
          Deletes all data points within the normalized rectangle.
protected  void drawShapes(Graphics2D g2d, AffineTransform af)
          This is the only entry point where I can savely draw my userdata and do not have to care about graphics paint attributes, as they are reset in the calling method.
private  boolean extract(Object cardkey, String setname, List<DataTransfer> sink)
          Extracts a specific data card from a set by means of its key.
protected  List<DataTransfer> extractKeys(List<Object> keys, String setname)
          If somehow we know the list of keys we want to delete from a set, We extract them into data transfer lists here.
protected  List<DataTransfer> extractKeys(List<Object> keys, String setname, boolean notify)
          If somehow we know the list of keys we want to delete from a set, We extract them into data transfer lists here.
 Map<String,Action> getActions()
          Adds an action that can be used for saving the data in a file.
 Collection<DrawingInfo> getAnimationInfo(String stylename)
          Adds the line set and the legend set, if they exist.
 DataCard getClosestData(Point2D norm, String setname)
          Returns the data card that is closest to the point in question for the given set name.
 DataCard getClosestData(Point2D norm, String setname, double maxnorm)
          Returns the data card that is closest to the point in question for the given set name.
 Centerable getClosestDataShape(Point2D norm, String setname, double maxnorm)
          Looks in the specified data set and returns the the closest Centerable there.
<T extends Centerable>
T
getClosestShape(Point2D norm, Class<T> oftype)
          Overrides for searching in my special point maps, too.
 Collection<JDataCanvas> getComposingCanvases()
          Returns a collection containing only this.
static Map<String,String> getDefaultProperties()
          Returns a default mapping for applications that only want to override specific settings.
 Collection<DataCard> getInsideData(Rectangle2D norm, String setname)
          Returns all data cards inside the normalized rectangle for the given set name.
<T extends Centerable>
Collection<T>
getInsideShapes(Rectangle2D norm, Class<T> oftype)
          Adds my points, if requested.
 JDataCanvas getMainCanvas()
          Returns this.
 int getMaximumPoints()
          Returns the number of points in the canvas.
 List<DataCard> getMeasuredData(String setname)
          Returns all measures belonging to the given set name.
private static VectorG getMinMax(List<DataCard> nvector, boolean ad, int index, int erridx)
          Takes a list of VectorGs and returns the maximum and minimum found at the specified index as index 0/1.
 ShapeDraw getShapeForSet(String setname)
          Returns the generic shape to a setname.
private static VectorG getSpan(Collection<VectorG> vec2d, boolean ad)
          Takes a collection of 2d vectors and gets the minimum of x and y.
 Vector2D getSpanX()
          Returns the current span of x coordinates.
 Vector2D getSpanY()
          Returns the current span of y coordinates.
 Map<String,List<DataCard>> getUserData()
          Returns all user data as a mapping of set names to VectorG,key-lists.
 void init()
          On init, clear the data.
private
<T> int
insertInto(Map<String,List<T>> setdata, String color, T shape)
          Adds a shape to the drawable list of objects.
 boolean isEmpty()
          Returns true if all drawable objects have no entries.
private
<T extends Centerable>
T
nearest(T one, T two, Point2D p)
          Returns the centerable that is closer to the point.
protected  void notifyClear(Collection<String> sets)
          Notifies all listeners to the set names of cleared data.
private  void notifyListeners(String setname, DataChangeEvent dce)
          Notifies all listeners to the given set name that the data has changed
protected  void notifyNew(Collection<String> sets)
          Notifies all listeners to the set names of new data.
protected  void notifyOnAdd(String setname, List<DataCard> removed)
          Notifies all registered listeners of a remove of data.
protected  void notifyOnRemove(String setname, List<DataCard> removed)
          Notifies all registered listeners of a remove of data.
protected  void prepareCanvas(Graphics g)
          Adds the axis labels, if given.
 int putMeasuredSet(List<? extends VectorG> points)
          Sets a new list of data in the default color.
 int putMeasuredSet(String setname, List<? extends VectorG> points, List<Object> keys)
          Sets a new list of data into the specified set.
 int putMeasuredSets(Map<String,List<? extends VectorG>> pointmap, Map<String,List<Object>> keymap)
          This methods allows setting of a bunch of user data, rescaling is only done at the very end if necessary.
private  boolean putMeasurements(String setname, List<? extends VectorG> points, List<Object> keys, boolean scale)
          Sets a new list of data into the specified set.
private  void putOneDataSet(String setname, List<DataCard> all)
          Puts a single data set with the given color into the drawable or fillabale map of the parent.
private  void putSinglePoint(String setname, DataCard current, DataCard old)
          Adds a single data point to the drawable/fillable maps.
 void rebuildOneDataSet(String setname)
           
private  boolean redeem(DataTransfer undel, String setname)
          Redeems a previously extracted point.
protected  boolean redeemList(List<DataTransfer> redeem, String setname)
          Reenters a list of data into the canvas without notification.
 void removeDataObserver(DataObserver eye, String setname)
          Removes the data observer from the list.
 void removeJoint(String setname)
          Removes this set to our allowed joints list.
private  void rescale()
          Rescales the entire data.
 boolean revertDeleted(List<DataTransfer> redeem, String setname)
          Reverts deleted data points.
private static
<T extends FilledShape>
T
scanRemove(List<T> scan, Object key)
          Scans a list of either ShapeDraws or PointDraws for the first occurence of a given key.
 void setComposedProperties(PropertyBearing prop)
          Adds additional default mappings.
 ShapeDraw setShapeForSet(String setname, ShapeDraw sd)
          Replaces a generic shape, returns the old setting or null if currently unset.
 int setUserData(Map<String,List<DataCard>> apply)
          Sets the entire mapping of user data to this canvas.
 
Methods inherited from class jview.JBoxedCanvas
getBestDateFormat, getDefaultFormatX, getDefaultFormatY, getUserTransformation, printComponent, setUserTransformation, silentlySelectViewport, xIsDate, yIsDate
 
Methods inherited from class jview.JFrameCanvas
calculateActiveCanvas, calculateShapeTransform, getArea, isScreenInNormalized, paintObjects, wasReshaped
 
Methods inherited from class jview.JViewportCanvas
addAttachedViewport, addZoom, getViewport, getViewportImage, isMaximalViewport, isNormalizedOnScreen, removeAttachedViewport, resetViewport, selectArea, selectViewport, setViewportImage, transferView
 
Methods inherited from class jview.JNormalizedCanvas
addCrossCursor, addDrawable, addDrawable, addDrawable, addLink, addLink, addPoint, addPoint, addText, addText, allInside, applyDrawingInfo, assignCursorLabel, clearAllDrawable, clearAllText, clearDrawable, clearText, createCanvasCursor, disabledCanvas, drawPoints, drawPointsMap, drawShapesMap, drawText, drawTextMap, firePropertyChange, getBackground, getBackgroundImage, getCanvasCursor, getClosest, getClosest, getClosest, getComposedProperties, getFromName, getImageOperation, getInside, getInverseTransform, getLink, getLinkedTo, getMaximumSize, getMinimumSize, getNormalized, getNormalizedRect, getPreferredSize, getSaveBuffer, getScreen, getScreenRect, getShapeTransform, isFlipX, isFlipY, paintComponent, paintPointsList, paintShapesList, paintTextList, removeDrawable, removeDrawable, removeLink, removeText, removeText, repaintLater, repaintNow, setBackgroundImage, setBounds, setComplete, setCursor, setCursor, setDrawable, setImageOperation, setLink, setPrepare, startAnimation, stopAnimation
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, 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, update, updateUI
 
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, 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, setComponentOrientation, 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
 
Methods inherited from interface jview.NormalizedCoordinates
getArea, getNormalized, getNormalizedRect, getScreen, getScreenRect, getViewport, isNormalizedOnScreen, isScreenInNormalized
 

Field Detail

RESCALEPROPERTY

public static final String RESCALEPROPERTY
The name of the rescale property.

See Also:
Constant Field Values

DATALOSSPROPERTY

public static final String DATALOSSPROPERTY
The name of the data-lost property.

See Also:
Constant Field Values

KEY_POLYGONSHAPE

public static final String KEY_POLYGONSHAPE
The mapping of set names to shape from ShapeFactory.

See Also:
Constant Field Values

KEY_XERRORSHAPE

public static final String KEY_XERRORSHAPE
The String used to construct an error shape with ShapeFactory.

See Also:
Constant Field Values

KEY_YERRORSHAPE

public static final String KEY_YERRORSHAPE
The String used to construct an error shape with ShapeFactory.

See Also:
Constant Field Values

KEY_HIGHLIGHTSHAPE

public static final String KEY_HIGHLIGHTSHAPE
The shape for highlighted (active) data cards.

See Also:
Constant Field Values

KEY_YINDEX

public static final String KEY_YINDEX
The index of the y-component

See Also:
Constant Field Values

KEY_XINDEX

public static final String KEY_XINDEX
The index of the x-component.

See Also:
Constant Field Values

KEY_YERRORINDEX

public static final String KEY_YERRORINDEX
The index of the y-error, zero means absent.

See Also:
Constant Field Values

KEY_XERRORINDEX

public static final String KEY_XERRORINDEX
The index of the x-error, zero means absent.

See Also:
Constant Field Values

KEY_CONNECT

public static final String KEY_CONNECT
The key to showing connection lines between data points.

See Also:
Constant Field Values

KEY_JOINDATA

public static final String KEY_JOINDATA
Only sets with this name create connected points.

See Also:
Constant Field Values

KEY_POINTS

public static final String KEY_POINTS
The maximum number of data points displayed, zero for all points.

See Also:
Constant Field Values

KEY_YSHRINK

public static final String KEY_YSHRINK
The y-span added to the display, normalized coordinates.

See Also:
Constant Field Values

KEY_XSHRINK

public static final String KEY_XSHRINK
The x-span added to the display, normalized coordinates.

See Also:
Constant Field Values

KEY_FLIPXAXIS

public static final String KEY_FLIPXAXIS
The key to flipping x-coordinates.

See Also:
Constant Field Values

KEY_FLIPYAXIS

public static final String KEY_FLIPYAXIS
The key to flipping x-coordinates.

See Also:
Constant Field Values

KEY_DATALAST

public static final String KEY_DATALAST
If true, data is drawn after normalized objects..

See Also:
Constant Field Values

KEY_SHAPESIZE

public static final String KEY_SHAPESIZE
An adjustable scaling factor for the data point shapes.

See Also:
Constant Field Values

KEY_RETAINSIZE

public static final String KEY_RETAINSIZE
If true, size of data symbols is constant under user zooms.

See Also:
Constant Field Values

KEY_ZEROXAXIS

public static final String KEY_ZEROXAXIS
If true, x has x=0 in the center of plot.

See Also:
Constant Field Values

KEY_ZEROYAXIS

public static final String KEY_ZEROYAXIS
If true, y has y=0 in the center of plot.

See Also:
Constant Field Values

KEY_EQUALSCALE

public static final String KEY_EQUALSCALE
If true, x and y are scaled with same factor in normalized space.

See Also:
Constant Field Values

KEY_EQUALSTART

public static final String KEY_EQUALSTART
If true, x and y start from the same minimum.

See Also:
Constant Field Values

KEY_ERRORSHOW

public static final String KEY_ERRORSHOW
If true, errors are shown if available.

See Also:
Constant Field Values

KEY_ERRORINCLUDE

public static final String KEY_ERRORINCLUDE
If true, errors are included in width calculation.

See Also:
Constant Field Values

KEY_ERRORALWAYSRED

public static final String KEY_ERRORALWAYSRED
If true, error shows up always in my error color.

See Also:
Constant Field Values

KEY_ERRORHAT

public static final String KEY_ERRORHAT
If true, error shows a little line on top/bootm of raiser.

See Also:
Constant Field Values

KEY_ERRORHATLENGTH

public static final String KEY_ERRORHATLENGTH
Normalized length of the error raiser top/bottom ridge.

See Also:
Constant Field Values

KEY_ERRORCOLOR

public static final String KEY_ERRORCOLOR
The error color.

See Also:
Constant Field Values

KEY_LEGEND

public static final String KEY_LEGEND
If given, the upper left corner of a legend box.

See Also:
Constant Field Values

KEY_LEGENDMAP

public static final String KEY_LEGENDMAP
If given, translates set names to legend displays.

See Also:
Constant Field Values

KEY_LEGENDLIST

public static final String KEY_LEGENDLIST
If given, the order of the legend entries.

See Also:
Constant Field Values

KEY_LEGENDY

public static final String KEY_LEGENDY
Defines the spacing between legend entries.

See Also:
Constant Field Values

KEY_LEGENDLENGTH

public static final String KEY_LEGENDLENGTH
Defines the length of the legend line.

See Also:
Constant Field Values

KEY_LEGENDGAP

public static final String KEY_LEGENDGAP
Defines the length of the gap between the legend line and string.

See Also:
Constant Field Values

KEY_LABELFONT

public static final String KEY_LABELFONT
If given, use this font for the axis label, otherwise use default.

See Also:
Constant Field Values

KEY_XAXISLABEL

public static final String KEY_XAXISLABEL
If given, a label drawn on the x-axis.

See Also:
Constant Field Values

KEY_YAXISLABEL

public static final String KEY_YAXISLABEL
If given, a label drawn on the y-axis.

See Also:
Constant Field Values

KEY_XAXISDISTANCE

public static final String KEY_XAXISDISTANCE
A distance from the lower box width to the x-axis label.

See Also:
Constant Field Values

KEY_YAXISDISTANCE

public static final String KEY_YAXISDISTANCE
A distance from the lower box width to the x-axis label.

See Also:
Constant Field Values

KEY_XUSERSPACEMIN

public static final String KEY_XUSERSPACEMIN
A minimum plotting size in user space x axis.

See Also:
Constant Field Values

KEY_YUSERSPACEMIN

public static final String KEY_YUSERSPACEMIN
A minimum plotting size in user space x axis.

See Also:
Constant Field Values

KEY_SAVESETS

public static final String KEY_SAVESETS
A mapping of set names to descriptions used at data save.

See Also:
Constant Field Values

SAVEDATA

public static final String SAVEDATA
The label one the action that save the plot data

See Also:
Constant Field Values

LEGEND

private static final String LEGEND
The name of legend lines.

See Also:
Constant Field Values

LINE

private static final String LINE
The name of legend lines.

See Also:
Constant Field Values

DEFSHAPE

private static final transient ShapeDraw DEFSHAPE
The default data shape, a circle of diameter 0.01.


DEFXERRORSHAPE

private static final transient Shape DEFXERRORSHAPE
The default error shape in x, a horizontal line length 1.


DEFYERRORSHAPE

private static final transient Shape DEFYERRORSHAPE
The default error shape in y, a vertical line length 1.


DEFHIGHLIGHTSHAPE

private static final transient Shape DEFHIGHLIGHTSHAPE
The default highlight shape.


DEFXINDEX

private static final int DEFXINDEX
The default x index.

See Also:
Constant Field Values

DEFYINDEX

private static final int DEFYINDEX
The default y index.

See Also:
Constant Field Values

DEFXERRORINDEX

private static final int DEFXERRORINDEX
The default error in x index, -1 for unspecified.

See Also:
Constant Field Values

DEFYERRORINDEX

private static final int DEFYERRORINDEX
The default error in y index, -1 for unspecified.

See Also:
Constant Field Values

DEFCONNECT

private static final boolean DEFCONNECT
The default connecting behaviour.

See Also:
Constant Field Values

DEFPOINTS

private static final int DEFPOINTS
The default maximum number of points, zero for all points.

See Also:
Constant Field Values

DEFXSHRINK

private static final double DEFXSHRINK
The default x inset in normalized space.

See Also:
Constant Field Values

DEFYSHRINK

private static final double DEFYSHRINK
The default y inset in normalized space.

See Also:
Constant Field Values

DEFFLIPXAXIS

private static final boolean DEFFLIPXAXIS
The default flipping of the x-axis.

See Also:
Constant Field Values

DEFFLIPYAXIS

private static final boolean DEFFLIPYAXIS
The default flipping of the y-axis.

See Also:
Constant Field Values

DEFSHAPESIZE

private static final double DEFSHAPESIZE
The default zooming factors for data shapes.

See Also:
Constant Field Values

DEFDATALAST

private static final boolean DEFDATALAST
The default keep-size-constant.

See Also:
Constant Field Values

DEFRETAINSIZE

private static final boolean DEFRETAINSIZE
The default keep-size-constant.

See Also:
Constant Field Values

DEFZEROXAXIS

private static final boolean DEFZEROXAXIS
The default zeroing x-axis.

See Also:
Constant Field Values

DEFZEROYAXIS

private static final boolean DEFZEROYAXIS
The default zeroing y-axis.

See Also:
Constant Field Values

DEFEQUALSCALE

private static final boolean DEFEQUALSCALE
The default keep-scale-constant.

See Also:
Constant Field Values

DEFEQUALSTART

private static final boolean DEFEQUALSTART
The default keep-scale-constant.

See Also:
Constant Field Values

DEFERRORSHOW

private static final boolean DEFERRORSHOW
The default error showing behaviour.

See Also:
Constant Field Values

DEFERRORINCLUDE

private static final boolean DEFERRORINCLUDE
The default error inclusion behaviour on size determination.

See Also:
Constant Field Values

DEFERRORALWAYSRED

private static final boolean DEFERRORALWAYSRED
The default draw-error-in-my-color behaviour.

See Also:
Constant Field Values

DEFERRORCOLOR

private static final DrawingInfo DEFERRORCOLOR
The default error color


DEFERRORHAT

private static final boolean DEFERRORHAT
Default we show the little error bars on top/bottom of the raiser.

See Also:
Constant Field Values

DEFERRORHATLENGTH

private static final double DEFERRORHATLENGTH
Default length of the tiny 'hats' on top/b/r/l of the error raiser.

See Also:
Constant Field Values

DEFLEGENDY

private static final double DEFLEGENDY
Spacing of legend in y .

See Also:
Constant Field Values

DEFLEGENDLENGTH

private static final double DEFLEGENDLENGTH
Spacing of legend in x .

See Also:
Constant Field Values

DEFLEGENDGAP

private static final double DEFLEGENDGAP
Spacing of legend in x .

See Also:
Constant Field Values

DEFXUSERSPACEMIN

public static final double DEFXUSERSPACEMIN
A minimum plotting size in user space.

See Also:
Constant Field Values

DEFYUSERSPACEMIN

public static final double DEFYUSERSPACEMIN
A minimum plotting size in user space.

See Also:
Constant Field Values

DEFPRINTFONTSCALE

private static final double DEFPRINTFONTSCALE
Default printer scaling for font.

See Also:
Constant Field Values

userdata

private Map<String,List<DataCard>> userdata
The mapping of set names to data points in user space.


ogle

private Map<String,List<DataObserver>> ogle
The mapping of set names to data observers.


datadraw

private Map<String,List<ShapeDraw>> datadraw
We do not want to remove fixed objects, thus we have another table.


pointdraw

private Map<String,List<PointDraw>> pointdraw
We do not want to remove fixed objects, thus we have another table.


linedraw

private Map<String,List<ShapeDraw>> linedraw
We do not want to remove fixed objects, thus we have another table.


errordraw

private Map<String,List<ShapeDraw>> errordraw
We do not want to remove fixed objects, thus we have another table.


errorhats

private Map<String,List<PointDraw>> errorhats
The error bars for nice viewing.


xminmax

private Map<String,VectorG> xminmax
For each color the current min/max of the x-coordinate.


yminmax

private Map<String,VectorG> yminmax
For each color the current min/max of the y-coordinate.


xspan

private VectorG xspan
From all coordinates, the current span in x plus error.


yspan

private VectorG yspan
From all coordinates, the current span in y plus error.


setshapes

private Map<String,ShapeDraw> setshapes
The set names mapped to their generic shapes.


joints

private List<String> joints
The list of sets that create joined points.

Constructor Detail

JDataCanvas

public JDataCanvas(PropertyBearing prop)
Constructs a new shelf canvas.

Method Detail

getMainCanvas

public JDataCanvas getMainCanvas()
Returns this.

Specified by:
getMainCanvas in interface DataCanvasProviding

getComposingCanvases

public Collection<JDataCanvas> getComposingCanvases()
Returns a collection containing only this.

Specified by:
getComposingCanvases in interface DataCanvasProviding

init

public void init()
On init, clear the data.

Specified by:
init in interface Initializable
Overrides:
init in class JBoxedCanvas

setComposedProperties

public void setComposedProperties(PropertyBearing prop)
Adds additional default mappings.

Specified by:
setComposedProperties in interface PropertyAware
Overrides:
setComposedProperties in class JBoxedCanvas

addDelete

public static void addDelete(JDataCanvas jtf)
Add a delete cursor to the data canvas. This is a convenience method to allow this often-used cursor to be added with a single line of code


addZoom

public static void addZoom(JDataCanvas jtf)
Add a zoom cursor to the data canvas. This is a convenience method to allow this often-used cursor to be added with a single line of code


clearData

public boolean clearData()
Clears all accumulated data.


getSpanX

public Vector2D getSpanX()
Returns the current span of x coordinates.


getSpanY

public Vector2D getSpanY()
Returns the current span of y coordinates.


getMaximumPoints

public int getMaximumPoints()
Returns the number of points in the canvas.


getClosestShape

public <T extends Centerable> T getClosestShape(Point2D norm,
                                                Class<T> oftype)
Overrides for searching in my special point maps, too.

Specified by:
getClosestShape in interface NormalizedShapes
Overrides:
getClosestShape in class JNormalizedCanvas
Parameters:
norm - The point-of-interest in normalized coordinates.

getInsideShapes

public <T extends Centerable> Collection<T> getInsideShapes(Rectangle2D norm,
                                                            Class<T> oftype)
Adds my points, if requested.

Specified by:
getInsideShapes in interface NormalizedShapes
Overrides:
getInsideShapes in class JNormalizedCanvas
Parameters:
norm - The bounding rectangle in normalized coordinates.

getClosestDataShape

public Centerable getClosestDataShape(Point2D norm,
                                      String setname,
                                      double maxnorm)
Looks in the specified data set and returns the the closest Centerable there. Depending on KEY_RETAINSIZE we either return a PointDraw or a ShapeDraw object, both are also FilledShapes and can be cast.

Parameters:
norm - Look around this normalized point
setname - Only look in this set
maxnorm - If closest distance higher, return null.

getClosestData

public DataCard getClosestData(Point2D norm,
                               String setname)
Returns the data card that is closest to the point in question for the given set name.


getClosestData

public DataCard getClosestData(Point2D norm,
                               String setname,
                               double maxnorm)
Returns the data card that is closest to the point in question for the given set name.


getInsideData

public Collection<DataCard> getInsideData(Rectangle2D norm,
                                          String setname)
Returns all data cards inside the normalized rectangle for the given set name.


deleteClosest

public DataTransfer deleteClosest(Point2D norm,
                                  String setname)
Deletes the data point on the set closest to the normalized screen coordinates. The data point is not totally lost, as it may be redeemed by issuing revertDeleted(java.util.List, java.lang.String) with the data transfer object returned by this call.


getAnimationInfo

public Collection<DrawingInfo> getAnimationInfo(String stylename)
Adds the line set and the legend set, if they exist.

Overrides:
getAnimationInfo in class JNormalizedCanvas

deleteInside

public List<DataTransfer> deleteInside(Rectangle2D norm,
                                       String setname)
Deletes all data points within the normalized rectangle. The data point is not totally lost, as it may be redeemed by issuing revertDeleted(java.util.List, java.lang.String) with the data transfer object returned by this call. Note that it is essential to retain the order of the transferred data points to correctly redeem them, if they are connected.


revertDeleted

public boolean revertDeleted(List<DataTransfer> redeem,
                             String setname)
Reverts deleted data points. Adds in reversed order. Does rescale if necessary, does not repaint. Return true, if anything has changed.


redeemList

protected boolean redeemList(List<DataTransfer> redeem,
                             String setname)
Reenters a list of data into the canvas without notification. Returns true, if the scaling has changed and rescale has been issued.


extractKeys

protected List<DataTransfer> extractKeys(List<Object> keys,
                                         String setname)
If somehow we know the list of keys we want to delete from a set, We extract them into data transfer lists here. No data change notification is sent here.


extractKeys

protected List<DataTransfer> extractKeys(List<Object> keys,
                                         String setname,
                                         boolean notify)
If somehow we know the list of keys we want to delete from a set, We extract them into data transfer lists here. No data change notification is sent here, if notify is false.


extract

private boolean extract(Object cardkey,
                        String setname,
                        List<DataTransfer> sink)
Extracts a specific data card from a set by means of its key. This means: To allow redeeming of the data point, the resulting DataTransfer object collects all necessary information and is put into the provided sink.


redeem

private boolean redeem(DataTransfer undel,
                       String setname)
Redeems a previously extracted point. Depending on the non-null data in the transfer provided, error bars, lines, etc are reconstructed. True is returned, if a rescale is necessary.


scanRemove

private static <T extends FilledShape> T scanRemove(List<T> scan,
                                                    Object key)
Scans a list of either ShapeDraws or PointDraws for the first occurence of a given key. This FilledShape is removed from the list and returned.


nearest

private <T extends Centerable> T nearest(T one,
                                         T two,
                                         Point2D p)
Returns the centerable that is closer to the point.


addDataObserver

public void addDataObserver(DataObserver eye,
                            String setname)
Adds a new data observer for the given set name. The observer is notified whenever the set data changes.


removeDataObserver

public void removeDataObserver(DataObserver eye,
                               String setname)
Removes the data observer from the list.


addMeasure

public int addMeasure(VectorG point)
Whenever we add a data point, we recalculate the drawable list and the user transform. We also set the viewpoint to ensure proper labeling.

Returns:
The index of the draw object added.

addMeasure

public int addMeasure(String setname,
                      VectorG onepoint,
                      Object key)
Add a point specifying the set name instead of the set color. If the set name is not found in our look-up table, the entry is ignored.


putMeasuredSet

public int putMeasuredSet(List<? extends VectorG> points)
Sets a new list of data in the default color.


putMeasuredSet

public int putMeasuredSet(String setname,
                          List<? extends VectorG> points,
                          List<Object> keys)
Sets a new list of data into the specified set. Old data is deleted


putMeasuredSets

public int putMeasuredSets(Map<String,List<? extends VectorG>> pointmap,
                           Map<String,List<Object>> keymap)
This methods allows setting of a bunch of user data, rescaling is only done at the very end if necessary. If keys are to be provided for the measurements, the second mapping must provide them.


putMeasurements

private boolean putMeasurements(String setname,
                                List<? extends VectorG> points,
                                List<Object> keys,
                                boolean scale)
Sets a new list of data into the specified set. Old data is deleted. Returns true, if rescale is pending, which is never the case if launched with scale=true


addDrawingInfo

public Object addDrawingInfo(String stylename,
                             DrawingInfo color)
We allow adding of a new drawing style anf add the line set

Overrides:
addDrawingInfo in class JNormalizedCanvas

getMeasuredData

public List<DataCard> getMeasuredData(String setname)
Returns all measures belonging to the given set name.


getUserData

public Map<String,List<DataCard>> getUserData()
Returns all user data as a mapping of set names to VectorG,key-lists.


setUserData

public int setUserData(Map<String,List<DataCard>> apply)
Sets the entire mapping of user data to this canvas. Must be a mapping of Strings to lists. Warning: No checking is done if the lists provided contain Shelf, thus use with care.


getShapeForSet

public ShapeDraw getShapeForSet(String setname)
Returns the generic shape to a setname.


setShapeForSet

public ShapeDraw setShapeForSet(String setname,
                                ShapeDraw sd)
Replaces a generic shape, returns the old setting or null if currently unset.


addJoint

public void addJoint(String setname)
Adds this set to our allowed joints list.


removeJoint

public void removeJoint(String setname)
Removes this set to our allowed joints list.


isEmpty

public boolean isEmpty()
Returns true if all drawable objects have no entries.

Overrides:
isEmpty in class JNormalizedCanvas

prepareCanvas

protected void prepareCanvas(Graphics g)
Adds the axis labels, if given.

Overrides:
prepareCanvas in class JBoxedCanvas

drawShapes

protected void drawShapes(Graphics2D g2d,
                          AffineTransform af)
This is the only entry point where I can savely draw my userdata and do not have to care about graphics paint attributes, as they are reset in the calling method.

Overrides:
drawShapes in class JNormalizedCanvas

rescale

private void rescale()
Rescales the entire data. The xspan and yspan Vectors must be up-to-date. From these tables, we get the overall scaling of the component. We calculate the user-space transformation and update the ticks/labels along with all data points.


rebuildOneDataSet

public void rebuildOneDataSet(String setname)

putOneDataSet

private void putOneDataSet(String setname,
                           List<DataCard> all)
Puts a single data set with the given color into the drawable or fillabale map of the parent. All entries in the parent with the specified color are ereased.


addLineData

private int addLineData(String color,
                        ShapeDraw shape)
Adds a shape to the drawable list of objects.

Returns:
The index of the draw object added.

addErrorData

private int addErrorData(String color,
                         ShapeDraw shape)
Adds a shape to the errorbar list of objects.

Returns:
The index of the draw object added.

addErrorHat

private int addErrorHat(String color,
                        PointDraw shape)
Adds a shape to the errorbar list of objects.

Returns:
The index of the draw object added.

addDrawData

private int addDrawData(String color,
                        ShapeDraw shape)
Adds a shape to the errorbar list of objects.

Returns:
The index of the draw object added.

addPointData

private int addPointData(String color,
                         PointDraw shape)
Adds a shape to the errorbar list of objects.

Returns:
The index of the draw object added.

insertInto

private <T> int insertInto(Map<String,List<T>> setdata,
                           String color,
                           T shape)
Adds a shape to the drawable list of objects.

Returns:
The index of the draw object added.

putSinglePoint

private void putSinglePoint(String setname,
                            DataCard current,
                            DataCard old)
Adds a single data point to the drawable/fillable maps. Does not erease old data.


notifyOnRemove

protected void notifyOnRemove(String setname,
                              List<DataCard> removed)
Notifies all registered listeners of a remove of data.


notifyOnAdd

protected void notifyOnAdd(String setname,
                           List<DataCard> removed)
Notifies all registered listeners of a remove of data.


notifyNew

protected void notifyNew(Collection<String> sets)
Notifies all listeners to the set names of new data.


notifyClear

protected void notifyClear(Collection<String> sets)
Notifies all listeners to the set names of cleared data.


notifyListeners

private void notifyListeners(String setname,
                             DataChangeEvent dce)
Notifies all listeners to the given set name that the data has changed


createNormalShape

private ShapeDraw createNormalShape(CoordinateTransforming xy,
                                    DataCard point,
                                    double scalex,
                                    double scaley,
                                    Shape generic,
                                    boolean filled)
Creates a shape from a generic shape that is centered on (0,0). The generic shape is scaled according to the defined scale rules and the shifted as desired to represent a drawable shape in normalized space. This method can be used to generate data point shapes by using scales of one, and error bars by scaling according to the error in normalized coordinates.


createNormalPoint

private PointDraw createNormalPoint(CoordinateTransforming xy,
                                    DataCard point,
                                    double scalex,
                                    double scaley,
                                    Shape generic,
                                    boolean filled)
Creates a shape from a generic shape that is centered on (0,0). The generic shape is scaled according to the defined scale rules and the shifted as desired to represent a drawable shape in normalized space. This method can be used to generate data point shapes by using scales of one, and error bars by scaling according to the error in normalized coordinates.


createLine

private ShapeDraw createLine(CoordinateTransforming xy,
                             DataCard p1,
                             DataCard p2)
Creates a line that connects the two data points. The id of the line is the id of the two data points as a two-dim object array.


getMinMax

private static final VectorG getMinMax(List<DataCard> nvector,
                                       boolean ad,
                                       int index,
                                       int erridx)
Takes a list of VectorGs and returns the maximum and minimum found at the specified index as index 0/1. If an error index is given, the error on that min/max place is also recorded on indices 2 and 3.


getSpan

private static final VectorG getSpan(Collection<VectorG> vec2d,
                                     boolean ad)
Takes a collection of 2d vectors and gets the minimum of x and y.


getActions

public Map<String,Action> getActions()
Adds an action that can be used for saving the data in a file.

Overrides:
getActions in class JNormalizedCanvas

getDefaultProperties

public static Map<String,String> getDefaultProperties()
Returns a default mapping for applications that only want to override specific settings. Allows construction with a string.