OverviewSingleDeprecated

jsx3.gui

interface Interactive

jsx3.gui.Interactive

All Known Implementing Classes:

jsx3.chart.AreaChart, jsx3.chart.AreaSeries, jsx3.chart.Axis, jsx3.chart.BCChart, jsx3.chart.BCSeries, jsx3.chart.BarChart, jsx3.chart.BarSeries, jsx3.chart.BubbleSeries, jsx3.chart.CartesianChart, jsx3.chart.CategoryAxis, jsx3.chart.Chart, jsx3.chart.ChartComponent, jsx3.chart.ChartLabel, jsx3.chart.ColumnChart, jsx3.chart.ColumnSeries, jsx3.chart.GridLines, jsx3.chart.Legend, jsx3.chart.LineChart, jsx3.chart.LineSeries, jsx3.chart.LinearAxis, jsx3.chart.LogarithmicAxis, jsx3.chart.PieChart, jsx3.chart.PieSeries, jsx3.chart.PlotChart, jsx3.chart.PlotSeries, jsx3.chart.PointSeries, jsx3.chart.RadialChart, jsx3.chart.Series, jsx3.gui.Block, jsx3.gui.BlockX, jsx3.gui.Button, jsx3.gui.CDF, jsx3.gui.CheckBox, jsx3.gui.ColorPicker, jsx3.gui.Column, jsx3.gui.DatePicker, jsx3.gui.Dialog, jsx3.gui.Grid, jsx3.gui.IFrame, jsx3.gui.Image, jsx3.gui.ImageButton, jsx3.gui.LayoutGrid, jsx3.gui.List, jsx3.gui.Matrix, jsx3.gui.Matrix.Column, jsx3.gui.Menu, jsx3.gui.RadioButton, jsx3.gui.Select, jsx3.gui.Slider, jsx3.gui.Sound, jsx3.gui.Splitter, jsx3.gui.Stack, jsx3.gui.StackGroup, jsx3.gui.Tab, jsx3.gui.TabbedPane, jsx3.gui.Table, jsx3.gui.Template.Block, jsx3.gui.TextBox, jsx3.gui.TimePicker, jsx3.gui.ToolbarButton, jsx3.gui.Tree, jsx3.gui.WindowBar, jsx3.vector.Block

interface Interactive
Mixin interface. Provides functionality to subclasses of jsx3.gui.Painted that allows them to publish model events.

Note that this class requires that implementors of this class extends the jsx3.gui.Painted class and implement the jsx3.util.EventDispatcher interface

Field Summary
static String
ADOPT
static String
AFTER_APPEND
static String
AFTER_COMMIT
static String
AFTER_EDIT
static String
AFTER_MOVE
static String
AFTER_REORDER
static String
AFTER_RESIZE
static String
AFTER_RESIZE_VIEW
static String
AFTER_SORT
static String
BEFORE_APPEND
static String
BEFORE_DROP
static String
BEFORE_EDIT
static String
BEFORE_MOVE
static String
BEFORE_RESIZE
static String
BEFORE_SELECT
static String
BEFORE_SORT
static String
CANCEL_DROP
static String
CHANGE
static String
CTRL_DROP
static String
DATA
static String
DESTROY
static String
DRAG
static String
DROP
static String
EXECUTE
static String
FOCUS_STYLE
static String
HIDE
static String
INCR_CHANGE
static String
INPUT
static String
JSXBLUR
static String
JSXCHANGE
static String
JSXCLICK
static String
JSXDOUBLECLICK
static String
JSXFOCUS
static String
JSXKEYDOWN
static String
JSXKEYPRESS
static String
JSXKEYUP
static String
JSXLOAD
static String
JSXMOUSEDOWN
static String
JSXMOUSEOUT
static String
JSXMOUSEOVER
static String
JSXMOUSEUP
static String
JSXMOUSEWHEEL
static String
MENU
static String
SCROLL
static String
SELECT
static String
SHOW
static String
SPYGLASS
static String
TOGGLE
Method Summary
Object
doEvent(strType : String, objContext : Object<String, Object>)
Publishes a model event.
int
Returns whether is object supports programmatic drag, meanining it will allow any contained item to be dragged and dropped on another container supporting drop.
int
Returns whether this object can be the target of a drop event.
int
Returns whether is object can be moved around the screen (this is not the same as drag/drop).
int
Returns whether is object can be spyglassed.
String
getEvent(strType : String)
Returns the event script registered for the given event type.
Object<String, String>
Returns the associative array containing all the registered event script of this object.
String
Returns the name of the jsx3.gui.Menu instance to display (as a context menu) when a user clicks on this object with the right button.
static String
Deprecated.
String
hasEvent(strType : String)
Returns true if there is a event script registered for the given event type.
jsx3.gui.HotKey
registerHotKey(vntCallback : String | Function | jsx3.gui.HotKey, vntKey : int | String, bShift : boolean, bControl : boolean, bAlt : boolean)
Registers a hot key with this JSX model node.
jsx3.gui.Interactive
removeEvent(strType : String)
Removes an event script registered for the given model event type.
jsx3.gui.Interactive
Removes all events scripts registered with this object.
jsx3.gui.Interactive
setCanDrag(bDrag : int)
Sets whether is object supports programmatic drag, meanining it will allow any contained item to be dragged/dropped.
jsx3.gui.Interactive
setCanDrop(bDrop : int)
Sets whether this object can be the target of a drop event.
jsx3.gui.Interactive
setCanMove(bMovable : int)
Sets whether is object can be moved around the screen (this is not the same as drag/drop).
jsx3.gui.Interactive
setCanSpy(bSpy : int)
Sets whether is object can be spyglassed.
jsx3.gui.Interactive
setEvent(strScript : String, strType : String)
Programmatically sets an event of this instance.
jsx3.gui.Interactive
setMenu(strMenu : String)
Sets the name of the jsx3.gui.Menu instance to display when a user clicks on this object with the right button.
void
setSpyStyles(strCSS : String)
Sets the CSS definition to apply to an HTML element when a spyglass is shown for that element
void
showSpy(strHTML : String, intLeft : int | jsx3.gui.Event, intTop : int)
called by 'window.setTimeout()' to display the spyglass hover for a given object;
Field Detail

ADOPT

static final String ADOPT

AFTER_APPEND

static final String AFTER_APPEND

AFTER_COMMIT

static final String AFTER_COMMIT

AFTER_EDIT

static final String AFTER_EDIT

AFTER_MOVE

static final String AFTER_MOVE

AFTER_REORDER

static final String AFTER_REORDER

AFTER_RESIZE

static final String AFTER_RESIZE

AFTER_RESIZE_VIEW

static final String AFTER_RESIZE_VIEW

AFTER_SORT

static final String AFTER_SORT

BEFORE_APPEND

static final String BEFORE_APPEND

BEFORE_DROP

static final String BEFORE_DROP

BEFORE_EDIT

static final String BEFORE_EDIT

BEFORE_MOVE

static final String BEFORE_MOVE

BEFORE_RESIZE

static final String BEFORE_RESIZE

BEFORE_SELECT

static final String BEFORE_SELECT

BEFORE_SORT

static final String BEFORE_SORT

CANCEL_DROP

static final String CANCEL_DROP

CHANGE

static final String CHANGE

CTRL_DROP

static final String CTRL_DROP

DATA

static final String DATA

DESTROY

static final String DESTROY

DRAG

static final String DRAG

DROP

static final String DROP

EXECUTE

static final String EXECUTE

FOCUS_STYLE

static final String FOCUS_STYLE

HIDE

static final String HIDE

INCR_CHANGE

static final String INCR_CHANGE

INPUT

static final String INPUT

JSXBLUR

static final String JSXBLUR

JSXCHANGE

static final String JSXCHANGE

JSXCLICK

static final String JSXCLICK

JSXDOUBLECLICK

static final String JSXDOUBLECLICK

JSXFOCUS

static final String JSXFOCUS

JSXKEYDOWN

static final String JSXKEYDOWN

JSXKEYPRESS

static final String JSXKEYPRESS

JSXKEYUP

static final String JSXKEYUP

JSXLOAD

static final String JSXLOAD

JSXMOUSEDOWN

static final String JSXMOUSEDOWN

JSXMOUSEOUT

static final String JSXMOUSEOUT

JSXMOUSEOVER

static final String JSXMOUSEOVER

JSXMOUSEUP

static final String JSXMOUSEUP

JSXMOUSEWHEEL

static final String JSXMOUSEWHEEL

MENU

static final String MENU

SCROLL

static final String SCROLL

SELECT

static final String SELECT

SHOW

static final String SHOW

SPYGLASS

static final String SPYGLASS

TOGGLE

static final String TOGGLE
Method Detail

doEvent

Object doEvent(strType : String, objContext : Object<String, Object>)
Publishes a model event. This method both evaluates any registered event script for the given event type and publishes the event through the EventDispatcher interface. This method ensures that any registered event script is executed in isolation to prevent most side effects.

Parameters:

strTypethe event type, one of the model event types defined as static fields in this class
objContextJavaScript object array with name/value pairs that provide a local variable stack for the execution of the event script. This argument is also passed as the context property of the event object that is published through the EventDispatcher interface.

Returns:

the result of evaluating the event script or null if not event script is registered  

getCanDrag

int getCanDrag()
Returns whether is object supports programmatic drag, meanining it will allow any contained item to be dragged and dropped on another container supporting drop.

Returns:

jsx3.Boolean.TRUE or jsx3.Boolean.FALSE  

getCanDrop

int getCanDrop()
Returns whether this object can be the target of a drop event.

Returns:

jsx3.Boolean.TRUE or jsx3.Boolean.FALSE  

getCanMove

int getCanMove()
Returns whether is object can be moved around the screen (this is not the same as drag/drop).

Returns:

jsx3.Boolean.TRUE or jsx3.Boolean.FALSE  

getCanSpy

int getCanSpy()
Returns whether is object can be spyglassed.

Returns:

jsx3.Boolean.TRUE or jsx3.Boolean.FALSE  

getEvent

String getEvent(strType : String)
Returns the event script registered for the given event type. This script could have been set by the setEvent() method or during component deserialization.

Parameters:

strTypethe event type, one of the model event types defined as static fields in this class

Returns:

the JavaScript event script 

See Also:

setEvent()

getEvents

Object<String, String> getEvents()
Returns the associative array containing all the registered event script of this object. This method returns the instance field itself and not a copy.

Returns:

an associative array mapping event type to event script  

getMenu

String getMenu()
Returns the name of the jsx3.gui.Menu instance to display (as a context menu) when a user clicks on this object with the right button.

Returns:

 

getVersion

static String getVersion()
Deprecated.
Returns the release/build for the class (i.e., "2.2.00")

Returns:

 

hasEvent

String hasEvent(strType : String)
Returns true if there is a event script registered for the given event type.

Parameters:

strTypethe event type, one of the model event types defined as static fields in this class

Returns:

the JavaScript event script  

registerHotKey

jsx3.gui.HotKey registerHotKey(vntCallback : String | Function | jsx3.gui.HotKey, vntKey : int | String, bShift : boolean, bControl : boolean, bAlt : boolean)
Registers a hot key with this JSX model node. All keydown events that bubble up to this object will be checked against the hot key. If an event matches, the callback function will execute and the event bubble will be canceled.

If the four parameters vntKey, bShift, bControl, and bAlt match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback function (the most recently registered) will be executed by a single keydown event.

Parameters:

vntCallbackeither a function, or the name of a method bound to this object. When a keydown event bubbles up to this object that matches the hot key created by this method, this function is called on this object. If this function returns false then this hot key will not cancel the key event. This parameter can also be an instance of HotKey, in which case all other parameters are ignored.
vntKeyif this parameter is a String, the hot key matches that key (the keycode to match is determined by HotKey.keyDownCharToCode()). If it is an integer, the hot key will match that keycode value.
bShiftif not null the shift key state of the keydown event must match this value to invoke the hot key.
bControlif not null the control key state of the keydown event must match this value to invoke the hot key.
bAltif not null the alt key state of the keydown event must match this value to invoke the hot key.

Returns:

the registered hot key. 

See Also:

jsx3.gui.HotKey.keyDownCharToCode()

removeEvent

jsx3.gui.Interactive removeEvent(strType : String)
Removes an event script registered for the given model event type.

Parameters:

strTypethe event type, one of the model event types defined as static fields in this class

Returns:

this object  

removeEvents

jsx3.gui.Interactive removeEvents()
Removes all events scripts registered with this object.

Returns:

this object  

setCanDrag

jsx3.gui.Interactive setCanDrag(bDrag : int)
Sets whether is object supports programmatic drag, meanining it will allow any contained item to be dragged/dropped. Implementing classes can decide whether to consult this value or ignore it.

Parameters:

bDragjsx3.Boolean.TRUE or jsx3.Boolean.FALSE

Returns:

this object  

setCanDrop

jsx3.gui.Interactive setCanDrop(bDrop : int)
Sets whether this object can be the target of a drop event. Implementing classes can decide whether to consult this value or ignore it.

Parameters:

bDropjsx3.Boolean.TRUE or jsx3.Boolean.FALSE

Returns:

this object  

setCanMove

jsx3.gui.Interactive setCanMove(bMovable : int)
Sets whether is object can be moved around the screen (this is not the same as drag/drop). Implementing classes can decide whether to consult this value or ignore it.

Parameters:

bMovablejsx3.Boolean.TRUE or jsx3.Boolean.FALSE

Returns:

this object  

setCanSpy

jsx3.gui.Interactive setCanSpy(bSpy : int)
Sets whether is object can be spyglassed. Implementing classes can decide whether to consult this value or ignore it.

Parameters:

bSpyjsx3.Boolean.TRUE or jsx3.Boolean.FALSE

Returns:

this object  

setEvent

jsx3.gui.Interactive setEvent(strScript : String, strType : String)
Programmatically sets an event of this instance. Sets the script that will execute when this object publishes a model event. The script value will be saved in the serialization file of a component. Not all classes that implement this interface will publish events of every type. Consult the documentation of a class for a description of the events it publishes.

For programmatic registering of event handlers when persistence in a serialization file is not required, consider using jsx3.util.EventDispatcher.subscribe() instead of this method. Whenever a model event is published, it is published using the EventDispatcher interface as well as by executing any registered event script.

Parameters:

strScriptthe actual JavaScript code that will execute when the given event is published. For example: obj.setEvent("alert('hello.');", jsx3.gui.Interactive.EXECUTE);
strTypethe event type. Must be one of the model event types defined as static fields in this class

Returns:

reference to this 

See Also:

jsx3.util.EventDispatcher.subscribe()

setMenu

jsx3.gui.Interactive setMenu(strMenu : String)
Sets the name of the jsx3.gui.Menu instance to display when a user clicks on this object with the right button. The name is a pointer by-name to a JSX object in the same server.

Parameters:

strMenuname or id (jsxname or jsxid) of the context menu

Returns:

this object  

setSpyStyles

void setSpyStyles(strCSS : String)
Sets the CSS definition to apply to an HTML element when a spyglass is shown for that element

Parameters:

strCSSvalid CSS. For example, text-decoration:underline;color:red;

showSpy

void showSpy(strHTML : String, intLeft : int | jsx3.gui.Event, intTop : int)
called by 'window.setTimeout()' to display the spyglass hover for a given object;

Parameters:

strHTMLHTML/text to display in the spyglass; as the spyglass does not define a height/width, this content will have improved layout if it specifies a preferred width in its in-line-style or referenced-css rule.
intLeftuse an integer to specify an on-screen location; otherwise, use a jsx3.gui.Event instance to have the system automatically calculate the x/y position.
intTopuse an integer if intLeft also uses an integer. Otherwise, use null.