Package com.reportmill.editor
Class RMEditorEvents
- java.lang.Object
-
- java.awt.event.MouseAdapter
-
- javax.swing.event.MouseInputAdapter
-
- com.reportmill.editor.RMEditorEvents
-
- All Implemented Interfaces:
java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.event.MouseWheelListener
,java.util.EventListener
,javax.swing.event.MouseInputListener
public class RMEditorEvents extends javax.swing.event.MouseInputAdapter
Handles editor methods specific to event operations.
-
-
Field Summary
Fields Modifier and Type Field Description java.awt.event.MouseEvent
_currentEvent
int
_doPopup
RMPoint
_downPoint
RMPoint
_lastPoint
-
Constructor Summary
Constructors Constructor Description RMEditorEvents(RMEditor editor)
Creates a new editor events object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.event.MouseEvent
getCurrentEvent()
Returns the current event.RMPoint
getEventPointInDoc()
Returns the current event point in document coords.RMPoint
getEventPointInDoc(boolean snapToGrid)
Returns the current event point in document coords with an option to adjust to conform to grid.RMPoint
getEventPointInShape(boolean snapToGrid)
Returns the current event point in super-selected shape coords, optionally snapped to grid.RMPoint
getEventPointInShape(boolean snapToGrid, boolean snapEdges)
Returns the current event point in super-selected shape coords with an option to adjust to conform to grid.static int
getGuideCount(RMDocument aDoc)
Returns the number of guides (4 if snapping to margin, otherwise zero).static float
getGuideLocation(RMDocument aDoc, int anIndex)
Returns the guide location for the given index.byte
getGuideOrientation(RMDocument aDoc, int anIndex)
Returns the guide orientation for the given index.void
mouseDragged(java.awt.event.MouseEvent anEvent)
Handle mouse dragged.void
mousePressed(java.awt.event.MouseEvent anEvent)
Handle mouse pressed.void
mouseReleased(java.awt.event.MouseEvent anEvent)
Handle mouse released.void
processKeyEvent(java.awt.event.KeyEvent anEvent)
Handles key press events.-
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
RMEditorEvents
public RMEditorEvents(RMEditor editor)
Creates a new editor events object.
-
-
Method Detail
-
processKeyEvent
public void processKeyEvent(java.awt.event.KeyEvent anEvent)
Handles key press events.
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent anEvent)
Handle mouse pressed.- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Overrides:
mousePressed
in classjava.awt.event.MouseAdapter
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent anEvent)
Handle mouse dragged.- Specified by:
mouseDragged
in interfacejava.awt.event.MouseMotionListener
- Overrides:
mouseDragged
in classjava.awt.event.MouseAdapter
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent anEvent)
Handle mouse released.- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
- Overrides:
mouseReleased
in classjava.awt.event.MouseAdapter
-
getCurrentEvent
public java.awt.event.MouseEvent getCurrentEvent()
Returns the current event.
-
getEventPointInDoc
public RMPoint getEventPointInDoc()
Returns the current event point in document coords.
-
getEventPointInDoc
public RMPoint getEventPointInDoc(boolean snapToGrid)
Returns the current event point in document coords with an option to adjust to conform to grid.
-
getEventPointInShape
public RMPoint getEventPointInShape(boolean snapToGrid)
Returns the current event point in super-selected shape coords, optionally snapped to grid.
-
getEventPointInShape
public RMPoint getEventPointInShape(boolean snapToGrid, boolean snapEdges)
Returns the current event point in super-selected shape coords with an option to adjust to conform to grid.
-
getGuideCount
public static int getGuideCount(RMDocument aDoc)
Returns the number of guides (4 if snapping to margin, otherwise zero).
-
getGuideLocation
public static float getGuideLocation(RMDocument aDoc, int anIndex)
Returns the guide location for the given index.
-
getGuideOrientation
public byte getGuideOrientation(RMDocument aDoc, int anIndex)
Returns the guide orientation for the given index.
-
-