Package jdepend.framework

Examples of jdepend.framework.JavaPackage


    JDepend jdepend = new JDepend(packageFilter);
    jdepend.addDirectory("classes");

    DependencyConstraint constraint = new DependencyConstraint();
    // Sweet Home 3D packages
    JavaPackage sweetHome3DModel = constraint.addPackage("com.eteks.sweethome3d.model");
    JavaPackage sweetHome3DTools = constraint.addPackage("com.eteks.sweethome3d.tools");
    JavaPackage sweetHome3DPlugin = constraint.addPackage("com.eteks.sweethome3d.plugin");
    JavaPackage sweetHome3DViewController = constraint.addPackage("com.eteks.sweethome3d.viewcontroller");
    JavaPackage sweetHome3DSwing = constraint.addPackage("com.eteks.sweethome3d.swing");
    JavaPackage sweetHome3DJava3D = constraint.addPackage("com.eteks.sweethome3d.j3d");
    JavaPackage sweetHome3DIO = constraint.addPackage("com.eteks.sweethome3d.io");
    JavaPackage sweetHome3DApplication = constraint.addPackage("com.eteks.sweethome3d");
    JavaPackage sweetHome3DApplet = constraint.addPackage("com.eteks.sweethome3d.applet");
    // Swing components packages
    JavaPackage swing = constraint.addPackage("javax.swing");
    JavaPackage imageio = constraint.addPackage("javax.imageio");
    // Java 3D
    JavaPackage java3d = constraint.addPackage("javax.media.j3d");
    JavaPackage vecmath = constraint.addPackage("javax.vecmath");
    JavaPackage sun3dLoaders = constraint.addPackage("com.sun.j3d.loaders");
    JavaPackage sun3dLoadersLw3d = constraint.addPackage("com.sun.j3d.loaders.lw3d");
    JavaPackage sun3dUtilsGeometry = constraint.addPackage("com.sun.j3d.utils.geometry");
    JavaPackage sun3dUtilsImage = constraint.addPackage("com.sun.j3d.utils.image");
    JavaPackage sun3dUtilsUniverse = constraint.addPackage("com.sun.j3d.utils.universe");
    JavaPackage sun3dExpSwing = constraint.addPackage("com.sun.j3d.exp.swing.JCanvas3D");
    JavaPackage loader3ds = constraint.addPackage("com.microcrowd.loader.java3d.max3ds");
    // XML
    JavaPackage xmlParsers = constraint.addPackage("javax.xml.parsers");
    JavaPackage xmlSax = constraint.addPackage("org.xml.sax");
    JavaPackage xmlSaxHelpers = constraint.addPackage("org.xml.sax.helpers");
    // JMF
    JavaPackage jmf = constraint.addPackage("javax.media");
    JavaPackage jmfControl = constraint.addPackage("javax.media.control");
    JavaPackage jmfDataSink = constraint.addPackage("javax.media.datasink");
    JavaPackage jmfFormat = constraint.addPackage("javax.media.format");
    JavaPackage jmfProtocol = constraint.addPackage("javax.media.protocol");
    // SunFlow
    JavaPackage sunflow = constraint.addPackage("org.sunflow");
    JavaPackage sunflowCore = constraint.addPackage("org.sunflow.core");
    JavaPackage sunflowCoreLight = constraint.addPackage("org.sunflow.core.light");
    JavaPackage sunflowCorePrimitive = constraint.addPackage("org.sunflow.core.primitive");
    JavaPackage sunflowImage = constraint.addPackage("org.sunflow.image");
    JavaPackage sunflowMath = constraint.addPackage("org.sunflow.math");
    JavaPackage sunflowSystem = constraint.addPackage("org.sunflow.system");
    JavaPackage sunflowSystemUI = constraint.addPackage("org.sunflow.system.ui");
    // iText for PDF
    JavaPackage iText = constraint.addPackage("com.lowagie.text");
    JavaPackage iTextPdf = constraint.addPackage("com.lowagie.text.pdf");
    // FreeHEP Vector Graphics for SVG
    JavaPackage vectorGraphicsUtil = constraint.addPackage("org.freehep.util");
    JavaPackage vectorGraphicsSvg = constraint.addPackage("org.freehep.graphicsio.svg");
    // Java JNLP
    JavaPackage jnlp = constraint.addPackage("javax.jnlp");
    // Mac OS X specific interfaces
    JavaPackage eawt = constraint.addPackage("com.applet.eawt");
    JavaPackage eio = constraint.addPackage("com.applet.eio");

    // Describe dependencies : model don't have any dependency on
    // other packages, IO and View/Controller packages ignore each other
    // and Swing components and Java 3D use is isolated in sweetHome3DSwing
    sweetHome3DTools.dependsUpon(sweetHome3DModel);
View Full Code Here


                    continue;
                }

                boolean found = false;
                String fqcn = c.containingPackage().name() + '.' + c.name().replace('.', '$');
                JavaPackage jpkg = jdepend.getPackage(c.containingPackage().name());
                if (jpkg != null) {
                    Collection<JavaClass> jclasses = jpkg.getClasses();
                    if (jclasses != null) {
                        for (JavaClass jcls: jclasses) {
                            if (fqcn.equals(jcls.getName())) {
                                found = true;
                                break;
View Full Code Here

        for (String pname: allPackages.keySet()) {
            if (isHidden(allPackages.get(pname))) {
                continue;
            }

            JavaPackage pkg = jdepend.getPackage(pname);
            if (pkg == null) {
                continue;
            }

            packages.put(pname, allPackages.get(pname));

            Collection<JavaPackage> epkgs = pkg.getEfferents();
            if (epkgs == null) {
                continue;
            }

            for (JavaPackage epkg: epkgs) {
View Full Code Here

        for (String pname: allPackages.keySet()) {
            if (isHidden(allPackages.get(pname))) {
                continue;
            }

            JavaPackage pkg = jdepend.getPackage(pname);
            if (pkg == null) {
                continue;
            }

            packages.put(pname, allPackages.get(pname));

            Collection<JavaPackage> epkgs = pkg.getEfferents();
            if (epkgs == null) {
                continue;
            }

            for (JavaPackage epkg: epkgs) {
View Full Code Here

                    continue;
                }

                boolean found = false;
                String fqcn = c.containingPackage().name() + '.' + c.name().replace('.', '$');
                JavaPackage jpkg = jdepend.getPackage(c.containingPackage().name());
                if (jpkg != null) {
                    Collection<JavaClass> jclasses = jpkg.getClasses();
                    if (jclasses != null) {
                        for (JavaClass jcls: jclasses) {
                            if (fqcn.equals(jcls.getName())) {
                                found = true;
                                break;
View Full Code Here

        super.tearDown();
    }

    private void assertPackageConstraint(String afferent, String expectedNotEfferent) {
        JavaPackage afferentPackage = engine.getPackage(afferent);
        assertNotNull("Afferent package not found: " + afferent, afferentPackage);
        JavaPackage efferentPackage = engine.getPackage(expectedNotEfferent);
        assertNotNull("Efferent package not found: " + efferentPackage, efferentPackage);
        assertFalse(afferentPackage.getName() + " shouldn't depend on " + efferentPackage.getName(), afferentPackage
                .getEfferents().contains(efferentPackage));
    }
View Full Code Here

                    continue;
                }

                boolean found = false;
                String fqcn = c.containingPackage().name() + '.' + c.name();
                JavaPackage jpkg = jdepend.getPackage(c.containingPackage().name());
                if (jpkg != null) {
                    Collection<JavaClass> jclasses = jpkg.getClasses();
                    if (jclasses != null) {
                        for (JavaClass jcls: jclasses) {
                            if (fqcn.equals(jcls.getName())) {
                                found = true;
                                break;
View Full Code Here

                    continue;
                }

                boolean found = false;
                String fqcn = c.containingPackage().name() + '.' + c.name().replace('.', '$');
                JavaPackage jpkg = jdepend.getPackage(c.containingPackage().name());
                if (jpkg != null) {
                    Collection<JavaClass> jclasses = jpkg.getClasses();
                    if (jclasses != null) {
                        for (JavaClass jcls: jclasses) {
                            if (fqcn.equals(jcls.getName())) {
                                found = true;
                                break;
View Full Code Here

    {
        Iterator pkgs = jdep.analyze().iterator();

        while ( pkgs.hasNext() )
        {
            JavaPackage pkg = (JavaPackage) pkgs.next();
            PackageVertex pv = findPackageVertex( pkg );

            Iterator clzs = pkg.getClasses().iterator();
            while ( clzs.hasNext() )
            {
                JavaClass clz = (JavaClass) clzs.next();
                ClassVertex cv = findClassVertex( clz );

                OwnershipEdge oe = new OwnershipEdge( pkg, clz );
                addEdge( oe, pv, cv );
                setWeight( oe, 5.0 );

                Iterator ipkgs = clz.getImportedPackages().iterator();
                while ( ipkgs.hasNext() )
                {
                    JavaPackage ipkg = (JavaPackage) ipkgs.next();
                    PackageVertex ipv = findPackageVertex( ipkg );

                    ImportEdge ie = new ImportEdge( clz, pkg );
                    addEdge( ie, cv, ipv );
                    setWeight( ie, 200.0 * ipkg.afferentCoupling() + 100.0 );
                }
            }
        }
    }
View Full Code Here

        ArrayList efferents = new ArrayList(jPackage.getEfferents());
        Collections.sort(efferents, new PackageComparator(PackageComparator
                .byName()));
        Iterator efferentIter = efferents.iterator();
        while (efferentIter.hasNext()) {
            JavaPackage efferent = (JavaPackage) efferentIter.next();
            printPackageName(efferent);
        }
        if (efferents.size() == 0) {
            printEfferentsError();
        }
View Full Code Here

TOP

Related Classes of jdepend.framework.JavaPackage

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.