Changeset 390
- Timestamp:
- 07/28/10 15:33:37 (2 years ago)
- Files:
-
- kahina/trunk/src/org/kahina/core/KahinaInstance.java (modified) (1 diff)
- kahina/trunk/src/org/kahina/core/gui/KahinaGUI.java (modified) (6 diffs)
- kahina/trunk/src/org/kahina/core/io/magazine/ObjectMagazine.java (modified) (1 diff)
- kahina/trunk/src/org/kahina/tralesld/TraleSLDRunner.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
kahina/trunk/src/org/kahina/core/KahinaInstance.java
r387 r390 39 39 public abstract class KahinaInstance<S extends KahinaState, G extends KahinaGUI, B extends KahinaBridge> implements KahinaListener 40 40 { 41 private static final boolean VERBOSE = true;41 private static final boolean VERBOSE = false; 42 42 43 43 protected S state; kahina/trunk/src/org/kahina/core/gui/KahinaGUI.java
r384 r390 38 38 public class KahinaGUI implements KahinaListener 39 39 { 40 private static final boolean verbose = true;40 private static final boolean VERBOSE = false; 41 41 42 42 protected KahinaInstance<?, ?, ?> kahina; … … 62 62 public KahinaGUI(Class<? extends KahinaStep> stepType, KahinaInstance<?, ?, ?> kahina) 63 63 { 64 if ( verbose)64 if (VERBOSE) 65 65 { 66 66 System.err.println("creating Kahina GUI..."); … … 102 102 protected void fillFieldToView(Class<? extends KahinaStep> stepType) 103 103 { 104 if ( verbose)104 if (VERBOSE) 105 105 { 106 106 System.err.println("Generating views for step fields:"); … … 108 108 for (Field field : stepType.getFields()) 109 109 { 110 if ( verbose)110 if (VERBOSE) 111 111 { 112 112 System.err.println("\tfield: " + field.getName() + "\n\t\tclass: " + field.getType()); … … 116 116 KahinaView<?> newView = KahinaViewRegistry.generateViewFor(field.getType()); 117 117 KahinaRunner.getControl().registerListener("update", newView); 118 if ( verbose)118 if (VERBOSE) 119 119 { 120 120 System.err.println("\t\tview: " + newView); … … 230 230 if (stepID != -1) 231 231 { 232 if ( verbose)232 if (VERBOSE) 233 233 { 234 234 System.err.println("Updating selection to step " + stepID); kahina/trunk/src/org/kahina/core/io/magazine/ObjectMagazine.java
r383 r390 25 25 public class ObjectMagazine<S> 26 26 { 27 private static final boolean VERBOSE = true;27 private static final boolean VERBOSE = false; 28 28 29 29 private final File folder; kahina/trunk/src/org/kahina/tralesld/TraleSLDRunner.java
r383 r390 1 1 package org.kahina.tralesld; 2 2 3 import java.io.File; 4 3 5 import org.kahina.core.KahinaRunner; 6 import org.kahina.core.event.KahinaSessionEvent; 4 7 import org.kahina.tralesld.bridge.TraleSLDBridge; 5 8 6 9 public class TraleSLDRunner extends KahinaRunner 7 10 { 8 public static void main(String[] args)9 {10 TraleSLDBridge bridge = runAndGetBridge();11 bridge.initializeParseTrace("[she,thinks,she,gives,her,milk]");12 bridge.registerChartEdge(0, 5, 6, "lexicon");13 bridge.registerStepInformation(1, "rule_close", "close chart edge under rule application");14 bridge.registerStepLocation(1, 0);15 bridge.registerRuleApplication(2, "subject_head_rule", 0, "apply rule, subject_head_rule"); // TODO16 bridge.registerStepSourceCodeLocation(2, "/home/johannes/pro/kahina/trale/test_gram/theory3.pl", 185);17 bridge.registerStepLocation(2, 1);18 bridge.registerEdgeRetrieval(0);19 bridge.registerStepInformation(3, "unify(Subj)", "unify edge with Subj");20 bridge.registerStepSourceCodeLocation(3, "/home/johannes/pro/kahina/trale/test_gram/theory3.pl", 191);21 bridge.registerStepLocation(3, 2);22 bridge.registerStepInformation(4, "type(edge,bot)", "add type, bot, to edge");23 bridge.registerStepLocation(4, 3);24 bridge.registerStepExit(4, true);25 bridge.registerStepExit(3, true);26 bridge.registerStepInformation(5, "featval(edge:phon)", "enforce description on phon value of edge");27 bridge.registerStepSourceCodeLocation(5, "/home/johannes/pro/kahina/trale/test_gram/theory3.pl", 191);28 bridge.registerStepLocation(5, 2);29 bridge.registerStepInformation(6, "unify(SubjPhon)", "unify value at phon with SubjPhon");30 bridge.registerStepSourceCodeLocation(6, "/home/johannes/pro/kahina/trale/test_gram/theory3.pl", 191);31 bridge.registerStepLocation(6, 5);32 bridge.registerStepInformation(7, "type(phon,ne_list)", "add type, ne_list, to value at phon");33 bridge.registerStepLocation(7, 6);34 bridge.registerStepExit(7, true);35 bridge.registerStepExit(6, true);36 bridge.registerStepExit(5, true);37 bridge.registerStepFailure(2);38 bridge.registerRuleApplication(8, "head_complement_rule", 0, "apply rule, head_complement_rule");39 bridge.registerStepSourceCodeLocation(8, "/home/johannes/pro/kahina/trale/test_gram/theory3.pl", 195);40 bridge.registerStepLocation(8, 1);41 bridge.registerEdgeRetrieval(0);42 bridge.registerStepInformation(9, "unify(Head)", "unify edge with Head");43 bridge.registerStepSourceCodeLocation(9, "/home/johannes/pro/kahina/trale/test_gram/theory3.pl", 201);44 bridge.registerStepLocation(9, 8);45 bridge.registerStepInformation(10, "type(edge,bot)", "add type, bot, to edge");46 bridge.registerStepLocation(10, 9);47 }48 11 49 12 public static void initialize() … … 68 31 } 69 32 } 33 34 private static void runWithoutBridge(File savedSession) 35 { 36 try 37 { 38 initialize(); 39 TraleSLDInstance kahina = new TraleSLDInstance(); 40 kahina.getGUI().prepare(); 41 kahina.getGUI().buildAndShow(); 42 if (savedSession != null) 43 { 44 KahinaRunner.processEvent(new KahinaSessionEvent(KahinaSessionEvent.LOAD_SESSION, savedSession)); 45 } 46 } catch (Exception e) 47 { 48 e.printStackTrace(); 49 System.exit(-1); 50 } 51 } 52 53 public static void main(String[] args) 54 { 55 File savedSession = null; 56 if (args.length > 0) 57 { 58 savedSession = new File(args[0]); 59 } 60 runWithoutBridge(savedSession); 61 } 70 62 }
