/[fenfire]/fenfire/org/fenfire/loom/Loom.java
ViewVC logotype

Diff of /fenfire/org/fenfire/loom/Loom.java

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

revision 1.15 by benja, Sat Mar 8 13:38:30 2003 UTC revision 1.16 by benja, Sat Mar 8 22:22:59 2003 UTC
# Line 73  public class Loom { Line 73  public class Loom {
73              System.exit(1);              System.exit(1);
74          }          }
75    
76          new Loom(file, blue);          new Loom(file, ColorScheme.blue);
77      }      }
78    
79      protected NodeView.Nodespec lastFocus;      protected NodeView.Nodespec lastFocus;
# Line 88  public class Loom { Line 88  public class Loom {
88          final Statement stmt = model.listStatements().next();          final Statement stmt = model.listStatements().next();
89          final GraphicsAPI api = GraphicsAPI.getInstance();          final GraphicsAPI api = GraphicsAPI.getInstance();
90    
         final Comparator subjOrder = new Comparator() {  
                 public int compare(Object o1, Object o2) {  
                     Statement s1 = (Statement)o1, s2 = (Statement)o2;  
                     int cmp = s1.getPredicate().toString()  
                         .compareTo(s2.getPredicate().toString());  
                     if(cmp == 0)  
                         cmp = s1.getSubject().toString()  
                             .compareTo(s2.getSubject().toString());  
                     return cmp;  
                 }  
             };  
         final Comparator objOrder = new Comparator() {  
                 public int compare(Object o1, Object o2) {  
                     Statement s1 = (Statement)o1, s2 = (Statement)o2;  
                     int cmp = s1.getPredicate().toString()  
                         .compareTo(s2.getPredicate().toString());  
                     if(cmp == 0)  
                         cmp = s1.getObject().toString()  
                             .compareTo(s2.getObject().toString());  
                     return cmp;  
                 }  
             };  
   
91          final Cursor cursor =          final Cursor cursor =
92              new Cursor(subjOrder, objOrder,              new Cursor(SimpleOrder.subjOrder, SimpleOrder.objOrder,
93                         new StatementSelector.SimpleSelector(),                         StatementSelector.simpleSelector,
94                         stmt.getSubject(), 1, stmt.getObject());                         stmt.getSubject(), 1, stmt.getObject());
95    
96          final TextStyle style = api.getTextStyle("Serif", 0, 12);          final TextStyle style = api.getTextStyle("Serif", 0, 12);
# Line 282  public class Loom { Line 259  public class Loom {
259                  }                  }
260              });              });
261      }      }
   
     public interface ColorScheme {  
         public Color getBg();  
         public Color getCursorColor();  
     }  
   
     public static class LightColorScheme implements ColorScheme {  
         float hue;  
         public LightColorScheme(float hue) { this.hue = hue; }  
         public Color getBg() {  
             return Color.getHSBColor(hue, 0.1f, 1f);  
         }  
         public Color getCursorColor() {  
             return Color.getHSBColor(hue, 0.4f, 1f);  
         }  
     }  
   
     public static final ColorScheme  
         green = new LightColorScheme(0.233f),  
         blue = new LightColorScheme(0.6f);  
       
262  }  }

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

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