v1 pot and label import bug

This commit is contained in:
bancika
2012-08-30 09:37:59 +00:00
parent 502186b1e3
commit cb547e40fb
4 changed files with 16 additions and 5 deletions
@@ -1,5 +1,9 @@
package org.diylc.common;
public enum HorizontalAlignment {
LEFT, CENTER, RIGHT
LEFT, CENTER, RIGHT;
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
}
}
@@ -1,5 +1,9 @@
package org.diylc.common;
public enum VerticalAlignment {
TOP, CENTER, BOTTOM
TOP, CENTER, BOTTOM;
public String toString() {
return name().substring(0, 1) + name().substring(1).toLowerCase();
}
}
@@ -24,7 +24,9 @@ import org.apache.log4j.Logger;
import org.diylc.appframework.simplemq.MessageDispatcher;
import org.diylc.common.Display;
import org.diylc.common.EventType;
import org.diylc.common.HorizontalAlignment;
import org.diylc.common.Orientation;
import org.diylc.common.VerticalAlignment;
import org.diylc.components.AbstractLeadedComponent;
import org.diylc.components.AbstractTransparentComponent;
import org.diylc.components.boards.AbstractBoard;
@@ -247,9 +249,10 @@ public class ProjectFileManager {
label.setColor(color);
}
label.setText(valueAttr);
label.setCenter(false);
label.setHorizontalAlignment(HorizontalAlignment.LEFT);
label.setVerticalAlignment(VerticalAlignment.CENTER);
label.setControlPoint(convertV1CoordinatesToV3Point(referencePoint, x1Attr,
y1Attr + 1), 0);
y1Attr), 0);
component = label;
} else if (nodeName.equalsIgnoreCase("pad")) {
LOG.debug("Recognized " + nodeName);
@@ -431,7 +434,7 @@ public class ProjectFileManager {
pot.setSpacing(new Size(0.2, SizeUnit.in));
pot.setName(nameAttr);
try {
pot.setResistance(Resistance.parseResistance(valueAttr));
pot.setValue(Resistance.parseResistance(valueAttr));
} catch (Exception e) {
LOG.debug("Could not set value of " + nameAttr);
}