Changeset 1102 for trunk/src/org/expeditee/io/ExpReader.java
- Timestamp:
- 05/10/18 16:04:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/io/ExpReader.java
r919 r1102 27 27 import java.util.List; 28 28 29 import org.expeditee.core.Point; 29 30 import org.expeditee.gui.Frame; 30 31 import org.expeditee.items.Constraint; … … 130 131 while (_reader.ready() && !(next = _reader.readLine()).equals("Z")) { 131 132 if (isValidLine(next)) { 132 java.awt.Point idtype = separateValues(next.substring(2));133 Point idtype = separateValues(next.substring(2)); 133 134 // The next line must be the endpoints 134 135 if (!_reader.ready()) 135 136 throw new Exception("Unexpected end of file"); 136 137 next = _reader.readLine(); 137 java.awt.Point startend = separateValues(next.substring(2));138 Point startend = separateValues(next.substring(2)); 138 139 int start = startend.x; 139 140 int end = startend.y; … … 153 154 while (_reader.ready() && !(next = _reader.readLine()).equals("Z")) { 154 155 if (isValidLine(next)) { 155 java.awt.Point idtype = separateValues(next.substring(2));156 Point idtype = separateValues(next.substring(2)); 156 157 // The next line must be the endpoints 157 158 if (!_reader.ready()) 158 159 throw new Exception("Unexpected end of file"); 159 160 next = _reader.readLine(); 160 java.awt.Point startend = separateValues(next.substring(2));161 Point startend = separateValues(next.substring(2)); 161 162 162 163 Item a = _linePoints.get(startend.x); … … 233 234 234 235 Method toRun = _ItemTags.get(tag); 235 if (toRun == null) 236 System.out.println("Error accessing tag method: " + tag); 236 if (toRun == null) System.out.println("Error accessing tag method: " + tag); 237 237 Object[] vals = Conversion.Convert(toRun, value); 238 238 239 239 try { 240 if (vals != null) 241 toRun.invoke(item, vals); 240 if (vals != null) toRun.invoke(item, vals); 242 241 } catch (Exception e) { 243 242 System.out.println("Error running tag method: " + tag); … … 297 296 298 297 // Returns a point from a String containing two ints separated by a space 299 protected java.awt.Point separateValues(String line) {298 protected Point separateValues(String line) { 300 299 int x = Integer.parseInt(line.substring(0, line.indexOf(" "))); 301 300 int y = Integer.parseInt(line.substring(line.indexOf(" ") + 1)); 302 301 303 return new java.awt.Point(x, y);302 return new Point(x, y); 304 303 } 305 304
Note:
See TracChangeset
for help on using the changeset viewer.