Package chemaxon.marvin.space.monitor
Class DihedralMonitor
- java.lang.Object
-
- chemaxon.marvin.space.GraphicComponent
-
- chemaxon.marvin.space.monitor.Monitor
-
- chemaxon.marvin.space.monitor.MeasurementMonitor
-
- chemaxon.marvin.space.monitor.DihedralMonitor
-
- All Implemented Interfaces:
chemaxon.marvin.space.UsableObject
@PublicAPI public class DihedralMonitor extends MeasurementMonitor
Monitor for measuring dihedral. Dihedral of 4 components is the angle between the 2 planes determinde by the first 3 and the second 3 components. Measuring dihedral has only sense if the 4 elements are 4 atoms of a molecule.- Since:
- Marvin 4.0.2
-
-
Field Summary
Fields Modifier and Type Field Description protected DihedralControl
control
-
Fields inherited from class chemaxon.marvin.space.monitor.MeasurementMonitor
label, measure, measurement, textPosWindow
-
Fields inherited from class chemaxon.marvin.space.monitor.Monitor
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 Constructor Description DihedralMonitor()
Creates a new instance of DihedralMonitor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
control(int v)
Passes the control event to the control.void
draw()
Draws dotted lines between the components, and a circle around the middle line.GraphicComponent
getComponent()
Returns the molecule whose atoms are monitored.void
getCoordinates(float[] c)
Returns the centroid of the second and third selected elements.protected byte[]
getMonitorColor()
Returns the color of the control if it exists.int
maximumItemCount()
Returns 4, as measuring dihedral is defined on 4 components.double
measurement()
Measures the dihedral.void
select()
When the monitor is selected, a DihedralControl is created or changes its direction if it was alredy created.void
setControl(DihedralControl control)
Sets a DihedralControl to the monitor.void
unSelect()
Sets the monitor to be unselected and destroys the DihedralControl.-
Methods inherited from class chemaxon.marvin.space.monitor.MeasurementMonitor
getCoordinates, getDescription, getDescription, receiveNotificationOnCoordinateChange, refresh, selectItem, setLabel
-
Methods inherited from class chemaxon.marvin.space.monitor.Monitor
clear, getSelectedElements, hasControl, hasInvisibleItem, hasTransparentPart, isFull, isVisible, onRemoveGraphicComponent, pickedIndicator, receiveNotificationOnInvisibility, receiveNotificationOnVisibility, refersTo
-
Methods inherited from class chemaxon.marvin.space.GraphicComponent
addDrawProperties, associate, cleanup, 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, selectComponentElementsInside, setColor, setColor, setColor, setColor, setDrawProperties, setDrawProperty, setGL, setMotionMode, setName, setProgressBar, setRenderingQuality, setRotateMatrix, setVisible, showFaded, storeDrawProperty, toString, touchObject, translate, unSelect
-
-
-
-
Field Detail
-
control
protected DihedralControl control
-
-
Method Detail
-
maximumItemCount
public int maximumItemCount()
Returns 4, as measuring dihedral is defined on 4 components.- Specified by:
maximumItemCount
in classMonitor
-
getCoordinates
public void getCoordinates(float[] c)
Returns the centroid of the second and third selected elements.- Overrides:
getCoordinates
in classMeasurementMonitor
- Parameters:
c
- allocated array where coordinates will be put
-
select
public void select()
When the monitor is selected, a DihedralControl is created or changes its direction if it was alredy created.- Specified by:
select
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
select
in classGraphicComponent
-
unSelect
public void unSelect()
Sets the monitor to be unselected and destroys the DihedralControl.
-
getComponent
public GraphicComponent getComponent()
Returns the molecule whose atoms are monitored.
-
setControl
public void setControl(DihedralControl control)
Sets a DihedralControl to the monitor. It will change the coordinates of the elements, and makes the monitor refresh.
-
control
public void control(int v)
Passes the control event to the control.
-
measurement
public double measurement()
Measures the dihedral.- Specified by:
measurement
in classMeasurementMonitor
-
draw
public void draw()
Draws dotted lines between the components, and a circle around the middle line.- Overrides:
draw
in classGraphicComponent
-
getMonitorColor
protected byte[] getMonitorColor()
Returns the color of the control if it exists.- Overrides:
getMonitorColor
in classMeasurementMonitor
-
-