Class MapStatus.Collector

    • Method Detail

      • run

        public void run()
        Execution function for the Collector.
        Specified by:
        run in interface Runnable
      • popupCreatePopup

        private Popup popupCreatePopup​(Component content,
                                       MapStatus.MouseState ms)
        Creates a popup for the given content next to the cursor. Tries to keep the popup on screen and shows a vertical scrollbar, if the screen is too small.
        Parameters:
        content - popup content
        ms - mouse state
        Returns:
        popup
      • popupCycleSelection

        private void popupCycleSelection​(Collection<OsmPrimitive> osms,
                                         int mods)
        Call this with a set of primitives to cycle through them. Method will automatically select the next item and update the map
        Parameters:
        osms - primitives to cycle through
        mods - modifiers (i.e. control keys)
      • popupHidePopup

        private void popupHidePopup()
        Tries to hide the given popup
      • popupShowPopup

        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
        Parameters:
        newPopup - popup to show
        lbls - labels to show (see popupLabels)
      • popupUpdateLabels

        private void popupUpdateLabels()
        This method should be called if the selection may have changed from outside of this class. This is the case when CTRL is pressed and the user clicks on the map instead of the popup.
      • popupSetLabelColors

        private void popupSetLabelColors​(JLabel lbl,
                                         IPrimitive osm)
        Sets the colors for the given label depending on the selected status of the given OsmPrimitive
        Parameters:
        lbl - The label to color
        osm - The primitive to derive the colors from
      • popupBuildPrimitiveLabels

        private JLabel popupBuildPrimitiveLabels​(OsmPrimitive osm)
        Builds the labels with all necessary listeners for the info popup for the given OsmPrimitive
        Parameters:
        osm - The primitive to create the label for
        Returns:
        labels for info popup
      • updateMousePosition

        public void updateMousePosition​(Point mousePos,
                                        int modifiers)
        Called whenever the mouse position or modifiers changed.
        Parameters:
        mousePos - The new mouse position. null if it did not change.
        modifiers - The new modifiers.