KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > prefuse > visual > expression > HoverPredicate


1 package prefuse.visual.expression;
2
3 import prefuse.data.expression.ColumnExpression;
4 import prefuse.data.expression.Expression;
5 import prefuse.data.expression.Function;
6 import prefuse.data.expression.NotPredicate;
7 import prefuse.data.expression.Predicate;
8 import prefuse.visual.VisualItem;
9
10 /**
11  * Expression that indicates if an item is currently under the mouse
12  * pointer.
13  *
14  * @author <a HREF="http://jheer.org">jeffrey heer</a>
15  */

16 public class HoverPredicate extends ColumnExpression
17     implements Predicate, Function
18 {
19     /** Convenience instance for the hover == true case. */
20     public static final Predicate TRUE = new HoverPredicate();
21     /** Convenience instance for the hover == false case. */
22     public static final Predicate FALSE = new NotPredicate(TRUE);
23     
24     /**
25      * Create a new HoverPredicate.
26      */

27     public HoverPredicate() {
28         super(VisualItem.HOVER);
29     }
30
31     /**
32      * @see prefuse.data.expression.Function#getName()
33      */

34     public String JavaDoc getName() {
35         return "HOVER";
36     }
37
38     /**
39      * @see prefuse.data.expression.Function#addParameter(prefuse.data.expression.Expression)
40      */

41     public void addParameter(Expression e) {
42         throw new IllegalStateException JavaDoc("This function takes 0 parameters");
43     }
44
45     /**
46      * @see prefuse.data.expression.Function#getParameterCount()
47      */

48     public int getParameterCount() {
49         return 0;
50     }
51     
52     /**
53      * @see java.lang.Object#toString()
54      */

55     public String JavaDoc toString() {
56         return getName()+"()";
57     }
58
59 } // end of class HoverPredicate
60
Popular Tags