better scaling

added marshall board and trimmer
This commit is contained in:
bancika
2011-02-03 21:47:16 +00:00
parent 02d38bed01
commit 6eee1525ee
34 changed files with 576 additions and 104 deletions
@@ -53,7 +53,7 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
* @param x
* @return
*/
protected int getClosestOdd(int x) {
return (x / 2) * 2 + 1;
protected int getClosestOdd(double x) {
return ((int) x / 2) * 2 + 1;
}
}
@@ -24,10 +24,12 @@ public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComp
public static Color GUIDELINE_COLOR = Color.blue;
public static Size DEFAULT_SIZE = new Size(1d, SizeUnit.in);
protected Point[] controlPoints = new Point[] { new Point(0, 0),
new Point(DEFAULT_SIZE.convertToPixels() / 2, 0),
new Point(DEFAULT_SIZE.convertToPixels() / 2, DEFAULT_SIZE.convertToPixels()),
new Point(DEFAULT_SIZE.convertToPixels(), DEFAULT_SIZE.convertToPixels()) };
protected Point[] controlPoints = new Point[] {
new Point(0, 0),
new Point((int) (DEFAULT_SIZE.convertToPixels() / 2), 0),
new Point((int) (DEFAULT_SIZE.convertToPixels() / 2), (int) (DEFAULT_SIZE
.convertToPixels())),
new Point((int) DEFAULT_SIZE.convertToPixels(), (int) DEFAULT_SIZE.convertToPixels()) };
protected Color color = getDefaultColor();
@@ -107,7 +109,7 @@ public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComp
public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
return VisibilityPolicy.WHEN_SELECTED;
}
@Override
public boolean canControlPointOverlap(int index) {
// Only shape control points may overlap.
@@ -40,7 +40,7 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
protected Size width;
protected Point[] points = new Point[] {
new Point((int) (-DEFAULT_SIZE.convertToPixels() / 2), 0),
new Point(DEFAULT_SIZE.convertToPixels() / 2, 0) };
new Point((int) (DEFAULT_SIZE.convertToPixels() / 2), 0) };
protected Color bodyColor = Color.white;
protected Color borderColor = Color.black;
protected Color labelColor = LABEL_COLOR;
@@ -173,7 +173,7 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
* @return default lead thickness. Override this method to change it.
*/
protected int getLeadThickness() {
return LEAD_THICKNESS.convertToPixels();
return (int) LEAD_THICKNESS.convertToPixels();
}
/**