Package org.woped.core.model

Examples of org.woped.core.model.ModelElementContainer


    for(String arcID:arcIDs)
      mec.getArcById(arcID).setHighlighted(true);
  }
 
  public void removeHighlights(){
    ModelElementContainer mec = editor.getModelProcessor().getElementContainer();
    mec.removeAllHighlighting();
  }
View Full Code Here


            return false;
        }
    }

    private boolean isBranchingOk(EditorVC editor) {
        ModelElementContainer mec = editor.getModelProcessor().getElementContainer();
        boolean branchingOk = true;
        String[] param = { "", "", "" };
        Iterator<AbstractPetriNetElementModel> transes = (mec.getElementsByType(AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE)).values()
                .iterator();
        IQualanalysisService qualanService = QualAnalysisServiceFactory.createNewQualAnalysisService(editor);
        Iterator<AbstractPetriNetElementModel> places = qualanService.getPlaces().iterator();
        AbstractPetriNetElementModel end = (AbstractPetriNetElementModel) qualanService.getSinkPlaces().iterator().next();

        while (transes.hasNext()) {
            AbstractPetriNetElementModel trans = (AbstractPetriNetElementModel) transes.next();
            Map<String, Object> outArcs = mec.getOutgoingArcs(trans.getId());
            int sum = 0;
            for (Object v : outArcs.values()) {
                double p = ((ArcModel) v).getProbability();
                sum += (Double.valueOf(p * 100)).intValue();
            }

            int type = ((OperatorTransitionModel) trans).getOperatorType();
            if ((type == OperatorTransitionModel.XOR_SPLIT_TYPE || type == OperatorTransitionModel.XOR_SPLITJOIN_TYPE || type == OperatorTransitionModel.ANDJOIN_XORSPLIT_TYPE)
                    & sum != 100) {
                branchingOk = false;
                param[0] = Messages.getString("QuantAna.Transition");
                param[1] = trans.getNameValue();
                param[2] = sum + "";
            }
        }

        while (places.hasNext()) {
            AbstractPetriNetElementModel place = (AbstractPetriNetElementModel) places.next();
            if (!place.equals(end)) {
                Map<String, Object> outArcs = mec.getOutgoingArcs(place.getId());
                int sum = 0;
                for (Object v : outArcs.values()) {
                    double p = ((ArcModel) v).getProbability();
                    sum += (Double.valueOf(p * 100)).intValue();
                }
View Full Code Here

   *
   * @author Martin Meitz
   *
   */
  public void setPnmlString(){
    ModelElementContainer elementContainer = editor.getModelProcessor().getElementContainer();
        PetriNetModelProcessor petrinetModel = (PetriNetModelProcessor) editor.getModelProcessor();
        pnmlDoc = PnmlDocument.Factory.newInstance();
        PnmlType iPnml = pnmlDoc.addNewPnml();
        NetType iNet = iPnml.addNewNet();
        iNet.setType(petrinetModel.getType());
View Full Code Here

        // its an ordinary Model Element
        super(map);
        setOperatorType(map.getOperatorType());

        simpleTransContainer = new ModelElementContainer();
        // The simple transition container
        // is owned by the operator
        simpleTransContainer.setOwningElement(this);
        // Setting Toolspecific
        this.getToolSpecific().setOperatorId(this.getId());
View Full Code Here

                    if (subProcessNets.length > 1)
                      warnings
                          .add("- SKIP SUBPROCESS NET: Only one sub-process net may be defined per sub-process.");

                    NetType subProcessNet = subProcessNets[0];
                    ModelElementContainer container = ((SubProcessModel) element)
                        .getSimpleTransContainer();

                    importNet(subProcessNet, container);

                    // Now see whether we have any
                    // tool-specific information
                    // attached to the sub-net
                    // This might contain layout information
                    // for the sub-process editor
                    for (int j = 0; j < subProcessNet
                        .getToolspecificArray().length; ++j)
                      if (subProcessNet
                          .getToolspecificArray(j)
                          .getTool().equals("WoPeD")) {
                        if (subProcessNet
                            .getToolspecificArray(j)
                            .isSetBounds()) {
                          Dimension dim = new Dimension(
                              subProcessNet
                                  .getToolspecificArray(
                                      j)
                                  .getBounds()
                                  .getDimension()
                                  .getX()
                                  .intValue(),
                              subProcessNet
                                  .getToolspecificArray(
                                      j)
                                  .getBounds()
                                  .getDimension()
                                  .getY()
                                  .intValue());
                          Point location = new Point(
                              subProcessNet
                                  .getToolspecificArray(
                                      j)
                                  .getBounds()
                                  .getPosition()
                                  .getX()
                                  .intValue(),
                              subProcessNet
                                  .getToolspecificArray(
                                      j)
                                  .getBounds()
                                  .getPosition()
                                  .getY()
                                  .intValue());
                          EditorLayoutInfo layout = new EditorLayoutInfo();

                          layout.setSavedSize(dim);
                          layout
                              .setSavedLocation(location);
                          // Only if also the
                          // remaining information is
                          // available,
                          // try to import the width
                          // of the tree view
                          if (subProcessNet.getToolspecificArray(j).isSetTreeWidth()){
                            layout.setTreeViewWidthRight(subProcessNet.getToolspecificArray(j).getBounds()
                                    .getDimension().getX().intValue() - subProcessNet.getToolspecificArray(j).getTreeWidth());
                          }
                         
                          if (subProcessNet.getToolspecificArray(j).isSetTreeWidthRight()){
                            layout.setTreeViewWidthRight(subProcessNet.getToolspecificArray(j).getTreeWidthRight());
                          }
                           
                          if(subProcessNet.getToolspecificArray(j).isSetOverviewPanelVisible()){
                            layout.setOverviewPanelVisible(subProcessNet.getToolspecificArray(j).getOverviewPanelVisible());
                          }else{
                            layout.setOverviewPanelVisible(true);
                          }
                         
                          if(subProcessNet.getToolspecificArray(j).isSetTreeHeightOverview()){
                            layout.setTreeHeightOverview(subProcessNet.getToolspecificArray(j).getTreeHeightOverview());
                       
                          }
                         
                          if(subProcessNet.getToolspecificArray(j).isSetTreePanelVisible()){
                            layout.setTreePanelVisible(subProcessNet.getToolspecificArray(j).getTreePanelVisible());
                          }else{
                            layout.setTreePanelVisible(true);
                          }
                         
                          container.setEditorLayoutInfo(layout);
                        }
                      }
                  }
                }
              }
View Full Code Here

    }


    private void createJavaBeansInstances(EditorVC editor)
    {
        ModelElementContainer elementContainer = editor.getModelProcessor().getElementContainer();
        PetriNetModelProcessor petrinetModel = (PetriNetModelProcessor) editor.getModelProcessor();
        pnmlDoc = PnmlDocument.Factory.newInstance();
        PnmlType iPnml = pnmlDoc.addNewPnml();

        // Initialisieren der Statusbar
        int resources = petrinetModel.getResources().size();
        int roles = petrinetModel.getRoles().size();
        int orgaUnits = petrinetModel.getOrganizationUnits().size();
        int resourcesMapping = petrinetModel.getResourceMapping().size();
        int rootElements = elementContainer.getRootElements().size();
        int arcs = elementContainer.getArcMap().size();
        // TODO (blackfox) - extend statusbars for simulations

        for (int i = 0; i < statusBars.length; i++)
            statusBars[i].startProgress("Save to File", resources + roles + resourcesMapping + orgaUnits + rootElements + arcs);
View Full Code Here

                // so it can be assigned back later on when importing the net
                newPage.setId(currentModel.getId());
                // Create a new XMLBean representing the sub-net
                NetType newNet = newPage.addNewNet();
               
                ModelElementContainer subProcessContainer =                
                  ((SubProcessModel)currentModel).getSimpleTransContainer();
               
                EditorLayoutInfo subProcessLayout =subProcessContainer.getEditorLayoutInfo();
                if (subProcessLayout!=null)
                {
                  // This sub-process model stores some information about
                  // the layout of the subprocessor editor
                  // Convert it to XMLBeans information and store it
View Full Code Here

  }

  private LinkedList<TransitionModel> getTransModels() {
    LinkedList<TransitionModel> lst = new LinkedList<TransitionModel>();
    ArrayList<String> ids = new ArrayList<String>();
    ModelElementContainer mec = editor.getModelProcessor().getElementContainer();
    Node[] nodes = graph.getNodeArray();

    for (int i = 0; i < nodes.length; i++)
      if (graph.isTransition(nodes[i].getId()))
        ids.add(nodes[i].getId());

    for (int i = 0; i < ids.size(); i++) {
      lst.add((TransitionModel) mec.getElementById(ids.get(i)));
    }

    return lst;
  }
View Full Code Here

    this.fillVariableToComboBox(this.toVariableComboBox);
    this.toVariableComboBox.setSelectedItem(o);

    if (Assign.class.isInstance(this.transition.getBpelData())) {
      Assign assign = (Assign) this.transition.getBpelData();
      ModelElementContainer model = this.t_editor.getEditor()
          .getModelProcessor().getElementContainer();
      BpelVariable var = model.findBpelVariableByName(assign
          .getFromVariable());
      this.fromVariableComboBox.setSelectedItem(var);
      var = model.findBpelVariableByName(assign.getToVariable());
      this.toVariableComboBox.setSelectedItem(var);
    }
    this.repaint();
  }
View Full Code Here

   private void gettingElements(HashMap<String, SGYElement> vertices) {
    HashMap<String, SGYElement> potentialSources;
    AbstractPetriNetElementModel ele;
    ArcModel arc;
    String sSource, sTarget;
    ModelElementContainer mec = editor.getModelProcessor()
        .getElementContainer();

    // getting Elements and Arcs
    for (String elementId : mec.getIdMap().keySet()) {
      ele = mec.getElementById(elementId);
      selectElements.add(ele.getParent());
      if (lineType != 2) {
        if (ele instanceof TransitionModel) {
          TransitionModel transitionModel = (TransitionModel) ele;
          if (transitionModel.hasTrigger()) {
            lineType = 1;
          }
          if (transitionModel.hasResource()) {
            lineType = 2;
          }
        }
      }
      vertices.put(ele.getId(), new SGYElement(ele));
    }

    // building relationships, defines the source
    potentialSources = (HashMap<String, SGYElement>) vertices.clone();
    for (String arcId : mec.getArcMap().keySet()) {
      arc = mec.getArcById(arcId);
      selectElements.add(arc);
      sSource = null;
      sTarget = null;
      if (arc != null) {
        sSource = arc.getSourceId();
View Full Code Here

TOP

Related Classes of org.woped.core.model.ModelElementContainer

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.