예제 #1
0
    /** @return the port on the parent diagram */
    public BasicPort getParentPort() {
      if (parentPort == null) {
        try {
          if (containsSource) {
            parentPort = IOBlocks.getOpposite(target.getClass()).newInstance();
          } else {
            parentPort = IOBlocks.getOpposite(source.getClass()).newInstance();
          }
        } catch (InstantiationException e) {
          Logger.getLogger(RegionToSuperblockAction.class.getName()).severe(e.toString());
        } catch (IllegalAccessException e) {
          Logger.getLogger(RegionToSuperblockAction.class.getName()).severe(e.toString());
        }
      }

      return parentPort;
    }
예제 #2
0
    /** @return the child block to put on the child diagram */
    public ContextUpdate getChildBlock() {
      if (childBlock == null) {
        final BasicPort terminal = getTerminal();
        childBlock = IOBlocks.createBlock(terminal);

        /*
         * Set the child position
         */
        childBlock.getGeometry().setX(x);
        childBlock.getGeometry().setY(y);
      }

      return childBlock;
    }