Class 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 a Label by selecting this monitor as the selected item of the label.
    Since:
    Marvin 4.0.2
    • Field Detail

      • measurement

        protected double measurement
      • textPosWindow

        protected double[] textPosWindow
      • measure

        protected 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 String getDescription()
        Returns the measurement as a description.
        Overrides:
        getDescription in class GraphicComponent
        Returns:
        short description as String
      • getDescription

        public 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()