Package com.orange.links.client.connection

Examples of com.orange.links.client.connection.Connection


        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


     */
    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

     */
    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;
                break;
View Full Code Here

     * @param end end node widget
     * @return
     */
    public Connection getConnection(NodeWidget start, NodeWidget end) {

        Connection conn = null;
        Map<Widget, Connection> m = (Map<Widget, Connection>) functionsMap.get(start);
        if (m != null) {
            conn = (Connection) m.get(end);
        }
        return conn;
View Full Code Here

        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

        neighbors = controller.getCurrentNeighbor(current);
        if (neighbors == null) {
            neighbors = new ArrayList<NodeWidget>();
        }
        for (NodeWidget n : neighbors) {
            Connection conn = controller.getConnection(current, n);
            SwitchCase entry = null;

            // check existing case
            for (SwitchCase s : backup) {
                if (s.getWidget() == n) {
View Full Code Here

        action.setAttribute("name", name.getText());
        Element switchele = doc.createElement("switch");
        action.appendChild(switchele);
        for (SwitchCase ca : cases) {
            boolean isDefault = false;
            Connection conn = ca.getConnection();
            if (conn.getDecoration() != null) {
                isDefault = true;
            }
            if (isDefault) {
                Element defEle = doc.createElement("default");
                defEle.setAttribute("to", ca.getWidget().getName());
View Full Code Here

                OozieDiagramController controller = current.getController();
                NodeWidget target = widgetDropDown.get(addbox.getSelectedIndex());
                String predicate = predbox.getText();
                Boolean isDefault = defaultcheck.getValue();
                if (!controller.isConnected(current, target)) {
                    Connection conn = controller.addMultiConnection(current, target);
                    if (conn == null)
                        return;
                    // if default checked, add decoration label to connection
                    if (isDefault) {
                        initializeDefault(dataProvider.getList());
View Full Code Here

        // Button to delete row
        Column<SwitchCase, String> defaultCol = new Column<SwitchCase, String>(new ButtonCell()) {
            @Override
            public String getValue(SwitchCase object) {
                Connection c = object.getConnection();
                DecorationShape ds = c.getDecoration();
                String rel = "Change to Default";
                if (ds != null)
                    rel = "Default";
                return rel;
            }
        };

        defaultCol.setFieldUpdater(new FieldUpdater<SwitchCase, String>() {

            @Override
            public void update(int index, SwitchCase object, String value) {
                initializeDefault(dataProvider.getList());
                Connection c = object.getConnection();
                addDecorationDefaultLabel(c);
                table.redraw();
            }
        });
View Full Code Here

     */
    public void initializeDefault(List<SwitchCase> li) {

        OozieDiagramController controller = current.getController();
        for (SwitchCase s : li) {
            Connection c = s.getConnection();
            DecorationShape decoShape = c.getDecoration();
            if (decoShape != null) {
                controller.getView().remove(decoShape.asWidget());
            }
            c.removeDecoration();
        }
    }
View Full Code Here

TOP

Related Classes of com.orange.links.client.connection.Connection

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.