Note that there are some explanatory texts on larger screens.

plurals
  1. POinteractive planar straight line graph in swing
    primarykey
    data
    text
    <p>I am trying to draw an interactive planar straight line graph (PSLG) on a JApplet. I am using mouse-clicks to determine the vertices of the PSLG. </p> <p>Here is the algorithm which I am following for drawing edges of the PSLG 1. The point where user performs a mouse-click is added as a vertex of the PSLG. 2. If he clicks a second point,an edge is directly created among the point and the previously clicked-point</p> <p>Here are certain flaws which I observed due to the use of this algorithm:</p> <ol> <li>Inability to create disjoint-planar sets like say just a line segment</li> <li>A closed polygon is only created if the user clicks at the exact location where the start point was [Essentially, if the user clicks very close to the start point, there is no way to tell that this point is actually the start point since it appears within a certain tolerance range from the point].</li> </ol> <p>I've checked out some similar questions over here and people suggest to use the <strong>JFreeChart</strong> library. But as far as I get, the scenario in those questions was that the points of the PSLG were already known. I do not know whether <strong>JFreeChart</strong> can be used for creating interactive PSLG's </p> <p>I thought about adding points and having a button which would say add edges among points,but if that's the case selecting the 2 points will still involve the proximity problem encountered in 2.</p> <p>I was wondering if anybody could suggest me a better approach on how to handle this situation.</p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload