chemaxon.marvin.space.monitor
Class DihedralMonitor

java.lang.Object
  extended by chemaxon.marvin.space.GraphicComponent
      extended by chemaxon.marvin.space.monitor.Monitor
          extended by chemaxon.marvin.space.monitor.MeasurementMonitor
              extended by chemaxon.marvin.space.monitor.DihedralMonitor
All Implemented Interfaces:
chemaxon.marvin.space.UsableObject

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
Version:
MarvinSpace 1.0
Author:
Judit Papp

Field Summary
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
DihedralMonitor()
          Creates a new instance of DihedralMonitor
 
Method Summary
 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, 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, 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

control

protected DihedralControl control
Constructor Detail

DihedralMonitor

public DihedralMonitor()
Creates a new instance of DihedralMonitor

Method Detail

maximumItemCount

public int maximumItemCount()
Returns 4, as measuring dihedral is defined on 4 components.

Specified by:
maximumItemCount in class Monitor

getCoordinates

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

Overrides:
getCoordinates in class MeasurementMonitor
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 interface chemaxon.marvin.space.UsableObject
Overrides:
select in class GraphicComponent

unSelect

public void unSelect()
Sets the monitor to be unselected and destroys the DihedralControl.

Specified by:
unSelect in interface chemaxon.marvin.space.UsableObject
Overrides:
unSelect in class Monitor

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 class MeasurementMonitor

draw

public void draw()
Draws dotted lines between the components, and a circle around the middle line.

Overrides:
draw in class GraphicComponent

getMonitorColor

protected byte[] getMonitorColor()
Returns the color of the control if it exists.

Overrides:
getMonitorColor in class MeasurementMonitor