1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * ident "%Z%%M% %I% %E% SMI" 24 * 25 * Copyright (c) 2000 by Sun Microsystems, Inc. 26 * All rights reserved. 27 */ 28 29 /* 30 * Copyright (C) 1996 Active Software, Inc. 31 * All rights reserved. 32 * 33 * @(#) Operations.java 1.2 - last change made 07/18/96 34 */ 35 36 package sunsoft.jws.visual.rt.base; 37 38 import java.awt.Event; 39 40 public abstract class Operations { 41 42 /** 43 * Set the group class. 44 */ setGroup(Group group)45 public abstract void setGroup(Group group); 46 47 /** 48 * Set the root from the group class. 49 * This is called as soon as the root 50 * becomes available. 51 */ setRoot(Root root)52 public abstract void setRoot(Root root); 53 54 // 55 // Events 56 // 57 handleMessage(Message msg)58 public boolean handleMessage(Message msg) { 59 if (msg.isAWT) 60 return handleEvent(msg, (Event)msg.arg); 61 else 62 return false; 63 } 64 handleEvent(Message msg, Event evt)65 public boolean handleEvent(Message msg, Event evt) { 66 switch (evt.id) { 67 case Event.MOUSE_ENTER: 68 return mouseEnter(msg, evt, evt.x, evt.y); 69 case Event.MOUSE_EXIT: 70 return mouseExit(msg, evt, evt.x, evt.y); 71 case Event.MOUSE_MOVE: 72 return mouseMove(msg, evt, evt.x, evt.y); 73 case Event.MOUSE_DOWN: 74 return mouseDown(msg, evt, evt.x, evt.y); 75 case Event.MOUSE_DRAG: 76 return mouseDrag(msg, evt, evt.x, evt.y); 77 case Event.MOUSE_UP: 78 return mouseUp(msg, evt, evt.x, evt.y); 79 80 case Event.KEY_PRESS: 81 case Event.KEY_ACTION: 82 return keyDown(msg, evt, evt.key); 83 case Event.KEY_RELEASE: 84 case Event.KEY_ACTION_RELEASE: 85 return keyUp(msg, evt, evt.key); 86 87 case Event.ACTION_EVENT: 88 return action(msg, evt, evt.arg); 89 case Event.GOT_FOCUS: 90 return gotFocus(msg, evt, evt.arg); 91 case Event.LOST_FOCUS: 92 return lostFocus(msg, evt, evt.arg); 93 94 default: 95 return false; 96 } 97 } 98 mouseDown(Message msg, Event evt, int x, int y)99 public boolean mouseDown(Message msg, Event evt, int x, int y) { 100 return false; 101 } 102 mouseDrag(Message msg, Event evt, int x, int y)103 public boolean mouseDrag(Message msg, Event evt, int x, int y) { 104 return false; 105 } 106 mouseUp(Message msg, Event evt, int x, int y)107 public boolean mouseUp(Message msg, Event evt, int x, int y) { 108 return false; 109 } 110 mouseMove(Message msg, Event evt, int x, int y)111 public boolean mouseMove(Message msg, Event evt, int x, int y) { 112 return false; 113 } 114 mouseEnter(Message msg, Event evt, int x, int y)115 public boolean mouseEnter(Message msg, 116 Event evt, int x, int y) { 117 return false; 118 } 119 mouseExit(Message msg, Event evt, int x, int y)120 public boolean mouseExit(Message msg, Event evt, int x, int y) { 121 return false; 122 } 123 keyDown(Message msg, Event evt, int key)124 public boolean keyDown(Message msg, Event evt, int key) { 125 return false; 126 } 127 keyUp(Message msg, Event evt, int key)128 public boolean keyUp(Message msg, Event evt, int key) { 129 return false; 130 } 131 action(Message msg, Event evt, Object what)132 public boolean action(Message msg, Event evt, Object what) { 133 return false; 134 } 135 gotFocus(Message msg, Event evt, Object what)136 public boolean gotFocus(Message msg, Event evt, Object what) { 137 return false; 138 } 139 lostFocus(Message msg, Event evt, Object what)140 public boolean lostFocus(Message msg, Event evt, Object what) { 141 return false; 142 } 143 } 144