/[gzz]/gzz/lava/gzz/potion/potions/PrefixOrOther.java
ViewVC logotype

Diff of /gzz/lava/gzz/potion/potions/PrefixOrOther.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by benja, Fri Jan 3 18:05:06 2003 UTC revision 1.2 by benja, Sun Jan 5 10:41:06 2003 UTC
# Line 11  import gzz.potion.*; Line 11  import gzz.potion.*;
11  public class PrefixOrOther implements Function {  public class PrefixOrOther implements Function {
12    
13      protected Cell getCell(Map context) {      protected Cell getCell(Map context) {
         System.out.println("PrefixOrOther.getCell");  
14          Fallback.Win win = (Fallback.Win)context.get(ViewContext.class);          Fallback.Win win = (Fallback.Win)context.get(ViewContext.class);
15          return win.getOther().cursor;          return win.getOther().cursor;
16      }      }
17    
18      public List evaluate(List[] params, Map context) {      protected List getCells(Map context) {
19            System.out.println("PrefixOrOther.getCell");
20    
21            PotionFallbackBinder binder =
22                (PotionFallbackBinder)context.get(PotionFallbackBinder.class);
23    
24            if(!binder.markedCells.isEmpty())
25                return new ArrayList(binder.markedCells);
26    
27          return Collections.nCopies(1, getCell(context));          return Collections.nCopies(1, getCell(context));
28      }      }
29        
30        public List evaluate(List[] params, Map context) {
31            return getCells(context);
32        }
33    
34      public String getString(Expression[] params, Map context) {      public String getString(Expression[] params, Map context) {
35          return "the cell in the other window";          return "the cell in the other window";
36      }      }
37            
38      public void render(Expression[] params,Map context, HChain into) {      public void render(Expression[] params,Map context, HChain into) {
39      }      }
40            
41      public Type[] getParams() {      public Type[] getParams() {
42          return new Type[0];          return new Type[0];
43      }      }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26