Print

Print


Following from below, to get an idea of what I try to do, see here: http://object-field.blogspot.com/

Vlasios
On 23 Nov 2010, at 23:12, vlasios voudouris <[log in to unmask]> wrote:

> Hi mark,
> 
> Good luck with the PhD viva. 
> 
> I got GeoMason from the Google Code Subversion. 
> 
>> From what I can infer you're trying to dynamically render
>> the color for each geometry based on looking up some real value from
>> an agent?
> 
> Yes. What I  do is  to updated the  color of the geometry using some real value from a matching agent (note my agents are the world countries therefore therefore there is a one-to-one mapping between agents and geometry. )
> 
> Now, the code works which means that the map is updated but I have to click on the map (it seems that my clicking on the map the repaint method is invoked). What I fail to do is to make the update automatically. 
> 
> The question is how can I force the display to update the color of the geometry by calling the public void draw(Object object, Graphics2D graphics, DrawInfo2D info) at the end of each simulation? 
>  
>   public void draw(Object object, Graphics2D graphics, DrawInfo2D info)
>     {
>     	
>     	MasonGeometry gm= (MasonGeometry)	object;
>     	ArrayList<AttributeField> arrayL= (ArrayList<AttributeField>)gm.geometry.getUserData();
>     	Iterator itr= arrayL.iterator();
>     	AttributeField attriField;
> 		while(itr.hasNext())
> 		{
>     		 attriField = (AttributeField) itr.next();
>     		 if (attriField.name.equals("CNTRY_NAME"))
>     		 {
>     			 paint = colorMap.getColor(getAgent((String) attriField.value));
>     			// System.out.println(getAgent((String) attriField.value) + "  "+ attriField.value);
>     		 }
>     	     
>     	}
> 		
>         super.draw(object, graphics, info);  
>        
>     }
> 
> The getAgent((String) attriField.value) method returns the 'Oil Production' of the relevant agent/country at the relevant simulation step. 
> 
> Regards,
> Vlasios
> ==============================================
> Dr Vlasios Voudouris  <[log in to unmask]> 
> CIBS Deputy Director
> Centre for International Business and Sustainability
> London Metropolitan Business School
> London Metropolitan University
> 84 Moorgate, London EC2M 6SQ, UK 
> 
> web (CIBS): http://www.londonmet.ac.uk/lmbs/research/cibs/
> web (gamlss): www.gamlss.com
> web(Cities Institute): http://www.citiesinstitute.org/staff/vlasios-voudouris.cfm
> SSRN Author: http://ssrn.com/author=1145910 
> 									
> Save a tree...please don't print this e-mail unless you really need to
> ==============================================
> 
> 
> 
> 
> On 23 Nov 2010, at 22:48, Mark Coletti wrote:
> 
>> On Sun, Nov 21, 2010 at 11:21 AM, vlasios voudouris
>> <[log in to unmask]> wrote:
>>> Hi all,
>>> This is a question about Geomason.
>> 
>> [code snipped]
>> 
>>> The above codes works well. But what it fails to do is to update the map
>>> after each step
>> 
>> Sorry for the tardy response.  I'm a PhD student preparing for my
>> comprehensive exam and thesis topic proposal defense, so my schedule
>> is a little erratic.
>> 
>> In any case, I'd like a little more context here to understand your
>> problem.  From what I can infer you're trying to dynamically render
>> the color for each geometry based on looking up some real value from
>> an agent?
>> 
>> Also, just out of curiosity, did you get the GeoMason code from the
>> old java.net site or the current Google Code Subversion repository?
>> 
>> Cheers,
>> 
>> Mark
>> 
>