Package com.orange.links.client.shapes

Examples of com.orange.links.client.shapes.FunctionShape


     * @param w node widget
     * @return
     */
    public List<NodeWidget> getCurrentNeighbor(NodeWidget w) {
        List<NodeWidget> current = new ArrayList<NodeWidget>();
        FunctionShape s = widgetShapeMap.get(w);
        Map<Widget, Connection> connectMap = functionsMap.get(w);
        if (connectMap == null) {
            return null;
        }
        for (Iterator<Map.Entry<Widget, Connection>> it = connectMap.entrySet().iterator(); it.hasNext();) {
            Map.Entry<Widget, Connection> entry = it.next();
            Connection c = entry.getValue();
            if (c.getStartShape() == s) {
                FunctionShape e = (FunctionShape) c.getEndShape();
                current.add((NodeWidget) e.asWidget());
            }
        }

        return current;
    }
View Full Code Here


     * @param w node widget
     * @return
     */
    public List<Connection> getConnection(NodeWidget w) {
        List<Connection> li = new ArrayList<Connection>();
        FunctionShape shape = widgetShapeMap.get(w);
        for (Connection c : shape.getConnections()) {
            li.add(c);
        }
        return li;
    }
View Full Code Here

     * @param start start node widget
     * @param end end node widget
     */
    public void addConnection(NodeWidget start, NodeWidget end) {
        boolean exists = false;
        FunctionShape s1 = widgetShapeMap.get(start);
        FunctionShape s2 = widgetShapeMap.get(end);
        Connection current = null;
        for (Connection c : s1.getConnections()) {
            if (c.getStartShape() == s1) {
                current = c;
            }
            if (c.getEndShape() == s2) {
                exists = true;
                break;
            }
        }
        if (!exists) {
            if (current != null) {
                this.deleteConnection(current);
                s1.removeConnection(current);
                s2.removeConnection(current);
            }
            Connection c = drawStraightArrowConnection(start, end);
            fireEvent(new TieLinkEvent(start, end, c));
        }
    }
View Full Code Here

     * @param end end node widget
     * @return
     */
    public Connection addMultiConnection(NodeWidget start, NodeWidget end) {
        boolean exists = false;
        FunctionShape s1 = widgetShapeMap.get(start);
        FunctionShape s2 = widgetShapeMap.get(end);
        Connection conn = null;

        for (Connection c : s1.getConnections()) {
            if (c.getEndShape() == s2) {
                exists = true;
View Full Code Here

     * @param start start node widget
     * @param end end node widget
     */
    public void removeConnection(NodeWidget start, NodeWidget end) {

        FunctionShape s1 = widgetShapeMap.get(start);
        FunctionShape s2 = widgetShapeMap.get(end);

        if (functionsMap.get(start).containsKey(end)) {
            Connection c = functionsMap.get(start).get(end);
            this.deleteConnection(c);
            s1.removeConnection(c);
            s2.removeConnection(c);
            functionsMap.get(start).remove(end);
        }
    }
View Full Code Here

        xmldoc.appendChild(root);

        wrkflowtable.generateXML(xmldoc, root, null);

        for (Connection c : this.connections) {
            FunctionShape startShape = (FunctionShape) c.getStartShape();
            NodeWidget w = (NodeWidget) startShape.asWidget();
            if (w instanceof StartNodeWidget) {
                queue.add(w);
                break;
            }
        }
View Full Code Here

            }
        }
        else {
            // Don't go deeper if in edition mode
            // If mouse over a widget, highlight it
            FunctionShape s = getShapeUnderMouse();
            if (s != null) {
                s.drawHighlight();
                highlightFunctionShape = s;
            }
            else if (highlightFunctionShape != null) {
                highlightFunctionShape.draw();
                highlightFunctionShape = null;
View Full Code Here

TOP

Related Classes of com.orange.links.client.shapes.FunctionShape

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.