<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Can't draw Associations within a package"]]></title>
		<link>http://forums.visual-paradigm.com/posts/26.html</link>
		<description><![CDATA[Latest messages posted in the topic "Can't draw Associations within a package"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Can't draw Associations within a package</title>
				<description><![CDATA[ I have this block of code that read my project,  iterate through every element in a package.  I do a check:<br> if the element is an instanceof IClass, then I draw the class.   I was able to draw all the classes.   <br> If the element is an instanceof IAssociation, the draw the association.  But I wasn't able to draw associations.   Can anyone help?  Thanks.<br> <br> //  <br> 	public void createClassDiagram(DiagramManager manager,<br> 			IModelElementFactory factory) {<br> <br> 		// create and open a new class diagram<br> 		IClassDiagramUIModel diagram = (IClassDiagramUIModel) manager<br> 				.createDiagram(DiagramManager.DIAGRAM_TYPE_CLASS_DIAGRAM);<br> 		manager.openDiagram(diagram);<br> <br> 		// create a system boundary and the corresponding UI model<br> 		ISystem system = factory.createSystem();<br> 		system.setName("System 1");<br> 		IShapeUIModel systemShape = ((IShapeUIModel) manager<br> 				.createDiagramElement(diagram, system));<br> 		systemShape.setBounds(0, 0, 700, 700);<br> <br> 		// load project<br> 		IProject project = ApplicationManager.instance().getProjectManager()<br> 				.getProject();<br> 		Iterator iter1 = project<br> 				.modelElementIterator(IModelElementFactory.MODEL_TYPE_PACKAGE);<br> 		while (iter1.hasNext()) {<br> 			IPackage obj1 = (IPackage) iter1.next();<br> 			Iterator iter2 = obj1.childIterator();<br> 			while (iter2.hasNext()) {<br> 				Object obj = iter2.next();<br> 				if (obj instanceof IClass) {<br> 					IClass theClass = (IClass) obj;<br> 					system.addChild(theClass);<br> 					IShapeUIModel classShape = ((IShapeUIModel) manager<br> 							.createDiagramElement(diagram, theClass));<br> 					classShape.setBounds(10, 10, 10, 10);<br> 					classShape.setLocation(20, 20);<br> 				} else if (obj instanceof IAssociation) {<br> 					IAssociation theAssociation = (IAssociation) obj;<br> 					system.addChild(theAssociation);<br> 					IShapeUIModel associationShape = ((IShapeUIModel) manager<br> 							.createDiagramElement(diagram, theAssociation));<br> 					associationShape.setBounds(10, 10, 10, 10);<br> 					associationShape.setLocation(20, 20);<br> 				}<br> 			}<br> 		}<br> 	}<br> ]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/3100#35065.html</guid>
				<link>http://forums.visual-paradigm.com/posts/3100#35065.html</link>
				<pubDate><![CDATA[Sun, 11 May 2008 23:28:08]]></pubDate>
				<author><![CDATA[ Anonymous]]></author>
			</item>
			<item>
				<title>Re:Can't draw Associations within a package</title>
				<description><![CDATA[ Hi user,<br> <br> Thank you for post. It seems that you have submitted a ticket with the same query, please check your ticket if I'm right.<br> <br> If there are any inquiries, please feel free to ask.<br> <br> Best regards,<br> Lilian Wong]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/3100#35786.html</guid>
				<link>http://forums.visual-paradigm.com/posts/3100#35786.html</link>
				<pubDate><![CDATA[Wed, 14 May 2008 08:45:10]]></pubDate>
				<author><![CDATA[ LilianWong]]></author>
			</item>
	</channel>
</rss>