Changeset 1529
- Timestamp:
- 06/18/20 13:50:48 (4 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/agents/WriteTree.java
r919 r1529 60 60 61 61 _format = format.trim(); 62 62 63 63 64 int ind = params.indexOf(" "); -
trunk/src/org/expeditee/io/DefaultTreeWriter.java
r1415 r1529 20 20 21 21 import java.io.IOException; 22 import java.util.ArrayList; 22 23 import java.util.List; 23 24 import java.util.Stack; … … 47 48 try { 48 49 initialise(toWrite); 49 outputTree(toWrite); 50 //outputTree(toWrite); 51 outputTreeFlowWalkerStyle(toWrite); 50 52 51 53 } catch (IOException ioe) { … … 184 186 } 185 187 188 protected void outputTreeFlowWalkerStyle(Frame toWrite) { 189 XGroupItem.doImplicitBoxing = true; 190 XGroupItem xgroup = new XGroupItem(toWrite, new ArrayList<Item>(toWrite.getAllItems())); 191 xgroup.repositionOutOfFlowGroups(xgroup); 192 xgroup.mapInXGroupItemsRecursive(xgroup.getGroupedItemList()); 193 194 ArrayList<Item> yxOverlappingItemList = xgroup.getYXOverlappingItemList(); 195 196 for(Item i: yxOverlappingItemList) { 197 if (i instanceof Text) { 198 Text t = (Text) i; 199 if (t.isAnnotation()) { continue; } 200 Text titleItem = t.getParent().getTitleItem(); 201 if (t.equals(titleItem)) { continue; } 202 if (t.hasLink()) { 203 Frame toWalk = FrameIO.LoadFrame(t.getAbsoluteLink()); 204 outputTreeFlowWalkerStyle(toWalk); 205 continue; 206 } 207 try { 208 this.writeItem(t); 209 } catch (IOException e) { 210 System.err.println("DefaultTreeWriter::outputTreeFlowWalkerStyle::IOException while writing item."); 211 System.err.println(e.getMessage()); 212 } 213 } 214 } 215 } 216 186 217 protected String finaliseTree() throws IOException { 187 218 return "Tree" + finalise(); -
trunk/src/org/expeditee/io/TEXWriter.java
r919 r1529 32 32 // may be needed for sectioning commands 33 33 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 } 34 54 35 55 @Override 36 56 protected void initialise(Frame start, Writer writer) throws IOException { 37 57 _format = ".tex"; 58 Text annotation = start.getAnnotation("flowwalker"); 59 if (annotation != null) { 60 useFlowWalker = true; 61 } 38 62 super.initialise(start, writer); 39 63 } … … 104 128 105 129 @Override 106 protected void writeText(Text text) throws IOException { 130 protected void writeText(Text text) throws IOException { 107 131 for (String s : text.getTextList()) { 108 132 _writer.write(s);
Note:
See TracChangeset
for help on using the changeset viewer.