Ignore:
Timestamp:
05/10/18 16:04:51 (6 years ago)
Author:
davidb
Message:

Reworking of the code-base to separate logic from graphics. This version of Expeditee now supports a JFX graphics as an alternative to SWING

File:
1 edited

Legend:

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

    r919 r1102  
    2727import java.util.List;
    2828
     29import org.expeditee.core.Point;
    2930import org.expeditee.gui.Frame;
    3031import org.expeditee.items.Constraint;
     
    130131                        while (_reader.ready() && !(next = _reader.readLine()).equals("Z")) {
    131132                                if (isValidLine(next)) {
    132                                         java.awt.Point idtype = separateValues(next.substring(2));
     133                                        Point idtype = separateValues(next.substring(2));
    133134                                        // The next line must be the endpoints
    134135                                        if (!_reader.ready())
    135136                                                throw new Exception("Unexpected end of file");
    136137                                        next = _reader.readLine();
    137                                         java.awt.Point startend = separateValues(next.substring(2));
     138                                        Point startend = separateValues(next.substring(2));
    138139                                        int start = startend.x;
    139140                                        int end = startend.y;
     
    153154                        while (_reader.ready() && !(next = _reader.readLine()).equals("Z")) {
    154155                                if (isValidLine(next)) {
    155                                         java.awt.Point idtype = separateValues(next.substring(2));
     156                                        Point idtype = separateValues(next.substring(2));
    156157                                        // The next line must be the endpoints
    157158                                        if (!_reader.ready())
    158159                                                throw new Exception("Unexpected end of file");
    159160                                        next = _reader.readLine();
    160                                         java.awt.Point startend = separateValues(next.substring(2));
     161                                        Point startend = separateValues(next.substring(2));
    161162
    162163                                        Item a = _linePoints.get(startend.x);
     
    233234
    234235                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);
    237237                Object[] vals = Conversion.Convert(toRun, value);
    238238
    239239                try {
    240                         if (vals != null)
    241                                 toRun.invoke(item, vals);
     240                        if (vals != null) toRun.invoke(item, vals);
    242241                } catch (Exception e) {
    243242                        System.out.println("Error running tag method: " + tag);
     
    297296
    298297        // 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) {
    300299                int x = Integer.parseInt(line.substring(0, line.indexOf(" ")));
    301300                int y = Integer.parseInt(line.substring(line.indexOf(" ") + 1));
    302301
    303                 return new java.awt.Point(x, y);
     302                return new Point(x, y);
    304303        }
    305304
Note: See TracChangeset for help on using the changeset viewer.