com.nwoods.jgo
Class JGoViewEvent

java.lang.Object
  extended byjava.util.EventObject
      extended bycom.nwoods.jgo.JGoViewEvent
All Implemented Interfaces:
java.io.Serializable

public class JGoViewEvent
extends java.util.EventObject

This class defines the event object passed to JGoViewListeners when events of interest occur on the JGoView. Unlike JGoDocumentEvent, JGoViewEvent instances also may have view-specific information, such as the Point where the event happened, in both view and document coordinates, and the event modifiers that may come from a MouseEvent.

You may define your own hint values greater than LAST.

See Also:
JGoViewListener, JGoView, JGoDocumentEvent, Serialized Form

Field Summary
static int AUTOSCROLL_INSETS_CHANGED
          The margin where autoscrolling can occur has changed
static int BACKGROUND_CLICKED
          The user single clicked in the background, not on an object
static int BACKGROUND_DOUBLE_CLICKED
          The user double clicked in the background, not on an object
static int BACKGROUND_IMAGE_CHANGED
          The background image has changed
static int CHANGED
          A view object was modified
static int CLICKED
          The user single clicked on an object
static int CLIPBOARD_COPIED
          The user has copied some objects into the clipboard, by calling JGoView.copy() or JGoView.cut().
static int CLIPBOARD_PASTED
          The user has pasted a copy of the clipboard's collection of objects into this view's document, by calling JGoView.paste().
static int DEFAULT_CURSOR_CHANGED
          The default cursor used by the view has changed
static int DOUBLE_CLICKED
          The user double clicked on an object
static int DRAG_ENABLED_CHANGED
          Whether the user can initiate a drag gesture in this view has changed
static int DRAGS_REALTIME_CHANGED
          Whether dragging the selection actually changes their positions continuously has changed
static int DRAGS_SELECTION_IMAGE_CHANGED
          Whether dragging the selection drags an image or an outline has changed
static int DROP_ENABLED_CHANGED
          Whether the user can drop something in this view has changed
static int EXTERNAL_OBJECTS_DROPPED
          The user has dropped a copy of the collection of objects being dragged into this view's document
static int GRID_CHANGED
          The grid has changed.
static int HIDING_DISABLED_SCROLLBARS_CHANGED
          Whether scroll bars are always visible has changed
static int INCLUDING_NEGATIVE_COORDS_CHANGED
          Whether negative coordinates are shown has changed
static int INSERTED
          An object was added to the view
static int INTERNAL_MOUSE_ACTIONS_CHANGED
          The kind of drag-and-drop actions permitted for drag-and-drops within this view has changed
static int KEY_ENABLED_CHANGED
          Whether the view responds to keyboard events has changed
static int LAST
          The end of the predefined hints
static int LINK_CREATED
          The user has drawn a new link
static int LINK_RELINKED
          The user has reconnected an existing link
static int MOUSE_ENABLED_CHANGED
          Whether the view responds to mouse events has changed
static int OBJECT_EDITED
          The user has edited a text object
static int OBJECT_RESIZED
          The user has resized an object
static int POSITION_CHANGED
          The view's top-left point in the document has changed.
static int REMOVED
          An object was removed from the view
static int SCALE_CHANGED
          The scale factor for the view has changed
static int SELECTION_COLOR_CHANGED
          The selection color changed
static int SELECTION_COPIED
          The user has copied the selection
static int SELECTION_DELETED
          The user has deleted the selection
static int SELECTION_DELETING
          The user is about to delete the selection; view listeners can cancel the deletion by calling JGoViewEvent.consume() on the argument JGoViewEvent.
static int SELECTION_FINISHED
          This event happens just after a number of objects are selected or de-selected.
static int SELECTION_GAINED
          A document object became part of the selection
static int SELECTION_LOST
          A document object was taken out of the selection
static int SELECTION_MOVED
          The user has moved the selection
static int SELECTION_STARTING
          This event happens just before a number of objects are selected or de-selected.
static int UPDATE_ALL
          Repaint the whole view
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
JGoViewEvent(JGoView source, int hint, int flags, java.lang.Object obj, org.eclipse.swt.graphics.Point vc, org.eclipse.swt.graphics.Point dc, int modifiers)
          Construct a new JGoView event.
 
Method Summary
 void consume()
          Modify this event to inform the caller that the normal processing should not take place.
 int getFlags()
          Return the flags associated with this event.
 int getHint()
          Return the hint assocated with this event.
 JGoObject getJGoObject()
          Return the JGoObject assocated with this event, or null.
 int getModifiers()
          Return the modifiers assocated with this event.
 java.lang.Object getObject()
          Return the Object assocated with this event, or null.
 org.eclipse.swt.graphics.Point getPointDocCoords()
          Return the point associated with this event in JGoDocument coordinates.
 org.eclipse.swt.graphics.Point getPointViewCoords()
          Return the point associated with this event in JGoView coordinates or null.
 boolean isConsumed()
          Return whether this event has been consumed, thus informing the code that raised this event that the normal processing should not proceed.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UPDATE_ALL

public static final int UPDATE_ALL
Repaint the whole view

See Also:
Constant Field Values

INSERTED

public static final int INSERTED
An object was added to the view

See Also:
Constant Field Values

CHANGED

public static final int CHANGED
A view object was modified

See Also:
Constant Field Values

REMOVED

public static final int REMOVED
An object was removed from the view

See Also:
Constant Field Values

SELECTION_GAINED

public static final int SELECTION_GAINED
A document object became part of the selection

See Also:
Constant Field Values

SELECTION_LOST

public static final int SELECTION_LOST
A document object was taken out of the selection

See Also:
Constant Field Values

CLICKED

public static final int CLICKED
The user single clicked on an object

See Also:
Constant Field Values

DOUBLE_CLICKED

public static final int DOUBLE_CLICKED
The user double clicked on an object

See Also:
Constant Field Values

BACKGROUND_CLICKED

public static final int BACKGROUND_CLICKED
The user single clicked in the background, not on an object

See Also:
Constant Field Values

BACKGROUND_DOUBLE_CLICKED

public static final int BACKGROUND_DOUBLE_CLICKED
The user double clicked in the background, not on an object

See Also:
Constant Field Values

SELECTION_MOVED

public static final int SELECTION_MOVED
The user has moved the selection

See Also:
Constant Field Values

SELECTION_COPIED

public static final int SELECTION_COPIED
The user has copied the selection

See Also:
Constant Field Values

SELECTION_DELETING

public static final int SELECTION_DELETING
The user is about to delete the selection; view listeners can cancel the deletion by calling JGoViewEvent.consume() on the argument JGoViewEvent.

See Also:
Constant Field Values

SELECTION_DELETED

public static final int SELECTION_DELETED
The user has deleted the selection

See Also:
Constant Field Values

OBJECT_RESIZED

public static final int OBJECT_RESIZED
The user has resized an object

See Also:
Constant Field Values

LINK_CREATED

public static final int LINK_CREATED
The user has drawn a new link

See Also:
Constant Field Values

LINK_RELINKED

public static final int LINK_RELINKED
The user has reconnected an existing link

See Also:
Constant Field Values

OBJECT_EDITED

public static final int OBJECT_EDITED
The user has edited a text object

See Also:
Constant Field Values

CLIPBOARD_PASTED

public static final int CLIPBOARD_PASTED
The user has pasted a copy of the clipboard's collection of objects into this view's document, by calling JGoView.paste().

See Also:
Constant Field Values

EXTERNAL_OBJECTS_DROPPED

public static final int EXTERNAL_OBJECTS_DROPPED
The user has dropped a copy of the collection of objects being dragged into this view's document

See Also:
Constant Field Values

CLIPBOARD_COPIED

public static final int CLIPBOARD_COPIED
The user has copied some objects into the clipboard, by calling JGoView.copy() or JGoView.cut().

See Also:
Constant Field Values

SELECTION_STARTING

public static final int SELECTION_STARTING
This event happens just before a number of objects are selected or de-selected.

See Also:
Constant Field Values

SELECTION_FINISHED

public static final int SELECTION_FINISHED
This event happens just after a number of objects are selected or de-selected.

See Also:
Constant Field Values

POSITION_CHANGED

public static final int POSITION_CHANGED
The view's top-left point in the document has changed. For example, the user may have scrolled a scroll bar.

See Also:
Constant Field Values

SCALE_CHANGED

public static final int SCALE_CHANGED
The scale factor for the view has changed

See Also:
Constant Field Values

SELECTION_COLOR_CHANGED

public static final int SELECTION_COLOR_CHANGED
The selection color changed

See Also:
Constant Field Values

BACKGROUND_IMAGE_CHANGED

public static final int BACKGROUND_IMAGE_CHANGED
The background image has changed

See Also:
Constant Field Values

HIDING_DISABLED_SCROLLBARS_CHANGED

public static final int HIDING_DISABLED_SCROLLBARS_CHANGED
Whether scroll bars are always visible has changed

See Also:
Constant Field Values

INCLUDING_NEGATIVE_COORDS_CHANGED

public static final int INCLUDING_NEGATIVE_COORDS_CHANGED
Whether negative coordinates are shown has changed

See Also:
Constant Field Values

KEY_ENABLED_CHANGED

public static final int KEY_ENABLED_CHANGED
Whether the view responds to keyboard events has changed

See Also:
Constant Field Values

MOUSE_ENABLED_CHANGED

public static final int MOUSE_ENABLED_CHANGED
Whether the view responds to mouse events has changed

See Also:
Constant Field Values

DRAG_ENABLED_CHANGED

public static final int DRAG_ENABLED_CHANGED
Whether the user can initiate a drag gesture in this view has changed

See Also:
Constant Field Values

DROP_ENABLED_CHANGED

public static final int DROP_ENABLED_CHANGED
Whether the user can drop something in this view has changed

See Also:
Constant Field Values

DEFAULT_CURSOR_CHANGED

public static final int DEFAULT_CURSOR_CHANGED
The default cursor used by the view has changed

See Also:
Constant Field Values

DRAGS_REALTIME_CHANGED

public static final int DRAGS_REALTIME_CHANGED
Whether dragging the selection actually changes their positions continuously has changed

See Also:
Constant Field Values

INTERNAL_MOUSE_ACTIONS_CHANGED

public static final int INTERNAL_MOUSE_ACTIONS_CHANGED
The kind of drag-and-drop actions permitted for drag-and-drops within this view has changed

See Also:
Constant Field Values

DRAGS_SELECTION_IMAGE_CHANGED

public static final int DRAGS_SELECTION_IMAGE_CHANGED
Whether dragging the selection drags an image or an outline has changed

See Also:
Constant Field Values

AUTOSCROLL_INSETS_CHANGED

public static final int AUTOSCROLL_INSETS_CHANGED
The margin where autoscrolling can occur has changed

See Also:
Constant Field Values

GRID_CHANGED

public static final int GRID_CHANGED
The grid has changed. The flags indicate what kind of change occurred.

See Also:
Constant Field Values

LAST

public static final int LAST
The end of the predefined hints

See Also:
Constant Field Values
Constructor Detail

JGoViewEvent

public JGoViewEvent(JGoView source,
                    int hint,
                    int flags,
                    java.lang.Object obj,
                    org.eclipse.swt.graphics.Point vc,
                    org.eclipse.swt.graphics.Point dc,
                    int modifiers)
Construct a new JGoView event.

Parameters:
source - the JGoView that is the source of the event.
hint - identifies the type of event.
flags - additional information about the event.
obj - the Object, sometimes a JGoObject, associated with the event.
vc - the point in JGoView coordinates associated with the event.
dc - the point in JGoDocument coordinates associated with the event.
Method Detail

getHint

public int getHint()
Return the hint assocated with this event. The hint identifies what type of update is occurring. Predefined hints are defined in this class.


getFlags

public int getFlags()
Return the flags associated with this event. The flags value is dependent on the kind of event, and is often an enumerated sub-hint.


isConsumed

public boolean isConsumed()
Return whether this event has been consumed, thus informing the code that raised this event that the normal processing should not proceed.


consume

public void consume()
Modify this event to inform the caller that the normal processing should not take place. Currently only the SELECTION_DELETING case observes this protocol, so that JGoViewListeners can decide to cancel the deletion of the current selection.


getJGoObject

public JGoObject getJGoObject()
Return the JGoObject assocated with this event, or null.


getObject

public java.lang.Object getObject()
Return the Object assocated with this event, or null.


getPointViewCoords

public org.eclipse.swt.graphics.Point getPointViewCoords()
Return the point associated with this event in JGoView coordinates or null.


getPointDocCoords

public org.eclipse.swt.graphics.Point getPointDocCoords()
Return the point associated with this event in JGoDocument coordinates. or null.


getModifiers

public int getModifiers()
Return the modifiers assocated with this event.