Package chemaxon.marvin.space.monitor
Class MeasurementMonitor
- java.lang.Object
-
- chemaxon.marvin.space.GraphicComponent
-
- chemaxon.marvin.space.monitor.Monitor
-
- chemaxon.marvin.space.monitor.MeasurementMonitor
-
- All Implemented Interfaces:
chemaxon.marvin.space.UsableObject
- Direct Known Subclasses:
AngleMonitor
,DihedralMonitor
,DistanceMonitor
@PublicAPI public abstract class MeasurementMonitor extends Monitor
Monitor
that measures something on its elements. The measured value is supposed to be drawn as aLabel
by selecting this monitor as the selected item of the label.- Since:
- Marvin 4.0.2
-
-
Field Summary
Fields Modifier and Type Field Description protected Label
label
protected 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
Constructors Modifier Constructor Description protected
MeasurementMonitor()
Creates a new instance of MeasureMonitor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
getCoordinates(float[] c)
Returns the centroid of the selected elements.void
getCoordinates(ComponentElement item, float[] c)
Returns the centroid of the selected elements.String
getDescription()
Returns the measurement as a description.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, cleanup, draw, draw2DPart, drawBoundingBox, drawCoordinateAxes, drawSelection, drawTransparentPart, exclusiveSelection, exclusiveSelection, extendSelection, extendSelection, fadeSelected, fadeUnselected, getAssociatedComponents, getBoundingBox, getBoundingSphereRadius, getCell, getColor, getComponentElement, getDrawProperties, getDrawProperty, getGraphicComponent, getId, getLabelInformation, 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, setColor, setDrawProperties, setDrawProperty, setGL, setMotionMode, setName, setProgressBar, setRenderingQuality, setRotateMatrix, setVisible, showFaded, storeDrawProperty, toString, touchObject, translate, unSelect
-
-
-
-
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 classMonitor
- 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 classMonitor
- 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 classGraphicComponent
- 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 classGraphicComponent
- Parameters:
item
- specific part of the componentc
- allocated array where coordinates will be put
-
getDescription
public String getDescription()
Returns the measurement as a description.- Overrides:
getDescription
in classGraphicComponent
- Returns:
- short description as
String
-
getDescription
public String getDescription(ComponentElement element)
Returns the measurement as a description.- Overrides:
getDescription
in classGraphicComponent
- 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()
-
-