Logo Search packages:      
Sourcecode: wims version File versions

SelectionEvent.java

/*
$Id: SelectionEvent.java,v 1.3 2003/02/18 11:48:47 sander Exp $
*/


/*
Copyright (C) 2001-2002 Mainline Project (I3S - ESSI - CNRS -UNSA)

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

For further information on the GNU Lesser General Public License,
see: http://www.gnu.org/copyleft/lesser.html
For further information on this library, contact: mainline@essi.fr
*/


package fr.ove.openmath.jome.ctrlview.bidim.selection.events;

import java.util.EventObject;

/**
* The event to send to all objects that implements the interface SlectionEventListener
* and which want to maintain a list of selected elements.
*
* @author  1998 DIRAT Laurent
* @version 1.0  30/06/98
*/
00040 public class SelectionEvent extends EventObject {
    /**
    * The action to execute by sending the event.
    */
00044     private int action;

    /**
    * The object which has been selected.
    */
00049     private Object argument;

    /**
    * The constructor.
    * @param src the object which produces this event.
    */
00055     public SelectionEvent(Object src) {
        super(src);
    }

    /**
    * Sets the action to execute and its argument.
    * @param action the action.
    * @param argument the argument.<BR>
    * In the case of the actions GET_SELECTION and GET_SELECTION_SIZE,
    * arguments will serve as well as the return value
    */
00066     public void setAction(int action, Object argument) {
        this.action = action;
        this.argument = argument;
    }

    /**
    * Returns the action associated with the event.
    */
00074     public int getAction() {
        return action;
    }

    /**
    * Returns the action argument.
    */
00081     public Object getArgument() {
        return argument;
    }
    
    /**
    * Sets the action argument.
    * @param argument the action argument.
    */
00089     public void setArgument(Object argument) {
        this.argument = argument;
    }

    /**
    * The different actions associated with the event.<BR>
    */

    /**
    * This action tells the selections manager to remove all the elements it has.
    */
00100     public static final int PURGE               = 0;

    /**
    * This action tells the selections manager to remove an element. (which will be
    * given to him)
    */
00106     public static final int REMOVE              = 1;

    /**
    * This action tells the selections manager to add an element. (which will be
    * given to him)
    */
00112     public static final int ADD                 = 2;

    /**
    * This action tells the selections manager to give the number of selected 
    * elements
    */
00118     public static final int GET_SELECTION_SIZE  = 3;

    /**
    * This action tells the selections manager to give all the selected elements
    */
00123     public static final int GET_SELECTION       = 4;

    /**
    * For debugg only. To list all the selected elements.
    */
00128     public static final int LIST                = 10;
}

Generated by  Doxygen 1.6.0   Back to index