Class CrosshairOverlay

    • Constructor Detail

      • CrosshairOverlay

        public CrosshairOverlay()
        Default constructor.
    • Method Detail

      • clearDomainCrosshairs

        public void clearDomainCrosshairs()
        Clears all the domain crosshairs from the overlay and sends an OverlayChangeEvent to all registered listeners.
      • getDomainCrosshairs

        public List getDomainCrosshairs()
        Returns a new list containing the domain crosshairs for this overlay.
        Returns:
        A list of crosshairs.
      • addRangeCrosshair

        public void addRangeCrosshair​(Crosshair crosshair)
        Adds a crosshair against the range axis and sends an OverlayChangeEvent to all registered listeners.
        Parameters:
        crosshair - the crosshair (null not permitted).
      • clearRangeCrosshairs

        public void clearRangeCrosshairs()
        Clears all the range crosshairs from the overlay and sends an OverlayChangeEvent to all registered listeners.
      • getRangeCrosshairs

        public List getRangeCrosshairs()
        Returns a new list containing the range crosshairs for this overlay.
        Returns:
        A list of crosshairs.
      • paintOverlay

        public void paintOverlay​(Graphics2D g2,
                                 ChartPanel chartPanel)
        Paints the crosshairs in the layer.
        Specified by:
        paintOverlay in interface Overlay
        Parameters:
        g2 - the graphics target.
        chartPanel - the chart panel.
      • drawHorizontalCrosshair

        protected void drawHorizontalCrosshair​(Graphics2D g2,
                                               Rectangle2D dataArea,
                                               double y,
                                               Crosshair crosshair)
        Draws a crosshair horizontally across the plot.
        Parameters:
        g2 - the graphics target.
        dataArea - the data area.
        y - the y-value in Java2D space.
        crosshair - the crosshair.
      • drawVerticalCrosshair

        protected void drawVerticalCrosshair​(Graphics2D g2,
                                             Rectangle2D dataArea,
                                             double x,
                                             Crosshair crosshair)
        Draws a crosshair vertically on the plot.
        Parameters:
        g2 - the graphics target.
        dataArea - the data area.
        x - the x-value in Java2D space.
        crosshair - the crosshair.
      • equals

        public boolean equals​(Object obj)
        Tests this overlay for equality with an arbitrary object.
        Overrides:
        equals in class Object
        Parameters:
        obj - the object (null permitted).
        Returns:
        A boolean.