Package org.woped.core.model.petrinet

Examples of org.woped.core.model.petrinet.EditorLayoutInfo


    }

    // Try to retrieve saved layout information from the Model Element
    // container
    // and set it for this editor window
    EditorLayoutInfo layoutInfo = container.getEditorLayoutInfo();
    if (layoutInfo != null) {
      getEditorPanel().setSavedLayoutInfo(layoutInfo);
    }
    // Copy resources from parentEditor to subprocessEditor
    Vector<ResourceModel> res = ((PetriNetModelProcessor) (parentEditor
View Full Code Here


    this.setLayout(new BorderLayout());   
    // Set some default size for the subprocess window
    setPreferredSize(new Dimension(600, 400));
   
    m_orientation = new Orientation();
    m_EditorLayoutInfo = new EditorLayoutInfo();   
    editorSize = new EditorSize(editor);
   
    m_EditorLayoutInfo.setVerticalLayout(isRotateSelected());   
   
    if (loadUI) {
View Full Code Here

//      editorSize.resize(false);
    }
  }

  public EditorLayoutInfo getSavedLayoutInfo() {
    EditorLayoutInfo result = new EditorLayoutInfo();
    result.setTreeViewWidthRight(m_mainSplitPane.getDividerLocation());
    result.setOverviewPanelVisible(isOverviewPanelVisible());
    result.setTreeHeightOverview(m_rightSideTreeView.getDividerLocation());
    result.setTreePanelVisible(isTreeviewPanelVisible());
    result.setSavedSize(getSize());
    result.setSavedLocation(getLocation());
 
    return result;
  }
View Full Code Here

                  currentNet.getToolspecificArray(j)
                      .getBounds().getPosition().getY()
                      .intValue());
              if (editor[i] instanceof EditorVC) {
                // Pass read layout information on to the editor
                EditorLayoutInfo layout = new EditorLayoutInfo();
                layout.setSavedSize(dim);
                layout.setSavedLocation(location);
               
                // try to import the type of Layout (false if vertical)
                ((EditorVC) editor[i]).setRotateSelected(currentNet
                    .getToolspecificArray(j)
                    .getVerticalLayout());
               
                  //for importing a vertical net to change the rotate-button 
                  if (currentNet
                        .getToolspecificArray(j)
                        .getVerticalLayout()== true){
                      //EditorVC.setRotateSelected(true);
                    VisualController.getInstance().propertyChange(new PropertyChangeEvent(this, "Import", null, null));
                     
                   
                    // Update the UI representation
                      //EditorVC.getGraph().updateUI(); 
                    }
                 
                  if (currentNet.getToolspecificArray(j).isSetScale()) {
                    // try to import the saved scale
                    ((EditorVC) editor[i]).getGraph().setScale(currentNet
                      .getToolspecificArray(j).getScale()/100.0);
                  }
                 

                // Only if also the remaining information is
                // available,
                // try to import the width of the tree view and the height of the overview panel
                  if (currentNet.getToolspecificArray(j).isSetTreeWidth()){
                    GraphicsSimpleType bounds = currentNet.getToolspecificArray(j).getBounds();
                    DimensionType dimension = bounds.getDimension();
                    int x =(int) (dimension.getX()).doubleValue();
                    x = x - currentNet.getToolspecificArray(j).getTreeWidth();
                    layout.setTreeViewWidthRight(x);
                  } else if (currentNet.getToolspecificArray(j).isSetTreeWidthRight()){
                    layout.setTreeViewWidthRight(currentNet.getToolspecificArray(j).getTreeWidthRight());
                  }
                  else {
                    layout.setTreeViewWidthRight(currentNet
                        .getToolspecificArray(j).getBounds()
                        .getDimension().getX().intValue() - 100);                   
                  }
                 
                  if(currentNet.getToolspecificArray(j).isSetOverviewPanelVisible()){
                    layout.setOverviewPanelVisible(currentNet.getToolspecificArray(j).getOverviewPanelVisible());
                  }else{
                    layout.setOverviewPanelVisible(true);
                  }
                 
                  if (currentNet.getToolspecificArray(j).isSetTreeHeightOverview()){
                    if(currentNet.getToolspecificArray(j).getTreeHeightOverview() < 1){
                      layout.setTreeHeightOverview(100);
                    }else{
                    layout.setTreeHeightOverview(currentNet.getToolspecificArray(j).getTreeHeightOverview());
                    }
                  }else{
                    layout.setTreeHeightOverview(100);
                  }
                 
                  if(currentNet.getToolspecificArray(j).isSetTreePanelVisible()){

                    layout.setTreePanelVisible(currentNet.getToolspecificArray(j).getTreePanelVisible());
                     
                  }else{
                    layout.setTreePanelVisible(true);
                  }
                 
                  ((EditorVC) editor[i]).getEditorPanel().setSavedLayoutInfo(layout);
                }
              }
View Full Code Here

                                      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

            // scale
            iNetToolSpec.setScale((int)(editor.getGraph().getScale() * 100));
           
            // graphics
            GraphicsSimpleType iGraphicsNet = iNetToolSpec.addNewBounds();
            EditorLayoutInfo layoutInfo = editor.getEditorPanel().getSavedLayoutInfo();
            if (layoutInfo.getSavedSize() != null)
            {
                DimensionType dim = iGraphicsNet.addNewDimension();
                dim.setX(new BigDecimal(layoutInfo.getSavedSize().getWidth()));
                dim.setY(new BigDecimal(layoutInfo.getSavedSize().getHeight()));
            }
            if (layoutInfo.getSavedLocation() != null)
            {
              PositionType location = iGraphicsNet.addNewPosition();
                location.setX(new BigDecimal(layoutInfo.getSavedLocation().getX()));
                location.setY(new BigDecimal(layoutInfo.getSavedLocation().getY()));
            }
            // Store the width of the tree view and the height of the overview
            if(layoutInfo.getTreeViewWidthRight()!=0){
              iNetToolSpec.setTreeWidthRight(layoutInfo.getTreeViewWidthRight());
            }else{
              iNetToolSpec.setTreeWidthRight(layoutInfo.getTreeViewWidth());
            }
            iNetToolSpec.setOverviewPanelVisible(layoutInfo.getOverviewPanelVisible());
            iNetToolSpec.setTreeHeightOverview(layoutInfo.getTreeHeightOverview());
            iNetToolSpec.setTreePanelVisible(layoutInfo.getTreePanelVisible());
            //verticalLayout
            iNetToolSpec.setVerticalLayout(editor.isRotateSelected());
            // resources
            ResourcesType iNetResources = iNetToolSpec.addNewResources();
            // Rescources
View Full Code Here

                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
                  NetToolspecificType subPToolSpec = newNet.addNewToolspecific();
                 
                  subPToolSpec.setTool("WoPeD");
                  subPToolSpec.setVersion("1.0");
                  // graphics
                  GraphicsSimpleType iGraphicsNet = subPToolSpec.addNewBounds();
                  if (subProcessLayout.getSavedSize() != null)
                  {
                    DimensionType dim = iGraphicsNet.addNewDimension();
                    dim.setX(new BigDecimal(subProcessLayout.getSavedSize().getWidth()));
                    dim.setY(new BigDecimal(subProcessLayout.getSavedSize().getHeight()));
                  }
                  if (subProcessLayout.getSavedLocation() != null)
                  {
                    PositionType location = iGraphicsNet.addNewPosition();
                    location.setX(new BigDecimal(subProcessLayout.getSavedLocation().getX()));
                    location.setY(new BigDecimal(subProcessLayout.getSavedLocation().getY()));
                  }
                  // Store the width of the tree view
                  subPToolSpec.setTreeWidthRight(subProcessLayout.getTreeViewWidthRight());
                  subPToolSpec.setOverviewPanelVisible(subProcessLayout.getOverviewPanelVisible());
                  subPToolSpec.setTreeHeightOverview(subProcessLayout.getTreeHeightOverview());
                  subPToolSpec.setTreePanelVisible(subProcessLayout.getTreePanelVisible());
                }
               
                // Call ourselves recursively to store the sub-process net
                saveModelElementContainer(newNet, subProcessContainer);
            } else if (currentModel.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE)
View Full Code Here

TOP

Related Classes of org.woped.core.model.petrinet.EditorLayoutInfo

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.