summaryrefslogtreecommitdiff
path: root/src/graphyx/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphyx/graphics')
-rw-r--r--src/graphyx/graphics/Drawable.scala2
-rw-r--r--src/graphyx/graphics/GraphicalRectangle.scala2
-rw-r--r--src/graphyx/graphics/GraphicalRegularPolygon.scala3
-rw-r--r--src/graphyx/graphics/GraphicalWorld.scala11
4 files changed, 13 insertions, 5 deletions
diff --git a/src/graphyx/graphics/Drawable.scala b/src/graphyx/graphics/Drawable.scala
index fefd97d..07f3491 100644
--- a/src/graphyx/graphics/Drawable.scala
+++ b/src/graphyx/graphics/Drawable.scala
@@ -13,7 +13,7 @@ import sims.geometry._
trait Drawable {
/**Java Graphics Objekt zur graphischen Darstellung*/
- var g: java.awt.Graphics = _
+ var g: java.awt.Graphics2D = _
/**Anzahl von Pixeln pro Meter.*/
var ppm: Double = 39.37007874015748 * 96 //ppm = i/m * p/i
diff --git a/src/graphyx/graphics/GraphicalRectangle.scala b/src/graphyx/graphics/GraphicalRectangle.scala
index d3774bb..ae65c5e 100644
--- a/src/graphyx/graphics/GraphicalRectangle.scala
+++ b/src/graphyx/graphics/GraphicalRectangle.scala
@@ -15,4 +15,4 @@ case class GraphicalRectangle(real: Rectangle) extends Rectangle(real.halfWidth,
g.setColor(java.awt.Color.BLACK)
drawPolygon(vertices)
}
-}
+} \ No newline at end of file
diff --git a/src/graphyx/graphics/GraphicalRegularPolygon.scala b/src/graphyx/graphics/GraphicalRegularPolygon.scala
index 919b857..a3906c3 100644
--- a/src/graphyx/graphics/GraphicalRegularPolygon.scala
+++ b/src/graphyx/graphics/GraphicalRegularPolygon.scala
@@ -16,5 +16,4 @@ case class GraphicalRegularPolygon(real: RegularPolygon) extends RegularPolygon(
g.setColor(java.awt.Color.BLACK)
drawPolygon(vertices)
}
-
-}
+} \ No newline at end of file
diff --git a/src/graphyx/graphics/GraphicalWorld.scala b/src/graphyx/graphics/GraphicalWorld.scala
index 2837d69..abc9cbb 100644
--- a/src/graphyx/graphics/GraphicalWorld.scala
+++ b/src/graphyx/graphics/GraphicalWorld.scala
@@ -13,7 +13,16 @@ case class GraphicalWorld(real: World){
val iterations = real.iterations
val overCWarning = real.overCWarning
val gravity = real.gravity
- val monitorResults = for (b <- real.bodies; m <- real.monitors; if (b.monitor)) yield "b" + b.uid.toString + " " + m._1 + ": " + m._2(b)
+ val monitorResults = for (m <- real.monitors) yield
+ new MonitorResult(m,
+ for (b <- real.bodies.toList; if (b.monitor)) yield (b.uid, m._1, m._2(b))
+ )
+ val monitorFlatResults = for (b <- real.bodies; m <- real.monitors; if (b.monitor)) yield (b.uid, m._1, m._2(b))
val enableCollisionDetection = real.enableCollisionDetection
val enablePositionCorrection = real.enablePositionCorrection
}
+
+class MonitorResult (
+ val monitor: (String, Body => Any),
+ val results: List[(Int, String, Any)]
+)