Ignore:
Timestamp:
06/18/20 13:50:48 (4 years ago)
Author:
bnemhaus
Message:

When running the "WriteTree tex" action, the presence of the annotation "@flowwalker" is tested for. If it is present then the flow walker is used!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/io/TEXWriter.java

    r919 r1529  
    3232        // may be needed for sectioning commands
    3333        private Text _title = null;
     34        private boolean useFlowWalker = false;
     35       
     36        public String writeTree(Frame toWrite) throws IOException {
     37                try {
     38                        initialise(toWrite);
     39                        if (useFlowWalker) {
     40                                System.err.println("USING FLOW WALKER FOR TEXTWriter");
     41                                outputTreeFlowWalkerStyle(toWrite);
     42                        } else {
     43                                outputTree(toWrite);
     44                        }
     45                } catch (IOException ioe) {
     46                        _running = false;
     47                        throw ioe;
     48                } catch (Exception e) {
     49                        e.printStackTrace();
     50                }
     51                _running = false;
     52                return finaliseTree();
     53        }
    3454
    3555        @Override
    3656        protected void initialise(Frame start, Writer writer) throws IOException {
    3757                _format = ".tex";
     58                Text annotation = start.getAnnotation("flowwalker");
     59                if (annotation != null) {
     60                        useFlowWalker  = true;
     61                }
    3862                super.initialise(start, writer);
    3963        }
     
    104128
    105129        @Override
    106         protected void writeText(Text text) throws IOException {
     130        protected void writeText(Text text) throws IOException {       
    107131                for (String s : text.getTextList()) {
    108132                        _writer.write(s);
Note: See TracChangeset for help on using the changeset viewer.