setMouseZoomable(true, true) rectangle color

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Ted Hill
Posts: 54
Joined: Mon Jun 12, 2006 7:39 pm

setMouseZoomable(true, true) rectangle color

Post by Ted Hill » Fri Oct 02, 2009 4:56 pm

if call setMouseZoomable(true, true) is there some way to set the color and alpha value used to draw the zoom rectangle?
Ted Hill

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

Re: setMouseZoomable(true, true) rectangle color

Post by skunk » Fri Oct 02, 2009 6:09 pm

If you look at the source

Code: Select all

2112        /**
2113         * Draws zoom rectangle (if present).
2114         * The drawing is performed in XOR mode, therefore
2115         * when this method is called twice in a row,
2116         * the second call will completely restore the state
2117         * of the canvas.
2118         *
2119         * @param g2 the graphics device.
2120         */
2121        private void drawZoomRectangle(Graphics2D g2) {
2122            // Set XOR mode to draw the zoom rectangle
2123            g2.setXORMode(Color.gray);
2124            if (this.zoomRectangle != null) {
2125                if (this.fillZoomRectangle) {
2126                    g2.fill(this.zoomRectangle);
2127                }
2128                else {
2129                    g2.draw(this.zoomRectangle);
2130                }
2131            }
2132            // Reset to the default 'overwrite' mode
2133            g2.setPaintMode();
2134        }
It appears not

Locked