Examples of nearestNeighbor()


Examples of org.codemap.MapInstance.nearestNeighbor()

//        System.out.println("Distance to MapPerProject: " +  Math.sqrt(Math.pow(575 - mpp.px, 2) + Math.pow(500 - mpp.py, 2)));
//        System.out.println("Distance to ColorDropDownAction: " + Math.sqrt(Math.pow(575 - dda.px, 2) + Math.pow(500 - dda.py, 2)));
       
//        KdTree kdTree = mapInstance.getKdTree();
//        kdTree.setLog(new DebugLog());
        System.out.println(mapInstance.nearestNeighbor(575, 500).getDocument());
    }
   
    private static Location getLocation(MapInstance mapInstance, String makeRed) {
        Iterable<Location> locations = mapInstance.locations();
        for (Location location : locations) {
View Full Code Here

Examples of org.codemap.MapInstance.nearestNeighbor()

    @Override
    public void mouseDoubleClick(MouseEvent e) {
        MapInstance map = CodemapVisualization.mapValues(e).mapInstance.getValue();
        if (map == null) return;
        Location neighbor = map.nearestNeighbor(e.x, e.y);
        if (neighbor == null) return;
       
        IResource resource = Resources.asResource(neighbor.getDocument());
        if (!(resource instanceof IFile))
            return;
View Full Code Here

Examples of org.codemap.MapInstance.nearestNeighbor()

    }

    private void updateTooltip(MouseEvent e) {
        MapInstance map = mapValues.mapInstance.getValue();
        if (map == null) return;
        Location nearestNeighbor = map.nearestNeighbor(e.x, e.y);
       
        boolean noName = map.isEmpty() || !map.containsPoint(e.x, e.y) || nearestNeighbor == null;
        String name = noName ? null : nearestNeighbor.getName();
        textUpdater.updateNearestNeighbor(name);
    }
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.