minor changes

This commit is contained in:
hneemann 2016-03-20 22:47:33 +01:00
parent ccc588735c
commit 1bdd340aa6
4 changed files with 13 additions and 5 deletions

View File

@ -79,8 +79,10 @@ public class Circuit implements Drawable {
if (w.p2.inside(min, max))
m.add(w.p2);
}
return m;
if (m.isEmpty())
return null;
else
return m;
}
public ArrayList<Moveable> getElementsToCopy(Vector min, Vector max) {
@ -93,7 +95,10 @@ public class Circuit implements Drawable {
if (w.p1.inside(min, max) && w.p2.inside(min, max))
m.add(new Wire(w));
return m;
if (m.isEmpty())
return null;
else
return m;
}

View File

@ -26,6 +26,9 @@ public class GraphicSwing implements Graphic {
java.awt.Polygon poly = new java.awt.Polygon();
for (Vector v : p.getPoints())
poly.addPoint(v.x, v.y);
if (style.isFilled())
gr.fill(poly);
gr.draw(poly);
}

View File

@ -38,12 +38,12 @@ public class PartLibrary implements Iterable<PartLibrary.PartContainer> {
add(Delay.DESCRIPTION, "Logic");
add(In.DESCRIPTION, "IO");
add(Const.DESCRIPTION, "IO");
add(Out.DESCRIPTION, "IO");
add(Out.LEDDESCRIPTION, "IO");
add(Out.PROBEDESCRIPTION, "IO");
add(Splitter.DESCRIPTION, "Wires");
add(Const.DESCRIPTION, "Wires");
add(RS_FF.DESCRIPTION, "FlipFlops");
add(JK_FF.DESCRIPTION, "FlipFlops");

View File

@ -57,6 +57,6 @@ public class SplitterShape implements Shape {
.add(2, 0)
.add(SIZE - 2, 0)
.add(SIZE - 2, length)
.add(2, length), Style.NORMAL);
.add(2, length), Style.FILLED);
}
}