public final class MapStatus extends javax.swing.JPanel implements Helpful, Destroyable, PreferenceChangedListener, SystemOfMeasurement.SoMChangeListener, SelectionChangedListener, DataSetListener, NavigatableComponent.ZoomChangeListener
Modifier and Type | Class and Description |
---|---|
class |
MapStatus.BackgroundProgressMonitor
The progress monitor that is used to display the progress if the user selects to run in background
|
private class |
MapStatus.Collector
The collector class that waits for notification and then update the display objects.
|
(package private) static class |
MapStatus.JumpToOnLeftClickMouseAdapter |
private class |
MapStatus.MapStatusPopupMenu |
private static class |
MapStatus.MouseState
Everything, the collector is interested of.
|
(package private) static class |
MapStatus.ShowMonitorDialogMouseAdapter |
protected static class |
MapStatus.StatusTextHistory |
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
private boolean |
angleEnabled |
private ImageLabel |
angleText |
private java.awt.event.AWTEventListener |
awtListener |
private MapStatus.Collector |
collector |
private java.text.DecimalFormat |
DECIMAL_FORMAT |
private static AbstractProperty<java.lang.Double> |
DISTANCE_THRESHOLD |
private ImageLabel |
distText |
private double |
distValue |
private ImageLabel |
headingText |
private JosmTextField |
helpText |
private java.awt.event.KeyAdapter |
keyAdapter |
private ImageLabel |
latText |
private ImageLabel |
lonText |
private java.awt.event.MouseMotionListener |
mouseMotionListener |
private MapView |
mv
The MapView this status belongs to.
|
private java.awt.event.ComponentAdapter |
mvComponentAdapter |
private ImageLabel |
nameText |
private ICoordinateFormat |
previousCoordinateFormat
The
ICoordinateFormat set in the previous update |
private javax.swing.JProgressBar |
progressBar |
MapStatus.BackgroundProgressMonitor |
progressMonitor
The progress monitor for displaying a background progress
|
static NamedColorProperty |
PROP_ACTIVE_BACKGROUND_COLOR
Property for map status background color (active state).
|
static NamedColorProperty |
PROP_ACTIVE_FOREGROUND_COLOR
Property for map status foreground color (active state).
|
static NamedColorProperty |
PROP_BACKGROUND_COLOR
Property for map status background color.
|
static NamedColorProperty |
PROP_FOREGROUND_COLOR
Property for map status foreground color.
|
private static AbstractProperty<java.lang.Boolean> |
SHOW_ID |
private java.util.List<MapStatus.StatusTextHistory> |
statusText |
private java.lang.Thread |
thread
This is the thread that runs in the background and collects the information displayed.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
MapStatus(MapFrame mapFrame)
Construct a new MapStatus and attach it to the map view.
|
Modifier and Type | Method and Description |
---|---|
void |
activateAnglePanel(boolean activeFlag)
Activates the angle panel.
|
void |
addMouseListener(java.awt.event.MouseListener ml) |
void |
dataChanged(DataChangedEvent event)
Called after big changes in dataset.
|
void |
destroy()
Called when the object has been destroyed.
|
javax.swing.JPanel |
getAnglePanel()
Gets the panel that displays the angle
|
static void |
getColors()
Loads all colors from preferences.
|
private static int |
getNameLabelCharacterCount(java.awt.Component parent) |
java.lang.String |
helpTopic()
Returns the help topic on JOSM wiki for this feature.
|
void |
nodeMoved(NodeMovedEvent event)
A node's coordinates were modified.
|
void |
otherDatasetChange(AbstractDatasetChangedEvent event)
Minor dataset change, currently only changeset id changed is supported, but can
be extended in future.
|
void |
preferenceChanged(PreferenceChangeEvent e)
Triggered when a preference entry value changes.
|
void |
primitivesAdded(PrimitivesAddedEvent event)
A bunch of primitives were added into the DataSet, or existing
deleted/invisible primitives were resurrected.
|
void |
primitivesRemoved(PrimitivesRemovedEvent event)
A bunch of primitives were removed from the DataSet, or preexisting
primitives were marked as deleted.
|
private void |
refreshAnglePanel() |
private void |
refreshDistText(java.util.Collection<? extends OsmPrimitive> newSelection) |
private void |
registerListeners() |
void |
relationMembersChanged(RelationMembersChangedEvent event)
A relation's members have changed.
|
void |
resetHelpText(java.lang.Object id)
Removes a help text and restores the previous one
|
void |
selectionChanged(java.util.Collection<? extends OsmPrimitive> newSelection)
Informs the listener that the selection in the dataset has changed.
|
void |
setAngle(double a)
Sets the angle to display in the angle panel
|
void |
setDist(java.util.Collection<Way> ways)
Sets the distance text to the total sum of given ways length
|
void |
setDist(double dist)
Sets the distance text to the given value
|
void |
setHeading(double h)
Sets the heading to display in the heading panel
|
void |
setHelpText(java.lang.Object id,
java.lang.String text)
Sets the help status text to display
|
void |
setHelpText(java.lang.String text)
Sets the help text in the status panel
|
void |
systemOfMeasurementChanged(java.lang.String oldSoM,
java.lang.String newSoM)
The current SoM has changed.
|
void |
tagsChanged(TagsChangedEvent event)
There was some change in the tag set of a primitive.
|
private void |
unregisterListeners() |
private void |
updateLatLonText(int x,
int y) |
void |
updateSystemOfMeasurement(java.lang.String newsom)
Updates the system of measurement and displays a notification.
|
void |
wayNodesChanged(WayNodesChangedEvent event)
A way's node list was changed.
|
void |
zoomChanged()
Method called when the zoom area has changed.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, paintComponent, 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, update
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, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, 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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private final java.text.DecimalFormat DECIMAL_FORMAT
private static final AbstractProperty<java.lang.Double> DISTANCE_THRESHOLD
private static final AbstractProperty<java.lang.Boolean> SHOW_ID
public static final NamedColorProperty PROP_BACKGROUND_COLOR
public static final NamedColorProperty PROP_ACTIVE_BACKGROUND_COLOR
public static final NamedColorProperty PROP_FOREGROUND_COLOR
public static final NamedColorProperty PROP_ACTIVE_FOREGROUND_COLOR
private final transient MapStatus.Collector collector
private transient ICoordinateFormat previousCoordinateFormat
ICoordinateFormat
set in the previous updateprivate final ImageLabel latText
private final ImageLabel lonText
private final ImageLabel headingText
private final ImageLabel angleText
private final ImageLabel distText
private final ImageLabel nameText
private final JosmTextField helpText
private final javax.swing.JProgressBar progressBar
private final transient java.awt.event.ComponentAdapter mvComponentAdapter
public final transient MapStatus.BackgroundProgressMonitor progressMonitor
private double distValue
private boolean angleEnabled
private final transient java.lang.Thread thread
private final transient java.util.List<MapStatus.StatusTextHistory> statusText
private final transient java.awt.event.AWTEventListener awtListener
private final transient java.awt.event.MouseMotionListener mouseMotionListener
private final transient java.awt.event.KeyAdapter keyAdapter
private void registerListeners()
private void unregisterListeners()
private void updateLatLonText(int x, int y)
public void systemOfMeasurementChanged(java.lang.String oldSoM, java.lang.String newSoM)
SystemOfMeasurement.SoMChangeListener
systemOfMeasurementChanged
in interface SystemOfMeasurement.SoMChangeListener
oldSoM
- The old system of measurementnewSoM
- The new (current) system of measurementpublic void updateSystemOfMeasurement(java.lang.String newsom)
newsom
- The new system of measurement to setpublic javax.swing.JPanel getAnglePanel()
public java.lang.String helpTopic()
Helpful
public void addMouseListener(java.awt.event.MouseListener ml)
addMouseListener
in class java.awt.Component
public void setHelpText(java.lang.String text)
text
- The textpublic void setHelpText(java.lang.Object id, java.lang.String text)
id
- The object that caused the status update (or a id object it selects). May be null
text
- The textpublic void resetHelpText(java.lang.Object id)
id
- The id passed to setHelpText(Object, String)
public void setAngle(double a)
a
- The anglepublic void setHeading(double h)
h
- The headingpublic void setDist(double dist)
dist
- The distance value to display, in meterspublic void setDist(java.util.Collection<Way> ways)
ways
- The ways to consider for the total distancepublic void activateAnglePanel(boolean activeFlag)
activeFlag
- true
to activate it, false
to deactivate itprivate void refreshAnglePanel()
public void destroy()
Destroyable
destroy
in interface Destroyable
public void preferenceChanged(PreferenceChangeEvent e)
PreferenceChangedListener
preferenceChanged
in interface PreferenceChangedListener
e
- the preference change eventpublic static void getColors()
private static int getNameLabelCharacterCount(java.awt.Component parent)
private void refreshDistText(java.util.Collection<? extends OsmPrimitive> newSelection)
public void selectionChanged(java.util.Collection<? extends OsmPrimitive> newSelection)
SelectionChangedListener
selectionChanged
in interface SelectionChangedListener
newSelection
- The new selection.public void zoomChanged()
NavigatableComponent.ZoomChangeListener
zoomChanged
in interface NavigatableComponent.ZoomChangeListener
public void wayNodesChanged(WayNodesChangedEvent event)
DataSetListener
wayNodesChanged
in interface DataSetListener
event
- The event for the way that was modified.public void nodeMoved(NodeMovedEvent event)
DataSetListener
nodeMoved
in interface DataSetListener
event
- The event for the node that was moved.public void primitivesAdded(PrimitivesAddedEvent event)
DataSetListener
primitivesAdded
in interface DataSetListener
event
- An event for an collection of newly-visible primitivespublic void primitivesRemoved(PrimitivesRemovedEvent event)
DataSetListener
primitivesRemoved
in interface DataSetListener
event
- An event for an collection of newly-invisible primitivespublic void tagsChanged(TagsChangedEvent event)
DataSetListener
tagsChanged
in interface DataSetListener
event
- the event for the primitive, whose tags were affected.public void relationMembersChanged(RelationMembersChangedEvent event)
DataSetListener
relationMembersChanged
in interface DataSetListener
event
- The event for the relation that was modified.public void otherDatasetChange(AbstractDatasetChangedEvent event)
DataSetListener
otherDatasetChange
in interface DataSetListener
event
- the event for data modificationpublic void dataChanged(DataChangedEvent event)
DataSetListener
DataSetListener.dataChanged(DataChangedEvent event)
is called.dataChanged
in interface DataSetListener
event
- data change event