Package org.woped.core.controller

Examples of org.woped.core.controller.AbstractGraph


      NetInfo current = (NetInfo) selection[i].getLastPathComponent();
      Object[] sme = current.getReferencedElements();
      for (int j = 0; j < sme.length; ++j)
        processedSelection.add(sme[j]);
    }
    AbstractGraph currentGraph = m_currentEditor.getGraph();

    // Finally, select all elements selected in the tree view
    ArrayList<AbstractPetriNetElementModel> newSelection = new ArrayList<AbstractPetriNetElementModel>();
    for (Iterator<Object> i = processedSelection.iterator(); i.hasNext();) {
      AbstractPetriNetElementModel currentObject = (AbstractPetriNetElementModel) i.next();
      // Comparing only the IDs is too risky because we may crash in this
      // case if by
      // accident an id name is not unique.
      // Rather, look up by ID and see if the references match. This if
      // proof
      // that we're actually talking about the same element
      if (m_currentEditor.getModelProcessor().getElementContainer().getElementById(((currentObject).getId())) == currentObject)
        // The selected element is part of the currently edited net
        newSelection.add(currentObject);
      else {
        // The selected element is not part of the currently edited net
        // We will try to open a corresponding sub-net and
        // see if we can select it there
        AbstractPetriNetElementModel parent = currentObject.getRootOwningContainer().getOwningElement();
        if (parent instanceof SubProcessModel) {
          IEditor newEditor = m_mediator.createSubprocessEditor(true, m_currentEditor, (SubProcessModel) parent);
          // Select in the new editor
          newEditor.getGraph().addSelectionCell(currentObject);
        }
      }
    }
    if (highlightOnly == false) {
      valueChangedActive = true;
      // Need to have an intermediary for our new selection
      // as for some reason addSelection will clear all
      // previously selected items
      currentGraph.setSelectionCells(newSelection.toArray());
      valueChangedActive = false;
    } else {
      highlightElements(newSelection.iterator());
    }
  }
View Full Code Here


   * Check what elements are selected and changes the status accordingly.
   */
  protected void checkSelection()
  {
    IEditor     editor = am.getUi().getEditorFocus();
    AbstractGraph   graph = null;
    Object       selectedCell = null, mainCell = null;
   
    if (isActive())
    { 
      graph = null;
      selectedCell = null;
      if (editor != null)
      {
        graph = editor.getGraph();
        selectedCell = graph.getSelectionCell();
        mainCell = selectedCell;
      }
     
      boolean noSelection = (selectedCell == null && !arcpointSelected);
      boolean routedArcSelected = false;
      boolean xorArcSelected = false;
      boolean unroutedArcSelected = false;
      boolean transitionSelected = false;
      boolean triggeredTransitionSelected = false;
      boolean noTimeTriggerSelected = false;
      boolean noMessageTriggerSelected = false;
      boolean noResourceTriggerSelected = false;
      boolean placeSelected = false;
      boolean tokenPlaceSelected = false;
      boolean subprocessSelected = false;
      boolean arcSelected = false;
      boolean nameSelected = false;
      boolean operatorSelected = false
      boolean groupSelected = false;
      boolean multipleSelected = false;
      int triggerType = TriggerModel.TRIGGER_NONE;
     
      while (selectedCell instanceof GroupModel)
      {
        selectedCell = ((GroupModel) selectedCell).getMainElement();
      }
     
      if (graph != null && graph.isGroup(mainCell) && ((GroupModel)mainCell).isUngroupable())
      {
        groupSelected = true;
      }
      else if (graph != null && graph.getSelectionCount() > 1)
      {
        multipleSelected = true;
      }
      else if (selectedCell instanceof ArcModel)
      {
View Full Code Here

     *
     * @param editor
     */
    public void print(IEditor editor)
    {
        AbstractGraph graph = editor.getGraph();
        if (graph != null)
        {
            PrinterJob printJob = PrinterJob.getPrinterJob();
            printJob.setPrintable(graph);
            if (printJob.printDialog())
View Full Code Here

     *
     * @param editor
     */
    public static void print(IEditor editor)
    {
        AbstractGraph graph = editor.getGraph();
        if (graph != null)
        {
            PrinterJob printJob = PrinterJob.getPrinterJob();
            printJob.setPrintable(graph);
            PageFormat oldPage = new PageFormat();
View Full Code Here

TOP

Related Classes of org.woped.core.controller.AbstractGraph

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.