New QD files that don't do anything yet.

This commit is contained in:
eg3p 2002-12-10 20:53:55 +00:00
parent 26993a5093
commit 86c2374706
2 changed files with 109 additions and 0 deletions

View file

@ -0,0 +1,33 @@
package org.thdl.quilldriver;
import org.jdom.Document;
import org.thdl.tib.input.DuffPane;
public class TranscriptMediator {
private Document xml;
private DuffPane pane;
Properties nodeAbbreviations;
Properties globalProperties;
public TranscriptMediator(Document xmlDoc, DuffPane duffPane) {
xml = xmlDoc;
pane = duffPane;
}
public DuffPane getPane() {
return pane;
}
public Document getXML() {
return xml;
}
public Object getNodeAtPosition(int position) {
return null;
}
}

View file

@ -0,0 +1,76 @@
package org.thdl.quilldriver;
import org.jaxen.jdom.JDOMXPath;
import org.jaxen.XPath;
public class TranscriptNavigator {
private boolean autoInsertFlag = false;
private TranscriptMediator mediator;
TranscriptNavigator(TranscriptMediator mediator) {
this.mediator = mediator;
}
/*
Next = ancestor-or-self::S/following-sibling::
*/
public boolean edit(String xpathExpression) {
return false;
}
public boolean editNextText(String elementName) {
int pos = mediator.getPane().getCaretPosition();
Object next = next(pos, elementName);
if (next == null) {
if (autoInsertFlag) {
//insert after
return false;
} else
return false;
}
return false;
}
public boolean editPrevText(String elementName) {
pos = mediator.getPane().getCaretPosition();
Object prev = prev(pos, elementName);
if (prev == null) {
if (autoInsertFlag) {
//insert after
return false;
} else
return false;
}
return false;
}
public boolean highlightNext(String elementName) {
return false;
}
public boolean highlightPrev(String elementName) {
return false;
}
public Object next(int pos, String elementName) {
Object jdomNode = mediator.getNodeAtPos(int position);
if (jdomNode == null)
return null;
XPath path = new JDOMXPath("a/b/c");
List results = path.selectNodes(jdomNode);
return null;
}
public Object prev(int pos, String elementName) {
Object jdomNode = mediator.getNodeAtPos(int position);
if (jdomNode == null)
return null;
XPath path = new JDOMXPath("a/b/c");
List results = path.selectNodes(jdomNode);
return null;
}
}