1 package org.simantics.jfreechart.chart.element;
\r
3 import java.awt.geom.Rectangle2D;
\r
5 import org.simantics.g2d.diagram.IDiagram;
\r
6 import org.simantics.g2d.element.ElementHints;
\r
7 import org.simantics.g2d.element.IElement;
\r
8 import org.simantics.g2d.element.handler.LifeCycle;
\r
9 import org.simantics.g2d.element.handler.impl.BoundsOutline;
\r
12 * Outline with default bounds. Needed to avoid crashing when trying to rotate chart elements.
\r
13 * @author Teemu Lempinen
\r
16 public class ChartBoundsOutline extends BoundsOutline implements LifeCycle {
\r
17 private static final long serialVersionUID = -3819495313008722843L;
\r
19 Rectangle2D defaultBounds;
\r
21 public ChartBoundsOutline(Rectangle2D defaultBounds) {
\r
22 this.defaultBounds = defaultBounds;
\r
26 public void onElementCreated(IElement e) {
\r
27 e.setHint(ElementHints.KEY_BOUNDS, defaultBounds);
\r
31 public void onElementDestroyed(IElement e) {}
\r
33 public void onElementActivated(IDiagram d, IElement e) {}
\r
35 public void onElementDeactivated(IDiagram d, IElement e) {}
\r