[virtualcommons-svn] SF.net SVN: virtualcommons:[480] foraging/trunk/src/main/java/edu/asu/ common
Status: Beta
Brought to you by:
alllee
From: <db...@us...> - 2010-03-03 07:07:38
|
Revision: 480 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=480&view=rev Author: dbarge Date: 2010-03-03 07:07:30 +0000 (Wed, 03 Mar 2010) Log Message: ----------- This code version has 2 changes 1) Added a function call setClip() in order to clip the part of the field of vision circle that crossed the playing boundary. 2) Changed the RGB values (Color) of the field of vision so as to make it more bright and is more easy to visualize. Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/SubjectView.java Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/SubjectView.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/SubjectView.java 2010-03-02 23:03:47 UTC (rev 479) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/SubjectView.java 2010-03-03 07:07:30 UTC (rev 480) @@ -3,6 +3,7 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.FontMetrics; +import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Paint; import java.awt.Point; @@ -39,7 +40,7 @@ private final ClientDataModel dataModel; - public final static Color FIELD_OF_VISION_COLOR = new Color(192, 192, 192, 30); + public final static Color FIELD_OF_VISION_COLOR = new Color(255, 255, 255, 30); // associates a Duration with a piece of token consumed at the given Point - // the duration is used to render the token as shrinking. @@ -136,7 +137,10 @@ int y = scaleY(topLeftCorner.y); int diameter = (int) radius * 2; diameter = Math.min(scaleX(diameter), scaleY(diameter)); - Ellipse2D.Double circle = new Ellipse2D.Double(x, y, diameter, diameter); + Ellipse2D.Double circle = new Ellipse2D.Double(x, y, diameter, diameter); + //graphics2D.fillOval(x, y, diameter, diameter); + // clip the rendered part of the Field of vision circle that crosses the playing boundary + graphics2D.setClip(circle); graphics2D.fill(circle); graphics2D.setPaint(originalPaint); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |