public class IlvEventMap extends Object implements Cloneable, IlvPersistentObject
IlvCompositeInteractor
,
IlvMouseGesture
Constructor and Description |
---|
IlvEventMap()
Beans default constructor
|
IlvEventMap(IlvInputStream stream)
Reads the object from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
Action |
getAction(IlvMouseGesture gesture)
Returns the Swing action associated with the supplied gesture.
|
Object[] |
getActions()
Returns the actions for this
IlvEventMap instance or null if none. |
Object |
getActions(int index)
Returns either a
Action instance or a String which
is the class name of a Swing action. |
String[] |
getEvents()
Gets the events associated with the actions.
|
String |
getEvents(int index)
Returns the gesture at the supplied position.
|
boolean |
isEmpty()
Returns
true when this IlvEventMap instance is empty. |
void |
setActions(int index,
Object action)
Sets an action at the given position.
|
void |
setActions(Object[] actions)
Sets the actions for this
IlvEventMap instance. |
void |
setEvents(int index,
String event)
Associates the action at the given position with the supplied gesture.
|
void |
setEvents(String[] events)
Sets the events associated with the actions.
|
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
public IlvEventMap()
public IlvEventMap(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if the format is not correct.public void setEvents(String[] events)
events
- The events that will cause the actions to be performed.public String[] getEvents()
public void setEvents(int index, String event)
index
- Position of the action.event
- The event that will cause the action to be performed. This event is either
a String
defining a key stroke as described in
KeyStroke
or a String
corresponding to a mouse gesture.IlvMouseGesture
,
KeyStroke
public String getEvents(int index)
IlvMouseGesture
public void setActions(int index, Object action)
index
- The position of the action.action
- Can be either a Action
or a String
which is
the class name of a Swing action.setEvents(java.lang.String[])
public Object getActions(int index)
Action
instance or a String
which
is the class name of a Swing action.index
- The position of the required action.public Object[] getActions()
IlvEventMap
instance or null
if none.public void setActions(Object[] actions)
IlvEventMap
instance.actions
- Array of either a Action
or a String
which is
the class name of a Swing action.public Action getAction(IlvMouseGesture gesture)
gesture
- The gesture for which the action is required.IlvMouseGesture
,
Action
public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.
You should not
call this method directly; instead, you should use the write
methods of the manager.write
in interface IlvPersistentObject
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.public boolean isEmpty()
true
when this IlvEventMap
instance is empty.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.