mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
reorganized "stretchable" property into more granular control at the
point level added controlable label to pot symbol and transistor symbols
This commit is contained in:
@@ -43,7 +43,6 @@ public class ComponentType {
|
|||||||
private Class<? extends IDIYComponent<?>> instanceClass;
|
private Class<? extends IDIYComponent<?>> instanceClass;
|
||||||
private double zOrder;
|
private double zOrder;
|
||||||
private boolean flexibleZOrder;
|
private boolean flexibleZOrder;
|
||||||
private boolean stretchable;
|
|
||||||
private BomPolicy bomPolicy;
|
private BomPolicy bomPolicy;
|
||||||
private boolean autoEdit;
|
private boolean autoEdit;
|
||||||
private IComponentTransformer transformer;
|
private IComponentTransformer transformer;
|
||||||
@@ -52,8 +51,8 @@ public class ComponentType {
|
|||||||
|
|
||||||
public ComponentType(String name, String description, CreationMethod creationMethod, String category,
|
public ComponentType(String name, String description, CreationMethod creationMethod, String category,
|
||||||
String namePrefix, String author, Icon icon, Class<? extends IDIYComponent<?>> instanceClass, double zOrder,
|
String namePrefix, String author, Icon icon, Class<? extends IDIYComponent<?>> instanceClass, double zOrder,
|
||||||
boolean flexibleZOrder, boolean stretchable, BomPolicy bomPolicy, boolean autoEdit,
|
boolean flexibleZOrder, BomPolicy bomPolicy, boolean autoEdit, IComponentTransformer transformer,
|
||||||
IComponentTransformer transformer, KeywordPolicy keywordPolicy, String keywordTag) {
|
KeywordPolicy keywordPolicy, String keywordTag) {
|
||||||
super();
|
super();
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
@@ -65,7 +64,6 @@ public class ComponentType {
|
|||||||
this.instanceClass = instanceClass;
|
this.instanceClass = instanceClass;
|
||||||
this.zOrder = zOrder;
|
this.zOrder = zOrder;
|
||||||
this.flexibleZOrder = flexibleZOrder;
|
this.flexibleZOrder = flexibleZOrder;
|
||||||
this.stretchable = stretchable;
|
|
||||||
this.bomPolicy = bomPolicy;
|
this.bomPolicy = bomPolicy;
|
||||||
this.autoEdit = autoEdit;
|
this.autoEdit = autoEdit;
|
||||||
this.transformer = transformer;
|
this.transformer = transformer;
|
||||||
@@ -113,10 +111,6 @@ public class ComponentType {
|
|||||||
return flexibleZOrder;
|
return flexibleZOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isStretchable() {
|
|
||||||
return stretchable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BomPolicy getBomPolicy() {
|
public BomPolicy getBomPolicy() {
|
||||||
return bomPolicy;
|
return bomPolicy;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -302,4 +302,9 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
|
|||||||
public String getCommonPointName(int pointIndex) {
|
public String getCommonPointName(int pointIndex) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,6 +143,12 @@ public interface IDIYComponent<T> extends Serializable {
|
|||||||
*/
|
*/
|
||||||
String getCommonPointName(int pointIndex);
|
String getCommonPointName(int pointIndex);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param pointIndex
|
||||||
|
* @return true if the control point can move without affecting other points' position, false otherwise
|
||||||
|
*/
|
||||||
|
boolean canPointMoveFreely(int pointIndex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws the component onto the {@link Graphics2D}.
|
* Draws the component onto the {@link Graphics2D}.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -82,12 +82,6 @@ public @interface ComponentDescriptor {
|
|||||||
*/
|
*/
|
||||||
boolean flexibleZOrder() default false;
|
boolean flexibleZOrder() default false;
|
||||||
|
|
||||||
/**
|
|
||||||
* @return when false, moving one control point will cause all the others to move together with
|
|
||||||
* it.
|
|
||||||
*/
|
|
||||||
boolean stretchable() default true;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return controls what should be shown the BOM
|
* @return controls what should be shown the BOM
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ public class ComponentProcessor {
|
|||||||
Icon icon;
|
Icon icon;
|
||||||
double zOrder;
|
double zOrder;
|
||||||
boolean flexibleZOrder;
|
boolean flexibleZOrder;
|
||||||
boolean stretchable;
|
|
||||||
BomPolicy bomPolicy;
|
BomPolicy bomPolicy;
|
||||||
boolean autoEdit;
|
boolean autoEdit;
|
||||||
IComponentTransformer transformer;
|
IComponentTransformer transformer;
|
||||||
@@ -108,7 +107,6 @@ public class ComponentProcessor {
|
|||||||
author = annotation.author();
|
author = annotation.author();
|
||||||
zOrder = annotation.zOrder();
|
zOrder = annotation.zOrder();
|
||||||
flexibleZOrder = annotation.flexibleZOrder();
|
flexibleZOrder = annotation.flexibleZOrder();
|
||||||
stretchable = annotation.stretchable();
|
|
||||||
bomPolicy = annotation.bomPolicy();
|
bomPolicy = annotation.bomPolicy();
|
||||||
autoEdit = annotation.autoEdit();
|
autoEdit = annotation.autoEdit();
|
||||||
transformer = getComponentTransformer(annotation.transformer());
|
transformer = getComponentTransformer(annotation.transformer());
|
||||||
@@ -135,7 +133,7 @@ public class ComponentProcessor {
|
|||||||
}
|
}
|
||||||
ComponentType componentType =
|
ComponentType componentType =
|
||||||
new ComponentType(name, description, creationMethod, category, namePrefix, author, icon, clazz, zOrder,
|
new ComponentType(name, description, creationMethod, category, namePrefix, author, icon, clazz, zOrder,
|
||||||
flexibleZOrder, stretchable, bomPolicy, autoEdit, transformer, keywordPolicy, keywordTag);
|
flexibleZOrder, bomPolicy, autoEdit, transformer, keywordPolicy, keywordTag);
|
||||||
componentTypeMap.put(clazz.getName(), componentType);
|
componentTypeMap.put(clazz.getName(), componentType);
|
||||||
return componentType;
|
return componentType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ public class InstantiationManager {
|
|||||||
private Point potentialControlPoint;
|
private Point potentialControlPoint;
|
||||||
|
|
||||||
public static final ComponentType clipboardType = new ComponentType("Clipboard contents",
|
public static final ComponentType clipboardType = new ComponentType("Clipboard contents",
|
||||||
"Components from the clipboard", CreationMethod.SINGLE_CLICK, "Multi", "", "", null, null, 0, false, false, null,
|
"Components from the clipboard", CreationMethod.SINGLE_CLICK, "Multi", "", "", null, null, 0, false, null,
|
||||||
false, null, KeywordPolicy.NEVER_SHOW, null);
|
false, null, KeywordPolicy.NEVER_SHOW, null);
|
||||||
public static final ComponentType blockType = new ComponentType("Building block",
|
public static final ComponentType blockType = new ComponentType("Building block",
|
||||||
"Components from the building block", CreationMethod.SINGLE_CLICK, "Multi", "", "", null, null, 0, false, false, null,
|
"Components from the building block", CreationMethod.SINGLE_CLICK, "Multi", "", "", null, null, 0, false, null,
|
||||||
false, null, KeywordPolicy.NEVER_SHOW, null);
|
false, null, KeywordPolicy.NEVER_SHOW, null);
|
||||||
|
|
||||||
public InstantiationManager() {}
|
public InstantiationManager() {}
|
||||||
|
|||||||
@@ -821,7 +821,6 @@ public class Presenter implements IPlugInPort {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public void mouseMoved(Point point, boolean ctrlDown, boolean shiftDown, boolean altDown) {
|
public void mouseMoved(Point point, boolean ctrlDown, boolean shiftDown, boolean altDown) {
|
||||||
if (point == null)
|
if (point == null)
|
||||||
@@ -857,24 +856,15 @@ public class Presenter implements IPlugInPort {
|
|||||||
// Go backwards so we take the highest z-order components first.
|
// Go backwards so we take the highest z-order components first.
|
||||||
for (int i = currentProject.getComponents().size() - 1; i >= 0; i--) {
|
for (int i = currentProject.getComponents().size() - 1; i >= 0; i--) {
|
||||||
IDIYComponent<?> component = currentProject.getComponents().get(i);
|
IDIYComponent<?> component = currentProject.getComponents().get(i);
|
||||||
ComponentType componentType =
|
|
||||||
ComponentProcessor.getInstance().extractComponentTypeFrom(
|
|
||||||
(Class<? extends IDIYComponent<?>>) component.getClass());
|
|
||||||
for (int pointIndex = 0; pointIndex < component.getControlPointCount(); pointIndex++) {
|
for (int pointIndex = 0; pointIndex < component.getControlPointCount(); pointIndex++) {
|
||||||
Point controlPoint = component.getControlPoint(pointIndex);
|
Point controlPoint = component.getControlPoint(pointIndex);
|
||||||
// Only consider selected components that are not grouped.
|
// Only consider selected components that are not grouped.
|
||||||
if (selectedComponents.contains(component) && componentType.isStretchable()
|
if (selectedComponents.contains(component) && component.canPointMoveFreely(pointIndex)
|
||||||
&& findAllGroupedComponents(component).size() == 1) {
|
&& findAllGroupedComponents(component).size() == 1) {
|
||||||
try {
|
try {
|
||||||
if (previousScaledPoint.distance(controlPoint) < DrawingManager.CONTROL_POINT_SIZE) {
|
if (previousScaledPoint.distance(controlPoint) < DrawingManager.CONTROL_POINT_SIZE) {
|
||||||
Set<Integer> indices = new HashSet<Integer>();
|
Set<Integer> indices = new HashSet<Integer>();
|
||||||
if (componentType.isStretchable()) {
|
|
||||||
indices.add(pointIndex);
|
indices.add(pointIndex);
|
||||||
} else {
|
|
||||||
for (int j = 0; j < component.getControlPointCount(); j++) {
|
|
||||||
indices.add(j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
components.put(component, indices);
|
components.put(component, indices);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1101,15 +1091,10 @@ public class Presenter implements IPlugInPort {
|
|||||||
*
|
*
|
||||||
* @param controlPointMap
|
* @param controlPointMap
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private void includeStuckComponents(Map<IDIYComponent<?>, Set<Integer>> controlPointMap) {
|
private void includeStuckComponents(Map<IDIYComponent<?>, Set<Integer>> controlPointMap) {
|
||||||
int oldSize = controlPointMap.size();
|
int oldSize = controlPointMap.size();
|
||||||
LOG.trace("Expanding selected component map");
|
LOG.trace("Expanding selected component map");
|
||||||
for (IDIYComponent<?> component : currentProject.getComponents()) {
|
for (IDIYComponent<?> component : currentProject.getComponents()) {
|
||||||
ComponentType componentType =
|
|
||||||
ComponentProcessor.getInstance().extractComponentTypeFrom(
|
|
||||||
(Class<? extends IDIYComponent<?>>) component.getClass());
|
|
||||||
|
|
||||||
// Check if there's a control point in the current selection
|
// Check if there's a control point in the current selection
|
||||||
// that matches with one of its control points.
|
// that matches with one of its control points.
|
||||||
for (int i = 0; i < component.getControlPointCount(); i++) {
|
for (int i = 0; i < component.getControlPointCount(); i++) {
|
||||||
@@ -1142,7 +1127,7 @@ public class Presenter implements IPlugInPort {
|
|||||||
// For stretchable components just add the
|
// For stretchable components just add the
|
||||||
// matching component. Otherwise, add all control
|
// matching component. Otherwise, add all control
|
||||||
// points.
|
// points.
|
||||||
if (componentType.isStretchable()) {
|
if (component.canPointMoveFreely(i)) {
|
||||||
indices.add(i);
|
indices.add(i);
|
||||||
} else {
|
} else {
|
||||||
for (int k = 0; k < component.getControlPointCount(); k++) {
|
for (int k = 0; k < component.getControlPointCount(); k++) {
|
||||||
|
|||||||
Binary file not shown.
@@ -57,18 +57,34 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
|||||||
public static Color COLOR = Color.black;
|
public static Color COLOR = Color.black;
|
||||||
|
|
||||||
protected String value = "";
|
protected String value = "";
|
||||||
protected Point[] controlPoints = new Point[] {new Point(0, 0), new Point(0, 0), new Point(0, 0)};
|
protected Point[] controlPoints;
|
||||||
|
protected Point[] newControlPoints = new Point[] { new Point(0, 0), new Point(0, 0), new Point(0, 0), new Point(0, 0) };
|
||||||
protected Color color = COLOR;
|
protected Color color = COLOR;
|
||||||
protected SymbolFlipping flip = SymbolFlipping.NONE;
|
protected SymbolFlipping flip = SymbolFlipping.NONE;
|
||||||
protected Display display = Display.NAME;
|
protected Display display = Display.NAME;
|
||||||
transient protected Shape[] body;
|
transient protected Shape[] body;
|
||||||
protected Orientation orientation = Orientation.DEFAULT;
|
protected Orientation orientation = Orientation.DEFAULT;
|
||||||
|
protected boolean moveLabel = false;
|
||||||
|
|
||||||
public Abstract3LegSymbol() {
|
public Abstract3LegSymbol() {
|
||||||
super();
|
super();
|
||||||
updateControlPoints();
|
updateControlPoints();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Point[] getNewControlPoints() {
|
||||||
|
if (controlPoints != null) {
|
||||||
|
newControlPoints = new Point[] { controlPoints[0], controlPoints[1], controlPoints[2], getDefaultLabelPosition(controlPoints) };
|
||||||
|
controlPoints = null;
|
||||||
|
}
|
||||||
|
return newControlPoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Point getDefaultLabelPosition(Point[] oldControlPoints) {
|
||||||
|
int f = flip == SymbolFlipping.X ? -1 : 1;
|
||||||
|
int d = flip == SymbolFlipping.X ? (int) PIN_SPACING.convertToPixels() / 2 : 0;
|
||||||
|
return new Point(oldControlPoints[0].x + f * (int) (PIN_SPACING.convertToPixels() * 1.5 + d), oldControlPoints[0].y);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
|
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
|
||||||
IDrawingObserver drawingObserver) {
|
IDrawingObserver drawingObserver) {
|
||||||
@@ -97,6 +113,8 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
|||||||
|
|
||||||
AffineTransform old = g2d.getTransform();
|
AffineTransform old = g2d.getTransform();
|
||||||
|
|
||||||
|
Point[] controlPoints = getNewControlPoints();
|
||||||
|
|
||||||
if (this.flip == SymbolFlipping.Y) {
|
if (this.flip == SymbolFlipping.Y) {
|
||||||
g2d.translate(0, controlPoints[0].y);
|
g2d.translate(0, controlPoints[0].y);
|
||||||
g2d.scale(1, -1);
|
g2d.scale(1, -1);
|
||||||
@@ -144,38 +162,45 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
|||||||
Rectangle2D textRect = fontMetrics.getStringBounds(label, g2d);
|
Rectangle2D textRect = fontMetrics.getStringBounds(label, g2d);
|
||||||
Rectangle shapeRect = body[0].getBounds().union(body[1].getBounds()).union(body[2].getBounds());
|
Rectangle shapeRect = body[0].getBounds().union(body[1].getBounds()).union(body[2].getBounds());
|
||||||
|
|
||||||
|
if (getMoveLabel()) {
|
||||||
|
drawCenteredText(g2d, label, controlPoints[3].x, controlPoints[3].y, flip == SymbolFlipping.X ? HorizontalAlignment.RIGHT
|
||||||
|
: HorizontalAlignment.LEFT, VerticalAlignment.CENTER);
|
||||||
|
} else {
|
||||||
drawCenteredText(g2d, label, getLabelX(shapeRect, textRect, fontMetrics, outlineMode),
|
drawCenteredText(g2d, label, getLabelX(shapeRect, textRect, fontMetrics, outlineMode),
|
||||||
getLabelY(shapeRect, textRect, fontMetrics, outlineMode), flip == SymbolFlipping.X ? HorizontalAlignment.RIGHT
|
getLabelY(shapeRect, textRect, fontMetrics, outlineMode), flip == SymbolFlipping.X ? HorizontalAlignment.RIGHT
|
||||||
: HorizontalAlignment.LEFT, VerticalAlignment.CENTER);
|
: HorizontalAlignment.LEFT, VerticalAlignment.CENTER);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Point getControlPoint(int index) {
|
public Point getControlPoint(int index) {
|
||||||
return controlPoints[index];
|
return getNewControlPoints()[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getControlPointCount() {
|
public int getControlPointCount() {
|
||||||
return controlPoints.length;
|
return getNewControlPoints().length;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getLabelX(Rectangle2D shapeRect, Rectangle2D textRect, FontMetrics fontMetrics, boolean outlineMode) {
|
protected int getLabelX(Rectangle2D shapeRect, Rectangle2D textRect, FontMetrics fontMetrics, boolean outlineMode) {
|
||||||
int f = flip == SymbolFlipping.X ? -1 : 1;
|
int f = flip == SymbolFlipping.X ? -1 : 1;
|
||||||
int d = flip == SymbolFlipping.X ? (int) PIN_SPACING.convertToPixels() / 2 : 0;
|
int d = flip == SymbolFlipping.X ? (int) PIN_SPACING.convertToPixels() / 2 : 0;
|
||||||
return controlPoints[0].x + f * (int) (PIN_SPACING.convertToPixels() * 1.5 + d);
|
return getNewControlPoints()[0].x + f * (int) (PIN_SPACING.convertToPixels() * 1.5 + d);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getLabelY(Rectangle2D shapeRect, Rectangle2D textRect, FontMetrics fontMetrics, boolean outlineMode) {
|
protected int getLabelY(Rectangle2D shapeRect, Rectangle2D textRect, FontMetrics fontMetrics, boolean outlineMode) {
|
||||||
return controlPoints[0].y;
|
return getNewControlPoints()[0].y;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateControlPoints() {
|
protected void updateControlPoints() {
|
||||||
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
||||||
|
Point[] controlPoints = getNewControlPoints();
|
||||||
// Update control points.
|
// Update control points.
|
||||||
int x = controlPoints[0].x;
|
int x = controlPoints[0].x;
|
||||||
int y = controlPoints[0].y;
|
int y = controlPoints[0].y;
|
||||||
|
|
||||||
int f = flip == SymbolFlipping.X ? -1 : 1;
|
int f = flip == SymbolFlipping.X ? -1 : 1;
|
||||||
|
int d = flip == SymbolFlipping.X ? (int) PIN_SPACING.convertToPixels() / 2 : 0;
|
||||||
|
|
||||||
controlPoints[1].x = x + f * pinSpacing * 2;
|
controlPoints[1].x = x + f * pinSpacing * 2;
|
||||||
controlPoints[1].y = y - pinSpacing * 2;
|
controlPoints[1].y = y - pinSpacing * 2;
|
||||||
@@ -183,20 +208,22 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
|||||||
controlPoints[2].x = x + f * pinSpacing * 2;
|
controlPoints[2].x = x + f * pinSpacing * 2;
|
||||||
controlPoints[2].y = y + pinSpacing * 2;
|
controlPoints[2].y = y + pinSpacing * 2;
|
||||||
|
|
||||||
|
controlPoints[3].x = x + f * (int) (PIN_SPACING.convertToPixels() * 1.5 + d);
|
||||||
|
|
||||||
if (getOrientation() != Orientation.DEFAULT)
|
if (getOrientation() != Orientation.DEFAULT)
|
||||||
{
|
{
|
||||||
Point first = this.controlPoints[0];
|
Point first = controlPoints[0];
|
||||||
double angle = Double.parseDouble(getOrientation().name().replace("_", ""));
|
double angle = Double.parseDouble(getOrientation().name().replace("_", ""));
|
||||||
AffineTransform rotate = AffineTransform.getRotateInstance(Math.toRadians(angle), first.x, first.y);
|
AffineTransform rotate = AffineTransform.getRotateInstance(Math.toRadians(angle), first.x, first.y);
|
||||||
for (int i = 1; i < this.controlPoints.length; i++) {
|
for (int i = 1; i < controlPoints.length; i++) {
|
||||||
rotate.transform(this.controlPoints[i], this.controlPoints[i]);
|
rotate.transform(controlPoints[i], controlPoints[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
|
public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
|
||||||
return VisibilityPolicy.WHEN_SELECTED;
|
return index < 3 || getMoveLabel() ? VisibilityPolicy.WHEN_SELECTED : VisibilityPolicy.NEVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EditableProperty
|
@EditableProperty
|
||||||
@@ -212,17 +239,22 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isControlPointSticky(int index) {
|
public boolean isControlPointSticky(int index) {
|
||||||
return true;
|
return index < 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setControlPoint(Point point, int index) {
|
public void setControlPoint(Point point, int index) {
|
||||||
controlPoints[index].setLocation(point);
|
getNewControlPoints()[index].setLocation(point);
|
||||||
|
|
||||||
// make sure we have a new drawing
|
// make sure we have a new drawing
|
||||||
body = null;
|
body = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return pointIndex == 3;
|
||||||
|
}
|
||||||
|
|
||||||
@EditableProperty
|
@EditableProperty
|
||||||
public SymbolFlipping getFlip() {
|
public SymbolFlipping getFlip() {
|
||||||
return flip;
|
return flip;
|
||||||
@@ -245,6 +277,15 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
|||||||
this.color = color;
|
this.color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EditableProperty(name = "Moveable Label")
|
||||||
|
public boolean getMoveLabel() {
|
||||||
|
return moveLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMoveLabel(boolean moveLabel) {
|
||||||
|
this.moveLabel = moveLabel;
|
||||||
|
}
|
||||||
|
|
||||||
@EditableProperty
|
@EditableProperty
|
||||||
public Display getDisplay() {
|
public Display getDisplay() {
|
||||||
return display;
|
return display;
|
||||||
@@ -274,7 +315,7 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
|||||||
if (getOrientation() == Orientation.DEFAULT)
|
if (getOrientation() == Orientation.DEFAULT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Point first = this.controlPoints[0];
|
Point first = getNewControlPoints()[0];
|
||||||
double angle = Double.parseDouble(getOrientation().name().replace("_", ""));
|
double angle = Double.parseDouble(getOrientation().name().replace("_", ""));
|
||||||
AffineTransform rotate = AffineTransform.getRotateInstance(Math.toRadians(angle), first.x, first.y);
|
AffineTransform rotate = AffineTransform.getRotateInstance(Math.toRadians(angle), first.x, first.y);
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ import org.diylc.core.measures.Size;
|
|||||||
import org.diylc.core.measures.SizeUnit;
|
import org.diylc.core.measures.SizeUnit;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Breadboard", category = "Boards", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Breadboard", category = "Boards", author = "Branislav Stojkovic",
|
||||||
description = "Prototyping solderless breadboard", instanceNamePrefix = "BB", stretchable = false,
|
description = "Prototyping solderless breadboard", instanceNamePrefix = "BB",
|
||||||
zOrder = IDIYComponent.BOARD, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
|
zOrder = IDIYComponent.BOARD, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
|
||||||
keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME)
|
keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME)
|
||||||
public class Breadboard extends AbstractComponent<Void> {
|
public class Breadboard extends AbstractComponent<Void> {
|
||||||
@@ -314,6 +314,11 @@ public class Breadboard extends AbstractComponent<Void> {
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("incomplete-switch")
|
@SuppressWarnings("incomplete-switch")
|
||||||
@Override
|
@Override
|
||||||
public Point getControlPoint(int index) {
|
public Point getControlPoint(int index) {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Terminal Strip", author = "Branislav Stojkovic", category = "Boards",
|
@ComponentDescriptor(name = "Terminal Strip", author = "Branislav Stojkovic", category = "Boards",
|
||||||
instanceNamePrefix = "TS", description = "Row of terminals for point-to-point construction", stretchable = false,
|
instanceNamePrefix = "TS", description = "Row of terminals for point-to-point construction",
|
||||||
zOrder = IDIYComponent.BOARD, keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = TerminalStripTransformer.class)
|
zOrder = IDIYComponent.BOARD, keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = TerminalStripTransformer.class)
|
||||||
public class TerminalStrip extends AbstractTransparentComponent<String> implements IContinuity {
|
public class TerminalStrip extends AbstractTransparentComponent<String> implements IContinuity {
|
||||||
|
|
||||||
@@ -461,4 +461,9 @@ public class TerminalStrip extends AbstractTransparentComponent<String> implemen
|
|||||||
public boolean arePointsConnected(int index1, int index2) {
|
public boolean arePointsConnected(int index1, int index2) {
|
||||||
return Math.abs(index1 - index2) == getTerminalCount();
|
return Math.abs(index1 - index2) == getTerminalCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import org.diylc.core.measures.Size;
|
|||||||
import org.diylc.core.measures.SizeUnit;
|
import org.diylc.core.measures.SizeUnit;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Cut Line", category = "Connectivity", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Cut Line", category = "Connectivity", author = "Branislav Stojkovic",
|
||||||
description = "Cut line", instanceNamePrefix = "CL", stretchable = false, zOrder = IDIYComponent.COMPONENT,
|
description = "Cut line", instanceNamePrefix = "CL", zOrder = IDIYComponent.COMPONENT,
|
||||||
bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false, transformer = SimpleComponentTransformer.class)
|
bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false, transformer = SimpleComponentTransformer.class)
|
||||||
public class CutLine extends AbstractTransparentComponent<Void> {
|
public class CutLine extends AbstractTransparentComponent<Void> {
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import org.diylc.core.measures.Size;
|
|||||||
import org.diylc.core.measures.SizeUnit;
|
import org.diylc.core.measures.SizeUnit;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Dot", category = "Connectivity", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Dot", category = "Connectivity", author = "Branislav Stojkovic",
|
||||||
description = "Connector dot", instanceNamePrefix = "Dot", stretchable = false, zOrder = IDIYComponent.COMPONENT,
|
description = "Connector dot", instanceNamePrefix = "Dot", zOrder = IDIYComponent.COMPONENT,
|
||||||
bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false, transformer = SimpleComponentTransformer.class)
|
bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false, transformer = SimpleComponentTransformer.class)
|
||||||
public class Dot extends AbstractComponent<Void> {
|
public class Dot extends AbstractComponent<Void> {
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Eyelet", category = "Connectivity", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Eyelet", category = "Connectivity", author = "Branislav Stojkovic",
|
||||||
description = "Eyelet or turret terminal", instanceNamePrefix = "Eyelet", stretchable = false,
|
description = "Eyelet or turret terminal", instanceNamePrefix = "Eyelet",
|
||||||
zOrder = IDIYComponent.TRACE + 0.1, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
|
zOrder = IDIYComponent.TRACE + 0.1, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
|
||||||
keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = SimpleComponentTransformer.class)
|
keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = SimpleComponentTransformer.class)
|
||||||
public class Eyelet extends AbstractComponent<String> {
|
public class Eyelet extends AbstractComponent<String> {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Solder Pad", category = "Connectivity", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Solder Pad", category = "Connectivity", author = "Branislav Stojkovic",
|
||||||
description = "Copper solder pad, round or square", instanceNamePrefix = "Pad", stretchable = false,
|
description = "Copper solder pad, round or square", instanceNamePrefix = "Pad",
|
||||||
zOrder = IDIYComponent.TRACE + 0.1, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
|
zOrder = IDIYComponent.TRACE + 0.1, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
|
||||||
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "PCB", transformer = SimpleComponentTransformer.class)
|
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "PCB", transformer = SimpleComponentTransformer.class)
|
||||||
public class SolderPad extends AbstractComponent<Void> {
|
public class SolderPad extends AbstractComponent<Void> {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import org.diylc.utils.Constants;
|
|||||||
|
|
||||||
@ComponentDescriptor(name = "Trace Cut", category = "Connectivity", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Trace Cut", category = "Connectivity", author = "Branislav Stojkovic",
|
||||||
description = "Designates the place where a trace on the vero board needs to be cut", instanceNamePrefix = "Cut",
|
description = "Designates the place where a trace on the vero board needs to be cut", instanceNamePrefix = "Cut",
|
||||||
stretchable = false, zOrder = IDIYComponent.BOARD + 1, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
|
zOrder = IDIYComponent.BOARD + 1, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
|
||||||
transformer = SimpleComponentTransformer.class)
|
transformer = SimpleComponentTransformer.class)
|
||||||
public class TraceCut extends AbstractComponent<Void> {
|
public class TraceCut extends AbstractComponent<Void> {
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Turret Lug", category = "Connectivity", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Turret Lug", category = "Connectivity", author = "Branislav Stojkovic",
|
||||||
description = "Turret terminal lug", instanceNamePrefix = "Turret", stretchable = false,
|
description = "Turret terminal lug", instanceNamePrefix = "Turret",
|
||||||
zOrder = IDIYComponent.TRACE + 0.1, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
|
zOrder = IDIYComponent.TRACE + 0.1, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
|
||||||
keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = SimpleComponentTransformer.class)
|
keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = SimpleComponentTransformer.class)
|
||||||
public class Turret extends AbstractComponent<String> {
|
public class Turret extends AbstractComponent<String> {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "9V Battery Snap", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "9V Battery Snap", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
||||||
description = "", stretchable = false, zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "BTR",
|
description = "", zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "BTR",
|
||||||
autoEdit = false, transformer = BatterySnapTransformer.class)
|
autoEdit = false, transformer = BatterySnapTransformer.class)
|
||||||
public class BatterySnap9V extends AbstractTransparentComponent<String> {
|
public class BatterySnap9V extends AbstractTransparentComponent<String> {
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Cliff 1/4\" Jack", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Cliff 1/4\" Jack", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
||||||
description = "Cliff-style closed panel mount 1/4\" phono jack", stretchable = false,
|
description = "Cliff-style closed panel mount 1/4\" phono jack",
|
||||||
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "J", autoEdit = false, transformer = CliffJackTransformer.class)
|
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "J", autoEdit = false, transformer = CliffJackTransformer.class)
|
||||||
public class CliffJack1_4 extends AbstractMultiPartComponent<String> {
|
public class CliffJack1_4 extends AbstractMultiPartComponent<String> {
|
||||||
|
|
||||||
@@ -338,4 +338,9 @@ public class CliffJack1_4 extends AbstractMultiPartComponent<String> {
|
|||||||
this.orientation = orientation;
|
this.orientation = orientation;
|
||||||
updateControlPoints();
|
updateControlPoints();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Closed 1/4\" Jack", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Closed 1/4\" Jack", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
||||||
description = "Enclosed panel mount 1/4\" phono jack", stretchable = false, zOrder = IDIYComponent.COMPONENT,
|
description = "Enclosed panel mount 1/4\" phono jack", zOrder = IDIYComponent.COMPONENT,
|
||||||
instanceNamePrefix = "J", autoEdit = false, transformer = ClosedJackTransformer.class)
|
instanceNamePrefix = "J", autoEdit = false, transformer = ClosedJackTransformer.class)
|
||||||
public class ClosedJack1_4 extends AbstractMultiPartComponent<String> {
|
public class ClosedJack1_4 extends AbstractMultiPartComponent<String> {
|
||||||
|
|
||||||
@@ -364,4 +364,9 @@ public class ClosedJack1_4 extends AbstractMultiPartComponent<String> {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "DIP Switch", author = "Branislav Stojkovic", category = "Electro-Mechanical",
|
@ComponentDescriptor(name = "DIP Switch", author = "Branislav Stojkovic", category = "Electro-Mechanical",
|
||||||
instanceNamePrefix = "SW", description = "Dual-in-line package switch", stretchable = false,
|
instanceNamePrefix = "SW", description = "Dual-in-line package switch",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = DIL_ICTransformer.class)
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = DIL_ICTransformer.class)
|
||||||
public class DIPSwitch extends AbstractTransparentComponent<String> implements ISwitch {
|
public class DIPSwitch extends AbstractTransparentComponent<String> implements ISwitch {
|
||||||
|
|
||||||
@@ -538,6 +538,11 @@ public class DIPSwitch extends AbstractTransparentComponent<String> implements I
|
|||||||
return Math.abs(index1 - index2) == getSwitchCount().getValue() && binary.charAt(index1 < index2 ? index1 : index2) == '1';
|
return Math.abs(index1 - index2) == getSwitchCount().getValue() && binary.charAt(index1 < index2 ? index1 : index2) == '1';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private String toBinary(int n) {
|
private String toBinary(int n) {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
do {
|
do {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Fuse Holder (Panel)", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Fuse Holder (Panel)", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
||||||
description = "Panel mounted fuse holder", stretchable = false, zOrder = IDIYComponent.COMPONENT,
|
description = "Panel mounted fuse holder", zOrder = IDIYComponent.COMPONENT,
|
||||||
instanceNamePrefix = "FH", autoEdit = false)
|
instanceNamePrefix = "FH", autoEdit = false)
|
||||||
public class FuseHolderPanel extends AbstractMultiPartComponent<String> {
|
public class FuseHolderPanel extends AbstractMultiPartComponent<String> {
|
||||||
|
|
||||||
@@ -331,4 +331,9 @@ public class FuseHolderPanel extends AbstractMultiPartComponent<String> {
|
|||||||
public void setLabelColor(Color labelColor) {
|
public void setLabelColor(Color labelColor) {
|
||||||
this.labelColor = labelColor;
|
this.labelColor = labelColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "IEC Socket", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "IEC Socket", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
||||||
description = "Panel mounted IEC power socket", stretchable = false, zOrder = IDIYComponent.COMPONENT,
|
description = "Panel mounted IEC power socket", zOrder = IDIYComponent.COMPONENT,
|
||||||
instanceNamePrefix = "IEC", autoEdit = false)
|
instanceNamePrefix = "IEC", autoEdit = false)
|
||||||
public class IECSocket extends AbstractMultiPartComponent<String> {
|
public class IECSocket extends AbstractMultiPartComponent<String> {
|
||||||
|
|
||||||
@@ -385,4 +385,9 @@ public class IECSocket extends AbstractMultiPartComponent<String> {
|
|||||||
public void setBorderColor(Color borderColor) {
|
public void setBorderColor(Color borderColor) {
|
||||||
this.borderColor = borderColor;
|
this.borderColor = borderColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ import org.diylc.utils.Constants;
|
|||||||
|
|
||||||
@ComponentDescriptor(name = "Mini Relay", author = "Branislav Stojkovic", category = "Electro-Mechanical",
|
@ComponentDescriptor(name = "Mini Relay", author = "Branislav Stojkovic", category = "Electro-Mechanical",
|
||||||
instanceNamePrefix = "RY", description = "Miniature PCB mount relay, like Omron G5V-1 or G5V-2",
|
instanceNamePrefix = "RY", description = "Miniature PCB mount relay, like Omron G5V-1 or G5V-2",
|
||||||
stretchable = false, zOrder = IDIYComponent.COMPONENT)
|
zOrder = IDIYComponent.COMPONENT)
|
||||||
public class MiniRelay extends AbstractTransparentComponent<String> {
|
public class MiniRelay extends AbstractTransparentComponent<String> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -425,6 +425,11 @@ public class MiniRelay extends AbstractTransparentComponent<String> {
|
|||||||
this.body = null;
|
this.body = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static enum RelayType {
|
public static enum RelayType {
|
||||||
SPDT, DPDT;
|
SPDT, DPDT;
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -51,7 +51,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Mini Toggle Switch", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Mini Toggle Switch", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
||||||
description = "Panel mounted mini toggle switch", stretchable = false, zOrder = IDIYComponent.COMPONENT,
|
description = "Panel mounted mini toggle switch", zOrder = IDIYComponent.COMPONENT,
|
||||||
instanceNamePrefix = "SW", autoEdit = false)
|
instanceNamePrefix = "SW", autoEdit = false)
|
||||||
public class MiniToggleSwitch extends AbstractTransparentComponent<ToggleSwitchType> implements ISwitch {
|
public class MiniToggleSwitch extends AbstractTransparentComponent<ToggleSwitchType> implements ISwitch {
|
||||||
|
|
||||||
@@ -400,6 +400,11 @@ public class MiniToggleSwitch extends AbstractTransparentComponent<ToggleSwitchT
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPositionCount() {
|
public int getPositionCount() {
|
||||||
switch (switchType) {
|
switch (switchType) {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Open 1/4\" Jack", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Open 1/4\" Jack", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
||||||
description = "Switchcraft-style open panel mount 1/4\" phono jack, stereo and mono", stretchable = false,
|
description = "Switchcraft-style open panel mount 1/4\" phono jack, stereo and mono",
|
||||||
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "J")
|
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "J")
|
||||||
public class OpenJack1_4 extends AbstractMultiPartComponent<String> {
|
public class OpenJack1_4 extends AbstractMultiPartComponent<String> {
|
||||||
|
|
||||||
@@ -399,6 +399,11 @@ public class OpenJack1_4 extends AbstractMultiPartComponent<String> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public enum OpenJackType {
|
public enum OpenJackType {
|
||||||
|
|
||||||
MONO, STEREO, SWITCHED;
|
MONO, STEREO, SWITCHED;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Pilot Lamp Holder", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Pilot Lamp Holder", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
||||||
description = "Fender-style pilot bulb holder for T2 and T-3 ¼ miniature bayonet lamps", stretchable = false,
|
description = "Fender-style pilot bulb holder for T2 and T-3 ¼ miniature bayonet lamps",
|
||||||
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "PL")
|
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "PL")
|
||||||
public class PilotLampHolder extends AbstractMultiPartComponent<String> {
|
public class PilotLampHolder extends AbstractMultiPartComponent<String> {
|
||||||
|
|
||||||
@@ -404,6 +404,11 @@ public class PilotLampHolder extends AbstractMultiPartComponent<String> {
|
|||||||
body = null;
|
body = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
protected double getTheta() {
|
protected double getTheta() {
|
||||||
return Math.toRadians(getAngle());
|
return Math.toRadians(getAngle());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Plastic DC Jack", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Plastic DC Jack", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
||||||
description = "Panel mount plastic DC jack", stretchable = false, zOrder = IDIYComponent.COMPONENT,
|
description = "Panel mount plastic DC jack", zOrder = IDIYComponent.COMPONENT,
|
||||||
instanceNamePrefix = "J", autoEdit = false)
|
instanceNamePrefix = "J", autoEdit = false)
|
||||||
public class PlasticDCJack extends AbstractMultiPartComponent<String> {
|
public class PlasticDCJack extends AbstractMultiPartComponent<String> {
|
||||||
|
|
||||||
@@ -262,4 +262,9 @@ public class PlasticDCJack extends AbstractMultiPartComponent<String> {
|
|||||||
public void setPolarity(DCPolarity polarity) {
|
public void setPolarity(DCPolarity polarity) {
|
||||||
this.polarity = polarity;
|
this.polarity = polarity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,8 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "RCA Jack", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "RCA Jack", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
||||||
description = "Panel mount RCA phono jack socket", stretchable = false,
|
description = "Panel mount RCA phono jack socket", zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "J")
|
||||||
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "J")
|
|
||||||
public class RCAJack extends AbstractMultiPartComponent<String> {
|
public class RCAJack extends AbstractMultiPartComponent<String> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -320,4 +319,9 @@ public class RCAJack extends AbstractMultiPartComponent<String> {
|
|||||||
public String getControlPointNodeName(int index) {
|
public String getControlPointNodeName(int index) {
|
||||||
return getName() + (index == 0 ? "Tip" : "Sleeve");
|
return getName() + (index == 0 ? "Tip" : "Sleeve");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -189,6 +189,11 @@ public abstract class AbstractGuitarPickup extends AbstractTransparentComponent<
|
|||||||
body = null;
|
body = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@EditableProperty
|
@EditableProperty
|
||||||
public Polarity getPolarity() {
|
public Polarity getPolarity() {
|
||||||
if (polarity == null)
|
if (polarity == null)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Humbucker Pickup", category = "Guitar", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Humbucker Pickup", category = "Guitar", author = "Branislav Stojkovic",
|
||||||
description = "Double-coil humbucker guitar pickup (PAF, Mini Humbuckers, Filtertrons)", stretchable = false,
|
description = "Double-coil humbucker guitar pickup (PAF, Mini Humbuckers, Filtertrons)",
|
||||||
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "PKP", autoEdit = false,
|
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "PKP", autoEdit = false,
|
||||||
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
||||||
public class HumbuckerPickup extends AbstractGuitarPickup {
|
public class HumbuckerPickup extends AbstractGuitarPickup {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Jazz Bass Pickup", category = "Guitar", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Jazz Bass Pickup", category = "Guitar", author = "Branislav Stojkovic",
|
||||||
description = "Single coil pickup for Jazz Bass and similar guitars", stretchable = false,
|
description = "Single coil pickup for Jazz Bass and similar guitars",
|
||||||
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "PKP", autoEdit = false,
|
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "PKP", autoEdit = false,
|
||||||
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
||||||
public class JazzBassPickup extends AbstractSingleOrHumbuckerPickup {
|
public class JazzBassPickup extends AbstractSingleOrHumbuckerPickup {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "LP Toggle Switch", category = "Guitar", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "LP Toggle Switch", category = "Guitar", author = "Branislav Stojkovic",
|
||||||
description = "Les Paul style 3 position toggle switch", stretchable = false, zOrder = IDIYComponent.COMPONENT,
|
description = "Les Paul style 3 position toggle switch", zOrder = IDIYComponent.COMPONENT,
|
||||||
instanceNamePrefix = "SW")
|
instanceNamePrefix = "SW")
|
||||||
public class LPSwitch extends AbstractTransparentComponent<String> implements ISwitch {
|
public class LPSwitch extends AbstractTransparentComponent<String> implements ISwitch {
|
||||||
|
|
||||||
@@ -301,6 +301,11 @@ public class LPSwitch extends AbstractTransparentComponent<String> implements IS
|
|||||||
body = null;
|
body = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Lever Switch", category = "Guitar", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Lever Switch", category = "Guitar", author = "Branislav Stojkovic",
|
||||||
description = "Strat-style lever switch", stretchable = false, zOrder = IDIYComponent.COMPONENT,
|
description = "Strat-style lever switch", zOrder = IDIYComponent.COMPONENT,
|
||||||
instanceNamePrefix = "SW", keywordPolicy = KeywordPolicy.SHOW_TAG,
|
instanceNamePrefix = "SW", keywordPolicy = KeywordPolicy.SHOW_TAG,
|
||||||
keywordTag = "Guitar Wiring Diagram")
|
keywordTag = "Guitar Wiring Diagram")
|
||||||
public class LeverSwitch extends AbstractTransparentComponent<String> implements ISwitch {
|
public class LeverSwitch extends AbstractTransparentComponent<String> implements ISwitch {
|
||||||
@@ -476,4 +476,9 @@ public class LeverSwitch extends AbstractTransparentComponent<String> implements
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "P-90 Single Coil Pickup", category = "Guitar", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "P-90 Single Coil Pickup", category = "Guitar", author = "Branislav Stojkovic",
|
||||||
description = "Single coil P-90 guitar pickup, both \"dog ear\" and \"soap bar\"", stretchable = false,
|
description = "Single coil P-90 guitar pickup, both \"dog ear\" and \"soap bar\"",
|
||||||
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "PKP", autoEdit = false,
|
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "PKP", autoEdit = false,
|
||||||
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
||||||
public class P90Pickup extends AbstractSingleOrHumbuckerPickup {
|
public class P90Pickup extends AbstractSingleOrHumbuckerPickup {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "P- Bass Pickup", category = "Guitar", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "P- Bass Pickup", category = "Guitar", author = "Branislav Stojkovic",
|
||||||
description = "Split-coil pickup for P-Bass and similar guitars", stretchable = false,
|
description = "Split-coil pickup for P-Bass and similar guitars",
|
||||||
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "PKP", autoEdit = false,
|
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "PKP", autoEdit = false,
|
||||||
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
||||||
public class PBassPickup extends AbstractSingleOrHumbuckerPickup {
|
public class PBassPickup extends AbstractSingleOrHumbuckerPickup {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Single Coil Pickup", category = "Guitar", author = "Branislav Stojkovic",
|
@ComponentDescriptor(name = "Single Coil Pickup", category = "Guitar", author = "Branislav Stojkovic",
|
||||||
description = "Single coil guitar pickup, both Strat and Tele style", stretchable = false,
|
description = "Single coil guitar pickup, both Strat and Tele style",
|
||||||
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "PKP", autoEdit = false,
|
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "PKP", autoEdit = false,
|
||||||
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
||||||
public class SingleCoilPickup extends AbstractSingleOrHumbuckerPickup {
|
public class SingleCoilPickup extends AbstractSingleOrHumbuckerPickup {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import org.diylc.utils.BomEntry;
|
|||||||
import org.diylc.utils.BomMaker;
|
import org.diylc.utils.BomMaker;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Bill of Materials", author = "Branislav Stojkovic", category = "Misc", description = "",
|
@ComponentDescriptor(name = "Bill of Materials", author = "Branislav Stojkovic", category = "Misc", description = "",
|
||||||
instanceNamePrefix = "BOM", zOrder = IDIYComponent.TEXT, stretchable = false, bomPolicy = BomPolicy.NEVER_SHOW,
|
instanceNamePrefix = "BOM", zOrder = IDIYComponent.TEXT, bomPolicy = BomPolicy.NEVER_SHOW,
|
||||||
autoEdit = false)
|
autoEdit = false)
|
||||||
public class BOM extends AbstractComponent<Void> {
|
public class BOM extends AbstractComponent<Void> {
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import org.diylc.core.measures.Size;
|
|||||||
import org.diylc.core.measures.SizeUnit;
|
import org.diylc.core.measures.SizeUnit;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Ground", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
@ComponentDescriptor(name = "Ground", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
||||||
instanceNamePrefix = "GND", description = "Ground schematic symbol", stretchable = false,
|
instanceNamePrefix = "GND", description = "Ground schematic symbol",
|
||||||
zOrder = IDIYComponent.COMPONENT, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false)
|
zOrder = IDIYComponent.COMPONENT, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false)
|
||||||
public class GroundSymbol extends AbstractComponent<Void> {
|
public class GroundSymbol extends AbstractComponent<Void> {
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ import com.thoughtworks.xstream.annotations.XStreamConverter;
|
|||||||
|
|
||||||
@ComponentDescriptor(name = "Image", author = "Branislav Stojkovic", category = "Misc",
|
@ComponentDescriptor(name = "Image", author = "Branislav Stojkovic", category = "Misc",
|
||||||
description = "User defined image", instanceNamePrefix = "Img", zOrder = IDIYComponent.COMPONENT,
|
description = "User defined image", instanceNamePrefix = "Img", zOrder = IDIYComponent.COMPONENT,
|
||||||
flexibleZOrder = true, stretchable = false, bomPolicy = BomPolicy.NEVER_SHOW)
|
flexibleZOrder = true, bomPolicy = BomPolicy.NEVER_SHOW)
|
||||||
public class Image extends AbstractTransparentComponent<Void> {
|
public class Image extends AbstractTransparentComponent<Void> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import org.diylc.core.annotations.EditableProperty;
|
|||||||
|
|
||||||
@ComponentDescriptor(name = "Label", author = "Branislav Stojkovic", category = "Misc",
|
@ComponentDescriptor(name = "Label", author = "Branislav Stojkovic", category = "Misc",
|
||||||
description = "User defined label", instanceNamePrefix = "L", zOrder = IDIYComponent.TEXT, flexibleZOrder = true,
|
description = "User defined label", instanceNamePrefix = "L", zOrder = IDIYComponent.TEXT, flexibleZOrder = true,
|
||||||
stretchable = false, bomPolicy = BomPolicy.NEVER_SHOW, transformer = TextTransformer.class)
|
bomPolicy = BomPolicy.NEVER_SHOW, transformer = TextTransformer.class)
|
||||||
public class Label extends AbstractComponent<String> {
|
public class Label extends AbstractComponent<String> {
|
||||||
|
|
||||||
public static String DEFAULT_TEXT = "Double click to edit text";
|
public static String DEFAULT_TEXT = "Double click to edit text";
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ import org.diylc.core.annotations.EditableProperty;
|
|||||||
|
|
||||||
@ComponentDescriptor(name = "PCB Text", author = "Branislav Stojkovic", category = "Misc",
|
@ComponentDescriptor(name = "PCB Text", author = "Branislav Stojkovic", category = "Misc",
|
||||||
description = "Mirrored text for PCB artwork", instanceNamePrefix = "L", zOrder = IDIYComponent.TRACE,
|
description = "Mirrored text for PCB artwork", instanceNamePrefix = "L", zOrder = IDIYComponent.TRACE,
|
||||||
flexibleZOrder = false, stretchable = false, bomPolicy = BomPolicy.NEVER_SHOW, transformer = TextTransformer.class)
|
flexibleZOrder = false, bomPolicy = BomPolicy.NEVER_SHOW, transformer = TextTransformer.class)
|
||||||
public class PCBText extends AbstractComponent<Void> {
|
public class PCBText extends AbstractComponent<Void> {
|
||||||
|
|
||||||
public static String DEFAULT_TEXT = "Double click to edit text";
|
public static String DEFAULT_TEXT = "Double click to edit text";
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Audio Transformer", author = "Branislav Stojkovic", category = "Passive",
|
@ComponentDescriptor(name = "Audio Transformer", author = "Branislav Stojkovic", category = "Passive",
|
||||||
instanceNamePrefix = "TR", description = "Small signal audio transformer with EI core", stretchable = false,
|
instanceNamePrefix = "TR", description = "Small signal audio transformer with EI core",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = DIL_ICTransformer.class)
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = DIL_ICTransformer.class)
|
||||||
public class AudioTransformer extends AbstractMultiPartComponent<String> {
|
public class AudioTransformer extends AbstractMultiPartComponent<String> {
|
||||||
|
|
||||||
@@ -518,4 +518,9 @@ public class AudioTransformer extends AbstractMultiPartComponent<String> {
|
|||||||
this.secondaryCT = secondaryCT;
|
this.secondaryCT = secondaryCT;
|
||||||
updateControlPoints();
|
updateControlPoints();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import org.diylc.utils.Constants;
|
|||||||
|
|
||||||
@ComponentDescriptor(name = "Multi-Section Capacitor", author = "Branislav Stojkovic", category = "Passive",
|
@ComponentDescriptor(name = "Multi-Section Capacitor", author = "Branislav Stojkovic", category = "Passive",
|
||||||
instanceNamePrefix = "C", description = "Multi-section vertically mounted electrolytic capacitor, similar to JJ, CE and others",
|
instanceNamePrefix = "C", description = "Multi-section vertically mounted electrolytic capacitor, similar to JJ, CE and others",
|
||||||
stretchable = false, zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE)
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE)
|
||||||
public class MultiSectionCapacitor extends AbstractTransparentComponent<Capacitance[]> {
|
public class MultiSectionCapacitor extends AbstractTransparentComponent<Capacitance[]> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -516,4 +516,9 @@ public class MultiSectionCapacitor extends AbstractTransparentComponent<Capacita
|
|||||||
public void setPinColor(Color pinColor) {
|
public void setPinColor(Color pinColor) {
|
||||||
this.pinColor = pinColor;
|
this.pinColor = pinColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ import org.diylc.utils.Constants;
|
|||||||
|
|
||||||
@ComponentDescriptor(name = "Potentiometer", author = "Branislav Stojkovic", category = "Passive",
|
@ComponentDescriptor(name = "Potentiometer", author = "Branislav Stojkovic", category = "Passive",
|
||||||
creationMethod = CreationMethod.SINGLE_CLICK, instanceNamePrefix = "VR",
|
creationMethod = CreationMethod.SINGLE_CLICK, instanceNamePrefix = "VR",
|
||||||
description = "Panel mount potentiometer with solder lugs", zOrder = IDIYComponent.COMPONENT, stretchable = false,
|
description = "Panel mount potentiometer with solder lugs", zOrder = IDIYComponent.COMPONENT,
|
||||||
transformer = PotentiometerTransformer.class)
|
transformer = PotentiometerTransformer.class)
|
||||||
public class PotentiometerPanel extends AbstractPotentiometer {
|
public class PotentiometerPanel extends AbstractPotentiometer {
|
||||||
|
|
||||||
@@ -470,6 +470,11 @@ public class PotentiometerPanel extends AbstractPotentiometer {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public enum Type {
|
public enum Type {
|
||||||
ThroughHole("Through Hole"), PCB("PCB");
|
ThroughHole("Through Hole"), PCB("PCB");
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ package org.diylc.components.passive;
|
|||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.FontMetrics;
|
import java.awt.FontMetrics;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.Point;
|
||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
import java.awt.geom.GeneralPath;
|
import java.awt.geom.GeneralPath;
|
||||||
@@ -36,7 +37,7 @@ import org.diylc.core.annotations.ComponentDescriptor;
|
|||||||
import org.diylc.core.annotations.KeywordPolicy;
|
import org.diylc.core.annotations.KeywordPolicy;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Potentiometer", author = "MCbx", category = "Schematic Symbols",
|
@ComponentDescriptor(name = "Potentiometer", author = "MCbx", category = "Schematic Symbols",
|
||||||
instanceNamePrefix = "VR", description = "Potentiometer symbol", stretchable = false,
|
instanceNamePrefix = "VR", description = "Potentiometer symbol",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Schematic")
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Schematic")
|
||||||
public class PotentiometerSymbol extends Abstract3LegSymbol {
|
public class PotentiometerSymbol extends Abstract3LegSymbol {
|
||||||
|
|
||||||
@@ -48,6 +49,7 @@ public class PotentiometerSymbol extends Abstract3LegSymbol {
|
|||||||
|
|
||||||
public Shape[] getBody() {
|
public Shape[] getBody() {
|
||||||
Shape[] body = new Shape[3];
|
Shape[] body = new Shape[3];
|
||||||
|
Point[] controlPoints = getNewControlPoints();
|
||||||
int x = controlPoints[0].x;
|
int x = controlPoints[0].x;
|
||||||
int y = controlPoints[0].y;
|
int y = controlPoints[0].y;
|
||||||
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ import org.diylc.utils.Constants;
|
|||||||
|
|
||||||
@ComponentDescriptor(name = "Transformer Coil", author = "Branislav Stojkovic", category = "Schematic Symbols", instanceNamePrefix = "L",
|
@ComponentDescriptor(name = "Transformer Coil", author = "Branislav Stojkovic", category = "Schematic Symbols", instanceNamePrefix = "L",
|
||||||
description = "Transformer coil symbol. Use multiple instances together with \"Transformer Core Symbol\"<br>to draw transformer schematics.",
|
description = "Transformer coil symbol. Use multiple instances together with \"Transformer Core Symbol\"<br>to draw transformer schematics.",
|
||||||
stretchable = false, zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG,
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG,
|
||||||
keywordTag = "Schematic")
|
keywordTag = "Schematic")
|
||||||
public class TransformerCoil extends AbstractComponent<org.diylc.core.measures.Voltage> {
|
public class TransformerCoil extends AbstractComponent<org.diylc.core.measures.Voltage> {
|
||||||
|
|
||||||
@@ -282,4 +282,9 @@ public class TransformerCoil extends AbstractComponent<org.diylc.core.measures.V
|
|||||||
}
|
}
|
||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,8 +46,7 @@ import org.diylc.utils.Constants;
|
|||||||
|
|
||||||
@ComponentDescriptor(name = "Transformer Core", author = "Branislav Stojkovic", category = "Schematic Symbols", instanceNamePrefix = "T",
|
@ComponentDescriptor(name = "Transformer Core", author = "Branislav Stojkovic", category = "Schematic Symbols", instanceNamePrefix = "T",
|
||||||
description = "Transformer core symbol. Use multiple instances together with \"Transformer Coil Symbol\"<br>to draw transformer schematics.",
|
description = "Transformer core symbol. Use multiple instances together with \"Transformer Coil Symbol\"<br>to draw transformer schematics.",
|
||||||
stretchable = true, zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG,
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG, creationMethod = CreationMethod.POINT_BY_POINT, keywordTag = "Schematic")
|
||||||
creationMethod = CreationMethod.POINT_BY_POINT, keywordTag = "Schematic")
|
|
||||||
public class TransformerCore extends AbstractComponent<Void> {
|
public class TransformerCore extends AbstractComponent<Void> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -154,6 +153,10 @@ public class TransformerCore extends AbstractComponent<Void> {
|
|||||||
@Override
|
@Override
|
||||||
public void setValue(Void value) {
|
public void setValue(Void value) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ import org.diylc.utils.Constants;
|
|||||||
|
|
||||||
@ComponentDescriptor(name = "Trimmer Potentiometer", author = "Branislav Stojkovic", category = "Passive",
|
@ComponentDescriptor(name = "Trimmer Potentiometer", author = "Branislav Stojkovic", category = "Passive",
|
||||||
creationMethod = CreationMethod.SINGLE_CLICK, instanceNamePrefix = "VR",
|
creationMethod = CreationMethod.SINGLE_CLICK, instanceNamePrefix = "VR",
|
||||||
description = "Various types of board mounted trimmer potentiometers", zOrder = IDIYComponent.COMPONENT,
|
description = "Various types of board mounted trimmer potentiometers", zOrder = IDIYComponent.COMPONENT)
|
||||||
stretchable = false)
|
|
||||||
public class TrimmerPotentiometer extends AbstractPotentiometer {
|
public class TrimmerPotentiometer extends AbstractPotentiometer {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -530,6 +529,11 @@ public class TrimmerPotentiometer extends AbstractPotentiometer {
|
|||||||
body = null;
|
body = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static enum TrimmerType {
|
public static enum TrimmerType {
|
||||||
FLAT_SMALL("Horizontal Small 1"), FLAT_SMALL2("Horizontal Small 2"), FLAT_XSMALL("Horizontal X-Small"), FLAT_LARGE(
|
FLAT_SMALL("Horizontal Small 1"), FLAT_SMALL2("Horizontal Small 2"), FLAT_XSMALL("Horizontal X-Small"), FLAT_LARGE(
|
||||||
"Horizontal Medium"), FLAT_XLARGE("Horizontal Large"), VERTICAL_INLINE("Vertical Inline"), VERTICAL_OFFSET(
|
"Horizontal Medium"), FLAT_XLARGE("Horizontal Large"), VERTICAL_INLINE("Vertical Inline"), VERTICAL_OFFSET(
|
||||||
|
|||||||
+5
@@ -196,4 +196,9 @@ public abstract class AbstractTransistorPackage extends AbstractTransparentCompo
|
|||||||
public void setPinout(TransistorPinout pinout) {
|
public void setPinout(TransistorPinout pinout) {
|
||||||
this.pinout = pinout;
|
this.pinout = pinout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
package org.diylc.components.semiconductors;
|
package org.diylc.components.semiconductors;
|
||||||
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.Point;
|
||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
import java.awt.geom.AffineTransform;
|
import java.awt.geom.AffineTransform;
|
||||||
@@ -36,7 +37,7 @@ import org.diylc.core.annotations.EditableProperty;
|
|||||||
import org.diylc.core.annotations.KeywordPolicy;
|
import org.diylc.core.annotations.KeywordPolicy;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "BJT", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
@ComponentDescriptor(name = "BJT", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
||||||
instanceNamePrefix = "Q", description = "Bipolar junction transistor schematic symbol", stretchable = false,
|
instanceNamePrefix = "Q", description = "Bipolar junction transistor schematic symbol",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG_AND_VALUE, keywordTag = "Schematic")
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG_AND_VALUE, keywordTag = "Schematic")
|
||||||
public class BJTSymbol extends Abstract3LegSymbol {
|
public class BJTSymbol extends Abstract3LegSymbol {
|
||||||
|
|
||||||
@@ -46,6 +47,7 @@ public class BJTSymbol extends Abstract3LegSymbol {
|
|||||||
|
|
||||||
public Shape[] getBody() {
|
public Shape[] getBody() {
|
||||||
Shape[] body = new Shape[3];
|
Shape[] body = new Shape[3];
|
||||||
|
Point[] controlPoints = getNewControlPoints();
|
||||||
int x = controlPoints[0].x;
|
int x = controlPoints[0].x;
|
||||||
int y = controlPoints[0].y;
|
int y = controlPoints[0].y;
|
||||||
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ import org.diylc.core.measures.Voltage;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Bridge Rectifier", author = "Branislav Stojkovic", category = "Semiconductors",
|
@ComponentDescriptor(name = "Bridge Rectifier", author = "Branislav Stojkovic", category = "Semiconductors",
|
||||||
instanceNamePrefix = "BR", description = "Few variations of bridge rectifier chips", stretchable = false,
|
instanceNamePrefix = "BR", description = "Few variations of bridge rectifier chips",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = DIL_ICTransformer.class)
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = DIL_ICTransformer.class)
|
||||||
public class BridgeRectifier extends AbstractTransparentComponent<String> {
|
public class BridgeRectifier extends AbstractTransparentComponent<String> {
|
||||||
|
|
||||||
@@ -663,6 +663,11 @@ public class BridgeRectifier extends AbstractTransparentComponent<String> {
|
|||||||
this.labelOriantation = labelOriantation;
|
this.labelOriantation = labelOriantation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static enum RectifierType {
|
public static enum RectifierType {
|
||||||
|
|
||||||
MiniDIP1("DFM A", PinShape.Square),
|
MiniDIP1("DFM A", PinShape.Square),
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "DIP IC", author = "Branislav Stojkovic", category = "Semiconductors",
|
@ComponentDescriptor(name = "DIP IC", author = "Branislav Stojkovic", category = "Semiconductors",
|
||||||
instanceNamePrefix = "IC", description = "Dual-in-line package IC", stretchable = false,
|
instanceNamePrefix = "IC", description = "Dual-in-line package IC",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = DIL_ICTransformer.class)
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = DIL_ICTransformer.class)
|
||||||
public class DIL_IC extends AbstractTransparentComponent<String> {
|
public class DIL_IC extends AbstractTransparentComponent<String> {
|
||||||
|
|
||||||
@@ -538,6 +538,11 @@ public class DIL_IC extends AbstractTransparentComponent<String> {
|
|||||||
this.displayNumbers = numbers;
|
this.displayNumbers = numbers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static enum PinCount {
|
public static enum PinCount {
|
||||||
|
|
||||||
_4, _6, _8, _10, _12, _14, _16, _18, _20, _22, _24, _26, _28, _30, _32, _34, _36, _38, _40, _42, _44, _46, _48, _50;
|
_4, _6, _8, _10, _12, _14, _16, _18, _20, _22, _24, _26, _28, _30, _32, _34, _36, _38, _40, _42, _44, _46, _48, _50;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "IC", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
@ComponentDescriptor(name = "IC", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
||||||
instanceNamePrefix = "IC", description = "IC symbol with 3 or 5 contacts", stretchable = false,
|
instanceNamePrefix = "IC", description = "IC symbol with 3 or 5 contacts",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG_AND_VALUE, keywordTag = "Schematic")
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG_AND_VALUE, keywordTag = "Schematic")
|
||||||
public class ICSymbol extends AbstractTransparentComponent<String> {
|
public class ICSymbol extends AbstractTransparentComponent<String> {
|
||||||
|
|
||||||
@@ -296,4 +296,9 @@ public class ICSymbol extends AbstractTransparentComponent<String> {
|
|||||||
public void setDisplay(Display display) {
|
public void setDisplay(Display display) {
|
||||||
this.display = display;
|
this.display = display;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
package org.diylc.components.semiconductors;
|
package org.diylc.components.semiconductors;
|
||||||
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.Point;
|
||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
import java.awt.geom.GeneralPath;
|
import java.awt.geom.GeneralPath;
|
||||||
@@ -34,7 +35,7 @@ import org.diylc.core.annotations.EditableProperty;
|
|||||||
import org.diylc.core.annotations.KeywordPolicy;
|
import org.diylc.core.annotations.KeywordPolicy;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "JFET", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
@ComponentDescriptor(name = "JFET", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
||||||
instanceNamePrefix = "Q", description = "JFET transistor schematic symbol", stretchable = false,
|
instanceNamePrefix = "Q", description = "JFET transistor schematic symbol",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG_AND_VALUE, keywordTag = "Schematic")
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG_AND_VALUE, keywordTag = "Schematic")
|
||||||
public class JFETSymbol extends Abstract3LegSymbol {
|
public class JFETSymbol extends Abstract3LegSymbol {
|
||||||
|
|
||||||
@@ -44,6 +45,7 @@ public class JFETSymbol extends Abstract3LegSymbol {
|
|||||||
|
|
||||||
public Shape[] getBody() {
|
public Shape[] getBody() {
|
||||||
Shape[] body = new Shape[3];
|
Shape[] body = new Shape[3];
|
||||||
|
Point[] controlPoints = getNewControlPoints();
|
||||||
int x = controlPoints[0].x;
|
int x = controlPoints[0].x;
|
||||||
int y = controlPoints[0].y;
|
int y = controlPoints[0].y;
|
||||||
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Logic Gate", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
@ComponentDescriptor(name = "Logic Gate", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
||||||
instanceNamePrefix = "LG", description = "Basic logic gate schematic symbols", stretchable = false,
|
instanceNamePrefix = "LG", description = "Basic logic gate schematic symbols",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG_AND_VALUE, keywordTag = "Schematic")
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG_AND_VALUE, keywordTag = "Schematic")
|
||||||
public class LogicGateSymbol extends AbstractTransparentComponent<String> {
|
public class LogicGateSymbol extends AbstractTransparentComponent<String> {
|
||||||
|
|
||||||
@@ -318,6 +318,11 @@ public class LogicGateSymbol extends AbstractTransparentComponent<String> {
|
|||||||
this.display = display;
|
this.display = display;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public enum GateType {
|
public enum GateType {
|
||||||
Buffer(false), Not(true), Or(false), And(false), Xor(false), Nor(true), Nand(true), Xnor(true);
|
Buffer(false), Not(true), Or(false), And(false), Xor(false), Nor(true), Nand(true), Xnor(true);
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
package org.diylc.components.semiconductors;
|
package org.diylc.components.semiconductors;
|
||||||
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.Point;
|
||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
import java.awt.geom.GeneralPath;
|
import java.awt.geom.GeneralPath;
|
||||||
@@ -34,7 +35,7 @@ import org.diylc.core.annotations.EditableProperty;
|
|||||||
import org.diylc.core.annotations.KeywordPolicy;
|
import org.diylc.core.annotations.KeywordPolicy;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "MOSFET", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
@ComponentDescriptor(name = "MOSFET", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
||||||
instanceNamePrefix = "Q", description = "MOSFET transistor schematic symbol", stretchable = false,
|
instanceNamePrefix = "Q", description = "MOSFET transistor schematic symbol",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG_AND_VALUE, keywordTag = "Schematic")
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG_AND_VALUE, keywordTag = "Schematic")
|
||||||
public class MOSFETSymbol extends Abstract3LegSymbol {
|
public class MOSFETSymbol extends Abstract3LegSymbol {
|
||||||
|
|
||||||
@@ -44,6 +45,7 @@ public class MOSFETSymbol extends Abstract3LegSymbol {
|
|||||||
|
|
||||||
public Shape[] getBody() {
|
public Shape[] getBody() {
|
||||||
Shape[] body = new Shape[3];
|
Shape[] body = new Shape[3];
|
||||||
|
Point[] controlPoints = getNewControlPoints();
|
||||||
int x = controlPoints[0].x;
|
int x = controlPoints[0].x;
|
||||||
int y = controlPoints[0].y;
|
int y = controlPoints[0].y;
|
||||||
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "SIP IC", author = "Branislav Stojkovic", category = "Semiconductors",
|
@ComponentDescriptor(name = "SIP IC", author = "Branislav Stojkovic", category = "Semiconductors",
|
||||||
instanceNamePrefix = "IC", description = "Single-in-line package IC", stretchable = false,
|
instanceNamePrefix = "IC", description = "Single-in-line package IC",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = SIL_ICTransformer.class)
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = SIL_ICTransformer.class)
|
||||||
public class SIL_IC extends AbstractTransparentComponent<String> {
|
public class SIL_IC extends AbstractTransparentComponent<String> {
|
||||||
|
|
||||||
@@ -145,6 +145,11 @@ public class SIL_IC extends AbstractTransparentComponent<String> {
|
|||||||
body = null;
|
body = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@EditableProperty
|
@EditableProperty
|
||||||
public Display getDisplay() {
|
public Display getDisplay() {
|
||||||
if (display == null) {
|
if (display == null) {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Transistor (TO-1)", author = "Branislav Stojkovic", category = "Semiconductors",
|
@ComponentDescriptor(name = "Transistor (TO-1)", author = "Branislav Stojkovic", category = "Semiconductors",
|
||||||
instanceNamePrefix = "Q", description = "Transistor with small metal body", stretchable = false,
|
instanceNamePrefix = "Q", description = "Transistor with small metal body",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = TO1Transformer.class)
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = TO1Transformer.class)
|
||||||
public class TransistorTO1 extends AbstractTransistorPackage {
|
public class TransistorTO1 extends AbstractTransistorPackage {
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Transistor (TO-220)", author = "Branislav Stojkovic", category = "Semiconductors",
|
@ComponentDescriptor(name = "Transistor (TO-220)", author = "Branislav Stojkovic", category = "Semiconductors",
|
||||||
instanceNamePrefix = "Q", description = "Transistors with metal tab for heat sink mounting", stretchable = false,
|
instanceNamePrefix = "Q", description = "Transistors with metal tab for heat sink mounting",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = TO220Transformer.class)
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = TO220Transformer.class)
|
||||||
public class TransistorTO220 extends AbstractTransistorPackage {
|
public class TransistorTO220 extends AbstractTransistorPackage {
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Transistor (TO-3)", author = "Branislav Stojkovic", category = "Semiconductors",
|
@ComponentDescriptor(name = "Transistor (TO-3)", author = "Branislav Stojkovic", category = "Semiconductors",
|
||||||
instanceNamePrefix = "Q", description = "Transistor with large metal body", stretchable = false,
|
instanceNamePrefix = "Q", description = "Transistor with large metal body",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE)
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE)
|
||||||
public class TransistorTO3 extends AbstractTransparentComponent<String> {
|
public class TransistorTO3 extends AbstractTransparentComponent<String> {
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Transistor (TO-92)", author = "Branislav Stojkovic", category = "Semiconductors",
|
@ComponentDescriptor(name = "Transistor (TO-92)", author = "Branislav Stojkovic", category = "Semiconductors",
|
||||||
instanceNamePrefix = "Q", description = "Transistor with small plastic or epoxy body", stretchable = false,
|
instanceNamePrefix = "Q", description = "Transistor with small plastic or epoxy body",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = TO92Transformer.class)
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = TO92Transformer.class)
|
||||||
public class TransistorTO92 extends AbstractTransistorPackage {
|
public class TransistorTO92 extends AbstractTransistorPackage {
|
||||||
|
|
||||||
|
|||||||
@@ -407,6 +407,11 @@ public abstract class PassiveSMDComponent<T> extends AbstractTransparentComponen
|
|||||||
this.labelColor = labelColor;
|
this.labelColor = labelColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static enum SMDSize {
|
public static enum SMDSize {
|
||||||
|
|
||||||
_0805(new Size(0.05d, SizeUnit.in), new Size(0.08d, SizeUnit.in)), _1206(new Size(1.6d, SizeUnit.mm), new Size(3.2d,
|
_0805(new Size(0.05d, SizeUnit.in), new Size(0.08d, SizeUnit.in)), _1206(new Size(1.6d, SizeUnit.mm), new Size(3.2d,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import org.diylc.core.annotations.PositiveMeasureValidator;
|
|||||||
import org.diylc.core.measures.Capacitance;
|
import org.diylc.core.measures.Capacitance;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "SMD Capacitor", author = "Branislav Stojkovic", category = "SMD",
|
@ComponentDescriptor(name = "SMD Capacitor", author = "Branislav Stojkovic", category = "SMD",
|
||||||
instanceNamePrefix = "C", description = "Surface mount capacitor", stretchable = false,
|
instanceNamePrefix = "C", description = "Surface mount capacitor",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE)
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE)
|
||||||
public class SMDCapacitor extends PassiveSMDComponent<Capacitance> {
|
public class SMDCapacitor extends PassiveSMDComponent<Capacitance> {
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import org.diylc.core.annotations.PositiveMeasureValidator;
|
|||||||
import org.diylc.core.measures.Resistance;
|
import org.diylc.core.measures.Resistance;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "SMD Resistor", author = "Branislav Stojkovic", category = "SMD", instanceNamePrefix = "C",
|
@ComponentDescriptor(name = "SMD Resistor", author = "Branislav Stojkovic", category = "SMD", instanceNamePrefix = "C",
|
||||||
description = "Surface mount resistor", stretchable = false, zOrder = IDIYComponent.COMPONENT,
|
description = "Surface mount resistor", zOrder = IDIYComponent.COMPONENT,
|
||||||
keywordPolicy = KeywordPolicy.SHOW_VALUE)
|
keywordPolicy = KeywordPolicy.SHOW_VALUE)
|
||||||
public class SMDResistor extends PassiveSMDComponent<Resistance> {
|
public class SMDResistor extends PassiveSMDComponent<Resistance> {
|
||||||
|
|
||||||
|
|||||||
@@ -297,4 +297,9 @@ public abstract class AbstractTubeSymbol extends AbstractComponent<String> {
|
|||||||
rotate.transform(this.controlPoints[i], this.controlPoints[i]);
|
rotate.transform(this.controlPoints[i], this.controlPoints[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPointMoveFreely(int pointIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import org.diylc.core.annotations.EditableProperty;
|
|||||||
import org.diylc.core.annotations.KeywordPolicy;
|
import org.diylc.core.annotations.KeywordPolicy;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Diode", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
@ComponentDescriptor(name = "Diode", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
||||||
instanceNamePrefix = "V", description = "Diode tube symbol", stretchable = false, zOrder = IDIYComponent.COMPONENT,
|
instanceNamePrefix = "V", description = "Diode tube symbol", zOrder = IDIYComponent.COMPONENT,
|
||||||
keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = TubeSymbolTransformer.class)
|
keywordPolicy = KeywordPolicy.SHOW_VALUE, transformer = TubeSymbolTransformer.class)
|
||||||
public class DiodeSymbol extends AbstractTubeSymbol {
|
public class DiodeSymbol extends AbstractTubeSymbol {
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import org.diylc.core.annotations.EditableProperty;
|
|||||||
import org.diylc.core.annotations.KeywordPolicy;
|
import org.diylc.core.annotations.KeywordPolicy;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Pentode", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
@ComponentDescriptor(name = "Pentode", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
||||||
instanceNamePrefix = "V", description = "Pentode tube symbol", stretchable = false,
|
instanceNamePrefix = "V", description = "Pentode tube symbol",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE,
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE,
|
||||||
transformer = TubeSymbolTransformer.class)
|
transformer = TubeSymbolTransformer.class)
|
||||||
public class PentodeSymbol extends AbstractTubeSymbol {
|
public class PentodeSymbol extends AbstractTubeSymbol {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import org.diylc.core.annotations.EditableProperty;
|
|||||||
import org.diylc.core.annotations.KeywordPolicy;
|
import org.diylc.core.annotations.KeywordPolicy;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Triode", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
@ComponentDescriptor(name = "Triode", author = "Branislav Stojkovic", category = "Schematic Symbols",
|
||||||
instanceNamePrefix = "V", description = "Triode tube symbol", stretchable = false,
|
instanceNamePrefix = "V", description = "Triode tube symbol",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE,
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE,
|
||||||
transformer = TubeSymbolTransformer.class)
|
transformer = TubeSymbolTransformer.class)
|
||||||
public class TriodeSymbol extends AbstractTubeSymbol {
|
public class TriodeSymbol extends AbstractTubeSymbol {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ import org.diylc.core.measures.SizeUnit;
|
|||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Tube Socket", author = "Branislav Stojkovic", category = "Tubes",
|
@ComponentDescriptor(name = "Tube Socket", author = "Branislav Stojkovic", category = "Tubes",
|
||||||
instanceNamePrefix = "V", description = "Various types of tube/valve sockets", stretchable = false,
|
instanceNamePrefix = "V", description = "Various types of tube/valve sockets",
|
||||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE)
|
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE)
|
||||||
public class TubeSocket extends AbstractTransparentComponent<String> {
|
public class TubeSocket extends AbstractTransparentComponent<String> {
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -2632,7 +2632,11 @@
|
|||||||
<changes>
|
<changes>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>NEW_FEATURE</changeType>
|
<changeType>NEW_FEATURE</changeType>
|
||||||
<description>Added an optional third control point to leaded components that can be used to set component label position. This feature is off by default to keep things backwards compatible and is driven by "Movable Label" property</description>
|
<description>Added an optional third control point to leaded components and some schematic symbols that can be used to set component label position. This feature is off by default to keep things backwards compatible and is driven by "Movable Label" property</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>Ability to show labels for standing components and control the position</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
|||||||
Reference in New Issue
Block a user