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: * ScriptedComponentListener 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 ScriptedComponentListener extends ScriptedListener
019: implements ComponentListener {
020: public final static String COMPONENT_RESIZED = "onresize";
021: public final static String COMPONENT_MOVED = "onmoved";
022: public final static String COMPONENT_SHOWN = "onshown";
023: public final static String COMPONENT_HIDDEN = "onhidden";
024:
025: /**
026: * Construct a listener with the script content type.
027: */
028: public ScriptedComponentListener(String contentType) {
029: super (contentType);
030: }
031:
032: /**
033: * Get the component Resized Script.
034: */
035: public Object getComponentResizedScript() {
036: return get(COMPONENT_RESIZED);
037: }
038:
039: /**
040: * Get the component Resized Script.
041: */
042: public ScriptedComponentListener setComponentResizedScript(
043: Object componentResizedScript) {
044: put(COMPONENT_RESIZED, componentResizedScript);
045: return this ;
046: }
047:
048: /**
049: * Get the component Moved Script.
050: */
051: public Object getComponentMovedScript() {
052: return get(COMPONENT_MOVED);
053: }
054:
055: /**
056: * Get the component Moved Script.
057: */
058: public ScriptedComponentListener setComponentMovedScript(
059: Object componentMovedScript) {
060: put(COMPONENT_MOVED, componentMovedScript);
061: return this ;
062: }
063:
064: /**
065: * Get the component Shown Script.
066: */
067: public Object getComponentShownScript() {
068: return get(COMPONENT_SHOWN);
069: }
070:
071: /**
072: * Get the component Shown Script.
073: */
074: public ScriptedComponentListener setComponentShownScript(
075: Object componentShownScript) {
076: put(COMPONENT_SHOWN, componentShownScript);
077: return this ;
078: }
079:
080: /**
081: * Get the component Hidden Script.
082: */
083: public Object getComponentHiddenScript() {
084: return get(COMPONENT_HIDDEN);
085: }
086:
087: /**
088: * Get the component Hidden Script.
089: */
090: public ScriptedComponentListener setComponentHiddenScript(
091: Object componentHiddenScript) {
092: put(COMPONENT_HIDDEN, componentHiddenScript);
093: return this ;
094: }
095:
096: // STUB EVENT HANDLERS /////////////////////////////////////////////////////
097:
098: public void componentResized(ComponentEvent e) {
099: };
100:
101: public void componentMoved(ComponentEvent e) {
102: };
103:
104: public void componentShown(ComponentEvent e) {
105: };
106:
107: public void componentHidden(ComponentEvent e) {
108: };
109:
110: // PRIVATE /////////////////////////////////////////////////////////////////
111:
112: }
|