The Java "flavour" of EjsS remains as usual. That means a positive answer for Java.
As for Javascript, the corresponding methods are: _view._initialize(); and _view._reset(); (Notice the leading underscore in _initialie and _reset.)
This propagates a call to initialize or reset to all the view elements. The actual response of the element depends on it type. Trails will typically clear their data.
And yes, you can also call: _view.yourTrailName.addPoint(x,y).
Hope this helps. If it does not, please send your example and I'll try to help.
Hi Paco, Attached is my attempt to use the _view.trail.addpoint() procedure. It seems to fail with not particular error. I try generating a plot by populating the trail during the initialization procedure. Any ideas about what I might be doing wrong?
- The method is called addPoint(). Notice the uppercase P. - The problem is that, by default, the plotting panel has bounds [-1,1]x[-1,1] and AutoScaleX and AutoScaleY are set to false. This means that your trail is out of scale and hence not visible.
Change the AutoscaleX and AutoscaleY properties to true. (Maybe they should be try by default?) And use addPoint, and you will get it.
Is it possible to use some sort of _view call to update just one panel, such as a drawing panel? I'm modifying the colors array for a cell lattice on the fly, but the graphics don;t update until I resize the browser or some such. I have trails going in another panel, and they get cleared if I just try view._reset();
The problem code is in the Custom:Image Lib Page in the first function (image_color_mapper)
The cellLattice is very time consuming to redraw if it has had no changes. For this reason,we do not refresh it UNLESS you tell us explicitly that it has changed.
You need to add a line like this:
_view.yourCellLatticeName.setChanged(true);
where "yourCellLatticeName" is the name of the cell lattice in your simulation.