MASON-INTEREST-L Archives

November 2010

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
vlasios voudouris <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Sun, 21 Nov 2010 16:21:25 +0000
Content-Type:
multipart/alternative
Parts/Attachments:
text/plain (2031 bytes) , text/html (32 kB)
Hi all,

This is a question about Geomason.

//reada the worl mapshapefile
worldMap = new WorldMap(this);	
worldPortrayal.setField(worldMap.worldMap);
//inheritics the GeomPortrayal with an updated draw.
colorWorldPetroleumPortrayal=new ColorWorldPetroleumPortrayal(new  
SimpleColorMap(0.0, 2000.0, Color.BLACK, Color.RED),this);
   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 above codes works well. But what it fails to do is to update the  
map after each step despite  the use of: display = new Display2D(755,  
405, this, 1).

Note the the colors of the map is updated (reflecting the new values  
as) when I click on it (it seems that the mouseclick forces it to  
update). How can I force it to repaint after each step? I tries the:
	display.reset();
         display.repaint();
without success.

Any help?

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
==============================================





ATOM RSS1 RSS2