FreeHEP API
Version current

org.freehep.swing.graphics
Class GraphicalSelectionEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byorg.freehep.swing.graphics.GraphicalSelectionEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PointSelectionEvent, RegionSelectionEvent

public class GraphicalSelectionEvent
extends EventObject

GraphicalSelectionEvent is an event which is generated when an user makes a graphical selection. This event contains information about the source, the type of selection which was made, and the selection type.

Version:
$Id: GraphicalSelectionEvent.java,v 1.4 2001/04/03 10:25:37 loomis Exp $
Author:
Charles Loomis
See Also:
Serialized Form
Source Code:
GraphicalSelectionEvent.java

Field Summary
protected  int actionCode
          An integer which describes what should be done with this selection.
static int DEFAULT_MODE
          This indicates that the component should switch to the default selection mode.
static int NEXT_MODE
          This indicates that the component should switch to the next selection mode.
static int NO_ACTION
          This action code indicates no action.
static int PICK
          This indicates that the selection should be used to select event objects.
static int PICK_ADD
          This indicates that the selection should be used to select event objects and that these objects should be selected in addition to any previously selected objects.
static int PREVIOUS_MODE
          This indicates that the component should switch to the previous selection mode.
protected  Object selection
          The Object which describes the graphical selection which has been made.
static int UNPICK
          This indicates that the selection should be used to select event objects and that these objects should be deselected.
static int ZOOM
          This action code indicates that the view should be zoomed with the given parameters in the same view.
static int ZOOM_NEW_VIEW
          This action code indicates that the view should be cloned and the zoom applied to the clone.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
GraphicalSelectionEvent(Object source, int actionCode, Object selection, AffineTransform transform)
          The constructor requires the source object, the selection type, and the actual selection.
 
Method Summary
 int getActionCode()
          Return the action code for this event.
 Object getSelection()
          Get the Object which describes the graphical selection.
 AffineTransform getTransform()
          Return an AffineTransform which is appropriate for this selection.
 
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

NO_ACTION

public static final int NO_ACTION
This action code indicates no action.

See Also:
Constant Field Values

ZOOM

public static final int ZOOM
This action code indicates that the view should be zoomed with the given parameters in the same view.

See Also:
Constant Field Values

ZOOM_NEW_VIEW

public static final int ZOOM_NEW_VIEW
This action code indicates that the view should be cloned and the zoom applied to the clone.

See Also:
Constant Field Values

PICK

public static final int PICK
This indicates that the selection should be used to select event objects. These objects should replace any previously selected objects.

See Also:
Constant Field Values

PICK_ADD

public static final int PICK_ADD
This indicates that the selection should be used to select event objects and that these objects should be selected in addition to any previously selected objects.

See Also:
Constant Field Values

UNPICK

public static final int UNPICK
This indicates that the selection should be used to select event objects and that these objects should be deselected.

See Also:
Constant Field Values

NEXT_MODE

public static final int NEXT_MODE
This indicates that the component should switch to the next selection mode.

See Also:
Constant Field Values

PREVIOUS_MODE

public static final int PREVIOUS_MODE
This indicates that the component should switch to the previous selection mode.

See Also:
Constant Field Values

DEFAULT_MODE

public static final int DEFAULT_MODE
This indicates that the component should switch to the default selection mode.

See Also:
Constant Field Values

actionCode

protected int actionCode
An integer which describes what should be done with this selection.


selection

protected Object selection
The Object which describes the graphical selection which has been made.

Constructor Detail

GraphicalSelectionEvent

public GraphicalSelectionEvent(Object source,
                               int actionCode,
                               Object selection,
                               AffineTransform transform)
The constructor requires the source object, the selection type, and the actual selection.

Parameters:
source - the Object which generates this event
selection - the selection itself
actionCode - integer giving action to be done
transform - an AffineTransform which will, for example, zoom into a selected region
Method Detail

getSelection

public Object getSelection()
Get the Object which describes the graphical selection.

Returns:
Object which describes the selection

getTransform

public AffineTransform getTransform()
Return an AffineTransform which is appropriate for this selection. For a point, the transform might center the display on this point. For a region, the transform might zoom into the selected region.

Returns:
the appropriate AffineTransform

getActionCode

public int getActionCode()
Return the action code for this event.

Returns:
an integer describing the action which should be taken

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.