001: /*
002: * Copyright Javelin Software, All rights reserved.
003: */
004:
005: package com.javelin.swinglets.event;
006:
007: import java.awt.*;
008: import java.awt.event.*;
009:
010: /**
011: * ScriptedMouseListener is used to determine what happens when
012: * a Scripted Event happens, such as a JavaScript event on the client
013: * browser.
014: *
015: * @author Robin Sharp
016: */
017:
018: public class ScriptedMouseListener extends ScriptedListener implements
019: MouseListener {
020: public final static String MOUSE_CLICKED = "onclick";
021: public final static String MOUSE_DBLCLICK = "ondblclick";
022: public final static String MOUSE_PRESSED = "onmousedown";
023: public final static String MOUSE_RELEASED = "onmouseup";
024: public final static String MOUSE_ENTERED = "onmouseover";
025: public final static String MOUSE_EXITED = "onmouseout";
026:
027: /**
028: * Construct a listener with the script content type.
029: */
030: public ScriptedMouseListener(String contentType) {
031: super (contentType);
032: }
033:
034: /**
035: * Get the mouse Clicked Script.
036: */
037: public Object getMouseClickedScript() {
038: return get(MOUSE_CLICKED);
039: }
040:
041: /**
042: * Get the mouse Clicked Script.
043: */
044: public ScriptedMouseListener setMouseClickedScript(
045: Object mouseClickedScript) {
046: put(MOUSE_CLICKED, mouseClickedScript);
047: return this ;
048: }
049:
050: /**
051: * Get the mouse Pressed Script.
052: */
053: public Object getMousePressedScript() {
054: return get(MOUSE_PRESSED);
055: }
056:
057: /**
058: * Get the mouse Pressed Script.
059: */
060: public ScriptedMouseListener setMousePressedScript(
061: Object mousePressedScript) {
062: put(MOUSE_PRESSED, mousePressedScript);
063: return this ;
064: }
065:
066: /**
067: * Get the mouse Released Script.
068: */
069: public Object getMouseReleasedScript() {
070: return get(MOUSE_RELEASED);
071: }
072:
073: /**
074: * Get the mouse Released Script.
075: */
076: public ScriptedMouseListener setMouseReleasedScript(
077: Object mouseReleasedScript) {
078: put(MOUSE_RELEASED, mouseReleasedScript);
079: return this ;
080: }
081:
082: /**
083: * Get the mouse Entered Script.
084: */
085: public Object getMouseEnteredScript() {
086: return get(MOUSE_ENTERED);
087: }
088:
089: /**
090: * Get the mouse Entered Script.
091: */
092: public ScriptedMouseListener setMouseEnteredScript(
093: Object mouseEnteredScript) {
094: put(MOUSE_ENTERED, mouseEnteredScript);
095: return this ;
096: }
097:
098: /**
099: * Get the mouse Exited Script.
100: */
101: public Object getMouseExitedScript() {
102: return get(MOUSE_EXITED);
103: }
104:
105: /**
106: * Get the mouse Exited Script.
107: */
108: public ScriptedMouseListener setMouseExitedScript(
109: Object mouseExitedScript) {
110: put(MOUSE_EXITED, mouseExitedScript);
111: return this ;
112: }
113:
114: // STUB EVENT HANDLERS /////////////////////////////////////////////////////
115:
116: public void mouseClicked(MouseEvent e) {
117: };
118:
119: public void mousePressed(MouseEvent e) {
120: };
121:
122: public void mouseReleased(MouseEvent e) {
123: };
124:
125: public void mouseEntered(MouseEvent e) {
126: };
127:
128: public void mouseExited(MouseEvent e) {
129: };
130:
131: // PRIVATE /////////////////////////////////////////////////////////////////
132:
133: }
|