make grid spacing flexible

This commit is contained in:
bancika
2011-01-15 10:11:09 +00:00
parent c8de2aa271
commit dd4080accb
14 changed files with 110 additions and 65 deletions
@@ -11,17 +11,21 @@ import java.awt.geom.CubicCurve2D;
import org.diylc.core.ComponentState;
import org.diylc.core.Project;
import org.diylc.core.annotations.EditableProperty;
import org.diylc.utils.Constants;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComponent<T> {
private static final long serialVersionUID = 1L;
public static Color GUIDELINE_COLOR = Color.blue;
public static Size DEFAULT_SIZE = new Size(1d, SizeUnit.in);
protected Point[] controlPoints = new Point[] {
new Point(-5 * Constants.GRID, -5 * Constants.GRID), new Point(0, -5 * Constants.GRID),
new Point(0, 5 * Constants.GRID), new Point(5 * Constants.GRID, 5 * Constants.GRID) };
new Point(-DEFAULT_SIZE.convertToPixels() / 2, -DEFAULT_SIZE.convertToPixels() / 2),
new Point(0, -DEFAULT_SIZE.convertToPixels() / 2),
new Point(0, DEFAULT_SIZE.convertToPixels() / 2),
new Point(DEFAULT_SIZE.convertToPixels() / 2, DEFAULT_SIZE.convertToPixels() / 2) };
protected Color color = getDefaultColor();
@@ -32,11 +32,13 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
public static Color LABEL_COLOR = Color.black;
public static Color LABEL_COLOR_SELECTED = Color.red;
public static Size LEAD_THICKNESS = new Size(0.3d, SizeUnit.mm);
public static Size DEFAULT_SIZE = new Size(1d, SizeUnit.in);
protected Size width;
protected Size height;
protected Point[] points = new Point[] { new Point((int) (-Constants.GRID * 5), 0),
new Point((int) (Constants.GRID * 5), 0) };
protected Point[] points = new Point[] {
new Point((int) (-DEFAULT_SIZE.convertToPixels() / 2), 0),
new Point(DEFAULT_SIZE.convertToPixels() / 2, 0) };
protected Color bodyColor = getDefaultBodyColor();
protected Color borderColor = getDefaultBorderColor();