BOM and multi-edit doesn't work when there's a component without a value set

This commit is contained in:
bancika
2012-09-30 10:28:59 +00:00
parent 6087b39ccd
commit 4ddcea7bc7
17 changed files with 381 additions and 58 deletions
@@ -24,6 +24,8 @@ import org.diylc.core.annotations.BomPolicy;
import org.diylc.core.annotations.ComponentDescriptor; import org.diylc.core.annotations.ComponentDescriptor;
import org.diylc.core.annotations.EditableProperty; import org.diylc.core.annotations.EditableProperty;
import com.sun.corba.se.impl.ior.OldPOAObjectKeyTemplate;
/** /**
* Utility class with component processing methods. * Utility class with component processing methods.
* *
@@ -31,8 +33,7 @@ import org.diylc.core.annotations.EditableProperty;
*/ */
public class ComponentProcessor { public class ComponentProcessor {
private static final Logger LOG = Logger private static final Logger LOG = Logger.getLogger(ComponentProcessor.class);
.getLogger(ComponentProcessor.class);
private static ComponentProcessor instance; private static ComponentProcessor instance;
@@ -54,8 +55,7 @@ public class ComponentProcessor {
this.propertyValidatorCache = new HashMap<String, IPropertyValidator>(); this.propertyValidatorCache = new HashMap<String, IPropertyValidator>();
} }
public ComponentType extractComponentTypeFrom( public ComponentType extractComponentTypeFrom(Class<? extends IDIYComponent<?>> clazz) {
Class<? extends IDIYComponent<?>> clazz) {
if (componentTypeMap.containsKey(clazz.getName())) { if (componentTypeMap.containsKey(clazz.getName())) {
return componentTypeMap.get(clazz.getName()); return componentTypeMap.get(clazz.getName());
} }
@@ -72,8 +72,7 @@ public class ComponentProcessor {
BomPolicy bomPolicy; BomPolicy bomPolicy;
boolean autoEdit; boolean autoEdit;
if (clazz.isAnnotationPresent(ComponentDescriptor.class)) { if (clazz.isAnnotationPresent(ComponentDescriptor.class)) {
ComponentDescriptor annotation = clazz ComponentDescriptor annotation = clazz.getAnnotation(ComponentDescriptor.class);
.getAnnotation(ComponentDescriptor.class);
name = annotation.name(); name = annotation.name();
description = annotation.description(); description = annotation.description();
creationMethod = annotation.creationMethod(); creationMethod = annotation.creationMethod();
@@ -101,27 +100,24 @@ public class ComponentProcessor {
icon = null; icon = null;
// Draw component icon. // Draw component icon.
try { try {
IDIYComponent<?> componentInstance = (IDIYComponent<?>) clazz IDIYComponent<?> componentInstance = (IDIYComponent<?>) clazz.newInstance();
.newInstance(); Image image = new BufferedImage(Presenter.ICON_SIZE, Presenter.ICON_SIZE,
Image image = new BufferedImage(Presenter.ICON_SIZE,
Presenter.ICON_SIZE,
java.awt.image.BufferedImage.TYPE_INT_ARGB); java.awt.image.BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = (Graphics2D) image.getGraphics(); Graphics2D g2d = (Graphics2D) image.getGraphics();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, g2d
.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON); RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_RENDERING, g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
RenderingHints.VALUE_RENDER_QUALITY); // g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
// g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, // RenderingHints.VALUE_STROKE_PURE);
// RenderingHints.VALUE_STROKE_PURE); componentInstance.drawIcon(g2d, Presenter.ICON_SIZE, Presenter.ICON_SIZE);
componentInstance.drawIcon(g2d, Presenter.ICON_SIZE,
Presenter.ICON_SIZE);
icon = new ImageIcon(image); icon = new ImageIcon(image);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
ComponentType componentType = new ComponentType(name, description, ComponentType componentType = new ComponentType(name, description, creationMethod,
creationMethod, category, namePrefix, author, icon, clazz, category, namePrefix, author, icon, clazz, zOrder, flexibleZOrder, stretchable,
zOrder, flexibleZOrder, stretchable, bomPolicy, autoEdit); bomPolicy, autoEdit);
componentTypeMap.put(clazz.getName(), componentType); componentTypeMap.put(clazz.getName(), componentType);
return componentType; return componentType;
} }
@@ -142,8 +138,7 @@ public class ComponentProcessor {
try { try {
if (method.isAnnotationPresent(EditableProperty.class) if (method.isAnnotationPresent(EditableProperty.class)
&& !method.isAnnotationPresent(Deprecated.class)) { && !method.isAnnotationPresent(Deprecated.class)) {
EditableProperty annotation = method EditableProperty annotation = method.getAnnotation(EditableProperty.class);
.getAnnotation(EditableProperty.class);
String name; String name;
if (annotation.name().equals("")) { if (annotation.name().equals("")) {
name = method.getName().substring(3); name = method.getName().substring(3);
@@ -152,18 +147,16 @@ public class ComponentProcessor {
} }
IPropertyValidator validator = getPropertyValidator(annotation IPropertyValidator validator = getPropertyValidator(annotation
.validatorClass()); .validatorClass());
Method setter = clazz.getMethod("set" Method setter = clazz.getMethod("set" + method.getName().substring(3),
+ method.getName().substring(3), method method.getReturnType());
.getReturnType());
PropertyWrapper property = new PropertyWrapper(name, PropertyWrapper property = new PropertyWrapper(name,
method.getReturnType(), method.getName(), method.getReturnType(), method.getName(), setter.getName(),
setter.getName(), annotation.defaultable(), annotation.defaultable(), validator);
validator);
properties.add(property); properties.add(property);
} }
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
LOG.debug("No matching setter found for \"" LOG.debug("No matching setter found for \"" + method.getName()
+ method.getName() + "\". Skipping..."); + "\". Skipping...");
} }
} }
} }
@@ -205,8 +198,7 @@ public class ComponentProcessor {
} }
for (int i = 1; i < selectedComponents.size(); i++) { for (int i = 1; i < selectedComponents.size(); i++) {
IDIYComponent<?> component = selectedComponents.get(i); IDIYComponent<?> component = selectedComponents.get(i);
List<PropertyWrapper> newProperties = extractProperties(component List<PropertyWrapper> newProperties = extractProperties(component.getClass());
.getClass());
for (PropertyWrapper property : newProperties) { for (PropertyWrapper property : newProperties) {
property.readFrom(component); property.readFrom(component);
} }
@@ -215,15 +207,16 @@ public class ComponentProcessor {
// their values match. // their values match.
for (PropertyWrapper oldProperty : properties) { for (PropertyWrapper oldProperty : properties) {
if (newProperties.contains(oldProperty)) { if (newProperties.contains(oldProperty)) {
PropertyWrapper newProperty = newProperties PropertyWrapper newProperty = newProperties.get(newProperties
.get(newProperties.indexOf(oldProperty)); .indexOf(oldProperty));
if ((newProperty.getValue() != null && newProperty if (newProperty.getValue() != null && newProperty.getValue() != null) {
.getValue() == null) if (!newProperty.getValue().equals(oldProperty.getValue()))
|| !newProperty.getValue().equals(
oldProperty.getValue())) {
// Values don't match, so the property is not unique // Values don't match, so the property is not unique
// valued. // valued.
oldProperty.setUnique(false); oldProperty.setUnique(false);
} else if ((newProperty.getValue() == null && oldProperty.getValue() != null)
|| (newProperty.getValue() != null && oldProperty.getValue() == null)) {
oldProperty.setUnique(false);
} }
} }
} }
@@ -236,13 +229,11 @@ public class ComponentProcessor {
// } // }
// } // }
} }
Collections.sort(properties, ComparatorFactory.getInstance() Collections.sort(properties, ComparatorFactory.getInstance().getPropertyNameComparator());
.getPropertyNameComparator());
return properties; return properties;
} }
private IPropertyValidator getPropertyValidator( private IPropertyValidator getPropertyValidator(Class<? extends IPropertyValidator> clazz) {
Class<? extends IPropertyValidator> clazz) {
if (propertyValidatorCache.containsKey(clazz.getName())) { if (propertyValidatorCache.containsKey(clazz.getName())) {
return propertyValidatorCache.get(clazz.getName()); return propertyValidatorCache.get(clazz.getName());
} }
@@ -250,8 +241,7 @@ public class ComponentProcessor {
try { try {
validator = clazz.newInstance(); validator = clazz.newInstance();
} catch (Exception e) { } catch (Exception e) {
LOG.error("Could not instantiate validator for " + clazz.getName(), LOG.error("Could not instantiate validator for " + clazz.getName(), e);
e);
return null; return null;
} }
propertyValidatorCache.put(clazz.getName(), validator); propertyValidatorCache.put(clazz.getName(), validator);
@@ -63,7 +63,12 @@ public class BomMaker {
if (type.getBomPolicy() == BomPolicy.NEVER_SHOW) if (type.getBomPolicy() == BomPolicy.NEVER_SHOW)
continue; continue;
String name = component.getName(); String name = component.getName();
String value = component.getValueForDisplay(); String value;
try {
value = component.getValueForDisplay();
} catch (Exception e){
value = "<undefined>";
}
if ((name != null) && (value != null)) { if ((name != null) && (value != null)) {
String key = type.getName() + "|" + value; String key = type.getName() + "|" + value;
if (entryMap.containsKey(key)) { if (entryMap.containsKey(key)) {
@@ -0,0 +1,320 @@
//package org.diylc.components.guitar;
//
//import java.awt.AlphaComposite;
//import java.awt.Color;
//import java.awt.Composite;
//import java.awt.Graphics2D;
//import java.awt.Point;
//import java.awt.Shape;
//import java.awt.geom.AffineTransform;
//import java.awt.geom.Area;
//import java.awt.geom.Ellipse2D;
//import java.awt.geom.Rectangle2D;
//import java.awt.geom.RoundRectangle2D;
//
//import org.diylc.appframework.miscutils.ConfigurationManager;
//import org.diylc.common.IPlugInPort;
//import org.diylc.common.ObjectCache;
//import org.diylc.common.Orientation;
//import org.diylc.components.AbstractTransparentComponent;
//import org.diylc.core.ComponentState;
//import org.diylc.core.IDIYComponent;
//import org.diylc.core.IDrawingObserver;
//import org.diylc.core.Project;
//import org.diylc.core.Theme;
//import org.diylc.core.VisibilityPolicy;
//import org.diylc.core.annotations.ComponentDescriptor;
//import org.diylc.core.annotations.EditableProperty;
//import org.diylc.core.measures.Size;
//import org.diylc.core.measures.SizeUnit;
//import org.diylc.utils.Constants;
//
////@ComponentDescriptor(name = "Les Paul Switch", category = "Guitar", author = "Branislav Stojkovic", description = "Les Paul-style 3 position switch", stretchable = false, zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "SW")
//public class LPSwitch extends AbstractTransparentComponent<String> {
//
// private static final long serialVersionUID = 1L;
//
// private static Color BASE_COLOR = Color.lightGray;
// private static Color WAFER_COLOR = Color.decode("#CD8500");
//
// private static Size BASE_WIDTH = new Size(0.5d, SizeUnit.in);
// private static Size BASE_LENGTH = new Size(47.5d, SizeUnit.mm);
// private static Size WAFER_LENGTH = new Size(40d, SizeUnit.mm);
// private static Size WAFER_SPACING = new Size(7.62d, SizeUnit.mm);
// private static Size WAFER_THICKNESS = new Size(0.05d, SizeUnit.in);
// private static Size HOLE_SIZE = new Size(2d, SizeUnit.mm);
// private static Size HOLE_SPACING = new Size(41.2d, SizeUnit.mm);
// private static Size TERMINAL_LENGTH = new Size(3d, SizeUnit.mm);
// private static Size TERMINAL_SPACING = new Size(0.1d, SizeUnit.in);
// private static Size TERMINAL_THICKNESS = new Size(0.02d, SizeUnit.in);
//
// private String value = "";
// private Point[] controlPoints = new Point[] { new Point(0, 0), new Point(0, 0),
// new Point(0, 0), new Point(0, 0) };
// transient Shape[] body;
// private Orientation orientation = Orientation.DEFAULT;
//
// public LPSwitch() {
// super();
// updateControlPoints();
// }
//
// @Override
// public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode,
// Project project, IDrawingObserver drawingObserver) {
// Shape[] body = getBody();
//
// g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
// if (componentState != ComponentState.DRAGGING) {
// Composite oldComposite = g2d.getComposite();
// if (alpha < MAX_ALPHA) {
// g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha
// / MAX_ALPHA));
// }
// g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : BASE_COLOR);
// g2d.fill(body[0]);
// g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : WAFER_COLOR);
// g2d.fill(body[1]);
// g2d.setComposite(oldComposite);
// }
//
// Color finalBorderColor;
// if (outlineMode) {
// Theme theme = (Theme) ConfigurationManager.getInstance().readObject(
// IPlugInPort.THEME_KEY, Constants.DEFAULT_THEME);
// finalBorderColor = componentState == ComponentState.SELECTED
// || componentState == ComponentState.DRAGGING ? SELECTION_COLOR : theme
// .getOutlineColor();
// } else {
// finalBorderColor = componentState == ComponentState.SELECTED
// || componentState == ComponentState.DRAGGING ? SELECTION_COLOR : BASE_COLOR
// .darker();
// }
//
// g2d.setColor(finalBorderColor);
// g2d.draw(body[0]);
//
// if (outlineMode) {
// Theme theme = (Theme) ConfigurationManager.getInstance().readObject(
// IPlugInPort.THEME_KEY, Constants.DEFAULT_THEME);
// finalBorderColor = componentState == ComponentState.SELECTED
// || componentState == ComponentState.DRAGGING ? SELECTION_COLOR : theme
// .getOutlineColor();
// } else {
// finalBorderColor = componentState == ComponentState.SELECTED
// || componentState == ComponentState.DRAGGING ? SELECTION_COLOR : WAFER_COLOR
// .darker();
// }
//
// g2d.draw(body[1]);
//
// g2d.setColor(METAL_COLOR);
// g2d.fill(body[2]);
// g2d.setColor(METAL_COLOR.darker());
// g2d.draw(body[2]);
// }
//
// public Shape[] getBody() {
// if (body == null) {
// body = new Shape[3];
//
// int x = controlPoints[0].x;
// int y = controlPoints[0].y;
// int baseWidth = (int) BASE_WIDTH.convertToPixels();
// int baseLength = (int) BASE_LENGTH.convertToPixels();
// int holeSize = getClosestOdd(HOLE_SIZE.convertToPixels());
// int holeSpacing = (int) HOLE_SPACING.convertToPixels();
// int waferLength = (int) WAFER_LENGTH.convertToPixels();
// int waferSpacing = (int) WAFER_SPACING.convertToPixels();
// int waferThickness = (int) WAFER_THICKNESS.convertToPixels();
// int terminalSpacing = (int) TERMINAL_SPACING.convertToPixels();
// int terminalLength = getClosestOdd(TERMINAL_LENGTH.convertToPixels());
// int terminalWidth = getClosestOdd(TERMINAL_WIDTH.convertToPixels());
//
// int baseX = x - terminalLength / 2 - waferSpacing;
// int baseY = y
// - (baseLength - terminalSpacing * (type == LeverSwitchType.DP3T ? 7 : 12)) / 2;
// Area baseArea = new Area(new Rectangle2D.Double(baseX, baseY, baseWidth, baseLength));
// baseArea.subtract(new Area(new Ellipse2D.Double(baseX + baseWidth / 2 - holeSize / 2,
// baseY + (baseLength - holeSpacing) / 2 - holeSize / 2, holeSize, holeSize)));
// baseArea.subtract(new Area(new Ellipse2D.Double(baseX + baseWidth / 2 - holeSize / 2,
// baseY + (baseLength - holeSpacing) / 2 - holeSize / 2 + holeSpacing, holeSize,
// holeSize)));
// body[0] = baseArea;
//
// Area waferArea = new Area(new Rectangle2D.Double(x - terminalLength / 2
// - waferThickness / 2,
// y - (waferLength - terminalSpacing * (type == LeverSwitchType.DP3T ? 7 : 12))
// / 2, waferThickness, waferLength));
//
// if (type == LeverSwitchType._4P5T) {
// waferArea.add(new Area(new Rectangle2D.Double(x - terminalLength / 2
// - waferThickness / 2 + waferSpacing, y
// - (waferLength - terminalSpacing * (type == LeverSwitchType.DP3T ? 7 : 12))
// / 2, waferThickness, waferLength)));
// }
// body[1] = waferArea;
//
// double theta = 0;
// // Rotate if needed
// if (orientation != Orientation.DEFAULT) {
// switch (orientation) {
// case _90:
// theta = Math.PI / 2;
// break;
// case _180:
// theta = Math.PI;
// break;
// case _270:
// theta = Math.PI * 3 / 2;
// break;
// }
// }
//
// Area terminalArea = new Area();
// for (Point point : controlPoints) {
// Area terminal = new Area(new RoundRectangle2D.Double(point.x - terminalLength / 2,
// point.y - terminalWidth / 2, terminalLength, terminalWidth,
// terminalWidth / 2, terminalWidth / 2));
// terminal.subtract(new Area(
// new RoundRectangle2D.Double(point.x - terminalLength / 4, point.y
// - terminalWidth / 4, terminalLength / 2, terminalWidth / 2,
// terminalWidth / 2, terminalWidth / 2)));
// // Rotate the terminal if needed
// if (theta != 0) {
// AffineTransform rotation = AffineTransform.getRotateInstance(theta, point.x,
// point.y);
// terminal.transform(rotation);
// }
// terminalArea.add(terminal);
// }
// body[2] = terminalArea;
//
// // Rotate if needed
// if (theta != 0) {
// AffineTransform rotation = AffineTransform.getRotateInstance(theta, x, y);
// // Skip the last one because it's already rotated
// for (int i = 0; i < body.length - 1; i++) {
// Shape shape = body[i];
// Area area = (Area) shape;
// area.transform(rotation);
// }
// }
// }
// return body;
// }
//
// private void updateControlPoints() {
// int x = controlPoints[0].x;
// int y = controlPoints[0].y;
// int terminalSpacing = (int) TERMINAL_SPACING.convertToPixels();
// int baseLength = (int) BASE_LENGTH.convertToPixels();
//
// controlPoints[1].setLocation(x - terminalSpacing * 2 - baseLength, y - terminalSpacing);
// controlPoints[2].setLocation(x - terminalSpacing * 2 - baseLength, y);
// controlPoints[3].setLocation(x - terminalSpacing * 2 - baseLength, y);
//
// // Rotate if needed
// if (orientation != Orientation.DEFAULT) {
// double theta = 0;
// switch (orientation) {
// case _90:
// theta = Math.PI / 2;
// break;
// case _180:
// theta = Math.PI;
// break;
// case _270:
// theta = Math.PI * 3 / 2;
// break;
// }
// AffineTransform rotation = AffineTransform.getRotateInstance(theta, x, y);
// for (Point point : controlPoints) {
// rotation.transform(point, point);
// }
// }
// }
//
// @Override
// public void drawIcon(Graphics2D g2d, int width, int height) {
// g2d.setClip(width / 32, width / 32, width, height);
// g2d.setColor(BASE_COLOR);
// g2d.fillRect(0, 0, width * 2 / 3, height);
// g2d.setColor(BASE_COLOR.darker());
// g2d.drawRect(0, 0, width * 2 / 3, height);
// g2d.setColor(WAFER_COLOR);
// g2d.fillRect(width / 8 * 3, 0, width / 8, height);
// g2d.setColor(WAFER_COLOR.darker());
// g2d.drawRect(width / 8 * 3, 0, width / 8, height);
// Area terminals = new Area();
// int terminalLength = getClosestOdd(11 * width / 32);
// int terminalWidth = getClosestOdd(7 * width / 32);
// Area terminal = new Area(new RoundRectangle2D.Double(width / 16 * 7, 4 * width / 32,
// terminalLength, terminalWidth, terminalWidth / 2, terminalWidth / 2));
// terminal.subtract(new Area(new RoundRectangle2D.Double(width / 16 * 7 + terminalLength / 4
// + 1, 4 * width / 32 + terminalWidth / 4 + 1, terminalLength / 2, terminalWidth / 2,
// terminalWidth / 4, terminalWidth / 4)));
// terminals.add(terminal);
// terminal = new Area(terminal);
// terminal.transform(AffineTransform.getTranslateInstance(-terminalLength, terminalWidth + 2
// * width / 32));
// terminals.add(terminal);
// terminal = new Area(terminal);
// terminal.transform(AffineTransform.getTranslateInstance(terminalLength, terminalWidth + 2
// * width / 32));
// terminals.add(terminal);
// g2d.setColor(METAL_COLOR);
// g2d.fill(terminals);
// g2d.setColor(METAL_COLOR.darker());
// g2d.draw(terminals);
// }
//
// @Override
// public int getControlPointCount() {
// return controlPoints.length;
// }
//
// @Override
// public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
// return VisibilityPolicy.NEVER;
// }
//
// @Override
// public boolean isControlPointSticky(int index) {
// return true;
// }
//
// @Override
// public Point getControlPoint(int index) {
// return controlPoints[index];
// }
//
// @Override
// public void setControlPoint(Point point, int index) {
// this.controlPoints[index].setLocation(point);
// // Invalidate the body
// body = null;
// }
//
// @Override
// public String getValue() {
// return value;
// }
//
// @Override
// public void setValue(String value) {
// this.value = value;
// }
//
// @EditableProperty
// public Orientation getOrientation() {
// return orientation;
// }
//
// public void setOrientation(Orientation orientation) {
// this.orientation = orientation;
// updateControlPoints();
// // Invalidate the body
// body = null;
// }
//}
@@ -59,7 +59,7 @@ public class AxialElectrolyticCapacitor extends
@Override @Override
public String getValueForDisplay() { public String getValueForDisplay() {
return getValue().toString() + " " + getVoltageNew().toString(); return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
} }
@Deprecated @Deprecated
@@ -62,7 +62,7 @@ public class AxialFilmCapacitor extends AbstractLeadedComponent<Capacitance> {
@Override @Override
public String getValueForDisplay() { public String getValueForDisplay() {
return getValue().toString() + " " + getVoltageNew().toString(); return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
} }
@EditableProperty(name = "Voltage") @EditableProperty(name = "Voltage")
@@ -39,7 +39,7 @@ public class CapacitorSymbol extends AbstractSchematicLeadedSymbol<Capacitance>
@Override @Override
public String getValueForDisplay() { public String getValueForDisplay() {
return getValue().toString() + " " + getVoltageNew().toString(); return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
} }
@Deprecated @Deprecated
@@ -58,7 +58,7 @@ public class InductorSymbol extends AbstractSchematicLeadedSymbol<Inductance> {
@Override @Override
public String getValueForDisplay() { public String getValueForDisplay() {
return getValue().toString() + " " + getCurrent().toString(); return getValue().toString() + (getCurrent() == null ? "" : " " + getCurrent().toString());
} }
public void drawIcon(Graphics2D g2d, int width, int height) { public void drawIcon(Graphics2D g2d, int width, int height) {
@@ -47,7 +47,7 @@ public class RadialCeramicDiskCapacitor extends AbstractRadialComponent<Capacita
@Override @Override
public String getValueForDisplay() { public String getValueForDisplay() {
return getValue().toString() + " " + getVoltageNew().toString(); return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
} }
@EditableProperty(name = "Voltage") @EditableProperty(name = "Voltage")
@@ -65,7 +65,7 @@ public class RadialElectrolytic extends AbstractRadialComponent<Capacitance> {
@Override @Override
public String getValueForDisplay() { public String getValueForDisplay() {
return getValue().toString() + " " + getVoltageNew().toString(); return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
} }
@Deprecated @Deprecated
@@ -47,7 +47,7 @@ public class RadialFilmCapacitor extends AbstractRadialComponent<Capacitance> {
@Override @Override
public String getValueForDisplay() { public String getValueForDisplay() {
return getValue().toString() + " " + getVoltageNew().toString(); return getValue().toString() + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString());
} }
@Deprecated @Deprecated
@@ -57,7 +57,7 @@ public class Resistor extends AbstractLeadedComponent<Resistance> {
@Override @Override
public String getValueForDisplay() { public String getValueForDisplay() {
return getValue().toString() + " " + getPowerNew().toString(); return getValue().toString() + (getPowerNew() == null ? "" : " " + getPowerNew().toString());
} }
@Deprecated @Deprecated
@@ -39,7 +39,7 @@ public class ResistorSymbol extends AbstractSchematicLeadedSymbol<Resistance> {
@Override @Override
public String getValueForDisplay() { public String getValueForDisplay() {
return getValue().toString() + " " + getPowerNew().toString(); return getValue().toString() + (getPowerNew() == null ? "" : " " + getPowerNew().toString());
} }
@Deprecated @Deprecated
@@ -990,6 +990,14 @@
<releaseDate>2012-09-24 20:00:00.000 CET</releaseDate> <releaseDate>2012-09-24 20:00:00.000 CET</releaseDate>
<name></name> <name></name>
<changes> <changes>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>BOM doesn't work when there's a component without a value set</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>Editing multiple components doesn't work there's a component without a value set</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType> <changeType>NEW_FEATURE</changeType>
<description>Diode symbol</description> <description>Diode symbol</description>