mev-4.0.01/source/org/tigr/microarray/mev/cluster/algorithm/AlgorithmEvent.java

Code
Comments
Other
Rev Date Author Line
2 26 Feb 07 jari 1 /*
2 26 Feb 07 jari 2 Copyright @ 1999-2003, The Institute for Genomic Research (TIGR).
2 26 Feb 07 jari 3 All rights reserved.
2 26 Feb 07 jari 4 */
2 26 Feb 07 jari 5 /*
2 26 Feb 07 jari 6  * $RCSfile: AlgorithmEvent.java,v $
2 26 Feb 07 jari 7  * $Revision: 1.4 $
2 26 Feb 07 jari 8  * $Date: 2006/02/23 21:19:42 $
2 26 Feb 07 jari 9  * $Author: caliente $
2 26 Feb 07 jari 10  * $State: Exp $
2 26 Feb 07 jari 11  */
2 26 Feb 07 jari 12 package org.tigr.microarray.mev.cluster.algorithm;
2 26 Feb 07 jari 13
2 26 Feb 07 jari 14 import java.util.EventObject;
2 26 Feb 07 jari 15
2 26 Feb 07 jari 16 /**
2 26 Feb 07 jari 17  * This high-level event is generated by an algorithm when the algorithm-specific
2 26 Feb 07 jari 18  * action occurs (for example, calculation progress was changed).
2 26 Feb 07 jari 19  * The event is passed to every <code>AlgorithmListener</code> object
2 26 Feb 07 jari 20  * that registered to receive such events using the algorithm's
2 26 Feb 07 jari 21  * <code>addAlgorithmListener</code> method.
2 26 Feb 07 jari 22  *
2 26 Feb 07 jari 23  * @version 1.0
2 26 Feb 07 jari 24  * @author Aleksey D.Rezantsev
2 26 Feb 07 jari 25  */
2 26 Feb 07 jari 26 public class AlgorithmEvent extends EventObject {
2 26 Feb 07 jari 27     
2 26 Feb 07 jari 28     /**
2 26 Feb 07 jari 29      * This event id indicates that algorithm sends progress units.
2 26 Feb 07 jari 30      */
2 26 Feb 07 jari 31     public static final int SET_UNITS      = 1;
2 26 Feb 07 jari 32     
2 26 Feb 07 jari 33     /**
2 26 Feb 07 jari 34      * This event id indicates that progress value was changed.
2 26 Feb 07 jari 35      */
2 26 Feb 07 jari 36     public static final int PROGRESS_VALUE = 2;
2 26 Feb 07 jari 37     
2 26 Feb 07 jari 38     /**
2 26 Feb 07 jari 39      * This event id indicates that monitor value was changed.
2 26 Feb 07 jari 40      */
2 26 Feb 07 jari 41     public static final int MONITOR_VALUE  = 3;
2 26 Feb 07 jari 42     
2 26 Feb 07 jari 43     /**
2 26 Feb 07 jari 44      * This event id indicates that algorithm sends a warning.
2 26 Feb 07 jari 45      */
2 26 Feb 07 jari 46     public static final int WARNING        = 4;
2 26 Feb 07 jari 47     
2 26 Feb 07 jari 48     public static final int SET_VALUE = 5;
2 26 Feb 07 jari 49     
2 26 Feb 07 jari 50     private int id;
2 26 Feb 07 jari 51     private int intValue;
2 26 Feb 07 jari 52     private float floatValue;
2 26 Feb 07 jari 53     private String description;
2 26 Feb 07 jari 54     
2 26 Feb 07 jari 55     /**
2 26 Feb 07 jari 56      * Constructs an <code>AlgorithmEvent</code> object.
2 26 Feb 07 jari 57      *
2 26 Feb 07 jari 58      * @param source  the object that originated the event.
2 26 Feb 07 jari 59      * @param id      an integer that identifies the event.
2 26 Feb 07 jari 60      */
2 26 Feb 07 jari 61     public AlgorithmEvent(Object source, int id) {
2 26 Feb 07 jari 62   super(source);
2 26 Feb 07 jari 63   this.id = id;
2 26 Feb 07 jari 64     }
2 26 Feb 07 jari 65     
2 26 Feb 07 jari 66     /**
2 26 Feb 07 jari 67      * Constructs an <code>AlgorithmEvent</code> object.
2 26 Feb 07 jari 68      *
2 26 Feb 07 jari 69      * @param source  the object that originated the event.
2 26 Feb 07 jari 70      * @param id      an integer that identifies the event.
2 26 Feb 07 jari 71      * @param value   an integer that specifies meaningful int value.
2 26 Feb 07 jari 72      */
2 26 Feb 07 jari 73     public AlgorithmEvent(Object source, int id, int value) {
2 26 Feb 07 jari 74   this(source, id);
2 26 Feb 07 jari 75   this.intValue = value;
2 26 Feb 07 jari 76     }
2 26 Feb 07 jari 77     
2 26 Feb 07 jari 78     /**
2 26 Feb 07 jari 79      * Constructs an <code>AlgorithmEvent</code> object.
2 26 Feb 07 jari 80      *
2 26 Feb 07 jari 81      * @param source  the object that originated the event.
2 26 Feb 07 jari 82      * @param id      an integer that identifies the event.
2 26 Feb 07 jari 83      * @param value   an integer that specifies meaningful int value.
2 26 Feb 07 jari 84      * @param description the description of this event.
2 26 Feb 07 jari 85      */
2 26 Feb 07 jari 86     public AlgorithmEvent(Object source, int id, int value, String description) {
2 26 Feb 07 jari 87   this(source, id, value);
2 26 Feb 07 jari 88   this.description = description;
2 26 Feb 07 jari 89     }
2 26 Feb 07 jari 90     
2 26 Feb 07 jari 91     /**
2 26 Feb 07 jari 92      * Constructs an <code>AlgorithmEvent</code> object.
2 26 Feb 07 jari 93      *
2 26 Feb 07 jari 94      * @param source  the object that originated the event.
2 26 Feb 07 jari 95      * @param id      an integer that identifies the event.
2 26 Feb 07 jari 96      * @param intValue an integer that specifies meaningful int value.
2 26 Feb 07 jari 97      * @param floatValue a float that specifies meaningful float value.
2 26 Feb 07 jari 98      * @param description the description of this event.
2 26 Feb 07 jari 99      */
2 26 Feb 07 jari 100     public AlgorithmEvent(Object source, int id, int intValue, float floatValue, String description) {
2 26 Feb 07 jari 101   this(source, id, intValue, description);
2 26 Feb 07 jari 102   this.floatValue = floatValue;
2 26 Feb 07 jari 103     }
2 26 Feb 07 jari 104     
2 26 Feb 07 jari 105     /**
2 26 Feb 07 jari 106      * Returns the event id.
2 26 Feb 07 jari 107      */
2 26 Feb 07 jari 108     public int getId() {
2 26 Feb 07 jari 109   return id;
2 26 Feb 07 jari 110     }
2 26 Feb 07 jari 111     
2 26 Feb 07 jari 112     /**
2 26 Feb 07 jari 113      * Sets the event id.
2 26 Feb 07 jari 114      * @param id an integer that identifies the event.
2 26 Feb 07 jari 115      */
2 26 Feb 07 jari 116     public void setId(int id) {
2 26 Feb 07 jari 117   this.id = id;
2 26 Feb 07 jari 118     }
2 26 Feb 07 jari 119     
2 26 Feb 07 jari 120     /**
2 26 Feb 07 jari 121      * Returns meaningful integer value.
2 26 Feb 07 jari 122      */
2 26 Feb 07 jari 123     public int getIntValue() {
2 26 Feb 07 jari 124   return intValue;
2 26 Feb 07 jari 125     }
2 26 Feb 07 jari 126     
2 26 Feb 07 jari 127     /**
2 26 Feb 07 jari 128      * Sets meaningful integer value.
2 26 Feb 07 jari 129      * @param value an integer that specifies meaningful value.
2 26 Feb 07 jari 130      */
2 26 Feb 07 jari 131     public void setIntValue(int value) {
2 26 Feb 07 jari 132   this.intValue = value;
2 26 Feb 07 jari 133     }
2 26 Feb 07 jari 134     
2 26 Feb 07 jari 135     /**
2 26 Feb 07 jari 136      * Returns meaningful float value.
2 26 Feb 07 jari 137      */
2 26 Feb 07 jari 138     public float getFloatValue() {
2 26 Feb 07 jari 139   return floatValue;
2 26 Feb 07 jari 140     }
2 26 Feb 07 jari 141     
2 26 Feb 07 jari 142     /**
2 26 Feb 07 jari 143      * Sets meaningful float value.
2 26 Feb 07 jari 144      * @param value a float that specifies meaningful value.
2 26 Feb 07 jari 145      */
2 26 Feb 07 jari 146     public void setFloatValue(float value) {
2 26 Feb 07 jari 147   this.floatValue = value;
2 26 Feb 07 jari 148     }
2 26 Feb 07 jari 149     
2 26 Feb 07 jari 150     /**
2 26 Feb 07 jari 151      * Returns the event description.
2 26 Feb 07 jari 152      */
2 26 Feb 07 jari 153     public String getDescription() {
2 26 Feb 07 jari 154   return description;
2 26 Feb 07 jari 155     }
2 26 Feb 07 jari 156     
2 26 Feb 07 jari 157     /**
2 26 Feb 07 jari 158      * Sets the event description.
2 26 Feb 07 jari 159      * @param description the event description.
2 26 Feb 07 jari 160      */
2 26 Feb 07 jari 161     public void setDescription(String description) {
2 26 Feb 07 jari 162   this.description = description;
2 26 Feb 07 jari 163     }
2 26 Feb 07 jari 164 }