Package PamView.paneloverlay.overlaymark
Class OverlayMark
java.lang.Object
PamView.paneloverlay.overlaymark.OverlayMark
- Direct Known Subclasses:
ClipDisplayMark
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionOverlayMark
(OverlayMarker overlayMarker, Object markSource, MarkExtraInfo markExtraInfo, int markChannels, GeneralProjector.ParameterType[] parameterTypes, GeneralProjector.ParameterUnits[] parameterUnits) OverlayMark
(OverlayMarker overlayMarker, Object markSource, MarkExtraInfo markExtraInfo, int markChannels, GeneralProjector.ParameterType[] parameterTypes, GeneralProjector.ParameterUnits[] parameterUnits, PamCoordinate firstCoordinate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCoordinate
(PamCoordinate pamCoordinate) int
findParameterIndex
(GeneralProjector.ParameterType parameterType) Find the index of a given parameter type,getCoordinate
(int index) double[]
The limits of the overlay mark.int
getMarkShape
(GeneralProjector projector) Calculate the shape of the mark in screen coordinates.static Point
getSwingComponentMousePos
(Component component, javafx.scene.input.MouseEvent mouseEvent) Get the coordinate of the mouse in this mark in the coordinate frame of the given component.boolean
isHidden()
void
Repaint whatever drew this mark.void
setCurrentMouseCoordinate
(PamCoordinate currentMouse) void
setHidden
(boolean hidden) Set flag to hide the mark.void
setMarkChannels
(int markChannels) void
setMarkSource
(Object markSource) void
setMarkType
(OverlayMark.OverlayMarkType markType) int
size()
toString()
-
Constructor Details
-
OverlayMark
public OverlayMark(OverlayMarker overlayMarker, Object markSource, MarkExtraInfo markExtraInfo, int markChannels, GeneralProjector.ParameterType[] parameterTypes, GeneralProjector.ParameterUnits[] parameterUnits) -
OverlayMark
public OverlayMark(OverlayMarker overlayMarker, Object markSource, MarkExtraInfo markExtraInfo, int markChannels, GeneralProjector.ParameterType[] parameterTypes, GeneralProjector.ParameterUnits[] parameterUnits, PamCoordinate firstCoordinate)
-
-
Method Details
-
size
public int size() -
getCoordinate
-
getLastCoordinate
-
addCoordinate
-
getMarkType
- Returns:
- the markType
-
setMarkType
- Parameters:
markType
- the markType to set
-
setCurrentMouseCoordinate
-
getCurrentMouseCoordinate
-
getParameterTypes
- Returns:
- the parameterTypes
-
findParameterIndex
Find the index of a given parameter type,- Parameters:
parameterType
-- Returns:
- index of the parameter, or -1 if it can't be found.
-
getParameterUnits
- Returns:
- the parameterUnits
-
getCoordinates
- Returns:
- the coordinates
-
getCentre
- Returns:
- the central or mean position of all the mark points.
-
getLimits
public double[] getLimits()The limits of the overlay mark. The limits are x and y extremities.- Returns:
- the limits (minX, maxX, minY, maxY)
-
getCurrentMouse
- Returns:
- the currentMouse
-
getMarkShape
Calculate the shape of the mark in screen coordinates.- Parameters:
projector
- projector onto screen coordinates.- Returns:
- shape (Rectangle or Region)
-
toString
-
getMarkSource
- Returns:
- the markSource
-
setMarkSource
- Parameters:
markSource
- the markSource to set
-
getMarkChannels
public int getMarkChannels()- Returns:
- the markChannels
-
setMarkChannels
public void setMarkChannels(int markChannels) - Parameters:
markChannels
- the markChannels to set
-
getSwingComponentMousePos
public static Point getSwingComponentMousePos(Component component, javafx.scene.input.MouseEvent mouseEvent) Get the coordinate of the mouse in this mark in the coordinate frame of the given component. Used primarily for positioning popup menus.- Parameters:
component
- Swing component.mouseEvent
-- Returns:
- mouse coordinate within the given component.
-
repaintOwner
public void repaintOwner()Repaint whatever drew this mark. -
setHidden
public void setHidden(boolean hidden) Set flag to hide the mark. This can be useful if the mark observer is dragging something and wants to stop the mark rectangle appearing on the screen.- Parameters:
hidden
- hide flag
-
isHidden
public boolean isHidden()- Returns:
- Flag to say the mark should not be drawn.
-