Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [stem-dev] TimeStamp in tooltip

Hi Justin,

getting the timestamp is not as straightforward as I was hoping. You need a reference to the current running Simulation where you can access the Scenario and then the Sequencer to get the current time.

Here is one suggestion: The class GeographicControl has access to the current Simulation, and it's also the class that gets a callback after each cycle of the simulation to refresh the map (in the simulationChanged method). You'll see that it calls refresh, and inside that method a UI job is created calling geographicRenderer.render(polygonsToDraw). You could change that method to also pass the reference to the Simulation. Next, in MapRenderer.render a call is made to the MapCanvas calling the render method passing along the polygons to draw. Again, you can add a reference to the simulation here in this method so that you can extract and remember the time stamp and for the most recent map refresh and use in the tooltip.

Regards,
/ Stefan

Stefan Edlund
Public Health and Computer Science Research
IBM Almaden Research Center
(408) 927-1766 edlund@xxxxxxxxxxxxxxx


Inactive hide details for Justin Duperre ---04/04/2011 08:33:57 PM---Hi team, I've been looking at the SimulationControl, TimePJustin Duperre ---04/04/2011 08:33:57 PM---Hi team, I've been looking at the SimulationControl, TimeProvider and STEMTime


    From:

Justin Duperre <jduperre@xxxxxxxxx>

    To:

STEM-DEV@xxxxxxxxxxx

    Date:

04/04/2011 08:33 PM

    Subject:

[stem-dev] TimeStamp in tooltip

    Sent by:

stem-dev-bounces@xxxxxxxxxxx




Hi team, 

I've been looking at the SimulationControl, TimeProvider and STEMTime classes and trying to figure out a way to display the timestamp in the tooltip. Is this the right place to be looking? 

I noticed SimulationControl class accesses STEMTime and displays it in the Simulation panel - would a similar approach of accessing STEMTime be appropriate in the MapCanvas class, or is there an easier way to access STEMTime?

Thanks.

--
Justin Duperre

http://homepage.wnec.edu/~jd284212
_______________________________________________
stem-dev mailing list
stem-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/stem-dev


GIF image

GIF image


Back to the top