Package framework

Examples of framework.IPlaneDataObject


     * @param rpobj Das RadarPlaneObject aus dem die Daten kommen.
     */
    private void drawPlaneShape(final Graphics2D g,
            final RadarPlaneObject rpobj) {

        IPlaneDataObject dir = rpobj.getCurrentPos();
        /*IPlaneDataObject base = null;
        if (rpobj.getPositions().size() > 1) {
        base = (IPlaneDataObject) rpobj.getPositions().get(rpobj.getPositions().size() - 2);
        }*/
        //Colisiontest just if not on ground and faster than 100
        int coll = 0;
        String ps = rpobj.getPlaneState();
        if (doCollisionTest(rpobj)) {
            coll = collisionTest((PlaneDataObject) rpobj.getCurrentPos());
        }
        g.setColor(colors.get("PLANE_NAME_COLOR").getColor());
        g.setFont(AIRPLANE_NAME_FONT);

        if (zoomLevel < OWN_PLANE_MAX_ZOOM_NAMERENDER && rpobj != null && rpobj.getActiveController() != null && rpobj.getActiveController().equals(atmcModel.getUser())) {
            g.drawString(rpobj.getFlightNumber(),
                    getXFloat(dir.getLongitude()) - 4,
                    getYFloat(dir.getLatitude()) - 4);
        }

        if (zoomLevel < OTHER_PLANE_MAX_ZOOM_NAMERENDER && rpobj != null && rpobj.getActiveController() != null && !rpobj.getActiveController().equals(atmcModel.getUser())) {
            g.drawString(rpobj.getFlightNumber(), getXFloat(dir.getLongitude()) - 4, getYFloat(dir.getLatitude()) - 4);
        }
        g.setColor(colors.get("PLANE_SHAPE_COLOR").getColor());
        double heading = -(rpobj.getHeading() + 190) * Math.PI / 180.0;
        double baseX = getXFloat(dir.getLongitude());
        double baseY = getYFloat(dir.getLatitude());
        double xFactor = 3 * Math.sin(heading);
        double yFactor = 3 * Math.cos(heading);
        Point fwdPt = new Point((int) (baseX + 4 * xFactor), (int) (baseY + 4 * yFactor));
        Point lwingbasePt = new Point((int) (baseX + yFactor), (int) (baseY - xFactor));
        Point rwingbasePt = new Point((int) (baseX - yFactor), (int) (baseY + xFactor));
View Full Code Here


    private int collisionTest(final PlaneDataObject pdo) {
        int collisionIndicator = 0;
        Iterator<RadarPlaneObject> it = atmcModel.getRadarPlaneObjects().values().iterator();
        String thisIP = pdo.getIP();
        while (it.hasNext()) {
            IPlaneDataObject testPos = it.next().getCurrentPos();
            if (testPos != null && !testPos.getIP().equals(thisIP)) {
                if (DistanceCalculator.getDistance(testPos.getLatitude(), testPos.getLongitude(), pdo.getLatitude(), pdo.getLongitude()) < COLLISION_WARN_DISTANCE) {
                    return 2;
                } else if (DistanceCalculator.getDistance(testPos.getLatitude(), testPos.getLongitude(), pdo.getLatitude(), pdo.getLongitude()) < 2 * COLLISION_WARN_DISTANCE) {
                    collisionIndicator = 1;
                }
            }
        }
        return collisionIndicator;
View Full Code Here

        if (getCurrentPosition() != null) {
            tolerance = getCurrentPosition().getSpeed() / 3600;
            tolerance = tolerance / 60;
        }

        IPlaneDataObject tmp = planeObjects.peekLast();

        if (tmp == null) {
            return false;
        } else {
            return (tmp.getLatitude() - tolerance <= pdo.getLatitude() && tmp.getLatitude() + tolerance >= pdo.getLatitude()) && (tmp.getLongitude() - tolerance <= pdo.getLongitude() && tmp.getLongitude() + tolerance >= pdo.getLongitude());
        }

    }
View Full Code Here

    public LinkedList getPositionList() {
        return planeObjects;
    }

    public IPlaneDataObject getCurrentPosition() {
        IPlaneDataObject tmp = planeObjects.peekLast();
        return tmp;
    }
View Full Code Here

            }
        } else if(o instanceof IPlaneUpdateObject){
            IPlaneUpdateObject puo = (IPlaneUpdateObject)o;
            model.addPlaneUpdate(puo);
        } else if(o instanceof IPlaneDataObject){
            IPlaneDataObject pdo = (IPlaneDataObject)o;
            model.addPlaneData(pdo);
        }
    }
View Full Code Here

TOP

Related Classes of framework.IPlaneDataObject

Copyright © 2018 www.massapicom. 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.