Package fbench.graph

Examples of fbench.graph.InputPrimitive


        fbench.graph.ServiceSequence ss = new fbench.graph.ServiceSequence(getElement());
        ans.addElement(ss);
        int w = ss.getComponent(1).getPreferredSize().width;
        int x1 = w;
        NodeList trans = getElement().getChildNodes();
        InputPrimitive pred = null, succ = null;
        for (int i = 0; i < trans.getLength(); i++) {
            NodeList prims = trans.item(i).getChildNodes();
            for (int j = 0; j < prims.getLength(); j++) {
                succ = (InputPrimitive) GraphElement.forElement((Element) prims
                        .item(j));
                ans.add(succ);
                x1 = Math.max(x1, succ.getPreferredSize().width);
                if (j > 0)
                    ans.add(new ServiceLink(pred, succ));
                pred = succ;
            }
        }
        ss.setPreferredLocation(x1 - w, 0);
        int x2 = x1 + ss.getComponent(2).getPreferredSize().width;
        int y = ss.getPreferredSize().height;
        for (int i = 1; i < ans.size(); i++) {
            Object el = ans.elementAt(i);
            if (!(el instanceof InputPrimitive))
                continue;
            InputPrimitive prim = (InputPrimitive) el;
            int x = prim.isLeftInterface() ? x1 - prim.getPreferredSize().width
                    : x2;
            prim.setPreferredLocation(x, y);
            y += prim.getPreferredSize().height;
        }
        ans.add(new ServiceBounds(ss,succ));
        return ans;
    }
View Full Code Here

TOP

Related Classes of fbench.graph.InputPrimitive

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.