~tapaal-contributor/tapaal/autodetect-lens-check2

« back to all changes in this revision

Viewing changes to src/dk/aau/cs/io/PNMLoader.java

merged in lp:~yrke/tapaal/removeSpecialBatchLoading removing special loading of nets in batch processing

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
        
55
55
        enum GraphicsType { Position, Offset }
56
56
 
57
 
        private NameGenerator nameGenerator = new NameGenerator();
58
 
        private IdResolver idResolver = new IdResolver();
59
 
        private HashSet<String> arcs = new HashSet<String>();
60
 
        private HashMap<String, TimedPlace> places = new HashMap<String, TimedPlace>();
61
 
        private HashMap<String, TimedTransition> transitions = new HashMap<String, TimedTransition>();
 
57
        private final NameGenerator nameGenerator = new NameGenerator();
 
58
        private final IdResolver idResolver = new IdResolver();
 
59
        private final HashSet<String> arcs = new HashSet<String>();
 
60
        private final HashMap<String, TimedPlace> places = new HashMap<String, TimedPlace>();
 
61
        private final HashMap<String, TimedTransition> transitions = new HashMap<String, TimedTransition>();
62
62
        
63
63
        //If the net is too big, do not make the graphics
64
64
        private int netSize = 0;
65
 
        private int maxNetSize = 4000;
 
65
        private final int maxNetSize = 4000;
66
66
        private boolean hasPositionalInfo = false;
67
67
        
68
68
        public PNMLoader() {
321
321
                                                String arcTempX = position.getAttribute("x");
322
322
                                                String arcTempY = position.getAttribute("y");
323
323
 
324
 
                                                double arcPointX = Double.valueOf(arcTempX);
325
 
                        double arcPointY = Double.valueOf(arcTempY);
 
324
                                                double arcPointX = Double.parseDouble(arcTempX);
 
325
                        double arcPointY = Double.parseDouble(arcTempY);
326
326
                                                arcPointX += Pipe.ARC_CONTROL_POINT_CONSTANT + 1;
327
327
                                                arcPointY += Pipe.ARC_CONTROL_POINT_CONSTANT + 1;
328
328
                                                
364
364
                String x = offset.getAttribute("x");
365
365
                String y = offset.getAttribute("y");
366
366
                
367
 
                int xd = Math.round(Float.valueOf(x));
368
 
                int yd = Math.round(Float.valueOf(y));
 
367
                int xd = Math.round(Float.parseFloat(x));
 
368
                int yd = Math.round(Float.parseFloat(y));
369
369
               
370
370
                return new Point(xd, yd);
371
371
        }