Hi Zoran,

Sure:
What you get is a list of ArgoDiagram, and these have a getNamespace() method.

IIUC, you only want a list of diagrams directly contained in the Model, not in any subpackage. That can easily be accomplished by checking if the root Model equals the Object returned by the diagram's getNamespace method.

Regards,
Michiel



----- Original Message ----- From: "Zoran Jeremic" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, April 26, 2008 11:45 AM
Subject: Re: [argouml-dev] how to access all diagrams in model


Hi Michiel,

I have performed it as you have suggested, and it works fine, but this gives me all diagrams regardless they are direct ancestors of the model or they are in packages. What I wants further with this list is to check where does some diagram belongs to the some package, or to get diagrams without those that are in packages that belongs to the model.

 Can you give me some suggestions about this?

 Zoran

Michiel van der Wulp <[EMAIL PROTECTED]> wrote:
 Hi Zoran,

Diagrams are not part of the model, they are stored / maintained in the
Project:

ProjectManager.getManager().getCurrentProject().getDiagramList()

Regards,

Michiel



----- Original Message ----- From: "Zoran Jeremic"
To:
Sent: Friday, April 25, 2008 9:25 PM
Subject: [argouml-dev] how to access all diagrams in model


Hi,

I want to access all UML diagrams that belongs to model created. I have
created something like this:

Collection root=Model.getFacade().getRootElements();
Object element=null;
String projectN=null;
if (!root.isEmpty()) {
Object child=null;
for(Object t: root){
child = t;
}
if (Model.getFacade().isAModel(child)){
Collection children=Model.getFacade().getChildren(child);
...

In this code child is a modelElement. I'm expecting to get a collection
of all elements that belongs to the model, but children collection is
empty.
Can you suggest me how to access those diagrams?

I have also tried with

Model.getModelManagementHelper().getAllModelElementsOfKindWithModel(child,Model.getMetaTypes());

Zoran



---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
now.


--------------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.4/1397 - Release Date: 25/04/2008
7:42


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.


--------------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.4/1397 - Release Date: 25/04/2008 7:42


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to