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 * @(#) ImageButtonShadow.java 1.28 - last change made 07/25/97 34 */ 35 36package sunsoft.jws.visual.rt.shadow; 37 38import sunsoft.jws.visual.rt.type.ImageRef; 39import sunsoft.jws.visual.rt.awt.ImageButton; 40 41/** 42 * Wraps an AWT widget. The attributes available for this 43 * class are listed below. In the type column, type names beginning 44 * with "sunsoft.jws.visual.rt" have been abbreviated to begin with 45 * "rt". 46 * 47 * < pre> 48name type default value 49----------------------------------------------------------------------- 50lineWidth java.lang.Integer 2 51+ padWidth java.lang.Integer 2 52pressMovement java.lang.Integer 1 53* < /pre> 54* 55* + = this attribute overrides one inherited from an ancestor class. 56* < p> 57* Check the super class for additional attributes. 58* 59* @see ImageButton 60* @version 1.28, 07/25/97 61*/ 62public class ImageButtonShadow extends ImageLabelShadow { 63 public ImageButtonShadow() { 64 attributes.add(/* NOI18N */"padWidth", 65 /* NOI18N */"java.lang.Integer", 66 new Integer(2), 0); 67 attributes.add(/* NOI18N */"lineWidth", 68 /* NOI18N */"java.lang.Integer", new Integer(2), 0); 69 attributes.add(/* NOI18N */"pressMovement", 70 /* NOI18N */"java.lang.Integer", new Integer(1), 0); 71 } 72 73 protected Object getOnBody(String key) { 74 ImageButton button = (ImageButton)body; 75 76 if (key.equals(/* NOI18N */"lineWidth")) 77 return (new Integer(button.getLineWidth())); 78 else if (key.equals(/* NOI18N */"pressMovement")) 79 return (new Integer(button.getPressMovement())); 80 else 81 return (super.getOnBody(key)); 82 } 83 84 protected void setOnBody(String key, Object value) { 85 ImageButton button = (ImageButton)body; 86 87 if (key.equals(/* NOI18N */"lineWidth")) 88 button.setLineWidth(((Integer) value).intValue()); 89 else if (key.equals(/* NOI18N */"pressMovement")) 90 button.setPressMovement(((Integer) value).intValue()); 91 else 92 super.setOnBody(key, value); 93 } 94 95 public void createBody() { 96 body = new ImageButton(null); 97 } 98} 99