It seems like this should be straight forward but my searching has turned up little of use. Is there an easy way within EJS (in particular within the EJS GUI) to make a line dotted or dashed? Sorry if I missed something obvious.
- The first one is using a deprecated version of the 2D drawables that accept any kind of java.awt.Strokes. There is nothing wrong with this. They are old, and I recommend the later versions, but they still work.
- The second one is that you use the new (still experimental) EJS that I have just compiled and in which I have added this feature to any 2D drawable.
See attached an example which uses both possibilities. But, again, you need an EJS older than 130205 to run it (otherwise, the code that illustrates the second possibility will cause a compile error). Run the simulation to see the stroke working. (In this example, the stroke is computed in the initialization.)
You can find the new EJS at http://fem.um.es/EjsWiki/uploads/Download/EJS_4.3.7_130205.zip
Any future release of EJS will have this feature.
You can learn about Strokes here , for instance: http://docstore.mik.ua/orelly/java-ent/jfc/ch04_05.htm
dear prof paco, i follow the instructions and it works.
but i notice a lag in the "new" simulation i added the new features of dotted lines. the lag is noticable when i check or uncheck the checkboxes that control g1 g2 or phi1 phi2. in addition, the view mass1 and mass2 also becomes hard to drag around.
please take a look and see if i found a bug in the stroke implementation?