mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Cleaner XML format for .DIY files with less cross-references
pinout update
This commit is contained in:
@@ -294,7 +294,7 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSectionName(int pointIndex) {
|
||||
public String[] getSectionNames(int pointIndex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,10 +131,11 @@ public interface IDIYComponent<T> extends Serializable {
|
||||
String getInternalLinkName(int index1, int index2);
|
||||
|
||||
/**
|
||||
* @param pointIndex name of the internal section containing the specified point, or null if the component does not have internal sections.
|
||||
* @param pointIndex name of the internal section containing the specified point, or null if the component does not have internal sections.
|
||||
* One point can be shared between multiple sections, in which case, the result may contain more than one element.
|
||||
* @return
|
||||
*/
|
||||
String getSectionName(int pointIndex);
|
||||
String[] getSectionNames(int pointIndex);
|
||||
|
||||
/**
|
||||
* Draws the component onto the {@link Graphics2D}.
|
||||
|
||||
@@ -48,8 +48,8 @@ public class Node implements Comparable<Node> {
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
String section = component.getSectionName(pointIndex);
|
||||
return (section == null ? "" : section + ".") + component.getControlPointNodeName(pointIndex);
|
||||
String[] section = component.getSectionNames(pointIndex);
|
||||
return (section == null || section.length > 1 ? "" : section[0] + ".") + component.getControlPointNodeName(pointIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
package org.diylc.presenter;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -92,7 +93,16 @@ public class ProjectFileManager {
|
||||
}
|
||||
};
|
||||
xStream.autodetectAnnotations(true);
|
||||
xStream.registerConverter(new PointConverter());
|
||||
xStream.registerConverter(new PointConverter());
|
||||
xStream.addImmutableType(Color.class);
|
||||
xStream.addImmutableType(java.awt.Point.class);
|
||||
xStream.addImmutableType(org.diylc.core.measures.Voltage.class);
|
||||
xStream.addImmutableType(org.diylc.core.measures.Resistance.class);
|
||||
xStream.addImmutableType(org.diylc.core.measures.Capacitance.class);
|
||||
xStream.addImmutableType(org.diylc.core.measures.Current.class);
|
||||
xStream.addImmutableType(org.diylc.core.measures.Power.class);
|
||||
xStream.addImmutableType(org.diylc.core.measures.Inductance.class);
|
||||
xStream.addImmutableType(org.diylc.core.measures.Size.class);
|
||||
this.xStreamOld = new XStream(new DomDriver());
|
||||
xStreamOld.autodetectAnnotations(true);
|
||||
this.messageDispatcher = messageDispatcher;
|
||||
|
||||
Reference in New Issue
Block a user