Package org.evoludo.simulator.views
Class Pop2D
- All Implemented Interfaces:
HasAttachHandlers
,HasHandlers
,EventListener
,HasVisibility
,IsRenderable
,IsWidget
,ProvidesResize
,RequiresResize
,AbstractGraph.Controller
,GenericPopGraph.PopGraphController
,TooltipProvider
,TooltipProvider.Index
,ChangeListener
,MilestoneListener
,BasicTooltipProvider
The view to display configuration of the current state of the model in 2D.
The visual representation depends on the geometry of the model. Lattice
structures have a fixed layout but all other strutures are dynamically
generated through a process insipired by the physical arrangement of charged
spheres that are connected by springs. The spheres represent members of the
population and the springs represent their interaction (or competition)
neighbourhood. The size of the sphere scales with the size of the
individual's neighbourhood. Moreover, the colour of the spheres reflects the
state of the individual, for example their trait or fitness.
- Author:
- Christoph Hauert
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractView
AbstractView.ExportCommand, AbstractView.ExportType
Nested classes/interfaces inherited from class UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
Nested classes/interfaces inherited from interface ChangeListener
ChangeListener.PendingAction
Nested classes/interfaces inherited from interface TooltipProvider
TooltipProvider.Index, TooltipProvider.Parametric, TooltipProvider.Simplex
-
Field Summary
Fields inherited from class GenericPop
graphs, hitNode, tag
Fields inherited from class AbstractView
engine, exportSubmenu, exportSubmenuTrigger, gCols, gRows, isActive, isLoaded, logger, MIN_MSEC_BETWEEN_UPDATES, model, restoreMenu, timestamp, type, updatetime, wrapper
Fields inherited from class UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
ConstructorsConstructorDescriptionPop2D
(EvoLudoGWT engine, Data type) Construct a new view to display the configuration of the current state of the EvoLudo model in 2D. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Allocate all graphs managed by this view.void
clear()
Clear the view.protected AbstractView.ExportType[]
Return the list of export types that are acceptable for _all_ graphs in this view.void
reset
(boolean hard) Called when a module has been reset.Methods inherited from class GenericPop
destroyGraphs, getName, getTooltipAt, hasLayout, keyDownHandler, layoutComplete, modelChanged, modelDidInit, mouseHitNode, setGraphGeometry, unload, update
Methods inherited from class AbstractView
activate, createWidget, deactivate, dispose, export, export, exportDataHeader, exportMeanData, exportPNG, exportStatData, exportSVG, exportTrajData, getGraphAt, getLogger, getMode, getModel, getStatus, getStatus, getType, isRunning, keyUpHandler, load, modelDidReset, modelStopped, modelUnloaded, moduleRestored, moduleUnloaded, onResize, populateContextMenu, scheduleUpdate, setBounds, setMode, shift, update, zoom
Methods inherited from class Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
Methods inherited from class Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
Methods inherited from class UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface AbstractGraph.Controller
getLogger, getModel, getType, isRunning, populateContextMenu, setInitialState
Methods inherited from interface BasicTooltipProvider
getTooltipAt, getTooltipAt
Methods inherited from interface GenericPopGraph.PopGraphController
mouseHitNode, populateContextMenuAt
Methods inherited from interface MilestoneListener
modelLoaded, modelRelaxed, modelRunning, modelSettings, moduleLoaded
-
Constructor Details
-
Pop2D
Construct a new view to display the configuration of the current state of the EvoLudo model in 2D.- Parameters:
engine
- the pacemaker for running the modeltype
- the type of data to display
-
-
Method Details
-
allocateGraphs
protected void allocateGraphs()Description copied from class:AbstractView
Allocate all graphs managed by this view. This is called when loading the view. Once all views are attached to the browser DOM a call to the graph'scalcBounds(int, int)
is triggered throughsetBounds(int, int)
to properly calculate the layout.- Specified by:
allocateGraphs
in classAbstractView
- See Also:
-
clear
public void clear()Description copied from class:AbstractView
Clear the view.- Overrides:
clear
in classAbstractView
-
reset
public void reset(boolean hard) Description copied from class:AbstractView
Called when a module has been reset. All graphs are reset and updated if needed, unlesshard
istrue
.- Overrides:
reset
in classAbstractView
- Parameters:
hard
- the flag to indicate whether to do a hard reset
-
exportTypes
Description copied from class:AbstractView
Return the list of export types that are acceptable for _all_ graphs in this view.- Overrides:
exportTypes
in classAbstractView
- Returns:
- the list of viable export types
-