mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
better netlist html format
This commit is contained in:
@@ -26,24 +26,24 @@ import java.util.Set;
|
||||
|
||||
public class Netlist {
|
||||
|
||||
private Set<Group> vertices = new HashSet<Group>();
|
||||
private Set<Group> groups = new HashSet<Group>();
|
||||
|
||||
public Netlist() {
|
||||
}
|
||||
|
||||
public Set<Group> getVertices() {
|
||||
return vertices;
|
||||
public Set<Group> getGroups() {
|
||||
return groups;
|
||||
}
|
||||
|
||||
public boolean verticesMatch(Netlist other) {
|
||||
return this.vertices.equals(other.vertices);
|
||||
return this.groups.equals(other.groups);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((vertices == null) ? 0 : vertices.hashCode());
|
||||
result = prime * result + ((groups == null) ? 0 : groups.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -56,10 +56,10 @@ public class Netlist {
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
Netlist other = (Netlist) obj;
|
||||
if (vertices == null) {
|
||||
if (other.vertices != null)
|
||||
if (groups == null) {
|
||||
if (other.groups != null)
|
||||
return false;
|
||||
} else if (!vertices.equals(other.vertices))
|
||||
} else if (!groups.equals(other.groups))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class Netlist {
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Group v : vertices) {
|
||||
for (Group v : groups) {
|
||||
sb.append("\t").append(v).append("\n");
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
@@ -2809,7 +2809,7 @@ public class Presenter implements IPlugInPort {
|
||||
checkGraphConnection(point2, point1, connections, continuityAreas, new boolean[connections.size()])) {
|
||||
boolean added = false;
|
||||
// add to an existing vertex if possible
|
||||
for (Group v :graph.getVertices())
|
||||
for (Group v :graph.getGroups())
|
||||
if (v.getNodes().contains(node1)) {
|
||||
v.getNodes().add(node2);
|
||||
added = true;
|
||||
@@ -2818,7 +2818,7 @@ public class Presenter implements IPlugInPort {
|
||||
added = true;
|
||||
}
|
||||
if (!added)
|
||||
graph.getVertices().add(new Group(node1, node2));
|
||||
graph.getGroups().add(new Group(node1, node2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ import org.diylc.core.measures.Nudge;
|
||||
import org.diylc.core.measures.Size;
|
||||
import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.images.IconLoader;
|
||||
import org.diylc.netlist.Group;
|
||||
import org.diylc.netlist.Netlist;
|
||||
import org.diylc.netlist.SwitchSetup;
|
||||
import org.diylc.presenter.Presenter;
|
||||
@@ -80,6 +81,8 @@ import org.diylc.swingframework.TextDialog;
|
||||
import org.diylc.swingframework.export.DrawingExporter;
|
||||
import org.diylc.utils.BomEntry;
|
||||
|
||||
import sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType;
|
||||
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import com.thoughtworks.xstream.io.xml.DomDriver;
|
||||
|
||||
@@ -1666,7 +1669,10 @@ public class ActionFactory {
|
||||
StringBuilder sb = new StringBuilder("<html><p style=\"font-family: " + new JLabel().getFont().getName() + "; font-size: 9px\">");
|
||||
for (Map.Entry<Netlist, List<SwitchSetup>> en : g.entrySet()) {
|
||||
sb.append("<b>").append(en.getValue()).append("</b><br>");
|
||||
sb.append(en.getKey()).append("<br><br>");
|
||||
for (Group v : en.getKey().getGroups()) {
|
||||
sb.append(v).append("<br>");
|
||||
}
|
||||
sb.append("<br>");
|
||||
}
|
||||
sb.append("</p></html>");
|
||||
new TextDialog(swingUI.getOwnerFrame().getRootPane(), sb.toString(), "Netlist", new Dimension(600, 480)).setVisible(true);
|
||||
|
||||
Reference in New Issue
Block a user