Package edu.uci.ics.jung.graph

Examples of edu.uci.ics.jung.graph.Vertex


                addImagePreRenderer(key2, getBackground(key2));
            }
           
            AbstractLayout l1 = getLayout(key1);
            AbstractLayout l2 = getLayout(key2);
            Vertex v = null;
            for (Object o: _myGraph.getVertices()) {
                if (o instanceof Vertex) {
                    v = (Vertex)o;
                    l2.forceMove(v, l1.getX(v), l1.getY(v));
                    if (v.getUserDatum(userdatumkey+key1) != null) {
                        v.setUserDatum(userdatumkey+key2, v.getUserDatum(userdatumkey+key1), UserData.REMOVE);
                    }
                }
            }
            Edge e = null;
            for (Object o: _myGraph.getEdges()) {
View Full Code Here


     * Sets the service's status in host identified by host to <code>status</code>
     *@param host The host whose service status <code>status</code> is to be set
     *@param status The service's status to set
     */
    public void setVertex_ServiceStatus(String host, ServiceStatus status) {
        Vertex v = getVertex(host);
        if (v == null)
            return;
        Map <String, ServiceStatus>services = (Map<String,ServiceStatus>)v.getUserDatum("servicesstatus");
        if (services == null) {
            v.addUserDatum("servicesstatus", new HashMap<String, ServiceStatus>(), UserData.REMOVE);
            services = (Map<String,ServiceStatus>)v.getUserDatum("servicesstatus");
        }
        services.remove(status.getServiceDescription());
        services.put(status.getServiceDescription(), status);
    }
View Full Code Here

    }
   
    public void clearHostsComments() {
        Set vertices = _myGraph.getVertices();
       
        Vertex v = null;
        for (Object o: vertices) {
            if (o instanceof Vertex) {
                v = (Vertex)o;
                v.removeUserDatum("hostcomment");
            }
        }       
    }
View Full Code Here

            }
        }       
    }
   
    public void setVertex_HostComment(String host, StatHostComment hostcomment) {
        Vertex v = getVertex(host);
        if (v != null) {
            Map <Long, StatHostComment> hc = (Map<Long, StatHostComment>)v.getUserDatum("hostcomment");
            if (hc == null) {
                v.addUserDatum("hostcomment", new HashMap<Long, StatHostComment>(), UserData.REMOVE);
                hc = (Map<Long, StatHostComment>)v.getUserDatum("hostcomment");
            }
            hc.put(hostcomment.getCommentId(), hostcomment);
        }
    }
View Full Code Here

    }
   
    public void clearServicesComments() {
        Set vertices = _myGraph.getVertices();
       
        Vertex v = null;
        for (Object o: vertices) {
            if (o instanceof Vertex) {
                v = (Vertex)o;
                v.removeUserDatum("servicescomment");
            }
        }
    }
View Full Code Here

            }
        }
    }
   
    public void setVertex_ServiceComment(String host, StatServiceComment servicecomment) {
        Vertex v = getVertex(host);
            if (v != null) {
            Map <String, LinkedList<StatServiceComment>> servicescomment = (Map<String, LinkedList<StatServiceComment>>)v.getUserDatum("servicescomment");
            if (servicescomment == null) { /* initializes the userdatum key */
                v.addUserDatum("servicescomment", new HashMap<String, LinkedList<StatServiceComment>>(), UserData.REMOVE);
                servicescomment = (Map<String, LinkedList<StatServiceComment>>)v.getUserDatum("servicescomment");
            }

            /* create a new linked list for the service */
            if (!servicescomment.containsKey(servicecomment.getServiceDescription())) {
                servicescomment.put(servicecomment.getServiceDescription(), new LinkedList<StatServiceComment>());
View Full Code Here

            return null;
        }
    }
   
    public LinkedList<StatServiceComment> getVertext_ServiceComment(String hostname, String service) {
        Vertex v = getVertex(hostname);
        if (v != null) {
            return getVertex_ServiceComment(v, service);
        } else {
            return null;
        }
View Full Code Here

            return null;
        }
    }
   
    public Map<String,LinkedList<StatServiceComment>> getVertex_ServiceComment(String hostname) {
        Vertex v = getVertex(hostname);
        if (v != null)
            return getVertex_ServiceComment(v);
        else
            return null;
    }
View Full Code Here

     * @param hostname The host's name related to the comment
     * @param servicedescription The service's description related to host and comment id
     * @param comment_id The comment's id to be removed
     */
    public void delVertex_Comment(String hostname, String servicedescription, long comment_id) {
        Vertex v = getVertex(hostname);
        Map<String, LinkedList<StatServiceComment>> serv =
                (Map<String, LinkedList<StatServiceComment>>)v.getUserDatum("servicescomment");
        LinkedList<StatServiceComment> ll = serv.get(servicedescription);
       
        Iterator<StatServiceComment> it = ll.iterator();
        while (it.hasNext()) {
            if (it.next().getCommentId() == comment_id) {
View Full Code Here

        }
    }
   

    public Map<Long,StatHostComment> getVertex_HostComment(String hostname) {
        Vertex v = getVertex(hostname);
        if (v != null)
            return getVertex_HostComment(v);
        else
            return null;
    }
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.graph.Vertex

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.