mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
added LED
This commit is contained in:
+16
-16
@@ -35,8 +35,8 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
public static Size LEAD_THICKNESS = new Size(0.6d, SizeUnit.mm);
|
||||
public static Size DEFAULT_SIZE = new Size(1d, SizeUnit.in);
|
||||
|
||||
protected Size length;
|
||||
protected Size width;
|
||||
protected Size height;
|
||||
protected Point[] points = new Point[] {
|
||||
new Point((int) (-DEFAULT_SIZE.convertToPixels() / 2), 0),
|
||||
new Point(DEFAULT_SIZE.convertToPixels() / 2, 0) };
|
||||
@@ -48,8 +48,8 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
protected AbstractLeadedComponent() {
|
||||
super();
|
||||
try {
|
||||
this.length = getDefaultLength().clone();
|
||||
this.width = getDefaultWidth().clone();
|
||||
this.height = getDefaultHeight().clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
// This should never happen because Size supports cloning.
|
||||
} catch (NullPointerException e) {
|
||||
@@ -145,16 +145,16 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
}
|
||||
|
||||
/**
|
||||
* @return default component width.
|
||||
* @return default component length.
|
||||
*/
|
||||
protected abstract Size getDefaultWidth();
|
||||
protected abstract Size getDefaultLength();
|
||||
|
||||
/**
|
||||
* Returns default component height.
|
||||
* Returns default component width.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected abstract Size getDefaultHeight();
|
||||
protected abstract Size getDefaultWidth();
|
||||
|
||||
/**
|
||||
* @return shape that represents component body. Shape should not be
|
||||
@@ -220,7 +220,16 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
this.borderColor = borderColor;
|
||||
}
|
||||
|
||||
@EditableProperty(defaultable = true)
|
||||
@EditableProperty(name = "Length", defaultable = true)
|
||||
public Size getLength() {
|
||||
return length;
|
||||
}
|
||||
|
||||
public void setLength(Size length) {
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
@EditableProperty(name = "Width", defaultable = true)
|
||||
public Size getWidth() {
|
||||
return width;
|
||||
}
|
||||
@@ -229,15 +238,6 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
@EditableProperty(defaultable = true)
|
||||
public Size getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(Size height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
@EditableProperty
|
||||
public Display getDisplay() {
|
||||
return display;
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ public class Presenter implements IPlugInPort {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(Presenter.class);
|
||||
|
||||
public static final VersionNumber CURRENT_VERSION = new VersionNumber(3, 0, 4);
|
||||
public static final VersionNumber CURRENT_VERSION = new VersionNumber(3, 0, 5);
|
||||
public static final String DEFAULTS_KEY_PREFIX = "default.";
|
||||
public static final String METRIC_KEY = "metric";
|
||||
|
||||
|
||||
+10
-10
@@ -260,8 +260,8 @@ public class ProjectFileManager {
|
||||
} catch (Exception e) {
|
||||
LOG.debug("Could not set value of " + nameAttr);
|
||||
}
|
||||
resistor.setWidth(new Size(6d, SizeUnit.mm));
|
||||
resistor.setHeight(new Size(2d, SizeUnit.mm));
|
||||
resistor.setLength(new Size(6d, SizeUnit.mm));
|
||||
resistor.setWidth(new Size(2d, SizeUnit.mm));
|
||||
resistor.setControlPoint(point1, 0);
|
||||
resistor.setControlPoint(point2, 1);
|
||||
component = resistor;
|
||||
@@ -274,8 +274,8 @@ public class ProjectFileManager {
|
||||
} catch (Exception e) {
|
||||
LOG.debug("Could not set value of " + nameAttr);
|
||||
}
|
||||
capacitor.setWidth(new Size(6d, SizeUnit.mm));
|
||||
capacitor.setHeight(new Size(2d, SizeUnit.mm));
|
||||
capacitor.setLength(new Size(6d, SizeUnit.mm));
|
||||
capacitor.setWidth(new Size(2d, SizeUnit.mm));
|
||||
capacitor.setControlPoint(point1, 0);
|
||||
capacitor.setControlPoint(point2, 1);
|
||||
component = capacitor;
|
||||
@@ -290,13 +290,13 @@ public class ProjectFileManager {
|
||||
}
|
||||
String sizeAttr = node.getAttributes().getNamedItem("Size").getNodeValue();
|
||||
if (sizeAttr.equalsIgnoreCase("small")) {
|
||||
capacitor.setWidth(new Size(3d, SizeUnit.mm));
|
||||
capacitor.setLength(new Size(3d, SizeUnit.mm));
|
||||
} else if (sizeAttr.equalsIgnoreCase("medium")) {
|
||||
capacitor.setWidth(new Size(5d, SizeUnit.mm));
|
||||
capacitor.setLength(new Size(5d, SizeUnit.mm));
|
||||
} else if (sizeAttr.equalsIgnoreCase("large")) {
|
||||
capacitor.setWidth(new Size(7d, SizeUnit.mm));
|
||||
capacitor.setLength(new Size(7d, SizeUnit.mm));
|
||||
} else {
|
||||
capacitor.setWidth(new Size(4d, SizeUnit.mm));
|
||||
capacitor.setLength(new Size(4d, SizeUnit.mm));
|
||||
}
|
||||
capacitor.setControlPoint(point1, 0);
|
||||
capacitor.setControlPoint(point2, 1);
|
||||
@@ -310,8 +310,8 @@ public class ProjectFileManager {
|
||||
} catch (Exception e) {
|
||||
LOG.debug("Could not set value of " + nameAttr);
|
||||
}
|
||||
capacitor.setWidth(new Size(6d, SizeUnit.mm));
|
||||
capacitor.setHeight(new Size(2d, SizeUnit.mm));
|
||||
capacitor.setLength(new Size(6d, SizeUnit.mm));
|
||||
capacitor.setWidth(new Size(2d, SizeUnit.mm));
|
||||
capacitor.setControlPoint(point1, 0);
|
||||
capacitor.setControlPoint(point2, 1);
|
||||
component = capacitor;
|
||||
|
||||
Reference in New Issue
Block a user