-
- All Known Implementing Classes:
CrosshairOverlay
public interface Overlay
AnOverlayis anything that can be drawn over top of a chart to add additional information to the chart. This interface defines the operations that must be supported for an overlay that can be added to aChartPanelin Swing.
Note: if you are using JavaFX rather than Swing, then you need to look at theOverlayFXinterface in the JFreeChart-FX project.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddChangeListener(OverlayChangeListener listener)Registers a change listener with the overlay.voidpaintOverlay(Graphics2D g2, ChartPanel chartPanel)Paints the visual representation of the overlay.voidremoveChangeListener(OverlayChangeListener listener)Deregisters a listener from the overlay.
-
-
-
Method Detail
-
paintOverlay
void paintOverlay(Graphics2D g2, ChartPanel chartPanel)
Paints the visual representation of the overlay. This method will be called by theChartPanelafter the underlying chart has been fully rendered. When implementing this method, thechartPanelargument can be used to get state information from the chart (you can, for example, extract the axis ranges for the chart).- Parameters:
g2- the graphics target (nevernull).chartPanel- the chart panel (nevernull).
-
addChangeListener
void addChangeListener(OverlayChangeListener listener)
Registers a change listener with the overlay. Typically this method not be called by user code, it exists so that theChartPanelcan register and receive notification of changes to the overlay (such changes will trigger an automatic repaint of the chart).- Parameters:
listener- the listener (nullnot permitted).- See Also:
removeChangeListener(org.jfree.chart.event.OverlayChangeListener)
-
removeChangeListener
void removeChangeListener(OverlayChangeListener listener)
Deregisters a listener from the overlay.- Parameters:
listener- the listener (nullnot permitted).- See Also:
addChangeListener(org.jfree.chart.event.OverlayChangeListener)
-
-