Package chemaxon.marvin.space.monitor
Class Monitor
java.lang.Object
chemaxon.marvin.space.GraphicComponent
chemaxon.marvin.space.monitor.Monitor
- All Implemented Interfaces:
chemaxon.marvin.space.UsableObject
- Direct Known Subclasses:
Label
,MeasurementMonitor
,PositionMonitor
The
A
A
A
Monitor
is for "watching" something in the scene.
The direct subclasses are MeasurementMonitor
, PositionMonitor
and Label
.A
MeasurementMonitor
watches some objects, and measures something between them.A
PositionMonitor
is watching a location as a center of a transformation.A
Label
is watching an object and describes it.- Since:
- Marvin 4.0.2
-
Field Summary
Modifier and TypeFieldDescriptionprotected Control
protected int
protected int[]
protected ComponentElement[]
Storage of the items of monitoring.protected int
Points to the next empty space in selectedItems.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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Deletes all items from selectedItems.Returns the set of the monitored items.boolean
Returns true if the monitor has a control.boolean
Retruns true if any of the selected elements is hidden.boolean
In wire mode (now only this is available) monitors are drawn with blending enabled.boolean
isFull()
Returns true if the monitor is full and can measure.boolean
A monitor is visible if all of its selected components are visible, and it is not hidden explicitly.abstract int
Returns the number of items necessary for monitoring.void
double
Monitors do not really have z coordinate, they are the nearer to us.void
Gets notification from its selected components if their coordinates have been changed.void
If the component to that this monitor is assigned becomes hidden, this monitor will also behave so.void
If the component to that this monitor is assigned becomes visible, this monitor will also behave so.boolean
refersTo
(GraphicComponent component) Retruns true if component is between the selected elements.void
selectItem
(ComponentElement item) Puts item to the selection.void
unSelect()
Sets the component not to be selected.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, getCoordinates, getCoordinates, getDescription, getDescription, 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
-
selectedItems
Storage of the items of monitoring. -
selectedItemCoordinates
protected int[] selectedItemCoordinates -
selectionPointer
protected int selectionPointerPoints to the next empty space in selectedItems. -
control
-
mode
protected int mode
-
-
Constructor Details
-
Monitor
protected Monitor()Creates a new instance ofMonitor
. Initializes selectedItems with a maximum item count, and becames a GraphicComponent which does not modify the origin of the Cell it is in.
-
-
Method Details
-
onRemoveGraphicComponent
public void onRemoveGraphicComponent()- Overrides:
onRemoveGraphicComponent
in classGraphicComponent
-
maximumItemCount
public abstract int maximumItemCount()Returns the number of items necessary for monitoring. E.g. 2 for distance monitoring. -
getSelectedElements
Returns the set of the monitored items.- Returns:
- identifiers of the monitored objects.
-
selectItem
Puts item to the selection. -
receiveNotificationOnCoordinateChange
Gets notification from its selected components if their coordinates have been changed. A monitor should be refreshed then.- Overrides:
receiveNotificationOnCoordinateChange
in classGraphicComponent
- Parameters:
gc
- component changing coordinates
-
receiveNotificationOnVisibility
If the component to that this monitor is assigned becomes visible, this monitor will also behave so.- Overrides:
receiveNotificationOnVisibility
in classGraphicComponent
- Parameters:
gc
- visible component
-
receiveNotificationOnInvisibility
If the component to that this monitor is assigned becomes hidden, this monitor will also behave so.- Overrides:
receiveNotificationOnInvisibility
in classGraphicComponent
- Parameters:
gc
- invisible component
-
isFull
public boolean isFull()Returns true if the monitor is full and can measure. -
hasControl
public boolean hasControl()Returns true if the monitor has a control. A monitor can have a control, but a control cannot exist without a monitor. -
clear
public void clear()Deletes all items from selectedItems. -
isVisible
public boolean isVisible()A monitor is visible if all of its selected components are visible, and it is not hidden explicitly.- Specified by:
isVisible
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
isVisible
in classGraphicComponent
- Returns:
- visibility of the component
-
hasInvisibleItem
public boolean hasInvisibleItem()Retruns true if any of the selected elements is hidden. (This monitor won't be displayed then.) -
refersTo
Retruns true if component is between the selected elements. -
unSelect
public void unSelect()Sets the component not to be selected.- Specified by:
unSelect
in interfacechemaxon.marvin.space.UsableObject
- Overrides:
unSelect
in classGraphicComponent
-
pickedIndicator
public double pickedIndicator()Monitors do not really have z coordinate, they are the nearer to us. Apart from that in case of picking every component tells its z coordinate so we can tell which component is really picked (the nearest). This function returns a virtual z coordinate, which represents a very near object. IflocateObject()
returns the same aspickedIndicator()
, then we say that the monitor was picked. -
hasTransparentPart
public boolean hasTransparentPart()In wire mode (now only this is available) monitors are drawn with blending enabled.- Overrides:
hasTransparentPart
in classGraphicComponent
- Returns:
- will the component draw with transparency
-