org::scilab::modules::gui::events::callback::CallBack Class Reference

Inheritance diagram for org::scilab::modules::gui::events::callback::CallBack:

Inheritance graph
[legend]
Collaboration diagram for org::scilab::modules::gui::events::callback::CallBack:

Collaboration graph
[legend]

Public Member Functions

 CallBack (String command)
String getCommand ()
abstract void callBack ()
void actionPerformed (ActionEvent e)

Static Public Member Functions

static CallBack createCallback (String command, int callbackType)
static CallBack createCallback (String command, int callbackType, int objectIndex)

Static Public Attributes

static final int UNTYPED = -1
static final int SCILAB_INSTRUCTION = 0
static final int C_FORTRAN = 1
static final int SCILAB_FUNCTION = 2
static final int SCILAB_OUT_OF_XCLICK_AND_XGETMOUSE = -2
static final int JAVA = 3
static final int SCILAB_INSTRUCTION_WITHOUT_GCBO = 4

Protected Attributes

String command

Detailed Description

Abstract class to manage all callbacks. Those that need Java code, and those that need Scilab execution.

Author:
bruno

Definition at line 28 of file CallBack.java.


Constructor & Destructor Documentation

org::scilab::modules::gui::events::callback::CallBack::CallBack ( String  command  )  [inline]

Constructor to be seen by specifics CallBack.

Parameters:
command the command associated to the ccallback

Definition at line 69 of file CallBack.java.

00069                                     {
00070         this.command = command;
00071     }


Member Function Documentation

String org::scilab::modules::gui::events::callback::CallBack::getCommand (  )  [inline]

Returns:
the command if it's a Scilab instruction.

Definition at line 76 of file CallBack.java.

References command.

Referenced by org::scilab::modules::gui::events::callback::ScilabCloseCallBack::create(), org::scilab::modules::gui::events::callback::ScilabCallBack::create(), and org::scilab::modules::gui::events::callback::ScilabCallBack::createOutOfXclickAndXgetmouse().

00076                                {
00077         return command;
00078     }

Here is the caller graph for this function:

abstract void org::scilab::modules::gui::events::callback::CallBack::callBack (  )  [pure virtual]

static CallBack org::scilab::modules::gui::events::callback::CallBack::createCallback ( String  command,
int  callbackType 
) [inline, static]

Create a Callback from Scilab data

Parameters:
command the instruction
callbackType the type of the instruction
Returns:
the Callback

Definition at line 91 of file CallBack.java.

References JAVA, SCILAB_INSTRUCTION_WITHOUT_GCBO, and SCILAB_OUT_OF_XCLICK_AND_XGETMOUSE.

00091                                                                             {
00092         switch (callbackType) {
00093         case JAVA :
00094             return JavaCallBack.create(command);
00095         case SCILAB_INSTRUCTION_WITHOUT_GCBO :
00096             return ScilabCallBack.create(command);
00097         case SCILAB_OUT_OF_XCLICK_AND_XGETMOUSE :
00098             return ScilabCallBack.createOutOfXclickAndXgetmouse(command);
00099         default:
00100             return ScilabCallBack.create(command);
00101         }
00102     }

static CallBack org::scilab::modules::gui::events::callback::CallBack::createCallback ( String  command,
int  callbackType,
int  objectIndex 
) [inline, static]

Create a Callback from Scilab data

Parameters:
command the instruction
callbackType the type of the instruction
objectIndex the index of the object in the UIElementMapper
Returns:
the Callback

Definition at line 111 of file CallBack.java.

References JAVA, SCILAB_INSTRUCTION_WITHOUT_GCBO, and SCILAB_OUT_OF_XCLICK_AND_XGETMOUSE.

00111                                                                                              {
00112         switch (callbackType) {
00113         case JAVA :
00114             return JavaCallBack.create(command);
00115         case SCILAB_INSTRUCTION_WITHOUT_GCBO :
00116             return ScilabCallBack.create(command);
00117         case SCILAB_OUT_OF_XCLICK_AND_XGETMOUSE :
00118             return ScilabCallBack.createOutOfXclickAndXgetmouse(command);
00119         default:
00120             return ScilabCallBack.create("if exists(\"gcbo\") then %oldgcbo = gcbo; end;"
00121                     + "gcbo = getcallbackobject(" + objectIndex + ");"
00122                     + command
00123                     + ";if exists(\"%oldgcbo\") then gcbo = %oldgcbo; else clear gcbo; end;");
00124         }
00125     }

void org::scilab::modules::gui::events::callback::CallBack::actionPerformed ( ActionEvent  e  )  [inline]

To match the standard Java Action management.

See also:
java.awt.event.ActionListener::actionPerformed(java.awt.event.ActionEvent)
Parameters:
e The event that launch the callback.

Reimplemented in org::scilab::modules::gui::events::callback::ScilabCloseCallBack.

Definition at line 132 of file CallBack.java.

References callBack(), and command.

Referenced by org::scilab::modules::gui::events::callback::ScilabCallBack::createOutOfXclickAndXgetmouse(), org::scilab::modules::gui::bridge::slider::SwingScilabSlider::setCallback(), org::scilab::modules::gui::bridge::menu::SwingScilabMenu::setCallback(), org::scilab::modules::gui::bridge::listbox::SwingScilabListBox::setCallback(), and org::scilab::modules::gui::bridge::editbox::SwingScilabEditBox::setCallback().

00132                                                {
00133         if (!GlobalEventWatcher.isActivated()) {
00134             callBack();
00135         } else {
00136             if (this.command != null) {
00137                 GlobalEventFilter.filterCallback(this.command);
00138             }
00139         }
00140     }

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

Unmanaged command type constant

Definition at line 33 of file CallBack.java.

Scilab instruction command type constant

Definition at line 37 of file CallBack.java.

C or Fortran function type constant

Definition at line 41 of file CallBack.java.

Scilab function type constant

Definition at line 45 of file CallBack.java.

Scilab function type constant

Definition at line 49 of file CallBack.java.

Referenced by createCallback().

Java function type constant

Definition at line 53 of file CallBack.java.

Referenced by createCallback().

Scilab instruction without GCBO setting (old addmenu compatibility)

Definition at line 58 of file CallBack.java.

Referenced by createCallback().

The Command to Store and remember.

Definition at line 63 of file CallBack.java.

Referenced by org::scilab::modules::gui::events::callback::ScilabCloseCallBack::actionPerformed(), actionPerformed(), and getCommand().


The documentation for this class was generated from the following file:

Generated on Tue Sep 9 18:25:42 2008 for Scilab [trunk] by  doxygen 1.5.5