KickJava   Java API By Example, From Geeks To Geeks.

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


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's visible flag is set.
12  *
13  * @author <a HREF="http://jheer.org">jeffrey heer</a>
14  */

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

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

34     public String JavaDoc getName() {
35         return "VISIBLE";
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 VisiblePredicate
60
Popular Tags