Package PamView.paneloverlay.overlaymark
Class OverlayMarker
java.lang.Object
PamView.paneloverlay.overlaymark.ExtMouseAdapter
PamView.paneloverlay.overlaymark.OverlayMarker
- All Implemented Interfaces:
 MarkManager
- Direct Known Subclasses:
 BTOverlayMarker,ClipDisplayMarker,SpectrogramMarker,StandardOverlayMarker
Receive mouse actions made on the map, turn them into regions
 displayed as an overlay on the map and send the region information 
 off to any observers who might be interested in those data. 
In some ways this class behaves in a very similar manner to the spectrogram mark observer system.
- Author:
 - Doug Gillespie
 
- 
Constructor Summary
ConstructorsConstructorDescriptionOverlayMarker(Object markSource, int markChannels, GeneralProjector projector)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserver(OverlayMarkObserver observer) booleancanDestroyMark(javafx.scene.input.MouseEvent e) Check whether a current mark can be destroyed.booleancanMark(OverlayMarkObserver markObserver) protected booleancompleteMark(javafx.scene.input.MouseEvent e) Complete the mark.createJPopMenu(javafx.scene.input.MouseEvent e) Create the JPopupMenu.voiddestroyCurrentMark(javafx.scene.input.MouseEvent e) Destroy the current mark.findClosestData(javafx.scene.input.MouseEvent e, double maxDistance) Find the closest data unit to the mouse point.protected MarkExtraInfofindExtraInfo(Object mouseSource) See if the display making the mark has any extra information.protected PamCoordinategetCoordinate(javafx.scene.input.MouseEvent e) Get an x,y coordinate as a lat long.protected intabstract Stringprotected ObjectGet the current mark warning.intGet the number of observers.Get the list of observers.List<javafx.scene.control.MenuItem> getPopupMenuItems(javafx.scene.input.MouseEvent e) getSelectedMarkedDataUnits(OverlayMark overlayMark, MarkDataSelector markDataSelector) Get a list of marked and selected data units.getSelectedMarkedDataUnits(OverlayMark overlayMark, MarkDataSelector markDataSelector, int minOverlap) protected booleanprotected booleanbooleanisCanMark(javafx.scene.input.MouseEvent e) booleanbooleanisMouseContained(javafx.scene.input.MouseEvent e) Check whether a mouse event is contained within the current mark shapebooleanNow markingbooleanmouseClicked(javafx.scene.input.MouseEvent e) booleanmouseDragged(javafx.scene.input.MouseEvent e) booleanmouseMoved(javafx.scene.input.MouseEvent e) booleanmousePressed(javafx.scene.input.MouseEvent e) booleanmouseReleased(javafx.scene.input.MouseEvent e) booleanbooleannotifyObservers(int markStatus, javafx.scene.input.MouseEvent mouseEvent, OverlayMarker overlayMarker, OverlayMark overlayMark) voidremoveObserver(OverlayMarkObserver observer) protected voidsetAllowPolygons(boolean allowPolygons) protected voidsetAllowRectangles(boolean allowRectangles) voidsetCurrentMark(OverlayMark currentMark) Set the current mark.protected voidsetMarkChannels(int markChannels) protected voidsetMarkSource(Object markSource) protected voidsetMarkSTartXY(javafx.geometry.Point3D point3d) voidsetNowMarking(boolean nowMarking) Set if markingvoidsetProjector(GeneralProjector<PamCoordinate> projector) booleanshowNoObserverPopup(javafx.scene.input.MouseEvent e) An optional additional popup that can occur even if there were no observers of the popup This get's used on displays that are starting to label data units using generic annotations, thereby avoiding the need for more advanced marks and groupers.booleanshowObserverPopups(javafx.scene.input.MouseEvent e) Show any popup menus form the mark observers in response to the mouse going down with a right click.voidUpdate the marked display.protected voidupdateObservers(int markStatus, javafx.scene.input.MouseEvent mouseEvent, OverlayMark overlayMark) Methods inherited from class PamView.paneloverlay.overlaymark.ExtMouseAdapter
fxMouse, mouseClicked, mouseDragged, mouseEntered, mouseEntered, mouseExited, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, mouseWheelMoved, swingMouse 
- 
Constructor Details
- 
OverlayMarker
 
 - 
 - 
Method Details
- 
getProjector
- Returns:
 - the projector
 
 - 
getMarkerName
 - 
isCanMark
public boolean isCanMark(javafx.scene.input.MouseEvent e)  - 
mousePressed
public boolean mousePressed(javafx.scene.input.MouseEvent e) - Overrides:
 mousePressedin classExtMouseAdapter
 - 
findExtraInfo
See if the display making the mark has any extra information.- Parameters:
 mouseSource-- Returns:
 
 - 
mouseReleased
public boolean mouseReleased(javafx.scene.input.MouseEvent e) - Overrides:
 mouseReleasedin classExtMouseAdapter
 - 
showNoObserverPopup
public boolean showNoObserverPopup(javafx.scene.input.MouseEvent e) An optional additional popup that can occur even if there were no observers of the popup This get's used on displays that are starting to label data units using generic annotations, thereby avoiding the need for more advanced marks and groupers.- Parameters:
 e- Mouse event (needed for popup coordinates)- Returns:
 - true if a menu was shown.
 
 - 
createJPopMenu
Create the JPopupMenu. this is a composite menu made up from all observers of a particular marker.- Returns:
 - the jpop up menu with overlay options.
 
 - 
getPopupMenuItems
- Overrides:
 getPopupMenuItemsin classExtMouseAdapter
 - 
showObserverPopups
public boolean showObserverPopups(javafx.scene.input.MouseEvent e) Show any popup menus form the mark observers in response to the mouse going down with a right click.If a mark has been made, and is in existence, then
- Parameters:
 e- Mouse event- Returns:
 - true if a menu was shown.
 
 - 
findClosestData
Find the closest data unit to the mouse point.- Parameters:
 e- Mouse informatoinmaxDistance- Maximum distance to consider.- Returns:
 
 - 
destroyCurrentMark
public void destroyCurrentMark(javafx.scene.input.MouseEvent e) Destroy the current mark. - 
mouseClicked
public boolean mouseClicked(javafx.scene.input.MouseEvent e) - Overrides:
 mouseClickedin classExtMouseAdapter
 - 
needPaused
public boolean needPaused()- Returns:
 - true if whatever is going on makes it desirable to pause display scrolling.
 
 - 
canDestroyMark
public boolean canDestroyMark(javafx.scene.input.MouseEvent e) Check whether a current mark can be destroyed.- Parameters:
 e- - the mouse event- Returns:
 - true if mark can be destroyed. False otherwise.
 
 - 
updateObservers
protected void updateObservers(int markStatus, javafx.scene.input.MouseEvent mouseEvent, OverlayMark overlayMark)  - 
addObserver
 - 
removeObserver
 - 
getObserverCount
public int getObserverCount()Get the number of observers.- Returns:
 - The number of things observing this marker.
 
 - 
getObservers
Get the list of observers.- Returns:
 - the observers
 
 - 
notifyObservers
public boolean notifyObservers(int markStatus, javafx.scene.input.MouseEvent mouseEvent, OverlayMarker overlayMarker, OverlayMark overlayMark)  - 
mouseMoved
public boolean mouseMoved(javafx.scene.input.MouseEvent e) - Overrides:
 mouseMovedin classExtMouseAdapter
 - 
isMarkComplete
public boolean isMarkComplete() - 
completeMark
protected boolean completeMark(javafx.scene.input.MouseEvent e) Complete the mark.- Parameters:
 e- - mouse event
 - 
mouseDragged
public boolean mouseDragged(javafx.scene.input.MouseEvent e) - Overrides:
 mouseDraggedin classExtMouseAdapter
 - 
getCurrentMark
- Specified by:
 getCurrentMarkin interfaceMarkManager
 - 
getSelectedMarkedDataUnits
public List<PamDataUnit> getSelectedMarkedDataUnits(OverlayMark overlayMark, MarkDataSelector markDataSelector) Get a list of marked and selected data units. For now, work off the hover data within the projector, but feel free to override or use a totally different system of working out what's in the mark - that's the responsibility of whatever display has the mark. The MarkDataSelector comes from the Mark Observer, i.e. the thing that uses the data.- Parameters:
 overlayMark-markDataSelector-- Returns:
 
 - 
getSelectedMarkedDataUnits
public List<PamDataUnit> getSelectedMarkedDataUnits(OverlayMark overlayMark, MarkDataSelector markDataSelector, int minOverlap)  - 
getCoordinate
Get an x,y coordinate as a lat long.- Parameters:
 e- Mouse event- Returns:
 - coordinate.
 
 - 
canMark
- Parameters:
 markObserver-- Returns:
 - true if this marker can send marks to this observer.
 
 - 
isAllowRectangles
protected boolean isAllowRectangles()- Returns:
 - the allowRectangles
 
 - 
setAllowRectangles
protected void setAllowRectangles(boolean allowRectangles) - Parameters:
 allowRectangles- the allowRectangles to set
 - 
isAllowPolygons
protected boolean isAllowPolygons()- Returns:
 - the allowPolygons
 
 - 
setAllowPolygons
protected void setAllowPolygons(boolean allowPolygons) - Parameters:
 allowPolygons- the allowPolygons to set
 - 
getMarkSource
- Returns:
 - the markSource
 
 - 
setMarkSource
- Parameters:
 markSource- the markSource to set
 - 
getMarkChannels
protected int getMarkChannels()- Returns:
 - the markChannels
 
 - 
setMarkChannels
protected void setMarkChannels(int markChannels) - Parameters:
 markChannels- the markChannels to set
 - 
isNowMarking
public boolean isNowMarking()Now marking- Returns:
 - true if now marking.
 
 - 
setProjector
- Parameters:
 projector- the projector to set
 - 
updateMarkedDisplay
public void updateMarkedDisplay()Update the marked display. This can be called after the mark has been used to repaint the owner display. Forcing a repaint will generally make the mark disappear and may also recolour any changed dataunits. - 
isMouseContained
public boolean isMouseContained(javafx.scene.input.MouseEvent e) Check whether a mouse event is contained within the current mark shape- Parameters:
 e- - the mouse event- Returns:
 - true if the mouse event is cointained within the shape.
 
 - 
setNowMarking
public void setNowMarking(boolean nowMarking) Set if marking - 
setCurrentMark
Set the current mark.- Parameters:
 currentMark- - set the current mark
 - 
setMarkSTartXY
protected void setMarkSTartXY(javafx.geometry.Point3D point3d)  - 
getMarkWarning
Get the current mark warning. Can be null.- Returns:
 - the current mark warning.
 
 
 -