Examples of IPackageService


Examples of net.sourceforge.coffea.uml2.model.IPackageService

        else if(pack.getKind()==IPackageFragmentRoot.K_SOURCE) {
          String name = pack.getElementName();
          if((name==null)||(name.length()==0)) {
            name = IModelService.defaultPackageFileName;
          }
          IPackageService group =
            model.resolvePackageService(name);
          if(group==null) {
            new PackageService(
                pack,
                model
View Full Code Here

Examples of net.sourceforge.coffea.uml2.model.IPackageService

          "A model must be loaded first"
      );
    }
    // First, we need to identify a container package and isolate the
    // simple name
    IPackageService containerPackageService = null;
    String containerFullName = null;
    String simpleName = null;
    int lastPointIndex = packageFullName.lastIndexOf('.');
    if(lastPointIndex > 0) {
      containerFullName =
        packageFullName.substring(0, lastPointIndex - 1);
      simpleName = packageFullName.substring(lastPointIndex + 1);
    }
    else {
      simpleName = packageFullName;
    }
    // If we have a container package,
    if(containerFullName != null) {
      // Then we resolve the corresponding service
      containerPackageService =
        modelService.resolvePackageService(containerFullName);
    }
    else {
      // Else we resolve the default package service
      containerPackageService =
        modelService.resolvePackageService(
          IPackageService.defaultUMLPackageName
        );
    }
    if(containerPackageService != null) {
      IPackageService packageService =
        containerPackageService.createNestedPackage(simpleName);
      return packageService != null;
    }
    else return false;
  }
View Full Code Here

Examples of net.sourceforge.coffea.uml2.model.IPackageService

          displayedFigure = null;
        }
        figureSystem.setContents(displayedFigure);
      }
      else if(packageEl != null) {
        IPackageService packageService =
          serviceBuilder.buildPackageService(packageEl);
        if(packageService != null) {
          displayedFigure =
            new PackageFigure<IPackageService>(packageService);
        }
View Full Code Here

Examples of net.sourceforge.coffea.uml2.model.IPackageService

  }

  /** Set up the package hierarchy from the content of {@link #packages} */
  protected void setUpPackageHierarchy() {
    if(packages!=null) {
      IPackageService p = null;
      // In a first loop on the packages list,
      for(int i=0 ; i<packages.size() ; i++) {
        //Each package retrieves its parent
        p = packages.get(i);
        if(p!=null) {
          p.retrieveContainerFromHierarchy();
        }
      }
      // Recursively each package retrieve its children
      List<IPackageService> root = fetchSubPackagesFromHierarchy();
      packages = root;
View Full Code Here

Examples of net.sourceforge.coffea.uml2.model.IPackageService

    return packages;
  }

  public IPackageService resolvePackageService(String n) {
    for (int i = 0; i < this.packages.size(); i++) {
      IPackageService pck = this.packages.get(i);
      String packFullName = pck.getFullName();
      if ((packFullName!=null)&&(packFullName.equals(n))) {
        return pck;
      }
      else {
        IPackageService el;
        if ((el = pck.resolvePackageService(n)) != null) {
          return el;
        }
      }
    }
View Full Code Here

Examples of net.sourceforge.coffea.uml2.model.IPackageService

  public List<IPackageService> fetchSubPackagesFromHierarchy() {
    // Looping on the packages list,
    List<IPackageService> rootPackages =
      new ArrayList<IPackageService>();
    IPackageService p = null;
    for(int i=0 ; i<packages.size() ; i++) {
      // We identify which have directly the model for container
      p = packages.get(i);
      if((p!=null) &&(p.getContainerService().equals(this))) {
        // The package, which are "root packages", will be the
        // basement for a recursive retrieving of sub packages
        p.fetchSubPackagesFromHierarchy();
        rootPackages.add(p);
      }
    }
    return rootPackages;
  }
View Full Code Here

Examples of net.sourceforge.coffea.uml2.model.IPackageService

          ret.add(t);
        }
      }
    }
    if(packages!=null) {
      IPackageService p;
      for(int i=0 ; i<packages.size() ; i++) {
        p = packages.get(i);
        if(p!=null) {
          ret.add(p);
        }
View Full Code Here

Examples of net.sourceforge.coffea.uml2.model.IPackageService

            }
          }
        }
      }
      if((ret==null)&&(packages!=null)) {
        IPackageService p;
        for(int i=0 ; i<packages.size() ; i++) {
          p = packages.get(i);
          if(p!=null) {
            if(n.equals(p.getFullName())) {
              ret = p;
            }
            else {
              ret = p.getElementService(n);
            }
            if(ret!=null) {
              break;
            }
          }
View Full Code Here

Examples of net.sourceforge.coffea.uml2.model.IPackageService

        // Then we look for it in the model
        supplier = getModelService().resolveTypeService(typeName);
      }
      else {
        // Else we got to get the local package
        IPackageService packH = null;
        IContainerService contH = getContainerService();
        while(
            (contH != null)
            &&(!(contH instanceof IPackageService))
            &&(contH instanceof IContainableElementService<?, ?>)
        ) {
         
          contH =
            ((IContainableElementService<?, ?>)contH)
            .getContainerService();
        }
        // From the package we can have the type
        if(contH instanceof IPackageService) {
          packH = (IPackageService)contH;
          String packName = packH.getFullName();
          String fullName = packName + '.' + typeName;
          supplier = packH.resolveTypeService(fullName);
        }
      }
    }
    return supplier;
  }
View Full Code Here

Examples of net.sourceforge.coffea.uml2.model.IPackageService

        // Then we look for it in the model
        tHandler = getModelService().resolveTypeService(typeName);
      }
      else {
        // Else we got to get the local package
        IPackageService packSrv = null;
        IContainerService contSrv = getContainerService();
        while(
            (contSrv != null)
            &&(!(contSrv instanceof IPackageService))
            &&(contSrv instanceof IContainableElementService<?, ?>)
        ) {

          contSrv =
            ((IContainableElementService<?, ?>)contSrv)
            .getContainerService();
        }
        // From the package we can have the type
        if(contSrv instanceof IPackageService) {
          packSrv = (IPackageService)contSrv;
          String packName = packSrv.getFullName();
          String fullName = packName + '.' + typeName;
          tHandler = packSrv.resolveTypeService(fullName);
        }
      }
    }
    return tHandler;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.