|
@@ -13,6 +13,7 @@ public class Model extends Observable
|
|
|
private Color curColour;
|
|
|
private int curThiccness;
|
|
|
private int totalLen;
|
|
|
+ private int totalVisibleLen;
|
|
|
public Color sideColour;
|
|
|
public Color controlColour;
|
|
|
|
|
@@ -24,6 +25,7 @@ public class Model extends Observable
|
|
|
this.curColour = Color.black;
|
|
|
this.curThiccness = 5;
|
|
|
this.totalLen = 0;
|
|
|
+ this.totalVisibleLen = 0;
|
|
|
setChanged();
|
|
|
}
|
|
|
|
|
@@ -33,6 +35,7 @@ public class Model extends Observable
|
|
|
thingies.add(curThingy);
|
|
|
curThingy.addPoint(x, y);
|
|
|
totalLen++;
|
|
|
+ totalVisibleLen++:
|
|
|
setChanged();
|
|
|
notifyObservers();
|
|
|
}
|
|
@@ -41,6 +44,7 @@ public class Model extends Observable
|
|
|
{
|
|
|
curThingy.addPoint(x, y);
|
|
|
totalLen++;
|
|
|
+ totalVisibleLen++;
|
|
|
setChanged();
|
|
|
notifyObservers();
|
|
|
}
|
|
@@ -50,6 +54,11 @@ public class Model extends Observable
|
|
|
return totalLen;
|
|
|
}
|
|
|
|
|
|
+ public int getTotalVisibleLen()
|
|
|
+ {
|
|
|
+ return totalVisibleLen;
|
|
|
+ }
|
|
|
+
|
|
|
public ArrayList<Thingy> getThingies()
|
|
|
{
|
|
|
return thingies;
|
|
@@ -76,10 +85,12 @@ public class Model extends Observable
|
|
|
if (tempLen > x)
|
|
|
{
|
|
|
tempThingy.reduceLen();
|
|
|
+ totalVisibleLen--;
|
|
|
}
|
|
|
else // go forwards
|
|
|
{
|
|
|
tempThingy.increaseLen();
|
|
|
+ totalVisibleLen++;
|
|
|
}
|
|
|
setChanged();
|
|
|
notifyObservers();
|