Design question. 2D Area manipulation, what should listen?

  • Thread starter Richard A. DeVenezia
  • Start date
R

Richard A. DeVenezia

Consider
FigurePanel - subclass of JPanel used to display 'plotable' objects as seen
in a bounding box; llx,lly urx ury maintains the current
AffineTransformation, 't'.
Plotable - an abstract root for plotable objects
AreaX - A plotable thing with an associated Area. The vertices of the Area
are mapped to the FigurePanel coordinates using 't'.

The figure panel has some mouse listeners installed to allow polygonal
rubberbanding. Pixel coordinates are converted to geometrical coordinates
using the inverse of 't'. This lets me construct an area from the
rubberband and subtract from the area of AreaX. It works ok, but now I am
getting more adventurous.

I want detect when the user is 'hovering' over an Area's vertex. A left
click within 2 pixels of a vertex is to make it moveable until another left
click (or right click to cancel [perhaps as an option of a PopupMenu])

A gungo ho approach might be to load up the current mouse event handling
routines with ever more code to handle the state information needed to track
either rubber banding or vertex movement; both ideas need to deal with
transforming pixel coordinates to geometric coordinates via the inverse of
't'.

Can anyone suggest good designs, books or sites that discuss UI and class
constructs/separations suitable for developing an application dealing with
figures or shapes in an arbitrary space ?
 

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top