Package org.openbp.core.model.item.process

Examples of org.openbp.core.model.item.process.ProcessObject


  protected boolean saveEdit()
  {
    if (pec != null)
    {
      ProcessObject po = pec.getReferredProcessElement();

      String text = textOverlay.getText();
      text = StringUtil.trimNull(text);

      String msg = null;

      if (text == null)
      {
        msg = "An object name must not be empty.";
      }
      else if (!ModelQualifier.isValidIdentifier(text))
      {
        msg = "An object name must not contain one of the characters '.', '/', ':', ';'.";
      }
      else if (((ProcessDrawing) getDrawing()).getProcess().getNodeByName(text) != null)
      {
        for (Iterator it = po.getContainerIterator(); it.hasNext();)
        {
          ModelObject mo = (ModelObject) it.next();
          if (mo.getName().equals(text) && mo != po)
          {
            msg = "An element having this name already exists.";
            break;
          }
        }
      }

      if (msg != null)
      {
        JMsgBox.show(null, msg, JMsgBox.ICON_INFO);
        return false;
      }

      po.setName(text);
      pec.updateFigure();

      getView().singleSelect(pec);
    }
    return true;
View Full Code Here


  public JaspiraEventHandlerCode plugin_propertybrowser_executesave(PropertyBrowserSaveEvent oee)
  {
    if (!(oee.original instanceof ProcessObject))
      return EVENT_IGNORED;

    ProcessObject orig = (ProcessObject) oee.original;

    if (!modeler.getProcessQualifier().equals(orig.getProcess().getQualifier()))
    {
      return EVENT_IGNORED;
    }

    modeler.startUndo("Edit Properties");

    try
    {
      orig.copyFrom(oee.getObject(), ModelObject.COPY_SHALLOW);
    }
    catch (CloneNotSupportedException e)
    {
      ExceptionUtil.printTrace(e);
      return EVENT_CONSUMED;
    }

    // Make sure all subordinate objects refer to this object
    orig.maintainReferences(0);

    if (orig instanceof MultiSocketNode)
    {
      MultiSocketNode node = (MultiSocketNode) orig;

      // If we edit an action node and the configuration bean contains default values only, we remove it
      // so it won't be persisted to the XML file.
      if (node.getConfigurationBean() != null && node.getConfigurationBean().hasDefaultValues())
      {
        node.setConfigurationBean(null);
      }
    }

    modeler.getDrawing().updateFigure();

    Object o = orig.getRepresentation();
    if (o instanceof Figure)
    {
      ((Figure) o).invalidate();
      modeler.getDrawingView().checkDamage();
    }
View Full Code Here

      Figure f = fe.nextFigure();

      if (f instanceof ProcessElementContainer)
      {
        ProcessElementContainer pec = (ProcessElementContainer) f;
        ProcessObject pe = pec.getProcessElement();
        ModelQualifier qualifier = pe.getQualifier();

        if (result == null)
        {
          result = new ArrayList();
        }
View Full Code Here

    if (!CommonUtil.equalsNull(processQualifier.getItem(), qualifier.getItem()))
      return null;
    if (qualifier.getItemType() != null && !CommonUtil.equalsNull(processQualifier.getItemType(), qualifier.getItemType()))
      return null;

    ProcessObject po = process.getProcessElementByName(qualifier.getObjectPath());
    if (po == null)
      return null;

    if (po.getRepresentation() == null)
    {
      Throwable t = new Throwable("No representation for qualifier '" + qualifier + "'.");
      ExceptionUtil.printTrace(t);
    }

    return (ProcessElementContainer) po.getRepresentation();
  }
View Full Code Here

   * When reinitializing the contents of the socket, the text information may be hidden if the name of the
   * underlying process element is 'In' or 'Out' and the skin tells us to do so.
   */
  public void applyContentState()
  {
    ProcessObject pe = getReferredProcessElement();
    String name = pe.getName();

    boolean anchorVisible = ViewModeMgr.getInstance().isControlAnchorVisible(this) || getDrawing().isDisplayAll();
    boolean hideText = false;

    // When control anchors are hidden, we also hide the socket name
View Full Code Here

TOP

Related Classes of org.openbp.core.model.item.process.ProcessObject

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.