Package research.connector

Examples of research.connector.Connector


            if (getTargetFigure() != null) {
                FigureHelper.setConnectorVisible(getTargetFigure(), true);
            }
        }

        Connector cc = null;
        if (c != null) {
            cc = findConnector(x, y, c);
        }
        if (cc != getTargetConnector()) {
            setTargetConnector(cc);
View Full Code Here


        dw.writeStorable(getEndConnector());
    }

    public void read(StorableInput dr) throws IOException {
        super.read(dr);
        Connector start = (Connector) dr.readStorable();
        if (start != null) {
            connectStart(start);
        }
        Connector end = (Connector) dr.readStorable();
        if (end != null) {
            connectEnd(end);
        }
        if (start != null && end != null) {
            //updateConnection();
View Full Code Here

            c = findConnectionStart(x, y, drawingView.getDrawing());
        } else {
            c = findTarget(x, y, drawingView.getDrawing());
        }
       
        Connector startConnector = getStartConnector();

        // track the figure containing the mouse
        if (true/*c != getTargetFigure()*/) {
            if (getTargetFigure() != null) {
                FigureHelper.setConnectorVisible(getTargetFigure(), false);
            }
            setTargetFigure(c);
            if (getTargetFigure() != null) {
          if (startConnector == null) { //��û������ͼԪ��һ�ˣ�mouse move
              FigureHelper.setConnectorVisible(getTargetFigure(), true);
          }
          else { //������һ�ˣ�������һ��
              String featureId = (String)c.getAttribute("id");
              String constraintId = (String)this.getStartConnector().owner().getAttribute("id");
              boolean isSource = true;
              int direction = this.getStartConnector().getDirection();
              if (direction == Connector.EAST_DIRECTION || direction == Connector.SOUTH_DIRECTION)
            isSource = false;

              if (modelValidation.canConnect(featureId, constraintId, isSource))
            FigureHelper.setConnectorVisible(getTargetFigure(), true);
              else
            c = null;
          }
            }
        }

        Connector cc = null;
        if (c != null) {
            cc = findConnector(x, y, c);
        }
        if (cc != getTargetConnector()) {
            setTargetConnector(cc);
View Full Code Here

        _targetFigure = getTargetFigure();

        if (_targetFigure != null) {
            _isValid = true;
            setStartConnector(findConnector(x, y, _targetFigure));
            Connector startConnector = getStartConnector();
            if (startConnector != null) {
                consumeFigure();
                setConnection((ConnectionFigure) createdFigure);
                _connection = getConnection();
                Rectangle rect = startConnector.getDisplayBox();
                _connection.startPoint((int) rect.getCenterX(), (int) rect.getCenterY());
                _connection.endPoint(x, y);
                setAddedFigure(drawingView.add(_connection));
                drawingView.setSelection(_connection);
            }
View Full Code Here

            if (targetFigure != null) {
                FigureHelper.setConnectorVisible(targetFigure, true);
            }
        }

        Connector cc = null;
        if (c != null) {
            cc = findConnector(x, y, c);
        }
        if (cc != getTargetConnector()) {
            setTargetConnector(cc);
View Full Code Here

                FigureHelper.setConnectorVisible(targetFigure, true);
            }

        }

        Connector cc = null;

        if (targetFigure != null) {
            cc = targetFigure.connectorAt(x, y);
        }
View Full Code Here

        int cell = ((Integer) getAttribute(CELL)).intValue();

        Connector[] array = getConnectors();

        Connector rv = null;
        for (int i = 0; i < array.length; i++) {

            Rectangle _rect = array[i].getDisplayBox();
            _rect.setBounds(_rect.x + _rect.width / 2 - cell / 2, _rect.y + _rect.height / 2 - cell / 2, cell, cell);
            if (_rect.contains(x, y)) {
View Full Code Here

                    (!bCheck || cf.canConnect(sf, ef))) {
               
                if (bCheck) {
                    Point sp = sf.center();
                    Point ep = ef.center();
                    Connector fStartConnector = cf.startFigure().connectorAt(ep.x, ep.y);
                    Connector fEndConnector = cf.endFigure().connectorAt(sp.x, sp.y);
                   
                    if (fEndConnector != null && fStartConnector != null) {
                        cf.connectStart(fStartConnector);
                        cf.connectEnd(fEndConnector);
                        cf.updateConnection();
View Full Code Here

   */
  public Connector connectorAt(int x, int y) {

        Connector[] array = getConnectors();

        Connector rv = null;
        for(int i = 0; i < array.length; i++){
            if(array[i].containsPoint(x,y)){
                rv = array[i];
                break;
            }
View Full Code Here

    public UndoActivity(DrawingView newView) {
      super(newView);
    }

    protected Connector replaceConnector(ConnectionFigure connection) {
      Connector tempStartConnector = connection.getStartConnector();
      connection.connectStart(getOldConnector());
      return tempStartConnector;
    }
View Full Code Here

TOP

Related Classes of research.connector.Connector

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.