Part Five: Doing More With JPE & DIP

The MouseToolManager object in JPEFrame has some more convenient methods.

(sharing) In[129]:=

toolManager = frame @ getToolManager[]

The getCurrentTool( ) returns currently selected mouse tool.
When the marquee rect is current, the DraggingToolMarqueeRect object is returned.

[Graphics:../HTMLFiles/index_339.gif]

(sharing) In[130]:=

currentTool = toolManager @ getCurrentTool[]

When the Frame Line tool is selected, the DraggingToolLine object is returned.

[Graphics:../HTMLFiles/index_343.gif]

(sharing) In[131]:=

currentTool = toolManager @ getCurrentTool[]

The getPoints( ) method returns a trajectory of the mouse when the tool is used by mouse clicks or drag.

(sharing) In[132]:=

toolManager @ getPoints[]

The points are received in {{x1,x2,...,xn},{y1,y2,...,yn}} format.

(sharing) In[133]:=

toolManager @ getPointsAsList[]

The same result is obtained by GetPointsAsList[ ] function.

(sharing) In[134]:=

GetPointsAsList[frame]

Six tools; Frame Rect, Frame Oval, Frame Poly, Fill Rect, Fill Oval, and Fill Poly, can return its shape as a Java object.

[Graphics:../HTMLFiles/index_357.gif]

(sharing) In[135]:=

shape = toolManager @ getShape[]

In case of Frame Oval tool, the bounding rectangle is returned.

(sharing) In[136]:=

shape @ toString[]

•Working with Clicking PolyLine


Converted by Mathematica  (July 17, 2003)