mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
v1 pot and label import bug
This commit is contained in:
Binary file not shown.
+5
-1
@@ -1,5 +1,9 @@
|
|||||||
package org.diylc.common;
|
package org.diylc.common;
|
||||||
|
|
||||||
public enum HorizontalAlignment {
|
public enum HorizontalAlignment {
|
||||||
LEFT, CENTER, RIGHT
|
LEFT, CENTER, RIGHT;
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return name().substring(0, 1) + name().substring(1).toLowerCase();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -1,5 +1,9 @@
|
|||||||
package org.diylc.common;
|
package org.diylc.common;
|
||||||
|
|
||||||
public enum VerticalAlignment {
|
public enum VerticalAlignment {
|
||||||
TOP, CENTER, BOTTOM
|
TOP, CENTER, BOTTOM;
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return name().substring(0, 1) + name().substring(1).toLowerCase();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-3
@@ -24,7 +24,9 @@ import org.apache.log4j.Logger;
|
|||||||
import org.diylc.appframework.simplemq.MessageDispatcher;
|
import org.diylc.appframework.simplemq.MessageDispatcher;
|
||||||
import org.diylc.common.Display;
|
import org.diylc.common.Display;
|
||||||
import org.diylc.common.EventType;
|
import org.diylc.common.EventType;
|
||||||
|
import org.diylc.common.HorizontalAlignment;
|
||||||
import org.diylc.common.Orientation;
|
import org.diylc.common.Orientation;
|
||||||
|
import org.diylc.common.VerticalAlignment;
|
||||||
import org.diylc.components.AbstractLeadedComponent;
|
import org.diylc.components.AbstractLeadedComponent;
|
||||||
import org.diylc.components.AbstractTransparentComponent;
|
import org.diylc.components.AbstractTransparentComponent;
|
||||||
import org.diylc.components.boards.AbstractBoard;
|
import org.diylc.components.boards.AbstractBoard;
|
||||||
@@ -247,9 +249,10 @@ public class ProjectFileManager {
|
|||||||
label.setColor(color);
|
label.setColor(color);
|
||||||
}
|
}
|
||||||
label.setText(valueAttr);
|
label.setText(valueAttr);
|
||||||
label.setCenter(false);
|
label.setHorizontalAlignment(HorizontalAlignment.LEFT);
|
||||||
|
label.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
label.setControlPoint(convertV1CoordinatesToV3Point(referencePoint, x1Attr,
|
label.setControlPoint(convertV1CoordinatesToV3Point(referencePoint, x1Attr,
|
||||||
y1Attr + 1), 0);
|
y1Attr), 0);
|
||||||
component = label;
|
component = label;
|
||||||
} else if (nodeName.equalsIgnoreCase("pad")) {
|
} else if (nodeName.equalsIgnoreCase("pad")) {
|
||||||
LOG.debug("Recognized " + nodeName);
|
LOG.debug("Recognized " + nodeName);
|
||||||
@@ -431,7 +434,7 @@ public class ProjectFileManager {
|
|||||||
pot.setSpacing(new Size(0.2, SizeUnit.in));
|
pot.setSpacing(new Size(0.2, SizeUnit.in));
|
||||||
pot.setName(nameAttr);
|
pot.setName(nameAttr);
|
||||||
try {
|
try {
|
||||||
pot.setResistance(Resistance.parseResistance(valueAttr));
|
pot.setValue(Resistance.parseResistance(valueAttr));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.debug("Could not set value of " + nameAttr);
|
LOG.debug("Could not set value of " + nameAttr);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user