private final class MapStatus.Collector extends Object implements Runnable
Modifier and Type | Field and Description |
---|---|
private Point |
oldMousePos
the mouse position of the previous iteration.
|
private MapFrame |
parent |
private Popup |
popup
The popup displayed to show additional information
|
private List<JLabel> |
popupLabels
Contains the labels that are currently shown in the information
popup
|
Modifier and Type | Method and Description |
---|---|
private JLabel |
popupBuildPrimitiveLabels(OsmPrimitive osm)
Builds the labels with all necessary listeners for the info popup for the
given OsmPrimitive
|
private Popup |
popupCreatePopup(Component content,
MapStatus.MouseState ms)
Creates a popup for the given content next to the cursor.
|
private void |
popupCycleSelection(Collection<OsmPrimitive> osms,
int mods)
Call this with a set of primitives to cycle through them.
|
private void |
popupHidePopup()
Tries to hide the given popup
|
private void |
popupSetLabelColors(JLabel lbl,
OsmPrimitive osm)
Sets the colors for the given label depending on the selected status of
the given OsmPrimitive
|
private void |
popupShowPopup(Popup newPopup,
List<JLabel> lbls)
Tries to show the given popup, can be hidden using
popupHidePopup()
If an old popup exists, it will be automatically hidden |
private void |
popupUpdateLabels()
This method should be called if the selection may have changed from
outside of this class.
|
void |
run()
Execution function for the Collector.
|
private void |
statusBarElementUpdate(MapStatus.MouseState ms)
Calls this to update the element that is shown in the statusbar
|
private Point oldMousePos
private List<JLabel> popupLabels
private Popup popupCreatePopup(Component content, MapStatus.MouseState ms)
content
- ms
- private void statusBarElementUpdate(MapStatus.MouseState ms)
ms
- private void popupCycleSelection(Collection<OsmPrimitive> osms, int mods)
osms
- primitives to cycle throughmods
- modifiers (i.e. control keys)private void popupHidePopup()
private void popupShowPopup(Popup newPopup, List<JLabel> lbls)
popupHidePopup()
If an old popup exists, it will be automatically hiddennewPopup
- popup to showlbls
- lables to show (see popupLabels
)private void popupUpdateLabels()
private void popupSetLabelColors(JLabel lbl, OsmPrimitive osm)
lbl
- The label to colorosm
- The primitive to derive the colors fromprivate JLabel popupBuildPrimitiveLabels(OsmPrimitive osm)
osm
- The primitive to create the label for