mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
make grid spacing flexible
This commit is contained in:
+7
-3
@@ -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();
|
||||
|
||||
|
||||
+4
-2
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user