com.levigo.jadice.swing.tool
Class EditEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.levigo.jadice.swing.tool.EditEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
KeyEditEvent, MouseEditEvent, MouseWheelEditEvent

public abstract class EditEvent
extends EventObject

See Also:
Serialized Form

Field Summary
protected  InputEvent inputEvent
           
protected  Rectangle pageBounds
           
 
Fields inherited from class java.util.EventObject
source
 
Method Summary
 void consume()
           
static EditEvent create(JComponent source, InputEvent e, Page page, int pageIndex, Rectangle renderBounds, RenderControls renderControls)
          Create the correct EditEvent for the given InputEvent.
 int getID()
           
abstract  InputEvent getInputEvent()
           
 int getModifiers()
           
 int getModifiersEx()
           
 Page getPage()
          Return the Page to which this event pertains to.
 int getPageIndex()
           
 RenderControls getPageRenderControls()
          Return RenderControls used to render the page this event pertains to.
 Rectangle getRenderedPageBounds()
          Return bounds of the rendered page this event pertains to.
 Dimension getRenderedSize()
          Return size of the rendered page this event pertains to.
 JComponent getSource()
           
 long getWhen()
           
 boolean hasPageContext()
          Return whether this event has a Page as a context.
 boolean isAltDown()
           
 boolean isAltGraphDown()
           
 boolean isConsumed()
           
 boolean isControlDown()
           
 boolean isMetaDown()
           
 boolean isShiftDown()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

inputEvent

protected final InputEvent inputEvent

pageBounds

protected final Rectangle pageBounds
Method Detail

create

public static EditEvent create(JComponent source,
                               InputEvent e,
                               Page page,
                               int pageIndex,
                               Rectangle renderBounds,
                               RenderControls renderControls)
Create the correct EditEvent for the given InputEvent.

Parameters:
source -
e -
page -
pageIndex - TODO
renderBounds - the bounds where the page was rendered
renderControls -
Returns:
an EditEvent

getSource

public JComponent getSource()
Overrides:
getSource in class EventObject

getRenderedSize

public Dimension getRenderedSize()
Return size of the rendered page this event pertains to.

Caveat: Clients must not attempt to call this method unless hasPageContext() returned true.

Throws:
IllegalStateException - if the event does not have a page context
See Also:
hasPageContext()

getRenderedPageBounds

public Rectangle getRenderedPageBounds()
Return bounds of the rendered page this event pertains to.

Caveat: Clients must not attempt to call this method unless hasPageContext() returned true.

Throws:
IllegalStateException - if the event does not have a page context
See Also:
hasPageContext()

getInputEvent

public abstract InputEvent getInputEvent()
Returns:
the inputEvent

getPageRenderControls

public RenderControls getPageRenderControls()
Return RenderControls used to render the page this event pertains to.

Caveat: Clients must not attempt to call this method unless hasPageContext() returned true.

Throws:
IllegalStateException - if the event does not have a page context
See Also:
hasPageContext()

isConsumed

public boolean isConsumed()
See Also:
InputEvent.isConsumed()

consume

public void consume()
See Also:
InputEvent.consume()

getModifiers

public int getModifiers()
See Also:
InputEvent.getModifiers()

getModifiersEx

public int getModifiersEx()
See Also:
InputEvent.getModifiersEx()

getWhen

public long getWhen()
See Also:
InputEvent.getWhen()

isAltDown

public boolean isAltDown()
See Also:
InputEvent.isAltDown()

isAltGraphDown

public boolean isAltGraphDown()
See Also:
InputEvent.isAltGraphDown()

isControlDown

public boolean isControlDown()
See Also:
InputEvent.isControlDown()

isMetaDown

public boolean isMetaDown()
See Also:
InputEvent.isMetaDown()

isShiftDown

public boolean isShiftDown()
See Also:
InputEvent.isShiftDown()

getID

public int getID()

getPage

public Page getPage()
Return the Page to which this event pertains to. This may be null for events happening outside the scope of a page.

Returns:
the page

getPageIndex

public int getPageIndex()
Returns:
the pageIndex

hasPageContext

public boolean hasPageContext()
Return whether this event has a Page as a context. An event typically has a page as its context, if the mouse currently resides within the bounds of some rendered page. In some cases, an event can have a context page, event if the mouse is not currently within the page's render bounds, such as for drag events for a drag gesture that started within the bounds but have since left it.

Caveat: Clients must not attempt to call this method unless hasPageContext() returned true.

Returns:
whether the current event has a page as its context
Throws:
IllegalStateException - if the event does not have a page context
See Also:
hasPageContext()

toString

public String toString()
Overrides:
toString in class EventObject


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.