Package Map
Class SimpleMap
- All Implemented Interfaces:
 ImageObserver,MenuContainer,Serializable,Accessible,PamSettings,SettingsNameProvider,PamObserver,PamScrollObserver,UserDisplayComponent
public class SimpleMap
extends JPanel
implements PamObserver, PamScrollObserver, PamSettings, UserDisplayComponent
Mainly a container for map objects, holding the main MapPanel and the right
 hand control items. 
Originally written by Dave McLaren. Modified by Doug Gillespie to incorporate controls onto main panel to increase overall visible size.
Originally written by Dave McLaren. Modified by Doug Gillespie to incorporate controls onto main panel to increase overall visible size.
- See Also:
 
- 
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy - 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClipboardCopierprotected PamDataBlockprotected MapDetectionsManagerprotected MapParametersFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH - 
Constructor Summary
ConstructorsConstructorDescriptionSimpleMap(MapController mapController, boolean isMainTab) SimpleMap(MapController mapController, boolean isMainTab, MapPanel mapPanel)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddData(PamObservable o, PamDataUnit arg) Informs the PamObserver that new data have been added to the Observable classvoidaddMouseAdapterToMapPanel(MouseAdapter mouseAdapter) protected voidIn viewer mode, check the right data are loaded.voidCalled when the component is removed from the display.createDisplayMenu(Frame parentFrame) protected voidcreateMapComment(int x, int y) Get a title for the frame the component will be added to.protected GPSControlprotected GPSDataBlockprotected GridbaseControlMap.SimpleMap.MapOverlayMarkerlongGet the time for the map (used when deciding what to plot)Gets a data unit currently hovered by the mouse.Map.SimpleMap.MapMouseMotionAdaptergetOptionsMenuItem(Frame parentFrame) getPanel()longName for data selectors and data filters.longSettings manager for when there are multiple maps in user displays.voidvoidmapCanScroll(boolean b) voidmasterClockUpdate(long milliSeconds, long sampleNumber) protected voidNotification that the viewer slider has moved.protected voidNotification of new viewer timesvoidvoidnotifyModelChanged(int changeType) Pick up model changed notifications from a parent user display.voidCalled when the component is first displayed.protected voidpaintComponent(Graphics arg0) voidreceiveSourceNotification(int type, Object object) Receive a notification from the data source - typically a change in DAQ status.voidvoidcalled when an Observable (PamDataBlock) is removed from the systembooleanrestoreSettings(PamControlledUnitSettings pamControlledUnitSettings) voidscrollRangeChanged(AbstractPamScroller absPamScroller) Notification sent when a scroller or slider changes it's data rangevoidscrollValueChanged(AbstractPamScroller abstractPamScroller) Notification sent when a scroller or slider changes it's positionvoidsetHiddenSliderTime(Integer hiddenSliderTime) voidsetSampleRate(float sampleRate, boolean notify) New sample ratevoidsetUniqueName(String uniqueName) Set a unique name for every display.booleanshouldPlot(PamDataBlock pamDataBlock) ShouldPlot function for a datablock, moved here from mappanel so that we can override for a special map for Target motion (and other) dialogsbooleanshouldPlot(PamDataUnit pamDataUnit, MapDetectionData mapDetectionData, long earliestToPlot, long now, DataSelector ds) Shouldplot function for individual data units.voidbooleanshowParametersDialog(Window parentFrame) booleanSubscribes a variety of data blocks to the scroll bar.voidupdateData(PamObservable observable, PamDataUnit pamDataUnit) Informs the PamObserver that existing data have been updatedMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle 
- 
Field Details
- 
clipboardCopier
 - 
mapParameters
 - 
mapDetectionsManager
 - 
effortDataBlock
 
 - 
 - 
Constructor Details
- 
SimpleMap
 - 
SimpleMap
 
 - 
 - 
Method Details
- 
getSelectorName
Name for data selectors and data filters.- Returns:
 
 - 
getUnitName
- Specified by:
 getUnitNamein interfaceSettingsNameProvider- Returns:
 - A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
 
 - 
getUnitType
Settings manager for when there are multiple maps in user displays.- Specified by:
 getUnitTypein interfacePamSettings- Returns:
 - A Name specific to the type, e.g. Click detector
 
 - 
getSettingsReference
- Specified by:
 getSettingsReferencein interfacePamSettings- Returns:
 - The serialisable object that will be stored
 
 - 
getSettingsVersion
public long getSettingsVersion()- Specified by:
 getSettingsVersionin interfacePamSettings- Returns:
 - An integer version number for the settings
 
 - 
restoreSettings
- Specified by:
 restoreSettingsin interfacePamSettings- Parameters:
 pamControlledUnitSettings-- Returns:
 - true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
 
 - 
getObserverObject
- Specified by:
 getObserverObjectin interfacePamObserver- Returns:
 - the actual observer. In most cases concrete classes will just return 'this' in response. The exception is the Threaded observer, which will return the single thread observer.
 
 - 
getMapTime
public long getMapTime()Get the time for the map (used when deciding what to plot)- Returns:
 - time from either the pamguard clock or the scroll bar.
 
 - 
shouldPlot
ShouldPlot function for a datablock, moved here from mappanel so that we can override for a special map for Target motion (and other) dialogs- Parameters:
 pamDataBlock-- Returns:
 - true if anything in that datablock should be displayed.
 
 - 
shouldPlot
public boolean shouldPlot(PamDataUnit pamDataUnit, MapDetectionData mapDetectionData, long earliestToPlot, long now, DataSelector ds) Shouldplot function for individual data units.- Parameters:
 pamDataUnit-mapDetectionData-earliestToPlot-now-ds-- Returns:
 
 - 
getMapParameters
- Returns:
 - The map parameters object.
 
 - 
showMapObjects
public void showMapObjects() - 
initMapPanel
public void initMapPanel() - 
getMapPanel
 - 
addData
Description copied from interface:PamObserverInforms the PamObserver that new data have been added to the Observable class- Specified by:
 addDatain interfacePamObserver
 - 
updateData
Description copied from interface:PamObserverInforms the PamObserver that existing data have been updated- Specified by:
 updateDatain interfacePamObserver
 - 
getObserverName
- Specified by:
 getObserverNamein interfacePamObserver
 - 
noteNewSettings
public void noteNewSettings()- Specified by:
 noteNewSettingsin interfacePamObserver
 - 
setSampleRate
public void setSampleRate(float sampleRate, boolean notify) Description copied from interface:PamObserverNew sample rate- Specified by:
 setSampleRatein interfacePamObserver- Parameters:
 sampleRate-notify- Notify other PamObservers and PamObservables in the chain.
 - 
masterClockUpdate
public void masterClockUpdate(long milliSeconds, long sampleNumber) - Specified by:
 masterClockUpdatein interfacePamObserver
 - 
getRequiredDataHistory
- Specified by:
 getRequiredDataHistoryin interfacePamObserver- Parameters:
 arg- optional argument from PamObservable- Returns:
 - time in milliseconds required by data held in PamObservable
 
 - 
receiveSourceNotification
Description copied from interface:PamObserverReceive a notification from the data source - typically a change in DAQ status. See the constants listed in AcquisitionProcess for potential change types.- Specified by:
 receiveSourceNotificationin interfacePamObserver- Parameters:
 type- the type of changeobject- generic object added here so that we can include anything in the future
 - 
getDataBlocks
 - 
getMousedDataUnit
Gets a data unit currently hovered by the mouse. This only gets set if the mouse actually hovers and is then clicked.- Returns:
 - hovered data unit.
 
 - 
paintComponent
- Overrides:
 paintComponentin classJComponent
 - 
removeObservable
Description copied from interface:PamObservercalled when an Observable (PamDataBlock) is removed from the system- Specified by:
 removeObservablein interfacePamObserver
 - 
getLastClickedMouseLatLong
 - 
createMapComment
protected void createMapComment(int x, int y)  - 
getMouseMotion
public Map.SimpleMap.MapMouseMotionAdapter getMouseMotion() - 
getPanel
 - 
addMouseAdapterToMapPanel
 - 
mapCanScroll
public void mapCanScroll(boolean b)  - 
refreshDetectorList
public void refreshDetectorList() - 
newViewTimes
protected void newViewTimes()Notification of new viewer times - 
newViewTime
protected void newViewTime()Notification that the viewer slider has moved. - 
scrollRangeChanged
Description copied from interface:PamScrollObserverNotification sent when a scroller or slider changes it's data rangeIf data were loaded in a worker thread, this notification is sent after the new data have loaded.
- Specified by:
 scrollRangeChangedin interfacePamScrollObserver- Parameters:
 absPamScroller- reference to moved scroller.
 - 
scrollValueChanged
Description copied from interface:PamScrollObserverNotification sent when a scroller or slider changes it's position- Specified by:
 scrollValueChangedin interfacePamScrollObserver- Parameters:
 abstractPamScroller- reference to moved scroller
 - 
subscribeViewerBlocks
public boolean subscribeViewerBlocks()Subscribes a variety of data blocks to the scroll bar.- Returns:
 - returns true if the list has changes, indicating that it's probably necessary to call loadData in the scroll manager to get new data.
 
 - 
getViewerScroller
 - 
createDisplayMenu
 - 
getOptionsMenuItem
 - 
showParametersDialog
 - 
checkViewerData
protected void checkViewerData()In viewer mode, check the right data are loaded. - 
getComponent
- Specified by:
 getComponentin interfaceUserDisplayComponent- Returns:
 - The Swing component to add to the frame
 
 - 
openComponent
public void openComponent()Description copied from interface:UserDisplayComponentCalled when the component is first displayed.- Specified by:
 openComponentin interfaceUserDisplayComponent
 - 
closeComponent
public void closeComponent()Description copied from interface:UserDisplayComponentCalled when the component is removed from the display.- Specified by:
 closeComponentin interfaceUserDisplayComponent
 - 
notifyModelChanged
public void notifyModelChanged(int changeType) Description copied from interface:UserDisplayComponentPick up model changed notifications from a parent user display.- Specified by:
 notifyModelChangedin interfaceUserDisplayComponent- Parameters:
 changeType-
 - 
getHiddenSliderTime
- Returns:
 - the hiddenSliderTime
 
 - 
setHiddenSliderTime
- Parameters:
 hiddenSliderTime- the hiddenSliderTime to set
 - 
getGpsDataBlock
- Returns:
 - the gpsDataBlock
 
 - 
getGpsControl
- Returns:
 - the gpsControl
 
 - 
getFrameTitle
Description copied from interface:UserDisplayComponentGet a title for the frame the component will be added to.- Specified by:
 getFrameTitlein interfaceUserDisplayComponent- Returns:
 - a title for the components frame.
 
 - 
getUniqueName
- Specified by:
 getUniqueNamein interfaceUserDisplayComponent- Returns:
 - a unique name (across all of PAMGuard) which will be used for mark overlays and settings storage.
 
 - 
setUniqueName
Description copied from interface:UserDisplayComponentSet a unique name for every display. This is important for saving settings and for managing things that need a unique name such as overlay marks and markers.- Specified by:
 setUniqueNamein interfaceUserDisplayComponent
 - 
getGridBaseControl
- Returns:
 - the gridBaseControl
 
 - 
getMapDetectionsManager
 - 
getViewerControls
 - 
getMapMarker
public Map.SimpleMap.MapOverlayMarker getMapMarker() 
 -