Search in sources :

Example 1 with VariableValueInsertionProblem

use of doc.mathobjects.VariableValueInsertionProblem in project OpenNotebook by jaltekruse.

the class DocReader method endElement.

@Override
public void endElement(String uri, String localName, String qName) {
    if (MathObject.isMathObjectType(qName)) {
        mObj = null;
        overridenLists = new Vector<>();
    }
    if (qName.equals(MathObject.GROUPING) || qName.equals(MathObject.VAR_INSERTION_PROBLEM) || qName.equals(PROBLEM) || qName.equals(MathObject.GENERATED_PROBLEM)) {
        if (qName.equals(MathObject.VAR_INSERTION_PROBLEM) || qName.equals(PROBLEM) || qName.equals(MathObject.GENERATED_PROBLEM)) {
            if (readingGenerators) {
                try {
                    doc.addGenerator((ProblemGenerator) containerStack.get(containerStack.size() - 1));
                } catch (Exception e) {
                    if (DEBUG) {
                        e.printStackTrace();
                    }
                }
            } else if (readingProblemDatabase) {
                database.addProblem((VariableValueInsertionProblem) containerStack.get(containerStack.size() - 1));
            }
        }
        for (MathObject mathObj : objectsInGroup.get(objectsInGroup.size() - 1)) {
            containerStack.get(containerStack.size() - 1).addObjectFromPage(mathObj);
        }
        objectsInGroup.remove(objectsInGroup.size() - 1);
        containerStack.remove(containerStack.get(containerStack.size() - 1));
    }
    if (qName.equals("Page")) {
        page = null;
    } else if (qName.equals(ListAttribute.LIST)) {
        readingList = false;
    } else if (qName.equals(Document.OPEN_NOTEBOOK_DOC)) {
    } else if (qName.equals(Document.GENERATORS)) {
        readingGenerators = false;
    }
}
Also used : VariableValueInsertionProblem(doc.mathobjects.VariableValueInsertionProblem) MathObject(doc.mathobjects.MathObject) AttributeException(doc.attributes.AttributeException) SAXException(org.xml.sax.SAXException)

Aggregations

AttributeException (doc.attributes.AttributeException)1 MathObject (doc.mathobjects.MathObject)1 VariableValueInsertionProblem (doc.mathobjects.VariableValueInsertionProblem)1 SAXException (org.xml.sax.SAXException)1