public class mxEventSource
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
mxEventSource.mxIEventListener
Defines the requirements for an object that listens to an event source.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.Object> |
eventListeners
Holds the event names and associated listeners in an array.
|
protected boolean |
eventsEnabled
Specifies if events can be fired.
|
protected java.lang.Object |
eventSource
Holds the source object for this event source.
|
Constructor and Description |
---|
mxEventSource()
Constructs a new event source using this as the source object.
|
mxEventSource(java.lang.Object source)
Constructs a new event source for the given source object.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(java.lang.String eventName,
mxEventSource.mxIEventListener listener)
Binds the specified function to the given event name.
|
void |
fireEvent(mxEventObject evt)
Dispatches the given event name with this object as the event source.
|
void |
fireEvent(mxEventObject evt,
java.lang.Object sender)
Dispatches the given event name, passing all arguments after the given
name to the registered listeners for the event.
|
java.lang.Object |
getEventSource() |
boolean |
isEventsEnabled() |
void |
removeListener(mxEventSource.mxIEventListener listener)
Function: removeListener
Removes all occurances of the given listener from the list of listeners.
|
void |
removeListener(mxEventSource.mxIEventListener listener,
java.lang.String eventName)
Function: removeListener
Removes all occurances of the given listener from the list of listeners.
|
void |
setEventsEnabled(boolean eventsEnabled) |
void |
setEventSource(java.lang.Object value) |
protected transient java.util.List<java.lang.Object> eventListeners
protected java.lang.Object eventSource
protected boolean eventsEnabled
public mxEventSource()
public mxEventSource(java.lang.Object source)
public java.lang.Object getEventSource()
public void setEventSource(java.lang.Object value)
public boolean isEventsEnabled()
public void setEventsEnabled(boolean eventsEnabled)
public void addListener(java.lang.String eventName, mxEventSource.mxIEventListener listener)
public void removeListener(mxEventSource.mxIEventListener listener)
public void removeListener(mxEventSource.mxIEventListener listener, java.lang.String eventName)
public void fireEvent(mxEventObject evt)
fireEvent(new mxEventObject("eventName", key1, val1, .., keyN, valN))
public void fireEvent(mxEventObject evt, java.lang.Object sender)
Copyright (c) 2010-2017 Gaudenz Alder, JGraph Ltd. All rights reserved.