Package prefuse

Examples of prefuse.Display


        this.g = g;
        this.frame = frame;
    }

    public void itemEntered(VisualItem item, MouseEvent e) {
        Display d = (Display) e.getSource();
        d.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        Object uo = item.getSourceTuple().get(Constants.USER_OBJECT);
        if (!(uo instanceof GraphNode))
            return;
        final GraphNode node = (GraphNode) uo;
        StringBuilder buff = new StringBuilder();
        if (node.isOpString()) {
            buff.append("OperationalString: ")
                .append(item.getString(VisualItem.LABEL));
        } else if(node.isServiceElement()) {
            buff.append("ServiceElement: ")
                .append(item.getString(VisualItem.LABEL));
        } else if (node.isServiceInstance()) {
            if(node.getInstance()!=null) {
                buff.append("Instance ID=");
                buff.append(node.getInstance().getServiceBeanConfig().getInstanceID());
            }
            if (node.getServiceItem() != null) {
                ComputeResourceInfo aInfo = getComputeResourceInfo(node.getServiceItem().attributeSets);
                if(aInfo!=null) {
                    buff.append("\n");
                    if (aInfo.osName != null && aInfo.osName.length() > 0) {
                        buff.append("Operating System=");
                        buff.append(aInfo.osName);
                        if (aInfo.osVersion != null &&
                            aInfo.osVersion.length() > 0)
                            buff.append(aInfo.osVersion);
                        buff.append("\n");
                    }
                    if (aInfo.arch != null && aInfo.arch.length() > 0) {
                        buff.append("Architecture=");
                        buff.append(aInfo.arch);
                        buff.append("\n");
                    }
                    if (aInfo.hostAddress != null &&
                        aInfo.hostAddress.length() > 0) {
                        buff.append("Host name=");
                        buff.append(aInfo.hostName);
                        buff.append("\n");
                    }
                    if (aInfo.hostAddress != null &&
                        aInfo.hostAddress.length() > 0) {
                        buff.append("Host address=");
                        buff.append(aInfo.hostAddress);
                        buff.append("\n");
                    }
                    buff.append("JVM Version=");
                    buff.append(aInfo.jvmVersion);
                } else {
                    Host host = getHost(node.getServiceItem().attributeSets);
                    if(host!=null) {
                        buff.append("\n");
                        buff.append(host.hostName);
                    }
                }
            } else {
                buff.append("Active, no ServiceItem");
            }
            if(node.getInstance()!=null) {
                buff.append("\n");
                buff.append(ServiceElementUtil.formatDiscoverySettings(
                    node.getInstance().getServiceBeanConfig()));
            }
        }
        d.setToolTipText(buff.toString());
    }
View Full Code Here


        }
        return null;
    }

    public void itemExited(VisualItem item, MouseEvent e) {
        Display d = (Display) e.getSource();
        d.setToolTipText(null);
        d.setCursor(Cursor.getDefaultCursor());
        // clear the focus
        //Visualization vis = item.getVisualization();
        //vis.getFocusGroup(Visualization.FOCUS_ITEMS).clear();
    }
View Full Code Here

TOP

Related Classes of prefuse.Display

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.