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; |
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); |
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 |
} |
} |