Package research

Examples of research.ConnectionFigure


        if (refineType == Refinement.Decompose || refineType == Refinement.Attribute) {

            FeatureFigure child[] = new FeatureFigure[childCount];
            Feature childFeature[] = new Feature[childCount];
            ConnectionFigure relation[] = new ConnectionFigure[childCount];
            FeatureRelation fr[] = new FeatureRelation[childCount];


            int xDis, yDis;
            xDis = 80;
View Full Code Here


                    if (th.isConnected()) {
                        Figure cf = th.getConnectedFigure();

                        if (cf instanceof ConnectionFigure) {
                            ConnectionFigure rcf = (ConnectionFigure) cf;
                            Figure st = rcf.getStartConnector().owner();
                            Figure ed = rcf.getEndConnector().owner();

                            if (listT.contains(st) || listT.contains(ed)) {
                                if (connectedTextHolder == null) {
                                    connectedTextHolder = new ArrayList();
                                }
                                connectedTextHolder.add(th);
                            }
                        }
                    }
                }
            }

            if (connectedTextHolder != null) {
                iterator = connectedTextHolder.iterator();
                while (iterator.hasNext()) {
                    listT.remove(iterator.next());
                }
            }

            /**
             *
             */
            int size = listT.size();
            for (int i = 0; i < size; i++) {
                ConnectionFigure[] scFigures = GlobalFunction.getStartConnectedFigures((Figure) listT.get(i));
                for (int k = 0; k < scFigures.length; k++) {
                    ConnectionFigure scf = scFigures[k];
                    if (listT.contains(scf.endFigure())) {
                        if (!listTConnection.contains(scf)) {
                            listTConnection.add(scf);
                        }
                    }
                }

                ConnectionFigure[] ecFigures = GlobalFunction.getEndConnectedFigures((Figure) listT.get(i));
                for (int k = 0; k < ecFigures.length; k++) {
                    ConnectionFigure ecf = ecFigures[k];
                    if (listT.contains(ecf.startFigure())) {
                        if (!listTConnection.contains(ecf))
                            listTConnection.add(ecf);
                    }
                }
            }
View Full Code Here

      FeatureRelation relation = itRelation.next();
      FeatureRelation newRelation = fmEditor.addRelation(relation.getName() , fmDist.getFeature(nameMap.get(relation.getStartFeature().getID())) , fmDist.getFeature(nameMap.get(relation.getEndFeature().getID())));
     
      nameMap.put(relation.getID() , newRelation.getID());
     
      ConnectionFigure cf = null;
      if (FeatureRelation.ATTRIBUTE.equals(newRelation.getName())) {
        AttributeConnection dvc = new AttributeConnection();
        cf = dvc;
      } else if (FeatureRelation.DECOMPOSE.equals(newRelation.getName())) {
        DecomposeConnection ic = new DecomposeConnection();
        cf = ic;
      } else if (FeatureRelation.REQUIRE.equals(newRelation.getName())) {
        ConstraintConnection cc = new ConstraintConnection(FeatureRelation.REQUIRE);
            cc.setEndDecoration(new ArrowTip());
        cf = cc;
      } else if (FeatureRelation.EXCLUDE.equals(newRelation.getName())) {
        ConstraintConnection cc = new ConstraintConnection(FeatureRelation.EXCLUDE);
            cc.setMidDecoration(new CrossDecoration(5));
        cf = cc;
      }
     
      if (cf!=null) {
        cf.setAttribute("id" , newRelation.getID());
        cf.startPoint(figureMap.get(newRelation.getStartFeature().getID()).center().x , figureMap.get(newRelation.getStartFeature().getID()).center().y);
        cf.endPoint(figureMap.get(newRelation.getEndFeature().getID()).center().x , figureMap.get(newRelation.getEndFeature().getID()).center().y);
        if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(relation)) {
          cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[2]);
          cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[1]);
        } else {
          cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[0]);
          cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[0]);
        }
        dvDist.add(cf);
        cf.updateConnection();
      }
    }
  }
View Full Code Here

                    if (th.isConnected()) {
                        Figure cf = th.getConnectedFigure();

                        if (cf instanceof ConnectionFigure) {
                            ConnectionFigure rcf = (ConnectionFigure) cf;
                            Figure st = rcf.getStartConnector().owner();
                            Figure ed = rcf.getEndConnector().owner();

                            if (listT.contains(st) || listT.contains(ed)) {
                                if (connectedTextHolder == null) {
                                    connectedTextHolder = new ArrayList();
                                }
                                connectedTextHolder.add(th);
                            }
                        }
                    }
                }
            }

            if (connectedTextHolder != null) {
                iterator = connectedTextHolder.iterator();
                while (iterator.hasNext()) {
                    listT.remove(iterator.next());
                }
            }

            /**
             *
             */
            int size = listT.size();
            for (int i = 0; i < size; i++) {
                ConnectionFigure[] scFigures = GlobalFunction.getStartConnectedFigures((Figure) listT.get(i));
                for (int k = 0; k < scFigures.length; k++) {
                    ConnectionFigure scf = scFigures[k];
                    if (listT.contains(scf.endFigure())) {
                        if (!listTConnection.contains(scf)) {
                            listTConnection.add(scf);
                        }
                    }
                }

                ConnectionFigure[] ecFigures = GlobalFunction.getEndConnectedFigures((Figure) listT.get(i));
                for (int k = 0; k < ecFigures.length; k++) {
                    ConnectionFigure ecf = ecFigures[k];
                    if (listT.contains(ecf.startFigure())) {
                        if (!listTConnection.contains(ecf))
                            listTConnection.add(ecf);
                    }
                }
            }
View Full Code Here

     
      FeatureRelation newRelation = fmEditor.addRelation(relation.getName() , fmDist.getFeature(nameMap.get(relation.getStartFeature().getID())) , fmDist.getFeature(nameMap.get(relation.getEndFeature().getID())));
     
      nameMap.put(relation.getID() , newRelation.getID());
     
      ConnectionFigure cf = null;
      if (FeatureRelation.ATTRIBUTE.equals(newRelation.getName())) {
        AttributeConnection dvc = new AttributeConnection();
        cf = dvc;
      } else if (FeatureRelation.DECOMPOSE.equals(newRelation.getName())) {
        DecomposeConnection ic = new DecomposeConnection();
        cf = ic;
      } else if (FeatureRelation.REQUIRE.equals(newRelation.getName())) {
        ConstraintConnection cc = new ConstraintConnection(FeatureRelation.REQUIRE);
            cc.setEndDecoration(new ArrowTip());
        cf = cc;
      } else if (FeatureRelation.EXCLUDE.equals(newRelation.getName())) {
        ConstraintConnection cc = new ConstraintConnection(FeatureRelation.EXCLUDE);
            cc.setMidDecoration(new CrossDecoration(5));
        cf = cc;
      }
     
      if (cf!=null) {
        cf.setAttribute("id" , newRelation.getID());
        cf.startPoint(figureMap.get(newRelation.getStartFeature().getID()).center().x , figureMap.get(newRelation.getStartFeature().getID()).center().y);
        cf.endPoint(figureMap.get(newRelation.getEndFeature().getID()).center().x , figureMap.get(newRelation.getEndFeature().getID()).center().y);
        if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(relation)) {
          cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[2]);
          cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[1]);
        } else {
          cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[0]);
          cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[0]);
        }
        dvDist.add(cf);
        cf.updateConnection();
      }
    }
  }
View Full Code Here

      for (Iterator<FeatureRelation> itRelation=fSrc.getAllRelatedRelation().iterator()  ; itRelation.hasNext() ; ) {
        FeatureRelation relation = itRelation.next();
        if (relation.getStartFeature().getID().equals(fParent.getID())) {
          FeatureRelation newRelation = fmEditor.addRelation(relation.getName() , fDist , fTarget);
         
          ConnectionFigure cf = null;
          if (FeatureRelation.ATTRIBUTE.equals(newRelation.getName())) {
            AttributeConnection dvc = new AttributeConnection();
            cf = dvc;
          } else if (FeatureRelation.DECOMPOSE.equals(newRelation.getName())) {
            DecomposeConnection ic = new DecomposeConnection();
            cf = ic;
          } else if (FeatureRelation.REQUIRE.equals(newRelation.getName())) {
            ConstraintConnection cc = new ConstraintConnection(FeatureRelation.REQUIRE);
                cc.setEndDecoration(new ArrowTip());
            cf = cc;
          } else if (FeatureRelation.EXCLUDE.equals(newRelation.getName())) {
            ConstraintConnection cc = new ConstraintConnection(FeatureRelation.EXCLUDE);
                cc.setMidDecoration(new CrossDecoration(5));
            cf = cc;
          }

          if (cf!=null) {
            cf.setAttribute("id" , newRelation.getID());
            cf.startPoint(figureMap.get(newRelation.getStartFeature().getID()).center().x , figureMap.get(newRelation.getStartFeature().getID()).center().y);
            cf.endPoint(figureMap.get(newRelation.getEndFeature().getID()).center().x , figureMap.get(newRelation.getEndFeature().getID()).center().y);
            if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(relation)) {
              cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[2]);
              cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[1]);
            } else {
              cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[0]);
              cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[0]);
            }
            dvDist.add(cf);
            cf.updateConnection();
          }
         
          break;
        }
      }
View Full Code Here

  }
 
  public static ConnectionFigure dupConnectionFigure(ConnectionFigure cfSrc
      , HashMap<String,String> mName , HashMap<String,Figure> mFigure
      , DrawingView dvDest) {
    ConnectionFigure result = null;
    if (cfSrc instanceof AttributeConnection) {
      result = new AttributeConnection();
    } else if (cfSrc instanceof DecomposeConnection) {
      result = new DecomposeConnection();
    } else if (cfSrc instanceof ConstraintConnection) {
      result = new ConstraintConnection((String)cfSrc.getAttribute("type"));
      ((ConstraintConnection)result).setStartDecoration(((ConstraintConnection)cfSrc).getStartDecoration());
      ((ConstraintConnection)result).setMidDecoration(((ConstraintConnection)cfSrc).getMidDecoration());
      ((ConstraintConnection)result).setEndDecoration(((ConstraintConnection)cfSrc).getEndDecoration());
    } else if (cfSrc instanceof PLConnection){
      result = new PLConnection();
      result.setAttribute("frameColor" , cfSrc.getAttribute("frameColor"));
      result.setAttribute("type" , cfSrc.getAttribute("type"));
      result.setAttribute("CFRModifier" , cfSrc.getAttribute("CFRModifier"));
    } else {
      return null;
    }
   
    result.setAttribute("id" , mName.get(cfSrc.getAttribute("id")));
    result.startPoint(cfSrc.startPoint().x , cfSrc.startPoint().y);
    result.endPoint(cfSrc.endPoint().x , cfSrc.endPoint().y);

    dvDest.add(result);
   
    mName.put((String)cfSrc.getAttribute("id") , UIDupHelper.FIGURE_ID_PREFIX + cfSrc.getAttribute("id"));
    mFigure.put(UIDupHelper.FIGURE_ID_PREFIX + cfSrc.getAttribute("id") , result);
View Full Code Here

            FeatureRelation relation = itRelation.next();
            FeatureRelation newRelation = fmEditor.addRelation(relation.getName(), fmDist.getFeature(nameMap.get(relation.getStartFeature().getID())), fmDist.getFeature(nameMap.get(relation.getEndFeature().getID())));

            nameMap.put(relation.getID(), newRelation.getID());

            ConnectionFigure cf = null;
            if (FeatureRelation.ATTRIBUTE.equals(newRelation.getName())) {
                AttributeConnection dvc = new AttributeConnection();
                cf = dvc;
            } else if (FeatureRelation.DECOMPOSE.equals(newRelation.getName())) {
                DecomposeConnection ic = new DecomposeConnection();
                cf = ic;
            } else if (FeatureRelation.REQUIRE.equals(newRelation.getName())) {
                ConstraintConnection cc = new ConstraintConnection(FeatureRelation.REQUIRE);
                cc.setEndDecoration(new ArrowTip());
                cf = cc;
            } else if (FeatureRelation.EXCLUDE.equals(newRelation.getName())) {
                ConstraintConnection cc = new ConstraintConnection(FeatureRelation.EXCLUDE);
                cc.setMidDecoration(new CrossDecoration(5));
                cf = cc;
            }

            if (cf != null) {
                cf.setAttribute("id", newRelation.getID());
                cf.startPoint(figureMap.get(newRelation.getStartFeature().getID()).center().x, figureMap.get(newRelation.getStartFeature().getID()).center().y);
                cf.endPoint(figureMap.get(newRelation.getEndFeature().getID()).center().x, figureMap.get(newRelation.getEndFeature().getID()).center().y);
                if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(relation)) {
                    cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[2]);
                    cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[1]);
                } else {
                    cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[0]);
                    cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[0]);
                }
                dvDist.add(cf);
                cf.updateConnection();
            }
        }
    }
View Full Code Here

                FeatureRelation newRelation = fmEditor.addRelation(relation.getName(), fmDist.getFeature(nameMap.get(relation.getStartFeature().getID())), fmDist.getFeature(nameMap.get(relation.getEndFeature().getID())));

                nameMap.put(relation.getID(), newRelation.getID());

                ConnectionFigure cf = null;
                if (FeatureRelation.ATTRIBUTE.equals(newRelation.getName())) {
                    AttributeConnection dvc = new AttributeConnection();
                    cf = dvc;
                } else if (FeatureRelation.DECOMPOSE.equals(newRelation.getName())) {
                    DecomposeConnection ic = new DecomposeConnection();
                    cf = ic;
                } else if (FeatureRelation.REQUIRE.equals(newRelation.getName())) {
                    ConstraintConnection cc = new ConstraintConnection(FeatureRelation.REQUIRE);
                    cc.setEndDecoration(new ArrowTip());
                    cf = cc;
                } else if (FeatureRelation.EXCLUDE.equals(newRelation.getName())) {
                    ConstraintConnection cc = new ConstraintConnection(FeatureRelation.EXCLUDE);
                    cc.setMidDecoration(new CrossDecoration(5));
                    cf = cc;
                }

                if (cf != null) {
                    cf.setAttribute("id", newRelation.getID());
                    cf.startPoint(figureMap.get(newRelation.getStartFeature().getID()).center().x, figureMap.get(newRelation.getStartFeature().getID()).center().y);
                    cf.endPoint(figureMap.get(newRelation.getEndFeature().getID()).center().x, figureMap.get(newRelation.getEndFeature().getID()).center().y);
                    if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(relation)) {
                        cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[2]);
                        cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[1]);
                    } else {
                        cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[0]);
                        cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[0]);
                    }
                    dvDist.add(cf);
                    cf.updateConnection();
                    dvDist.repairDamage();
                }
            }

    }
View Full Code Here

            for (Iterator<FeatureRelation> itRelation = fSrc.getAllRelatedRelation().iterator(); itRelation.hasNext();) {
                FeatureRelation relation = itRelation.next();
                if (relation.getStartFeature().getID().equals(fParent.getID())) {
                    FeatureRelation newRelation = fmEditor.addRelation(relation.getName(), fDist, fTarget);

                    ConnectionFigure cf = null;
                    if (FeatureRelation.ATTRIBUTE.equals(newRelation.getName())) {
                        AttributeConnection dvc = new AttributeConnection();
                        cf = dvc;
                    } else if (FeatureRelation.DECOMPOSE.equals(newRelation.getName())) {
                        DecomposeConnection ic = new DecomposeConnection();
                        cf = ic;
                    } else if (FeatureRelation.REQUIRE.equals(newRelation.getName())) {
                        ConstraintConnection cc = new ConstraintConnection(FeatureRelation.REQUIRE);
                        cc.setEndDecoration(new ArrowTip());
                        cf = cc;
                    } else if (FeatureRelation.EXCLUDE.equals(newRelation.getName())) {
                        ConstraintConnection cc = new ConstraintConnection(FeatureRelation.EXCLUDE);
                        cc.setMidDecoration(new CrossDecoration(5));
                        cf = cc;
                    }

                    if (cf != null) {
                        cf.setAttribute("id", newRelation.getID());
                        cf.startPoint(figureMap.get(newRelation.getStartFeature().getID()).center().x, figureMap.get(newRelation.getStartFeature().getID()).center().y);
                        cf.endPoint(figureMap.get(newRelation.getEndFeature().getID()).center().x, figureMap.get(newRelation.getEndFeature().getID()).center().y);
                        if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(relation)) {
                            cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[2]);
                            cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[1]);
                        } else {
                            cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[0]);
                            cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[0]);
                        }
                        dvDist.add(cf);
                        cf.updateConnection();
                    }

                    break;
                }
            }
View Full Code Here

TOP

Related Classes of research.ConnectionFigure

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.