1 // 2 // Description: 3 // SWFButton Class 4 // 5 // Authors: 6 // Jonathan Shore <jshore@e-shuppan.com> 7 // Based on php wrapper developed by <dave@opaque.net> 8 // 9 // Copyright: 10 // Copyright 2001 E-Publishing Group Inc. Permission is granted to use or 11 // modify this code provided that the original copyright notice is included. 12 // 13 // This software is distributed with no warranty of liability, merchantability, 14 // or fitness for a specific purpose. 15 // 16 17 18 19 20 21 22 // 23 // SWFButton Class 24 // button (region with actions) 25 // 26 // Notes 27 // - 28 // 29 public class SWFButton extends SWFObject implements SWFButtonI { 30 SWFButton()31 public SWFButton () 32 throws SWFException 33 { 34 setHandle (nNew()); 35 } 36 finalize()37 protected void finalize() 38 throws Throwable 39 { 40 // nDestroy (handle); 41 super.finalize(); 42 } 43 44 45 46 // methods 47 setUp(SWFShapeI shape)48 public void setUp (SWFShapeI shape) 49 throws SWFException 50 { shape.eval(); addShape (SWFButton.ButtonUp, shape); } setDown(SWFShapeI shape)51 public void setDown (SWFShapeI shape) 52 throws SWFException 53 { shape.eval(); addShape (SWFButton.ButtonDown, shape); } setOver(SWFShapeI shape)54 public void setOver (SWFShapeI shape) 55 throws SWFException 56 { shape.eval(); addShape (SWFButton.ButtonOver, shape); } setHit(SWFShapeI shape)57 public void setHit (SWFShapeI shape) 58 throws SWFException 59 { shape.eval(); addShape (SWFButton.ButtonHit, shape); } 60 addShape(int which, SWFShapeI shape)61 public void addShape (int which, SWFShapeI shape) 62 throws SWFException 63 { shape.eval(); nAddShape (handle, shape.getHandle(), which); } 64 addAction(SWFActionI action, int trigger)65 public void addAction (SWFActionI action, int trigger) 66 throws SWFException 67 { action.eval(); nAddAction (handle, action.getHandle(), trigger); } 68 69 70 // native methods 71 nNew()72 protected native int nNew (); nDestroy(int handle)73 protected native void nDestroy (int handle); 74 nAddShape(int handle, int shape, int which)75 protected native void nAddShape (int handle, int shape, int which); nAddAction(int handle, int action, int trigger)76 protected native void nAddAction (int handle, int action, int trigger); 77 78 }; 79 80 81 82 83