public class EnvelopeEvent extends Object
RectangleEvent
is used to notify a selection of a rectangular area in a view, with the mouse.
Constructor and Description |
---|
EnvelopeEvent(Envelope worldRect,
MouseEvent e,
Rectangle2D pixelRect)
Creates a new
RectangleEvent with all necessary data. |
Modifier and Type | Method and Description |
---|---|
MouseEvent |
getEvent()
Gets the event that has been the cause of creating this one.
|
Rectangle2D |
getPixelCoordRect()
Gets the rectangle selected in pixel coordinates.
|
Envelope |
getWorldCoordRect()
Gets the rectangle selected in world coordinates.
|
public EnvelopeEvent(Envelope worldRect, MouseEvent e, Rectangle2D pixelRect)
Creates a new RectangleEvent
with all necessary data.
worldRect
- rectangle selected in world coordinatespixelRect
- rectangle selected in view (pixel) coordinatese
- mouse event that has been the cause of creating this eventpublic Envelope getWorldCoordRect()
Gets the rectangle selected in world coordinates.
public Rectangle2D getPixelCoordRect()
Gets the rectangle selected in pixel coordinates.
This is useful for doing some verifications, like if rectangle is thinner than 3 pixels of width and height, keeping the zoom instead of reducing it.
public MouseEvent getEvent()
Gets the event that has been the cause of creating this one.