Class AbstractMapClickListener
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.sink.openstreetmapviewer.AbstractMapClickListener
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.ShallowCopySupporter<AbstractMapClickListener>
,adams.core.SizeOfHandler
,adams.db.DatabaseConnectionUser
,MapClickListener
,Serializable
- Direct Known Subclasses:
AbstractMapClickListenerWithDialog
,NullMapClickListener
public abstract class AbstractMapClickListener extends adams.core.option.AbstractOptionHandler implements MapClickListener, adams.core.ShallowCopySupporter<AbstractMapClickListener>, adams.db.DatabaseConnectionUser
Ancestor for classes that listen to clicks on aJMapViewer
.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.db.AbstractDatabaseConnection
m_DatabaseConnection
the database connection in use.
-
Constructor Summary
Constructors Constructor Description AbstractMapClickListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected adams.db.AbstractDatabaseConnection
getDatabaseConnection(adams.flow.core.Actor actor)
Determines the database connection in the flow.void
mapClicked(MapClickEvent e)
Gets called when user clicks on aJMapViewer
.protected abstract boolean
processClick(org.openstreetmap.gui.jmapviewer.JMapViewer viewer, MouseEvent e)
Performs the processing of the mouse click.abstract boolean
requiresDatabaseConnection()
Returns whether a database connection is required.AbstractMapClickListener
shallowCopy()
Returns a shallow copy of itself.AbstractMapClickListener
shallowCopy(boolean expand)
Returns a shallow copy of itself.void
updateDatabaseConnection(adams.flow.core.Actor actor)
Updates, if necessary, its database connection using the specified actor as starting point.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
requiresDatabaseConnection
public abstract boolean requiresDatabaseConnection()
Returns whether a database connection is required.- Returns:
- true if connection required
-
getDatabaseConnection
protected adams.db.AbstractDatabaseConnection getDatabaseConnection(adams.flow.core.Actor actor)
Determines the database connection in the flow.
Derived classes can override this method if different database connection objects need to be located.- Parameters:
actor
- the actor to use for looking up database connection- Returns:
- the database connection to use
-
updateDatabaseConnection
public void updateDatabaseConnection(adams.flow.core.Actor actor)
Updates, if necessary, its database connection using the specified actor as starting point.- Parameters:
actor
- the actor to use for lookin up database connection- See Also:
getDatabaseConnection(Actor)
-
processClick
protected abstract boolean processClick(org.openstreetmap.gui.jmapviewer.JMapViewer viewer, MouseEvent e)
Performs the processing of the mouse click.- Parameters:
viewer
- the associated viewere
- the associated mouse event- Returns:
- true if mouse event should get consumed
-
mapClicked
public void mapClicked(MapClickEvent e)
Gets called when user clicks on aJMapViewer
.- Specified by:
mapClicked
in interfaceMapClickListener
- Parameters:
e
- the event
-
shallowCopy
public AbstractMapClickListener shallowCopy()
Returns a shallow copy of itself.- Specified by:
shallowCopy
in interfaceadams.core.ShallowCopySupporter<AbstractMapClickListener>
- Returns:
- the shallow copy
-
shallowCopy
public AbstractMapClickListener shallowCopy(boolean expand)
Returns a shallow copy of itself.- Specified by:
shallowCopy
in interfaceadams.core.ShallowCopySupporter<AbstractMapClickListener>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
-