Interface SelectionZoomStrategy

    • Method Detail

      • isActivated

        boolean isActivated()
        If controller currently tracking zoom rectangle
        Returns:
        true if zoomRectangle exists for this controller and false otherwise
      • getZoomPoint

        Point2D getZoomPoint()
        The zoom rectangle starting point (selected by the user with a mouse click). This is a point on the screen, not the chart (which may have been scaled up or down to fit the panel).
      • setZoomTriggerDistance

        void setZoomTriggerDistance​(int distance)
        Sets the zoom trigger distance. This controls how far the mouse must move before a zoom action is triggered.
        Parameters:
        distance - the distance (in Java2D units).
      • getZoomTriggerDistance

        int getZoomTriggerDistance()
        Returns the zoom trigger distance. This controls how far the mouse must move before a zoom action is triggered.
        Returns:
        The distance (in Java2D units).
      • getFillZoomRectangle

        boolean getFillZoomRectangle()
        Returns the flag that controls whether or not the zoom rectangle is filled when drawn.
        Returns:
        A boolean.
      • setFillZoomRectangle

        void setFillZoomRectangle​(boolean flag)
        A flag that controls how the zoom rectangle is drawn.
        Parameters:
        flag - true instructs to fill the rectangle on zoom, otherwise it will be outlined.
      • updateZoomRectangleSelection

        void updateZoomRectangleSelection​(MouseEvent e,
                                          boolean hZoom,
                                          boolean vZoom,
                                          Rectangle2D scaledDataArea)
        Updates zoom rectangle with new mouse position
        Parameters:
        e - mouse event
        hZoom - if horizontal zoom allowed
        vZoom - if vertical zoom allowed
        scaledDataArea - plot area in screen coordinates
      • getZoomRectangle

        Rectangle2D getZoomRectangle​(boolean hZoom,
                                     boolean vZoom,
                                     Rectangle2D screenDataArea)
        Creates and returns current zoom rectangle
        Parameters:
        hZoom - if horizontal zoom acceptable
        vZoom - if vertical zoom acceptable
        screenDataArea - rectangle that describes plot on the screen
        Returns:
        rectangle in java2d screen coordinates selected by user
      • reset

        void reset()
        Removes zoom rectangle
      • drawZoomRectangle

        void drawZoomRectangle​(Graphics2D g2,
                               boolean xor)
        Draws zoom rectangle (if present). The drawing is performed in XOR mode, therefore when this method is called twice in a row, the second call will completely restore the state of the canvas.
        Parameters:
        g2 - the graphics device.
        xor - use XOR for drawing?