com.nwoods.jgo.instruments
Class MultipleIndicatorMeter

java.lang.Object
  extended bycom.nwoods.jgo.JGoObject
      extended bycom.nwoods.jgo.JGoArea
          extended bycom.nwoods.jgo.instruments.Meter
              extended bycom.nwoods.jgo.instruments.MultipleIndicatorMeter
All Implemented Interfaces:
JGoObjectCollection, JGoObjectSimpleCollection, JGoXMLSaveRestore, java.io.Serializable

public class MultipleIndicatorMeter
extends Meter

A Meter designed to maintain an array of Indicators.

See Also:
Serialized Form

Field Summary
static int InsertedIndicator
          This is a JGoObject update subhint.
static int RemovedIndicator
          This is a JGoObject update subhint.
static int ReplacedIndicator
          This is a JGoObject update subhint.
 
Fields inherited from class com.nwoods.jgo.instruments.Meter
ChangedBackground, ChangedIndicator, ChangedInsets, ChangedLabel, ChangedLabelRelativeSpot, ChangedLabelSpot, ChangedOrientation, ChangedScale, OrientationHorizontal, OrientationVertical
 
Fields inherited from class com.nwoods.jgo.JGoArea
ChangedPickableBackground
 
Fields inherited from class com.nwoods.jgo.JGoObject
Bottom, BottomCenter, BottomLeft, BottomMiddle, BottomRight, Center, CenterLeft, CenterRight, Changed4ResizeHandles, ChangedAutoRescale, ChangedBrush, ChangedDraggable, ChangedDragsNode, ChangedGeometry, ChangedGrabChildSelection, ChangedInitializing, ChangedPen, ChangedResizable, ChangedSelectable, ChangedUpdatePartner, ChangedVisible, ChangedZOrder, LastChangedHint, Left, LeftCenter, NoHandle, NoSpot, NumReservedHandles, RepaintAll, Right, RightCenter, SideLeft, SideRight, Top, TopCenter, TopLeft, TopMiddle, TopRight
 
Constructor Summary
MultipleIndicatorMeter()
          Construct a meter with no scale or indicator.
 
Method Summary
 void addIndicator(AbstractIndicator ind)
          Add an AbstractIndicator to the list.
 void changeValue(JGoDocumentChangedEdit e, boolean undo)
          Handle undo and redo changes.
 void copyNewValueForRedo(JGoDocumentChangedEdit e)
          This method is called when a JGoDocumentChangedEdit is created for a JGoDocumentEvent.CHANGED event, when a JGoObject has been changed.
 JGoObject copyObject(JGoCopyEnvironment env)
          Make sure references to the children, including the indicators, are referring to newly copied objects.
 AbstractIndicator getIndicator()
          Gets the main AbstractIndicator, the first one.
 AbstractIndicator getIndicator(int index)
          Get an AbstractIndicator at a particular position in the list.
 int getIndicatorCount()
          Gets the number of Indicators being displayed.
 java.util.ArrayList getIndicators()
          A read-only list containing all the Indicators associated with this MultipleIndicatorMeter.
 void insertIndicator(int index, AbstractIndicator ind)
          Add an AbstractIndicator at a particular position in the list.
 void removeIndicator(AbstractIndicator ind)
          Remove an AbstractIndicator from the list.
 JGoObject removeObjectAtPos(JGoListPosition pos)
          If any part is removed from this group, be sure to remove any references in local fields.
 void setIndicator(AbstractIndicator value)
          Set the main AbstractIndicator, the first one.
 void setIndicator(int index, AbstractIndicator ind)
          Replace an AbstractIndicator at a particular position in the list.
 
Methods inherited from class com.nwoods.jgo.instruments.Meter
copyChildren, createBackground, createIndicator, createLabel, createScale, getBackground, getInsets, getLabel, getLabelRelativeSpot, getLabelSpot, getMaximum, getMinimum, getOrientation, getQuantizeBase, getQuantizeUnit, getScale, getScaleLabelDistance, getScaleLabelFormat, getScaleLabelFrequency, getScaleLabelStyle, getTickBase, getTickColor, getTickLengthLeft, getTickLengthRight, getTickMajorFrequency, getTickMajorLengthRatio, getTickMajorWidth, getTickUnit, getTickWidth, getValue, initialize, isControllable, isQuantized, isTickLabels, layoutChildren, setBackground, setControllable, setInsets, setLabel, setLabelRelativeSpot, setLabelSpot, setMaximum, setMinimum, setOrientation, setQuantizeBase, setQuantized, setQuantizeUnit, setScale, setScaleLabelDistance, setScaleLabelFormat, setScaleLabelFrequency, setScaleLabelStyle, setTickBase, setTickColor, setTickLabels, setTickLengthLeft, setTickLengthRight, setTickMajorFrequency, setTickMajorLengthRatio, setTickMajorWidth, setTickUnit, setTickWidth, setValue, SVGReadObject, SVGUpdateReference, SVGWriteObject
 
Methods inherited from class com.nwoods.jgo.JGoArea
addCollection, addCollection, addObjectAtHead, addObjectAtTail, bringObjectToFront, computeBoundingRect, expandRectByPenWidth, findObject, geometryChange, geometryChangeChild, getFirstObjectPos, getLastObjectPos, getNearestIntersectionPoint, getNextObjectPos, getNextObjectPosAtTop, getNumObjects, getObjectAtPos, getPrevObjectPos, insertObjectAfter, insertObjectBefore, isEmpty, isPickableBackground, moveChildren, paint, pick, pickObject, pickObjects, removeObject, rescaleChildren, sendObjectToBack, setPickableBackground
 
Methods inherited from class com.nwoods.jgo.JGoObject
canView, computeMove, computeResize, copy, copyObjectDelayed, copyOldValueForUndo, copyRect, doMouseClick, doMouseDblClick, doUncapturedMouseMove, findCommonParent, foredate, gainedSelection, getBoundingRect, getDocument, getDraggingObject, getFlags, getHeight, getLayer, getLeft, getLocation, getLocation, getParent, getParentJGoNode, getParentNode, getPartner, getRectangleSpotLocation, getSize, getSize, getSpotLocation, getSpotLocation, getToolTipText, getTop, getTopLeft, getTopLeft, getTopLevelObject, getView, getWidth, growRect, handleMove, handleResize, hideSelectionHandles, is4ResizeHandles, isAutoRescale, isBoundingRectInvalid, isChildOf, isDraggable, isDragsNode, isInitializing, isPointInObj, isResizable, isSelectable, isSkipsUndoManager, isSuspendChildUpdates, isSuspendUpdates, isTopLevel, isUpdatePartner, isVisible, lostSelection, ownerChange, partnerUpdate, redirectSelection, remove, set4ResizeHandles, setAutoRescale, setBoundingRect, setBoundingRect, setBoundingRect, setBoundingRectForce, setBoundingRectForce, setBoundingRectInvalid, setBoundsRect, setDraggable, setDragsNode, setFlags, setHeight, setInitializing, setLeft, setLocation, setLocation, setLocationOffset, setLocationOffset, setParent, setPartner, setRectangleSpotLocation, setResizable, setSelectable, setSize, setSize, setSizeKeepingLocation, setSkipsUndoManager, setSpotLocation, setSpotLocation, setSpotLocation, setSpotLocationOffset, setSuspendChildUpdates, setSuspendUpdates, setTop, setTopLeft, setTopLeft, setUpdatePartner, setVisible, setWidth, showSelectionHandles, spotOpposite, SVGReadAttributes, SVGWriteAttributes, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

InsertedIndicator

public static final int InsertedIndicator
This is a JGoObject update subhint.

See Also:
Constant Field Values

RemovedIndicator

public static final int RemovedIndicator
This is a JGoObject update subhint.

See Also:
Constant Field Values

ReplacedIndicator

public static final int ReplacedIndicator
This is a JGoObject update subhint.

See Also:
Constant Field Values
Constructor Detail

MultipleIndicatorMeter

public MultipleIndicatorMeter()
Construct a meter with no scale or indicator.

Method Detail

getIndicator

public AbstractIndicator getIndicator()
Gets the main AbstractIndicator, the first one.

Overrides:
getIndicator in class Meter
Returns:
If there are no indicators, this returns null.

setIndicator

public void setIndicator(AbstractIndicator value)
Set the main AbstractIndicator, the first one.

Overrides:
setIndicator in class Meter
Parameters:
value - an AbstractIndicator that replaces the first one

getIndicators

public java.util.ArrayList getIndicators()
A read-only list containing all the Indicators associated with this MultipleIndicatorMeter.


addIndicator

public void addIndicator(AbstractIndicator ind)
Add an AbstractIndicator to the list.

Parameters:
ind - an AbstractIndicator

insertIndicator

public void insertIndicator(int index,
                            AbstractIndicator ind)
Add an AbstractIndicator at a particular position in the list.

Parameters:
index - a non-negative index that is less than or equal to the number of indicators
ind - an AbstractIndicator

removeIndicator

public void removeIndicator(AbstractIndicator ind)
Remove an AbstractIndicator from the list.

Parameters:
ind - an AbstractIndicator; if not present, this is a no-op.

getIndicator

public AbstractIndicator getIndicator(int index)
Get an AbstractIndicator at a particular position in the list.

Parameters:
index - a non-negative index that is less than the getIndicatorCount()
Returns:
the index'th AbstractIndicator

setIndicator

public void setIndicator(int index,
                         AbstractIndicator ind)
Replace an AbstractIndicator at a particular position in the list.

Parameters:
index - a non-negative index that is less than the getIndicatorCount()
ind - an AbstractIndicator

getIndicatorCount

public int getIndicatorCount()
Gets the number of Indicators being displayed.


copyObject

public JGoObject copyObject(JGoCopyEnvironment env)
Make sure references to the children, including the indicators, are referring to newly copied objects.

Overrides:
copyObject in class Meter
Parameters:
env - the environment for the copy operation - keeps track of copied objects.
Returns:
the new MultipleIndicatorMeter

removeObjectAtPos

public JGoObject removeObjectAtPos(JGoListPosition pos)
If any part is removed from this group, be sure to remove any references in local fields.

Specified by:
removeObjectAtPos in interface JGoObjectCollection
Overrides:
removeObjectAtPos in class Meter
Parameters:
pos - a JGoListPosition in this area

copyNewValueForRedo

public void copyNewValueForRedo(JGoDocumentChangedEdit e)
Description copied from class: JGoObject
This method is called when a JGoDocumentChangedEdit is created for a JGoDocumentEvent.CHANGED event, when a JGoObject has been changed. In order for the JGoDocumentChangedEdit to be able to perform a redo, it needs to remember the new property value or state. However, the JGoObject.update method does not provide such a new value. The value must be taken from this object and copied into the JGoDocumentChangedEdit by calling setNewValue and/or setNewValueInt.

Just as the previous/old value/state information is stored as one or both of an integer and an Object, the new value/state information may be stored as either or both of an integer or an Object.

The responsibility for copying rests with the document event listener rather than the code calling JGoObject.update for efficiency when there is no undo/redo manager.

Overrides:
copyNewValueForRedo in class Meter

changeValue

public void changeValue(JGoDocumentChangedEdit e,
                        boolean undo)
Handle undo and redo changes.

Overrides:
changeValue in class Meter
Parameters:
e -
undo -