home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / prosrc.bin / ToggleActionEvent.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  2.9 KB  |  82 lines

  1. /*
  2.  * Copyright (c) 1997 Krumel & Associates, Inc. All Rights Reserved.
  3.  *
  4.  * www.krumel.com - controls@krumel.com
  5.  *
  6.  * Permission is given to the buyer of this package for one software
  7.  * developer to use this software on one CPU (one workstation) and to make
  8.  * one backup copy.  You may uitilize and/or midfy this class for use in your
  9.  * projects.  You may distribute or sell any executable which results from
  10.  * using this code in yur application, except a utility or class of similar
  11.  * nature to this product.  You may distribute this this product in compiled
  12.  * form only, but soley to be used with your cmpiled executable product
  13.  * for the puposes of dynamic loading. You may NOT redistribute the source
  14.  * code in any form or make it accessible through a network or other
  15.  * distribution media to others. Please refer to the file "copyright.html"
  16.  * for further important copyright and licensing information.
  17.  *
  18.  * The source code is the confidential and proprietary information
  19.  * of Krumel & Associates, Inc. ("Confidential Information").  You shall
  20.  * not disclose such Confidential Information and shall use it only in
  21.  * accordance with the terms of the license agreement you entered into
  22.  * with Krumel & Associates, Inc..
  23.  
  24.  * KRUMEL & ASSOCIATES MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
  25.  * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
  26.  * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  27.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. KRUMEL & ASSOCIATES SHALL NOT
  28.  * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
  29.  * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  30.  */
  31.  
  32.  
  33. package symantec.itools.db.awt.event;
  34.  
  35. import java.awt.event.ActionEvent;
  36.  
  37. /**
  38.  * The action semantic event for the tree control.  Written since ActionEvent
  39.  * does not provide support for a secondary parameter besides source.
  40.  */
  41. public class ToggleActionEvent extends ActionEvent {
  42.     Toggler    toggler;
  43.  
  44.     /**
  45.      * Leaf was toggled open.
  46.      */
  47.     public static final int OPEN_ACTION_PERFORMED = 555555;
  48.  
  49.     /**
  50.      * Leaf was toggled closed.
  51.      */
  52.     public static final int CLOSED_ACTION_PERFORMED = 555556;
  53.  
  54.     /**
  55.      * Creates a ToggleActionEvent with the event id being set according to the state of the
  56.      * toggler.
  57.      */
  58.     public ToggleActionEvent (Object source, Toggler t) {
  59.         super(source, t.isOpen() ?OPEN_ACTION_PERFORMED :CLOSED_ACTION_PERFORMED, t.getName());
  60.  
  61.         toggler = t;
  62.     }
  63.  
  64.     /**
  65.      * Creates a ToggleActionEvent using the specified event id..
  66.      */
  67.     public ToggleActionEvent (Object source, int id, Toggler t) {
  68.         super(source, id, t.getName());
  69.  
  70.         toggler = t;
  71.     }
  72.  
  73.     /**
  74.      * Gets the toggled object.
  75.      */
  76.     public Toggler getToggler() { return toggler; }
  77.  
  78.     /**
  79.      * Sets the toggled object.
  80.      */
  81.     public void setToggler(Toggler t) { toggler = t; }
  82. }