1 package net.sf.openrocket.gui.scalefigure;
3 import java.awt.Dimension;
5 import net.sf.openrocket.util.ChangeSource;
8 public interface ScaleFigure extends ChangeSource {
11 * Extra scaling applied to the figure. The f***ing Java JRE doesn't know
12 * how to draw shapes when using very large scaling factors, so this must
13 * be manually applied to every single shape used.
15 * The scaling factor used is divided by this value, and every coordinate used
16 * in the figures must be multiplied by this factor.
18 public static final double EXTRA_SCALE = 1000;
21 * Shorthand for {@link #EXTRA_SCALE}.
23 public static final double S = EXTRA_SCALE;
27 * Set the scale level of the figure. A scale value of 1.0 indicates an original
28 * size when using the current DPI level.
30 * @param scale the scale level.
32 public void setScaling(double scale);
36 * Set the scale level so that the figure fits into the given bounds.
38 * @param bounds the bounds of the figure.
40 public void setScaling(Dimension bounds);
44 * Return the scale level of the figure. A scale value of 1.0 indicates an original
45 * size when using the current DPI level.
47 * @return the current scale level.
49 public double getScaling();
53 * Return the scale of the figure on px/m.
55 * @return the current scale value.
57 public double getAbsoluteScale();
61 * Return the pixel coordinates of the figure origin.
63 * @return the pixel coordinates of the figure origin.
65 public Dimension getOrigin();