mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12: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 double zOrder;
|
||||
private boolean flexibleZOrder;
|
||||
private boolean stretchable;
|
||||
private BomPolicy bomPolicy;
|
||||
private boolean autoEdit;
|
||||
private IComponentTransformer transformer;
|
||||
@@ -52,8 +51,8 @@ public class ComponentType {
|
||||
|
||||
public ComponentType(String name, String description, CreationMethod creationMethod, String category,
|
||||
String namePrefix, String author, Icon icon, Class<? extends IDIYComponent<?>> instanceClass, double zOrder,
|
||||
boolean flexibleZOrder, boolean stretchable, BomPolicy bomPolicy, boolean autoEdit,
|
||||
IComponentTransformer transformer, KeywordPolicy keywordPolicy, String keywordTag) {
|
||||
boolean flexibleZOrder, BomPolicy bomPolicy, boolean autoEdit, IComponentTransformer transformer,
|
||||
KeywordPolicy keywordPolicy, String keywordTag) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
@@ -65,7 +64,6 @@ public class ComponentType {
|
||||
this.instanceClass = instanceClass;
|
||||
this.zOrder = zOrder;
|
||||
this.flexibleZOrder = flexibleZOrder;
|
||||
this.stretchable = stretchable;
|
||||
this.bomPolicy = bomPolicy;
|
||||
this.autoEdit = autoEdit;
|
||||
this.transformer = transformer;
|
||||
@@ -113,10 +111,6 @@ public class ComponentType {
|
||||
return flexibleZOrder;
|
||||
}
|
||||
|
||||
public boolean isStretchable() {
|
||||
return stretchable;
|
||||
}
|
||||
|
||||
public BomPolicy getBomPolicy() {
|
||||
return bomPolicy;
|
||||
}
|
||||
|
||||
@@ -301,5 +301,10 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
|
||||
@Override
|
||||
public String getCommonPointName(int pointIndex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,13 @@ public interface IDIYComponent<T> extends Serializable {
|
||||
* @param pointIndex
|
||||
* @return name of the common point that joins all the other points with the same name together, e.g. GND
|
||||
*/
|
||||
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}.
|
||||
|
||||
@@ -82,12 +82,6 @@ public @interface ComponentDescriptor {
|
||||
*/
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -92,7 +92,6 @@ public class ComponentProcessor {
|
||||
Icon icon;
|
||||
double zOrder;
|
||||
boolean flexibleZOrder;
|
||||
boolean stretchable;
|
||||
BomPolicy bomPolicy;
|
||||
boolean autoEdit;
|
||||
IComponentTransformer transformer;
|
||||
@@ -108,7 +107,6 @@ public class ComponentProcessor {
|
||||
author = annotation.author();
|
||||
zOrder = annotation.zOrder();
|
||||
flexibleZOrder = annotation.flexibleZOrder();
|
||||
stretchable = annotation.stretchable();
|
||||
bomPolicy = annotation.bomPolicy();
|
||||
autoEdit = annotation.autoEdit();
|
||||
transformer = getComponentTransformer(annotation.transformer());
|
||||
@@ -135,7 +133,7 @@ public class ComponentProcessor {
|
||||
}
|
||||
ComponentType componentType =
|
||||
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);
|
||||
return componentType;
|
||||
}
|
||||
|
||||
@@ -62,10 +62,10 @@ public class InstantiationManager {
|
||||
private Point potentialControlPoint;
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
public InstantiationManager() {}
|
||||
|
||||
@@ -821,7 +821,6 @@ public class Presenter implements IPlugInPort {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void mouseMoved(Point point, boolean ctrlDown, boolean shiftDown, boolean altDown) {
|
||||
if (point == null)
|
||||
@@ -857,24 +856,15 @@ public class Presenter implements IPlugInPort {
|
||||
// Go backwards so we take the highest z-order components first.
|
||||
for (int i = currentProject.getComponents().size() - 1; i >= 0; 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++) {
|
||||
Point controlPoint = component.getControlPoint(pointIndex);
|
||||
// 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) {
|
||||
try {
|
||||
if (previousScaledPoint.distance(controlPoint) < DrawingManager.CONTROL_POINT_SIZE) {
|
||||
Set<Integer> indices = new HashSet<Integer>();
|
||||
if (componentType.isStretchable()) {
|
||||
indices.add(pointIndex);
|
||||
} else {
|
||||
for (int j = 0; j < component.getControlPointCount(); j++) {
|
||||
indices.add(j);
|
||||
}
|
||||
}
|
||||
components.put(component, indices);
|
||||
break;
|
||||
}
|
||||
@@ -1101,15 +1091,10 @@ public class Presenter implements IPlugInPort {
|
||||
*
|
||||
* @param controlPointMap
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void includeStuckComponents(Map<IDIYComponent<?>, Set<Integer>> controlPointMap) {
|
||||
int oldSize = controlPointMap.size();
|
||||
LOG.trace("Expanding selected component map");
|
||||
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
|
||||
// that matches with one of its control points.
|
||||
for (int i = 0; i < component.getControlPointCount(); i++) {
|
||||
@@ -1142,7 +1127,7 @@ public class Presenter implements IPlugInPort {
|
||||
// For stretchable components just add the
|
||||
// matching component. Otherwise, add all control
|
||||
// points.
|
||||
if (componentType.isStretchable()) {
|
||||
if (component.canPointMoveFreely(i)) {
|
||||
indices.add(i);
|
||||
} else {
|
||||
for (int k = 0; k < component.getControlPointCount(); k++) {
|
||||
|
||||
Binary file not shown.
@@ -57,16 +57,32 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
||||
public static Color COLOR = Color.black;
|
||||
|
||||
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 SymbolFlipping flip = SymbolFlipping.NONE;
|
||||
protected Display display = Display.NAME;
|
||||
transient protected Shape[] body;
|
||||
protected Orientation orientation = Orientation.DEFAULT;
|
||||
protected Orientation orientation = Orientation.DEFAULT;
|
||||
protected boolean moveLabel = false;
|
||||
|
||||
public Abstract3LegSymbol() {
|
||||
super();
|
||||
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
|
||||
@@ -95,7 +111,9 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
||||
applyOrientation(this.body);
|
||||
}
|
||||
|
||||
AffineTransform old = g2d.getTransform();
|
||||
AffineTransform old = g2d.getTransform();
|
||||
|
||||
Point[] controlPoints = getNewControlPoints();
|
||||
|
||||
if (this.flip == SymbolFlipping.Y) {
|
||||
g2d.translate(0, controlPoints[0].y);
|
||||
@@ -142,40 +160,47 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
||||
|
||||
FontMetrics fontMetrics = g2d.getFontMetrics();
|
||||
Rectangle2D textRect = fontMetrics.getStringBounds(label, g2d);
|
||||
Rectangle shapeRect = body[0].getBounds().union(body[1].getBounds()).union(body[2].getBounds());
|
||||
|
||||
drawCenteredText(g2d, label, getLabelX(shapeRect, textRect, fontMetrics, outlineMode),
|
||||
getLabelY(shapeRect, textRect, fontMetrics, outlineMode), flip == SymbolFlipping.X ? HorizontalAlignment.RIGHT
|
||||
: HorizontalAlignment.LEFT, VerticalAlignment.CENTER);
|
||||
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),
|
||||
getLabelY(shapeRect, textRect, fontMetrics, outlineMode), flip == SymbolFlipping.X ? HorizontalAlignment.RIGHT
|
||||
: HorizontalAlignment.LEFT, VerticalAlignment.CENTER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getControlPoint(int index) {
|
||||
return controlPoints[index];
|
||||
return getNewControlPoints()[index];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getControlPointCount() {
|
||||
return controlPoints.length;
|
||||
return getNewControlPoints().length;
|
||||
}
|
||||
|
||||
protected int getLabelX(Rectangle2D shapeRect, Rectangle2D textRect, FontMetrics fontMetrics, boolean outlineMode) {
|
||||
int f = flip == SymbolFlipping.X ? -1 : 1;
|
||||
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) {
|
||||
return controlPoints[0].y;
|
||||
return getNewControlPoints()[0].y;
|
||||
}
|
||||
|
||||
protected void updateControlPoints() {
|
||||
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
||||
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
||||
Point[] controlPoints = getNewControlPoints();
|
||||
// Update control points.
|
||||
int x = controlPoints[0].x;
|
||||
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].y = y - pinSpacing * 2;
|
||||
@@ -183,20 +208,22 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
||||
controlPoints[2].x = x + f * pinSpacing * 2;
|
||||
controlPoints[2].y = y + pinSpacing * 2;
|
||||
|
||||
controlPoints[3].x = x + f * (int) (PIN_SPACING.convertToPixels() * 1.5 + d);
|
||||
|
||||
if (getOrientation() != Orientation.DEFAULT)
|
||||
{
|
||||
Point first = this.controlPoints[0];
|
||||
Point first = controlPoints[0];
|
||||
double angle = Double.parseDouble(getOrientation().name().replace("_", ""));
|
||||
AffineTransform rotate = AffineTransform.getRotateInstance(Math.toRadians(angle), first.x, first.y);
|
||||
for (int i = 1; i < this.controlPoints.length; i++) {
|
||||
rotate.transform(this.controlPoints[i], this.controlPoints[i]);
|
||||
for (int i = 1; i < controlPoints.length; i++) {
|
||||
rotate.transform(controlPoints[i], controlPoints[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
|
||||
return VisibilityPolicy.WHEN_SELECTED;
|
||||
return index < 3 || getMoveLabel() ? VisibilityPolicy.WHEN_SELECTED : VisibilityPolicy.NEVER;
|
||||
}
|
||||
|
||||
@EditableProperty
|
||||
@@ -212,15 +239,20 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
||||
|
||||
@Override
|
||||
public boolean isControlPointSticky(int index) {
|
||||
return true;
|
||||
return index < 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setControlPoint(Point point, int index) {
|
||||
controlPoints[index].setLocation(point);
|
||||
getNewControlPoints()[index].setLocation(point);
|
||||
|
||||
// make sure we have a new drawing
|
||||
body = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return pointIndex == 3;
|
||||
}
|
||||
|
||||
@EditableProperty
|
||||
@@ -243,6 +275,15 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
||||
|
||||
public void setColor(Color color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@EditableProperty(name = "Moveable Label")
|
||||
public boolean getMoveLabel() {
|
||||
return moveLabel;
|
||||
}
|
||||
|
||||
public void setMoveLabel(boolean moveLabel) {
|
||||
this.moveLabel = moveLabel;
|
||||
}
|
||||
|
||||
@EditableProperty
|
||||
@@ -274,7 +315,7 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
||||
if (getOrientation() == Orientation.DEFAULT)
|
||||
return;
|
||||
|
||||
Point first = this.controlPoints[0];
|
||||
Point first = getNewControlPoints()[0];
|
||||
double angle = Double.parseDouble(getOrientation().name().replace("_", ""));
|
||||
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;
|
||||
|
||||
@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,
|
||||
keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME)
|
||||
public class Breadboard extends AbstractComponent<Void> {
|
||||
@@ -312,6 +312,11 @@ public class Breadboard extends AbstractComponent<Void> {
|
||||
@Override
|
||||
public int getControlPointCount() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class TerminalStrip extends AbstractTransparentComponent<String> implements IContinuity {
|
||||
|
||||
@@ -460,5 +460,10 @@ public class TerminalStrip extends AbstractTransparentComponent<String> implemen
|
||||
@Override
|
||||
public boolean arePointsConnected(int index1, int index2) {
|
||||
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;
|
||||
|
||||
@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)
|
||||
public class CutLine extends AbstractTransparentComponent<Void> {
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.diylc.core.measures.Size;
|
||||
import org.diylc.core.measures.SizeUnit;
|
||||
|
||||
@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)
|
||||
public class Dot extends AbstractComponent<Void> {
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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,
|
||||
keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = SimpleComponentTransformer.class)
|
||||
public class Eyelet extends AbstractComponent<String> {
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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,
|
||||
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "PCB", transformer = SimpleComponentTransformer.class)
|
||||
public class SolderPad extends AbstractComponent<Void> {
|
||||
|
||||
@@ -44,7 +44,7 @@ import org.diylc.utils.Constants;
|
||||
|
||||
@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",
|
||||
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)
|
||||
public class TraceCut extends AbstractComponent<Void> {
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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,
|
||||
keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = SimpleComponentTransformer.class)
|
||||
public class Turret extends AbstractComponent<String> {
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class BatterySnap9V extends AbstractTransparentComponent<String> {
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class CliffJack1_4 extends AbstractMultiPartComponent<String> {
|
||||
|
||||
@@ -337,5 +337,10 @@ public class CliffJack1_4 extends AbstractMultiPartComponent<String> {
|
||||
public void setOrientation(Orientation orientation) {
|
||||
this.orientation = orientation;
|
||||
updateControlPoints();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class ClosedJack1_4 extends AbstractMultiPartComponent<String> {
|
||||
|
||||
@@ -363,5 +363,10 @@ public class ClosedJack1_4 extends AbstractMultiPartComponent<String> {
|
||||
return "Ring";
|
||||
}
|
||||
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;
|
||||
|
||||
@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)
|
||||
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';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private String toBinary(int n) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
do {
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class FuseHolderPanel extends AbstractMultiPartComponent<String> {
|
||||
|
||||
@@ -69,7 +69,7 @@ public class FuseHolderPanel extends AbstractMultiPartComponent<String> {
|
||||
private static Color BORDER_COLOR = BODY_COLOR.darker();
|
||||
private static Color LABEL_COLOR = Color.white;
|
||||
|
||||
protected Point[] controlPoints = new Point[] {new Point(0, 0), new Point(0, 0)};
|
||||
protected Point[] controlPoints = new Point[] { new Point(0, 0), new Point(0, 0) };
|
||||
transient protected Area[] body;
|
||||
protected String name;
|
||||
protected String value = "";
|
||||
@@ -330,5 +330,10 @@ public class FuseHolderPanel extends AbstractMultiPartComponent<String> {
|
||||
|
||||
public void setLabelColor(Color 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;
|
||||
|
||||
@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)
|
||||
public class IECSocket extends AbstractMultiPartComponent<String> {
|
||||
|
||||
@@ -384,5 +384,10 @@ public class IECSocket extends AbstractMultiPartComponent<String> {
|
||||
|
||||
public void setBorderColor(Color 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",
|
||||
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> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -423,6 +423,11 @@ public class MiniRelay extends AbstractTransparentComponent<String> {
|
||||
updateControlPoints();
|
||||
// Invalidate body
|
||||
this.body = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static enum RelayType {
|
||||
|
||||
+6
-1
@@ -51,7 +51,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class MiniToggleSwitch extends AbstractTransparentComponent<ToggleSwitchType> implements ISwitch {
|
||||
|
||||
@@ -399,6 +399,11 @@ public class MiniToggleSwitch extends AbstractTransparentComponent<ToggleSwitchT
|
||||
// we don't want the switch to produce any nodes, it just makes connections
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPositionCount() {
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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")
|
||||
public class OpenJack1_4 extends AbstractMultiPartComponent<String> {
|
||||
|
||||
@@ -399,6 +399,11 @@ public class OpenJack1_4 extends AbstractMultiPartComponent<String> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public enum OpenJackType {
|
||||
|
||||
MONO, STEREO, SWITCHED;
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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")
|
||||
public class PilotLampHolder extends AbstractMultiPartComponent<String> {
|
||||
|
||||
@@ -404,6 +404,11 @@ public class PilotLampHolder extends AbstractMultiPartComponent<String> {
|
||||
body = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected double getTheta() {
|
||||
return Math.toRadians(getAngle());
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class PlasticDCJack extends AbstractMultiPartComponent<String> {
|
||||
|
||||
@@ -261,5 +261,10 @@ public class PlasticDCJack extends AbstractMultiPartComponent<String> {
|
||||
|
||||
public void setPolarity(DCPolarity 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;
|
||||
|
||||
@ComponentDescriptor(name = "RCA Jack", category = "Electro-Mechanical", author = "Branislav Stojkovic",
|
||||
description = "Panel mount RCA phono jack socket", stretchable = false,
|
||||
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "J")
|
||||
description = "Panel mount RCA phono jack socket", zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "J")
|
||||
public class RCAJack extends AbstractMultiPartComponent<String> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -319,5 +318,10 @@ public class RCAJack extends AbstractMultiPartComponent<String> {
|
||||
@Override
|
||||
public String getControlPointNodeName(int index) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@EditableProperty
|
||||
public Polarity getPolarity() {
|
||||
if (polarity == null)
|
||||
|
||||
@@ -49,7 +49,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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,
|
||||
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
||||
public class HumbuckerPickup extends AbstractGuitarPickup {
|
||||
|
||||
@@ -50,7 +50,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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,
|
||||
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
||||
public class JazzBassPickup extends AbstractSingleOrHumbuckerPickup {
|
||||
|
||||
@@ -51,7 +51,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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")
|
||||
public class LPSwitch extends AbstractTransparentComponent<String> implements ISwitch {
|
||||
|
||||
@@ -299,6 +299,11 @@ public class LPSwitch extends AbstractTransparentComponent<String> implements IS
|
||||
this.controlPoints[index].setLocation(point);
|
||||
// Invalidate the body
|
||||
body = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -53,7 +53,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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,
|
||||
keywordTag = "Guitar Wiring Diagram")
|
||||
public class LeverSwitch extends AbstractTransparentComponent<String> implements ISwitch {
|
||||
@@ -475,5 +475,10 @@ public class LeverSwitch extends AbstractTransparentComponent<String> implements
|
||||
return (index1 == 0 || index1 == 12 || index2 == 11 || index2 == 23) && index2 - index1 == position + 1;
|
||||
}
|
||||
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;
|
||||
|
||||
@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,
|
||||
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
||||
public class P90Pickup extends AbstractSingleOrHumbuckerPickup {
|
||||
|
||||
@@ -50,7 +50,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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,
|
||||
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
||||
public class PBassPickup extends AbstractSingleOrHumbuckerPickup {
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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,
|
||||
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram")
|
||||
public class SingleCoilPickup extends AbstractSingleOrHumbuckerPickup {
|
||||
|
||||
@@ -45,7 +45,7 @@ import org.diylc.utils.BomEntry;
|
||||
import org.diylc.utils.BomMaker;
|
||||
|
||||
@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)
|
||||
public class BOM extends AbstractComponent<Void> {
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.diylc.core.measures.Size;
|
||||
import org.diylc.core.measures.SizeUnit;
|
||||
|
||||
@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)
|
||||
public class GroundSymbol extends AbstractComponent<Void> {
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ import com.thoughtworks.xstream.annotations.XStreamConverter;
|
||||
|
||||
@ComponentDescriptor(name = "Image", author = "Branislav Stojkovic", category = "Misc",
|
||||
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> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -44,7 +44,7 @@ import org.diylc.core.annotations.EditableProperty;
|
||||
|
||||
@ComponentDescriptor(name = "Label", author = "Branislav Stojkovic", category = "Misc",
|
||||
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 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",
|
||||
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 static String DEFAULT_TEXT = "Double click to edit text";
|
||||
|
||||
@@ -57,7 +57,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class AudioTransformer extends AbstractMultiPartComponent<String> {
|
||||
|
||||
@@ -517,5 +517,10 @@ public class AudioTransformer extends AbstractMultiPartComponent<String> {
|
||||
public void setSecondaryCT(boolean secondaryCT) {
|
||||
this.secondaryCT = secondaryCT;
|
||||
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",
|
||||
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[]> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -515,5 +515,10 @@ public class MultiSectionCapacitor extends AbstractTransparentComponent<Capacita
|
||||
|
||||
public void setPinColor(Color 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",
|
||||
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)
|
||||
public class PotentiometerPanel extends AbstractPotentiometer {
|
||||
|
||||
@@ -468,6 +468,11 @@ public class PotentiometerPanel extends AbstractPotentiometer {
|
||||
return (index1 + 1) + "-" + (index2 + 1);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
|
||||
@@ -24,6 +24,7 @@ package org.diylc.components.passive;
|
||||
import java.awt.Color;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Point;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.Shape;
|
||||
import java.awt.geom.GeneralPath;
|
||||
@@ -36,7 +37,7 @@ import org.diylc.core.annotations.ComponentDescriptor;
|
||||
import org.diylc.core.annotations.KeywordPolicy;
|
||||
|
||||
@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")
|
||||
public class PotentiometerSymbol extends Abstract3LegSymbol {
|
||||
|
||||
@@ -47,7 +48,8 @@ public class PotentiometerSymbol extends Abstract3LegSymbol {
|
||||
}
|
||||
|
||||
public Shape[] getBody() {
|
||||
Shape[] body = new Shape[3];
|
||||
Shape[] body = new Shape[3];
|
||||
Point[] controlPoints = getNewControlPoints();
|
||||
int x = controlPoints[0].x;
|
||||
int y = controlPoints[0].y;
|
||||
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",
|
||||
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")
|
||||
public class TransformerCoil extends AbstractComponent<org.diylc.core.measures.Voltage> {
|
||||
|
||||
@@ -281,5 +281,10 @@ public class TransformerCoil extends AbstractComponent<org.diylc.core.measures.V
|
||||
|
||||
}
|
||||
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",
|
||||
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,
|
||||
creationMethod = CreationMethod.POINT_BY_POINT, keywordTag = "Schematic")
|
||||
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_TAG, creationMethod = CreationMethod.POINT_BY_POINT, keywordTag = "Schematic")
|
||||
public class TransformerCore extends AbstractComponent<Void> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -154,6 +153,10 @@ public class TransformerCore extends AbstractComponent<Void> {
|
||||
@Override
|
||||
public void setValue(Void value) {
|
||||
// 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",
|
||||
creationMethod = CreationMethod.SINGLE_CLICK, instanceNamePrefix = "VR",
|
||||
description = "Various types of board mounted trimmer potentiometers", zOrder = IDIYComponent.COMPONENT,
|
||||
stretchable = false)
|
||||
description = "Various types of board mounted trimmer potentiometers", zOrder = IDIYComponent.COMPONENT)
|
||||
public class TrimmerPotentiometer extends AbstractPotentiometer {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -529,6 +528,11 @@ public class TrimmerPotentiometer extends AbstractPotentiometer {
|
||||
updateControlPoints();
|
||||
body = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static enum TrimmerType {
|
||||
FLAT_SMALL("Horizontal Small 1"), FLAT_SMALL2("Horizontal Small 2"), FLAT_XSMALL("Horizontal X-Small"), FLAT_LARGE(
|
||||
|
||||
+5
@@ -196,4 +196,9 @@ public abstract class AbstractTransistorPackage extends AbstractTransparentCompo
|
||||
public void setPinout(TransistorPinout pinout) {
|
||||
this.pinout = pinout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
package org.diylc.components.semiconductors;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Point;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.Shape;
|
||||
import java.awt.geom.AffineTransform;
|
||||
@@ -36,7 +37,7 @@ import org.diylc.core.annotations.EditableProperty;
|
||||
import org.diylc.core.annotations.KeywordPolicy;
|
||||
|
||||
@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")
|
||||
public class BJTSymbol extends Abstract3LegSymbol {
|
||||
|
||||
@@ -45,7 +46,8 @@ public class BJTSymbol extends Abstract3LegSymbol {
|
||||
protected BJTPolarity polarity = BJTPolarity.NPN;
|
||||
|
||||
public Shape[] getBody() {
|
||||
Shape[] body = new Shape[3];
|
||||
Shape[] body = new Shape[3];
|
||||
Point[] controlPoints = getNewControlPoints();
|
||||
int x = controlPoints[0].x;
|
||||
int y = controlPoints[0].y;
|
||||
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
||||
|
||||
@@ -61,7 +61,7 @@ import org.diylc.core.measures.Voltage;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class BridgeRectifier extends AbstractTransparentComponent<String> {
|
||||
|
||||
@@ -661,6 +661,11 @@ public class BridgeRectifier extends AbstractTransparentComponent<String> {
|
||||
|
||||
public void setLabelOriantation(LabelOriantation labelOriantation) {
|
||||
this.labelOriantation = labelOriantation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static enum RectifierType {
|
||||
|
||||
@@ -56,7 +56,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class DIL_IC extends AbstractTransparentComponent<String> {
|
||||
|
||||
@@ -536,6 +536,11 @@ public class DIL_IC extends AbstractTransparentComponent<String> {
|
||||
|
||||
public void setDisplayNumbers(DisplayNumbers numbers) {
|
||||
this.displayNumbers = numbers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static enum PinCount {
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.awt.Shape;
|
||||
import java.awt.geom.Area;
|
||||
import java.awt.geom.GeneralPath;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
|
||||
import org.diylc.appframework.miscutils.ConfigurationManager;
|
||||
import org.diylc.common.Display;
|
||||
import org.diylc.common.HorizontalAlignment;
|
||||
@@ -53,7 +53,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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")
|
||||
public class ICSymbol extends AbstractTransparentComponent<String> {
|
||||
|
||||
@@ -295,5 +295,10 @@ public class ICSymbol extends AbstractTransparentComponent<String> {
|
||||
|
||||
public void setDisplay(Display display) {
|
||||
this.display = display;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,11 @@
|
||||
package org.diylc.components.semiconductors;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Point;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.Shape;
|
||||
import java.awt.geom.GeneralPath;
|
||||
|
||||
|
||||
import org.diylc.common.ObjectCache;
|
||||
import org.diylc.components.Abstract3LegSymbol;
|
||||
import org.diylc.core.IDIYComponent;
|
||||
@@ -34,7 +35,7 @@ import org.diylc.core.annotations.EditableProperty;
|
||||
import org.diylc.core.annotations.KeywordPolicy;
|
||||
|
||||
@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")
|
||||
public class JFETSymbol extends Abstract3LegSymbol {
|
||||
|
||||
@@ -43,7 +44,8 @@ public class JFETSymbol extends Abstract3LegSymbol {
|
||||
protected FETPolarity polarity = FETPolarity.NEGATIVE;
|
||||
|
||||
public Shape[] getBody() {
|
||||
Shape[] body = new Shape[3];
|
||||
Shape[] body = new Shape[3];
|
||||
Point[] controlPoints = getNewControlPoints();
|
||||
int x = controlPoints[0].x;
|
||||
int y = controlPoints[0].y;
|
||||
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
||||
|
||||
@@ -51,7 +51,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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")
|
||||
public class LogicGateSymbol extends AbstractTransparentComponent<String> {
|
||||
|
||||
@@ -317,6 +317,11 @@ public class LogicGateSymbol extends AbstractTransparentComponent<String> {
|
||||
public void setDisplay(Display display) {
|
||||
this.display = display;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public enum GateType {
|
||||
Buffer(false), Not(true), Or(false), And(false), Xor(false), Nor(true), Nand(true), Xnor(true);
|
||||
|
||||
@@ -22,10 +22,11 @@
|
||||
package org.diylc.components.semiconductors;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Point;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.Shape;
|
||||
import java.awt.geom.GeneralPath;
|
||||
|
||||
|
||||
import org.diylc.common.ObjectCache;
|
||||
import org.diylc.components.Abstract3LegSymbol;
|
||||
import org.diylc.core.IDIYComponent;
|
||||
@@ -34,7 +35,7 @@ import org.diylc.core.annotations.EditableProperty;
|
||||
import org.diylc.core.annotations.KeywordPolicy;
|
||||
|
||||
@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")
|
||||
public class MOSFETSymbol extends Abstract3LegSymbol {
|
||||
|
||||
@@ -43,7 +44,8 @@ public class MOSFETSymbol extends Abstract3LegSymbol {
|
||||
protected FETPolarity polarity = FETPolarity.NEGATIVE;
|
||||
|
||||
public Shape[] getBody() {
|
||||
Shape[] body = new Shape[3];
|
||||
Shape[] body = new Shape[3];
|
||||
Point[] controlPoints = getNewControlPoints();
|
||||
int x = controlPoints[0].x;
|
||||
int y = controlPoints[0].y;
|
||||
int pinSpacing = (int) PIN_SPACING.convertToPixels();
|
||||
|
||||
@@ -55,7 +55,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class SIL_IC extends AbstractTransparentComponent<String> {
|
||||
|
||||
@@ -143,6 +143,11 @@ public class SIL_IC extends AbstractTransparentComponent<String> {
|
||||
updateControlPoints();
|
||||
// Reset body shape;
|
||||
body = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@EditableProperty
|
||||
|
||||
@@ -51,7 +51,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class TransistorTO1 extends AbstractTransistorPackage {
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class TransistorTO220 extends AbstractTransistorPackage {
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class TransistorTO3 extends AbstractTransparentComponent<String> {
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class TransistorTO92 extends AbstractTransistorPackage {
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.awt.Rectangle;
|
||||
import java.awt.geom.Area;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.geom.RoundRectangle2D;
|
||||
|
||||
|
||||
import org.diylc.appframework.miscutils.ConfigurationManager;
|
||||
import org.diylc.common.Display;
|
||||
import org.diylc.common.IPlugInPort;
|
||||
@@ -405,6 +405,11 @@ public abstract class PassiveSMDComponent<T> extends AbstractTransparentComponen
|
||||
|
||||
public void setLabelColor(Color labelColor) {
|
||||
this.labelColor = labelColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static enum SMDSize {
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.diylc.core.annotations.PositiveMeasureValidator;
|
||||
import org.diylc.core.measures.Capacitance;
|
||||
|
||||
@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)
|
||||
public class SMDCapacitor extends PassiveSMDComponent<Capacitance> {
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.diylc.core.annotations.PositiveMeasureValidator;
|
||||
import org.diylc.core.measures.Resistance;
|
||||
|
||||
@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)
|
||||
public class SMDResistor extends PassiveSMDComponent<Resistance> {
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.geom.AffineTransform;
|
||||
|
||||
|
||||
import org.diylc.appframework.miscutils.ConfigurationManager;
|
||||
import org.diylc.common.Display;
|
||||
import org.diylc.common.HorizontalAlignment;
|
||||
@@ -296,5 +296,10 @@ public abstract class AbstractTubeSymbol extends AbstractComponent<String> {
|
||||
for (int i = 1; i < this.controlPoints.length; 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;
|
||||
|
||||
@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)
|
||||
public class DiodeSymbol extends AbstractTubeSymbol {
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.diylc.core.annotations.EditableProperty;
|
||||
import org.diylc.core.annotations.KeywordPolicy;
|
||||
|
||||
@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,
|
||||
transformer = TubeSymbolTransformer.class)
|
||||
public class PentodeSymbol extends AbstractTubeSymbol {
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.diylc.core.annotations.EditableProperty;
|
||||
import org.diylc.core.annotations.KeywordPolicy;
|
||||
|
||||
@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,
|
||||
transformer = TubeSymbolTransformer.class)
|
||||
public class TriodeSymbol extends AbstractTubeSymbol {
|
||||
|
||||
@@ -53,7 +53,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@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)
|
||||
public class TubeSocket extends AbstractTransparentComponent<String> {
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -2632,8 +2632,12 @@
|
||||
<changes>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<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>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Output SPICE node names in the "Nxxx" format</description>
|
||||
|
||||
Reference in New Issue
Block a user