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
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Label
protected String
protected double
protected double[]
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
ConstructorsModifierConstructorDescriptionprotected
Creates a new instance of MeasureMonitor -
Method Summary
Modifier and TypeMethodDescriptionvoid
getCoordinates
(float[] c) Returns the centroid of the selected elements.void
getCoordinates
(ComponentElement item, float[] c) Returns the centroid of the selected elements.Returns the measurement as a description.getDescription
(ComponentElement element) Returns the measurement as a description.protected byte[]
abstract double
Returns the measurement measured by the monitor as a double.void
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
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
-
Field Details
-
measurement
protected double measurement -
textPosWindow
protected double[] textPosWindow -
measure
-
label
-
-
Constructor Details
-
MeasurementMonitor
protected MeasurementMonitor()Creates a new instance of MeasureMonitor
-
-
Method Details
-
setLabel
Sets the Label of the monitor that is to display the measurement. -
selectItem
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
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
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
Returns the measurement as a description.- Overrides:
getDescription
in classGraphicComponent
- Returns:
- short description as
String
-
getDescription
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()
-