summaryrefslogtreecommitdiff
path: root/src/graphyx/graphics/GraphicalRegularPolygon.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphyx/graphics/GraphicalRegularPolygon.scala')
-rw-r--r--src/graphyx/graphics/GraphicalRegularPolygon.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/graphyx/graphics/GraphicalRegularPolygon.scala b/src/graphyx/graphics/GraphicalRegularPolygon.scala
new file mode 100644
index 0000000..919b857
--- /dev/null
+++ b/src/graphyx/graphics/GraphicalRegularPolygon.scala
@@ -0,0 +1,20 @@
+/*
+ * Graphyx
+ * copyright (c) 2009 Jakob Odersky
+ * made available under the MIT License
+*/
+
+package graphyx.graphics
+
+import sims._
+import geometry._
+import dynamics._
+case class GraphicalRegularPolygon(real: RegularPolygon) extends RegularPolygon(real.n, real.radius, real.density) with GraphicalShape{
+ override def draw() = {
+ g.setColor(java.awt.Color.orange)
+ fillPolygon(vertices)
+ g.setColor(java.awt.Color.BLACK)
+ drawPolygon(vertices)
+ }
+
+}