Examples of PlaneDataObject


Examples of messages.PlaneDataObject

            if (cAltitude > atmcModel.getMinHeight() && cAltitude < atmcModel.getMaxHeight()) {
                if (!lastPlanePosition.containsKey(current.getIp())) {
                    lastPlanePosition.put(current.getIp(), null);
                }
                PlaneDataObject lastPos = lastPlanePosition.get(current.getIp());
                PlaneDataObject currentPos = (PlaneDataObject) current.getCurrentPos();


                if (currentPos != null && !currentPos.equals(lastPlanePosition.get(current.getIp()))) {
                    lastPlanePosition.put(current.getIp(), currentPos);
                }

                if (currentPos != null) {
                    drawHistoryList(g2, current);
View Full Code Here

Examples of messages.PlaneDataObject

            }
        }
        Iterator it = tmpList.iterator();
        g.setColor(colors.get("PLANE_HISTORY_COLOR").getColor());
        while (it.hasNext()) {
            PlaneDataObject currentPos = (PlaneDataObject) it.next();
            g.drawRect(getX(currentPos.getLongitude()), getY(currentPos.getLatitude()), 1, 1);
        }
    }
View Full Code Here

Examples of messages.PlaneDataObject

            ip = InetAddress.getLocalHost();
        } catch (UnknownHostException ex) {
            Logger.getLogger(PluginReceiverPanel.class.getName()).log(Level.SEVERE, null, ex);
        }

        plane = new PlaneDataObject(ip.toString(), atmClient.getModel().getNickname(),0,0,0,0,0);

        timer = new Timer();
        timerTask = new MyTimerTask();
        timer.schedule(timerTask, 1000L, 1000L);
    }
View Full Code Here

Examples of messages.PlaneDataObject

        }

        public void run() {
            if (receiving) {
                System.out.println(atmClient.getModel().getNickname());
                plane = new PlaneDataObject(ip.toString(),atmClient.getModel().getNickname(), lat, lon, alt, speed, heading);
                atmClient.getModel().sendObject(plane);
            }
        }
View Full Code Here

Examples of messages.PlaneDataObject

            while (run) {
                SimDataObject so;
                try {
                    so  = (SimDataObject) in.readObject();
                    PlaneDataObject pdo = new PlaneDataObject(so.getName(),"simulator",so.getLat(),so.getLon(),so.getAlt(), 0,0);
//                    System.out.println("Lat: "+pdo.getLatitude()+" Lon: "+pdo.getLongitude());
                    server.broadcast(pdo);
                   
                } catch (IOException ex) {
                    System.out.println("lost stream, restarting...");
View Full Code Here

Examples of messages.PlaneDataObject

               
                System.out.println("UDP capturing started: ");
               
                while (true) {
                    dsocket.receive(packet);
                    PlaneDataObject pdo = parser.getPlaneData(buffer, packet.getAddress().toString());
                    if (pdo != null){
                        server.broadcast(pdo);
                       
//                        System.out.println("planedata broadcasted");
                    }
View Full Code Here

Examples of messages.PlaneDataObject

                for (int i = currentIndex; i < currentIndex + 4; i++) {
                    indexNum <<= 8;
                    indexNum += new Byte(buffer[i]).intValue();
                }
                if (indexNum == 18 && currentIndex + 16 < buffer.length) {
                    return new PlaneDataObject(ip,"xplane8",
                            this.getData(buffer, currentIndex + 4),
                            this.getData(buffer, currentIndex + 8),
                            this.getData(buffer, currentIndex + 12),0,0);
                } else if (currentIndex + 36 < buffer.length) {
                    currentIndex += 36;
View Full Code Here

Examples of messages.PlaneDataObject

                            model.updateUserInfo(ui);
                        }
                    } else if (input instanceof PlaneUpdateObject){
                        model.addPlaneUpdate((IPlaneUpdateObject)input, ui);
                    } else if (input instanceof PlaneDataObject){
                        PlaneDataObject pdo = (PlaneDataObject)input;
                        model.getServer().broadcast(input);
                    }
                }
        } catch (IOException ex) {
            System.err.println(ui.getNickName()+": logged out");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.