create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / gui / scalefigure / ScaleFigure.java
1 package net.sf.openrocket.gui.scalefigure;
2
3 import java.awt.Dimension;
4
5 import net.sf.openrocket.util.ChangeSource;
6
7
8 public interface ScaleFigure extends ChangeSource {
9         
10         /**
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.
14          * <p>
15          * The scaling factor used is divided by this value, and every coordinate used 
16          * in the figures must be multiplied by this factor.
17          */
18         public static final double EXTRA_SCALE = 1000;
19         
20         /**
21          * Shorthand for {@link #EXTRA_SCALE}.
22          */
23         public static final double S = EXTRA_SCALE;
24         
25         
26         /**
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.
29          * 
30          * @param scale   the scale level.
31          */
32         public void setScaling(double scale);
33         
34         
35         /**
36          * Set the scale level so that the figure fits into the given bounds.
37          * 
38          * @param bounds  the bounds of the figure.
39          */
40         public void setScaling(Dimension bounds);
41         
42         
43         /**
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.
46          * 
47          * @return   the current scale level.
48          */
49         public double getScaling();
50         
51         
52         /**
53          * Return the scale of the figure on px/m.
54          * 
55          * @return   the current scale value.
56          */
57         public double getAbsoluteScale();
58         
59         
60         /**
61          * Return the pixel coordinates of the figure origin.
62          * 
63          * @return      the pixel coordinates of the figure origin.
64          */
65         public Dimension getOrigin();
66         
67         
68         /**
69          * Get the amount of blank space left around the figure.
70          * 
71          * @return      the amount of horizontal and vertical space left on both sides of the figure.
72          */
73         public Dimension getBorderPixels();
74         
75         /**
76          * Set the amount of blank space left around the figure.
77          * 
78          * @param width         the amount of horizontal space left on both sides of the figure.
79          * @param height        the amount of vertical space left on both sides of the figure.
80          */
81         public void setBorderPixels(int width, int height);
82 }