Package org.woped.core.controller

Examples of org.woped.core.controller.IEditor


   * setSelected of all other editor to false
   * setSelected of the current editor to true
   */
  public void selectEditor(IEditor editor) {
   
    IEditor oldEditor = getSelectedEditor();
    if (oldEditor != null)
      oldEditor.getGraph().clearSelection();
    if (actions.get(editor) != null) {
      selectedEditor = editor;
      for (Iterator<JToggleButton> iter = actions.values().iterator(); iter
          .hasNext();) {
        iter.next().setSelected(false);
View Full Code Here


  public void checkSubprocessEditors(Vector<Object> selectedElement) {
    Iterator<Object> iterator = selectedElement.iterator();
    GroupModel element;
    ArcConfiguration arcConfig = new ArcConfiguration();
    IEditor subEditor;
    while (iterator.hasNext()) {
      try {
        element = (GroupModel) iterator.next();
        if (element.getMainElement().getType() == AbstractPetriNetElementModel.SUBP_TYPE) {
          SubProcessModel subprocess = (SubProcessModel) element
              .getMainElement();
          NetAlgorithms.getArcConfiguration(subprocess, arcConfig);
          IEditor editor = (EditorVC) getM_centralMediator().getUi()
              .getEditorFocus();
          if ((arcConfig.m_numIncoming != 0)
              || (arcConfig.m_numOutgoing != 0)) {
            subEditor = getM_centralMediator()
                .createSubprocessEditor(
View Full Code Here

        reachGraphVC.updatePanelsVisibility(aam.getUi().getEditorFocus());
//       aam.getUI.getCoverabilityGraphButton().setEnabled(true);
    }

    public void internalFrameClosed(InternalFrameEvent arg0) {
        IEditor editor = ((IEditorFrame) arg0.getSource()).getEditor();
        this.reachGraphVC.removePanel(editor);
//        aam.getUi().getCoverabilityGraphButton().setEnabled(false);
        reachGraphVC.updatePanelsVisibility(aam.getUi().getEditorFocus());
    }
View Full Code Here

  @Override
  public void processViewEvent(AbstractViewEvent event) {
    LoggerManager.debug(Constants.QUALANALYSIS_LOGGER, "-> processViewEvent " + this.getClass().getName());
    if(getMediator().getUi().getEditorFocus() instanceof IEditor /*&& !getMediator().getUi().getEditorFocus().isSubprocessEditor()*/){
      if(event.getOrder() == AbstractViewEvent.REACHGRAPH && getMediator().getUi().getEditorFocus() instanceof IEditor){
        IEditor editor = (IEditor) getMediator().getUi().getEditorFocus();
        IUserInterface dui = mediator.getUi();
        JDesktopPane desktop = (JDesktopPane) dui.getPropertyChangeSupportBean();
        // when the TokenGame is enabled there is shown a warning message
        if(editor.isTokenGameEnabled()){
          ReachabilityWarning.showReachabilityWarning(desktop, "QuanlAna.ReachabilityGraph.SimulationWarning");
          return;
        }
        JInternalFrame edit = desktop.getSelectedFrame();
        ReachabilityGraphVC toAdd = ReachabilityGraphVC.getInstance(dui);
        if(!desktop.isAncestorOf(toAdd)){
          rg_listener = new ReachabilityGraphVCListener(toAdd, mediator);
          edit.addInternalFrameListener(rg_listener);
          desktop.add(toAdd);
        } else {
          if(!hasAlreadyListener(edit, rg_listener)){
            edit.addInternalFrameListener(rg_listener);
          }
        }
        toAdd.setVisible(true);
        toAdd.validate();
        try { // to activate the JInternalFrame
          toAdd.setSelected(true);
        } catch (PropertyVetoException e) { //  if some component does not like this
          toAdd.moveToFront(); // then move it to front without activating
        }
        if(editor.isReachabilityEnabled()){ // is editor already added to RGVC ??
          toAdd.updatePanelsVisibility(editor);
        } else {
          toAdd.addEditor(editor);
          toAdd.refreshGraph(AbstractReachabilityGraphModel.HIERARCHIC);
        }
View Full Code Here

  /**
   * method to clean all highlights in the net
   */
  public void cleanHiglights() {
    IEditor editor = sideBar.getEditor();
    Iterator<AbstractPetriNetElementModel> i = editor.getModelProcessor()
        .getElementContainer().getRootElements().iterator();
    while (i.hasNext()) {
      AbstractPetriNetElementModel current = (AbstractPetriNetElementModel) i.next();
      current.setHighlighted(false);
    }
    editor.getGraph().repaint();
  }
View Full Code Here

    //! Return the last editor window that had the focus
    //! @return last editor window that had the focus for null if no editor window open
    public IEditor getEditorFocus()
    {
      JInternalFrame[] frames = desktop.getAllFrames();
      IEditor result = null;
      for (int i=0;(result==null)&&(i<frames.length);++i)
        if (frames[i] instanceof DefaultEditorFrame){
          result = ((DefaultEditorFrame)frames[i]).getEditor();
        }
      return result;
View Full Code Here

    super(vepID, mediator);
  }

  public void processViewEvent(AbstractViewEvent event)
  {
    IEditor editor;
    if (event.getSource() instanceof EditorVC)
    {
      editor = (EditorVC) event.getSource();
    } else
    {
      editor = (EditorVC) getMediator().getUi().getEditorFocus();
    }
    switch (event.getOrder())
    {
    case AbstractViewEvent.NEW:
      editor = getMediator().createEditor(true);
      break;
    case AbstractViewEvent.OPEN_SUBPROCESS:
      if (event.getSource() instanceof EditorVC)
      {
        editor = (EditorVC) event.getSource();
      } else
      {
        editor = (EditorVC) getMediator().getUi().getEditorFocus();
      }
      Object cell = editor.getGraph().getSelectionCell();
      if (cell instanceof GroupModel)
      {

        cell = ((GroupModel) cell).getMainElement();
        if (cell instanceof SubProcessModel)
        {
          SubProcessModel model = (SubProcessModel) cell;
       
          IEditor subEditor = getMediator().createSubprocessEditor(
              true, editor, model);
          //rotate of Subprocess like Mainprocess
          if  (editor.isRotateSelected() != model.getDirection()){
            subEditor.rotateLayout();
            model.setDirection(editor.isRotateSelected());
          }
        }
      } else
      {
View Full Code Here

     * @return true if modality had to be fixed because there is a modal frame and it was not the one currently due to
     *              an external event, false otherwise
     */
    private boolean FixModality()
    {
      IEditor activatedEditor = getEditorFocus();
      DefaultEditorFrame modalFrame =
        (m_modalityStack.size()>0)?m_modalityStack.get(0):null;
      JInternalFrame frames[] = desktop.getAllFrames();
      for (int i = 0;i<frames.length;++i)
      {
View Full Code Here

      FixModality();
    }

    public void internalFrameClosing(InternalFrameEvent e)
    {     
        IEditor editor = ((DefaultEditorFrame) e.getSource()).getEditor();
        WoPeDAction action = ActionFactory.getStaticAction(ActionFactory.ACTIONID_CLOSE);
        action.actionPerformed(new ViewEvent(editor, AbstractViewEvent.VIEWEVENTTYPE_GUI, AbstractViewEvent.CLOSE));

    }
View Full Code Here

    Vector<IEditor> editorList = new Vector<IEditor>(getMediator().getUi()
        .getAllEditors());
    boolean canceled = false;
    for (Iterator<IEditor> iter = editorList.iterator(); iter.hasNext();)
    {
      IEditor editor = (IEditor) iter.next();
      processViewEvent(new ViewEvent(editor,
          AbstractViewEvent.VIEWEVENTTYPE_GUI,
          AbstractViewEvent.CLOSE));
      if (getMediator().getUi().getAllEditors().contains(editor))
      {
View Full Code Here

TOP

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

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.