Package research

Examples of research.DrawingView


        DrawingEditor drawingEditor = (DrawingEditor)getValue(ConstantDefinition.DRAWING_EDITOR);

        if(drawingEditor == null) return false;

        DrawingView currentView = drawingEditor.getCurrentView();
        if (currentView == null) return false;

        Vector selection = currentView.getSelection();

        if (selection == null) return false;
        if (selection.size() < 2) return false;

        //AlignAction����connectionFigure��Ч�����Ҫ�жϵ�ǰѡ���ͼԪ�з�connectionFigure����Ŀ�Ƿ����2
View Full Code Here


            DrawingView[] dvs = (DrawingView[]) getContext().getValue("dvs");

            HashMap<String, Figure> mFigure = new HashMap<String, Figure>();
            HashMap<Figure, DrawingView> mDrawingView = new HashMap<Figure, DrawingView>();
            for (int i = 0; i < dvs.length; i++) {
                DrawingView dv = dvs[i];
                for (FigureEnumeration fe = dv.getDrawing().getFigures(); fe.hasMoreElements();) {
                    Figure figure = fe.nextFigure();
                    if (!mFigure.containsKey(figure.getAttribute("id"))) {
                        mFigure.put((String) figure.getAttribute("id"), figure);
                    }
                    mDrawingView.put(figure, dv);
View Full Code Here

            dtde.dropComplete(true);

            DropTarget dropTarget = (DropTarget) dtde.getSource();

            DrawingView drawingView = (DrawingView) dropTarget.getComponent();

            if (feature != null) {
                FeatureFigure ff = new FeatureFigure();
                ff.setAttribute("id", id);
                ff.setAttribute(FeatureFigure.IS_A_LINK, Boolean.TRUE);
                ff.setAttribute("text", feature.getName());
                ff.setAttribute(FeatureProperties.VARIABILITY, feature.getVariability().getName());
                ff.setAttribute(FeatureProperties.BINDINGTIME, feature.getBindingTime().getName());

                Point location = dtde.getLocation();
                double scale = drawingView.getScale();
                int realX = (int) (location.getX() / scale + 0.5);
                int realY = (int) (location.getY() / scale + 0.5);

                ff.basicDisplayBox(new Point(realX, realY), null);

                idToFigureMap.add(id, ff);
                drawingView.add(ff);
            } else if (rc != null) {
                ResourceComponentFigure rcf = new ResourceComponentFigure();
                rcf.setAttribute("id", id);
                rcf.setAttribute(FeatureFigure.IS_A_LINK, Boolean.TRUE);
                rcf.setAttribute("text", rc.getName());
                rcf.setAttribute(FeatureProperties.VARIABILITY, rc.getVariability().getName());

                Point location = dtde.getLocation();
                double scale = drawingView.getScale();
                int realX = (int) (location.getX() / scale + 0.5);
                int realY = (int) (location.getY() / scale + 0.5);

                rcf.basicDisplayBox(new Point(realX, realY), null);

                idToFigureMap.add(id, rcf);
                drawingView.add(rcf);
            }

            drawingView.repairDamage();
        }
View Full Code Here

        public void locateInCurrentView(String elementID) {
            Set figSet = idToFigureMap.get(elementID);

            if (figSet == null) return;

            DrawingView drawingView = editorArea.getCurrentView();
            drawingView.clearSelection();

            Iterator iterator = figSet.iterator();

            treeSet.clear();

            while (iterator.hasNext()) {
                Figure fig = (Figure) iterator.next();

                if (drawingView.getDrawing().includes(fig)) {
                    String type = (String) fig.getAttribute("type");
                    if ((type != null) && (type.equals("interactionTitle"))) continue;
                    drawingView.addToSelection(fig);
                    treeSet.add(fig);
                }
            }

            drawingView.repairDamage();

            adjustFigureToCenter(drawingView, treeSet.iterator());

        }
View Full Code Here

            }

            DrawingView[] views = editorArea.toArray();

            for (int i = 0; i < views.length; i++) {
                DrawingView drawingView = views[i];
                if (drawingView.getDrawing().includes(definition)) {
                    String type = (String) definition.getAttribute("type");
                    if ((type != null) && (type.equals("interactionTitle"))) continue;
                    drawingView.clearSelection();
                    drawingView.addToSelection(definition);
                    drawingView.repairDamage();
                    editorArea.setCurrentView(drawingView);
                    adjustFigureToCenter(drawingView, definition);
                    break;
                }
            }
View Full Code Here

        DrawingView[] views = drawingViewContainer.getAllDrawingViews();

        GroupMap rst = new GroupTreeMap();

        for (int i = 0; i < views.length; i++){
            DrawingView view = views[i];

            FigureEnumeration fe = view.getDrawing().getFigures();

            while (fe.hasMoreElements()){
                Figure fig = fe.nextFigure();
                String id = (String) fig.getAttribute("id");

                if ((id != null) && (!id.equals(""))){
                    rst.add(view.getDrawing().getTitle(), id);
                }
            }
        }

        return rst;
View Full Code Here

      List<FeatureRelation> relations = new ArrayList<FeatureRelation>(fm.getAllFeatureRelation().values());
      for (int i=relations.size()-1 ; i>=0 ; i--) {
        FeatureRelation relation = relations.get(i);
        if (removeFeatures.contains(relation.getStartFeature()) || removeFeatures.contains(relation.getEndFeature())) {
          Figure f = mFigure.get(relation.getID());
          DrawingView dv = mDrawingView.get(f);
         
          dv.remove(f);
          fme.removeRelation(relation);
        }
      }
    }
   
    for (int i=0 ; i<features.size() ; i++) {
      Feature feature = features.get(i);
      if (removeFeatures.contains(feature)) {
        Figure f = mFigure.get(feature.getID());
        DrawingView dv = mDrawingView.get(f);
       
        dv.remove(f);
        fme.removeFeature(feature);
      }
    }
   
    return true;
View Full Code Here

      frs.addAll(fm.getAllFeatureRelation().values());
      for (int i=0 ; i<frs.size() ; i++) {
        FeatureRelation fr = frs.get(i);
        if (FeatureRelation.REQUIRE.equals(fr.getName()) || FeatureRelation.EXCLUDE.equals(fr.getName())) {
          Figure f = mFigure.get(fr.getID());
          DrawingView dv = mDrawingView.get(f);
          if (!checkFeatureRelation(fr , fme , f , dv , cv)) {
//            return false;
          }
        }
      }
    }
   
    if (cm.getAllGroupConstraint()!=null) {
      List<GroupConstraint> gcs = new ArrayList<GroupConstraint>();
      gcs.addAll(cm.getAllGroupConstraint().values());
      for (int i=0 ; i<gcs.size() ; i++) {
        GroupConstraint gc = gcs.get(i);
        Figure f = mFigure.get(gc.getID());
        DrawingView dv = mDrawingView.get(f);
        if (!checkGroupConstraint(gc , cm , cme , dv , cv , mFigure)) {
//          return false;
        }
      }
    }
   
    if (cm.getAllCompositeConstraint()!=null) {
      List<CompositeConstraint> ccs = new ArrayList<CompositeConstraint>();
      ccs.addAll(cm.getAllCompositeConstraint().values());
      for (int i=0 ; i<ccs.size() ; i++) {
        CompositeConstraint cc = ccs.get(i);
        Figure f = mFigure.get(cc.getID());
        DrawingView dv = mDrawingView.get(f);
        if (!checkCompositeConstraint(cc , cm , cme , cce , gce , dv , cv , mFigure)) {
//          return false;
        }
      }
    }
View Full Code Here

        DrawingView[] views = drawingViewContainer.getAllDrawingViews();

        GroupMap rst = new GroupTreeMap();

        for (int i = 0; i < views.length; i++){
            DrawingView view = views[i];

            FigureEnumeration fe = view.getDrawing().getFigures();

            while (fe.hasMoreElements()){
                Figure fig = fe.nextFigure();
                String id  = (String) fig.getAttribute("id");

                if ((id != null) && (!id.equals(""))){
                    rst.add(view.getDrawing().getTitle(), id);
                }
            }
        }

        return rst;
View Full Code Here

                    fig.setAttribute(FeatureProperties.BINDINGTIME, target.getBindingTime().getName());
                    fig.invalidate();
                }
            }

            DrawingView view = editorArea.getCurrentView();
            if (view != null)
                view.repairDamage();

        }
View Full Code Here

TOP

Related Classes of research.DrawingView

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.