Class SelectionAdapter

    • Constructor Detail

      • SelectionAdapter

        public SelectionAdapter(Viewer viewer)
        Create a SelectionAdapter for the given viewer.
        Parameters:
        viewer - the viewer to wrap
    • Method Detail

      • getMouseActive

        public boolean getMouseActive()
        Specified by:
        getMouseActive in interface  MouseUser
        Returns:
        whether to react on mouse events.
      • setMouseActive

        public void setMouseActive(boolean state)
        Specified by:
        setMouseActive in interface  MouseUser
        Parameters:
        state - whether to react on mouse events.
      • mouseClicked

        public void mouseClicked(MouseEvent e)
      • mousePressed

        public void mousePressed(MouseEvent e)
      • mouseReleased

        public void mouseReleased(MouseEvent e)
      • mouseEntered

        public void mouseEntered(MouseEvent e)
      • mouseExited

        public void mouseExited(MouseEvent e)
      • mouseDragged

        public void mouseDragged(MouseEvent e)
      • mouseMoved

        public void mouseMoved(MouseEvent e)
      • onPaint

        public void onPaint(TileMapWindow mapWindow,
                            Graphics g)
        Description copied from interface: PaintListener
        Called when a paint has been done.
        Specified by:
        onPaint in interface  PaintListener
        Parameters:
        mapWindow - the associated mapWindow.
        g - the graphics object emitted.
      • getSelection

        public IntSelection getSelection()
        Returns:
        the current selection.
      • getGeographicSelection

        public GeographicSelection getGeographicSelection()
        Returns:
        the current selection.
      • setGeographicSelection

        public void setGeographicSelection(GeographicSelection degrees)
        Set the current geographic selection
        Parameters:
        degrees - the new selection.
      • clearSelection

        public void clearSelection()
      • changed

        public void changed()
      • isSnapSelection

        public boolean isSnapSelection()
        Returns:
        whether the selection snaps to the map.
      • setSnapSelection

        public void setSnapSelection(boolean b)
        Parameters:
        b - whether the selection should snap to the map.
      • addSelectionChangeListener

        public void addSelectionChangeListener(SelectionChangeListener listener)
        Add a listener that get informed on changes of the selections.
        Parameters:
        listener - the listener to add.
      • removeSelectionChangeListener

        public void removeSelectionChangeListener(SelectionChangeListener listener)
        Remove a listener from the list of selection listeners.
        Parameters:
        listener - the listener to remove.