chemaxon.marvin.space.monitor
Class MeasurementMonitor

java.lang.Object
  extended by chemaxon.marvin.space.GraphicComponent
      extended by chemaxon.marvin.space.monitor.Monitor
          extended by chemaxon.marvin.space.monitor.MeasurementMonitor
All Implemented Interfaces:
chemaxon.marvin.space.UsableObject
Direct Known Subclasses:
AngleMonitor, DihedralMonitor, DistanceMonitor

public abstract class MeasurementMonitor
extends Monitor

Monitor that measures something on its elements. The measured value is supposed to be drawn as a Label by selecting this monitor as the selected item of the label.

Since:
Marvin 4.0.2
Version:
MarvinSpace 1.0
Author:
Judit Papp

Field Summary
protected  Label label
           
protected  java.lang.String measure
           
protected  double measurement
           
protected  double[] textPosWindow
           
 
Fields inherited from class chemaxon.marvin.space.monitor.Monitor
control, mode, selectedItemCoordinates, selectedItems, selectionPointer
 
Fields inherited from class chemaxon.marvin.space.GraphicComponent
active, associatedComponents, boundingBox, color, COMPONENT_TYPE_ENTIRE, drawProperties, drawType, gl, glu, graphicCell, irm, modifiesOrigin, motionMode, mousex, mousey, name, pickedItem, RENDERING_QUALITY_HIGH, RENDERING_QUALITY_LOW, RENDERING_QUALITY_MEDIUM, renderingQuality, rm, uoid, visible
 
Constructor Summary
protected MeasurementMonitor()
          Creates a new instance of MeasureMonitor
 
Method Summary
 void getCoordinates(ComponentElement item, float[] c)
          Returns the centroid of the selected elements.
 void getCoordinates(float[] c)
          Returns the centroid of the selected elements.
 java.lang.String getDescription()
          Returns the measurement as a description.
 java.lang.String getDescription(ComponentElement element)
          Returns the measurement as a description.
protected  byte[] getMonitorColor()
           
abstract  double measurement()
          Returns the measurement measured by the monitor as a double.
 void receiveNotificationOnCoordinateChange(GraphicComponent gc)
          Gets notification from its selected components if their coordinates have been changed.
 void refresh()
          Deletes the position and the value of the measurement to recount.
 void selectItem(ComponentElement item)
          Puts the item to the selection and clears its description.
 void setLabel(Label label)
          Sets the Label of the monitor that is to display the measurement.
 
Methods inherited from class chemaxon.marvin.space.monitor.Monitor
clear, getSelectedElements, hasControl, hasInvisibleItem, hasTransparentPart, isFull, isVisible, maximumItemCount, onRemoveGraphicComponent, pickedIndicator, receiveNotificationOnInvisibility, receiveNotificationOnVisibility, refersTo, unSelect
 
Methods inherited from class chemaxon.marvin.space.GraphicComponent
addDrawProperties, associate, draw, draw2DPart, drawBoundingBox, drawCoordinateAxes, drawSelection, drawTransparentPart, exclusiveSelection, exclusiveSelection, extendSelection, extendSelection, fadeSelected, fadeUnselected, getAssociatedComponents, getBoundingBox, getBoundingSphereRadius, getCell, getColor, getComponentElement, getDrawProperties, getDrawProperty, getGraphicComponent, getId, getLabelInformation, getName, getRenderingQuality, getUsableObject, getZCoordinateTo2DPart, glColor, has2DPart, hasSelectedElements, hideSelected, hideUnselected, invertSelection, invertSelection, isControllable, isGraphicComponent, isSelected, isSelected, isVisible, locateObject, notifyCoordinateChange, notifyInvisibility, notifySelection, notifyUnSelection, notifyVisibility, pickObject, projectVector, receiveNotificationOnSelection, receiveNotificationOnUnSelection, removeAssociation, resize, rotate, rotate, rotate, select, select, selectComponentElementsInside, setColor, setColor, setColor, setDrawProperties, setDrawProperty, setGL, setMotionMode, setName, setProgressBar, setRenderingQuality, setRotateMatrix, setVisible, showFaded, storeDrawProperty, toString, touchObject, translate, unSelect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

measurement

protected double measurement

textPosWindow

protected double[] textPosWindow

measure

protected java.lang.String measure

label

protected Label label
Constructor Detail

MeasurementMonitor

protected MeasurementMonitor()
Creates a new instance of MeasureMonitor

Method Detail

setLabel

public void setLabel(Label label)
Sets the Label of the monitor that is to display the measurement.

Parameters:
label -

selectItem

public void selectItem(ComponentElement item)
Puts the item to the selection and clears its description. It is necessary to have proper measurement labels, because in case of predefined description the previously set description would appear instead of the measurement.

Overrides:
selectItem in class Monitor
Parameters:
item - item to select

receiveNotificationOnCoordinateChange

public void receiveNotificationOnCoordinateChange(GraphicComponent gc)
Gets notification from its selected components if their coordinates have been changed. A measurement monitor should recompute its measurement then.

Overrides:
receiveNotificationOnCoordinateChange in class Monitor
Parameters:
gc - component changing coordinates

measurement

public abstract double measurement()
Returns the measurement measured by the monitor as a double.


getCoordinates

public void getCoordinates(float[] c)
Returns the centroid of the selected elements.

Overrides:
getCoordinates in class GraphicComponent
Parameters:
c - allocated array where coordinates will be put

getCoordinates

public void getCoordinates(ComponentElement item,
                           float[] c)
Returns the centroid of the selected elements.

Overrides:
getCoordinates in class GraphicComponent
Parameters:
item - specific part of the component
c - allocated array where coordinates will be put

getDescription

public java.lang.String getDescription()
Returns the measurement as a description.

Overrides:
getDescription in class GraphicComponent
Returns:
short description as String

getDescription

public java.lang.String getDescription(ComponentElement element)
Returns the measurement as a description.

Overrides:
getDescription in class GraphicComponent
Parameters:
element - specific part of the component
Returns:
short description as String

refresh

public void refresh()
Deletes the position and the value of the measurement to recount.


getMonitorColor

protected byte[] getMonitorColor()