Changing the Color of the Zoom Rectangle

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
the_schmitz
Posts: 13
Joined: Thu May 18, 2006 6:01 pm
Location: Washington DC

Changing the Color of the Zoom Rectangle

Post by the_schmitz » Wed Aug 22, 2007 3:15 pm

Hello,
Can anyone tell me how to change the color of the Zoom Rectangle? Is it possible without having to override the mouse events?

Thanks in Advance,
Chris

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Wed Aug 22, 2007 4:28 pm

This is from org/jfree/chart/ChartPanel.java

Code: Select all

2024        private void drawZoomRectangle(Graphics2D g2) {
2025            // Set XOR mode to draw the zoom rectangle
2026            g2.setXORMode(Color.gray);
2027            if (this.zoomRectangle != null) {
2028                if (this.fillZoomRectangle) {
2029                    g2.fill(this.zoomRectangle);
2030                }
2031                else {
2032                    g2.draw(this.zoomRectangle);
2033                }
2034            }
2035            // Reset to the default 'overwrite' mode
2036            g2.setPaintMode();
2037        }

Locked