input metauml;
input metauml_package;
input metauml_package_relations;

beginfig(1);
    Package.emptyPackage("")();

    Package.nameOnlyPackage("java.sun.com")();

    Class.oneClass("A class")()();
    Package.oneClassPackage("One class package")(oneClass);

    Instance.oneInstance("An instance")();
    State.oneState("A state")();
    Activity.oneActivity("An activity");
    Package.multiPackage("Multipackage")(oneInstance, oneState, oneActivity);

    Package.allPackage("This package contains them all")(emptyPackage, nameOnlyPackage,
                        oneClassPackage, multiPackage);

    nameOnlyPackage.nw = emptyPackage.ne + (30, 0);
    oneClassPackage.ne = emptyPackage.s - (0, 50);

    multiPackage.top  = oneClassPackage.top;
    multiPackage.left = oneClassPackage.right + 20;

    centered_align_top(oneState, oneActivity)(10, below(oneInstance.s, 20));

    drawObjects(allPackage);
endfig;

beginfig(2);
    Package.nameOnlyOnTopPackage("Name on top")();
    nameOnlyOnTopPackage.info.forceEmptyContent := 1;
    Package.nameOnlyInMiddlePackage("By default, the name", "is in the middle")();

    Class.cl("A class")("Attribute")("Method");
    Package.notEmptyPackage("Contains class")(cl);

    nameOnlyInMiddlePackage.n = nameOnlyOnTopPackage.s - (0, 40);
    notEmptyPackage.w = nameOnlyInMiddlePackage.e + (80, 0);
    drawObjects(nameOnlyOnTopPackage, nameOnlyInMiddlePackage, notEmptyPackage);

    %link(import)(pathStepX(notEmptyPackage.w, nameOnlyOnTopPackage.e, -30));
    %link(import)(pathVertical(nameOnlyInMiddlePackage.ne - (10, 0), nameOnlyOnTopPackage.bottom));
    %link(import)(notEmptyPackage.sw -- nameOnlyInMiddlePackage.ne);
endfig;

beginfig(3);
    link(nest)((10,10)--(30,30));
endfig;


end