Book a Demo

Author Topic: How to add an Interface element with "Use circle  (Read 5523 times)

Jing Zhang

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
How to add an Interface element with "Use circle
« on: May 15, 2009, 01:55:30 am »
Hi All,

I am trying to add an Interface element with “Use Circle Notation” by using Interop.EA in C# (My EA version is 7.1.833); I went through all the properties/methods of both Element and DiagramObject in the help file, but I just can not figure it out.  I noticed the Style property of the DiagramObject is something like "DUID=A56A3FFE;Lollipop=1;" if the element is set to “Use Circle Notation”, and it will be first half – something like "DUID=A56A3FFE;” if the element is not set to “Use Circle Notation”. But if I set Style property of DiagramObject in code as below, the element added is still not using circle notation.
Code: [Select]
//create a new Diagram at current selected package
EA.Package currentPackage = Repository.GetTreeSelectedPackage();
EA.Diagram newDiagram = (EA.Diagram)currentPackage.Diagrams.AddNew("ESB Queues Deployment Diagram", "Deployment");
newDiagram.Notes = "This daigram is used for document ESB queues.";
newDiagram.Update();

//create a new cluster node
EA.Element newClusterElement = (EA.Element)currentPackage.Elements.AddNew("prodcluster", "Component");
newClusterElement.Stereotype = "Cluster";
newClusterElement.Update();

//create all elements for Queues
EA.Element newQueueElement = (EA.Element)currentPackage.Elements.AddNew("Queue1", "Interface");
newQueueElement.Stereotype = "JMS";
newQueueElement.Update();

//add elments to diagram
EA.DiagramObject newClusterDiagramObject = (EA.DiagramObject)newDiagram.DiagramObjects.AddNew("l=200;r=400;t=200;b=600;", "");
newClusterDiagramObject.ElementID = newClusterElement.ElementID;
newClusterDiagramObject.Update();
EA.DiagramObject newQueueDiagramObject = (EA.DiagramObject)newDiagram.DiagramObjects.AddNew("l=200;r=400;t=300;b=600;", "");
newQueueDiagramObject.ElementID = newQueueElement.ElementID;
newQueueDiagramObject.Update();
newQueueElement.Refresh();
String oldStyle = newQueueDiagramObject.Style.ToString();
newQueueDiagramObject.Style = oldStyle + "Lollipop = 1;";
newQueueDiagramObject.Update();

//add connection between cluster and queue
EA.Connector newConnector = (EA.Connector)newClusterElement.Connectors.AddNew("", "CommunicationPath");
newConnector.SupplierID = newQueueElement.ElementID;
newConnector.Direction = "Unspecified";
newConnector.Update();
newClusterElement.Connectors.Refresh();

If anyone can provide any hint on this, it would be very much appreciated.

Have a nice day!
 
Jing Zhang
« Last Edit: May 15, 2009, 02:09:05 am by jz247 »

Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: How to add an Interface element with "Use circ
« Reply #1 on: May 15, 2009, 06:41:57 am »
Hey...  ;D :)

Don't any of you folks use a visual / graphical notation....

The text even looks dull... which isn't a great motivator

A graphical non sequence diagram representation might even enable you to solve the issue unaided.

Thankyou for highlighting the issue; but not only do 'Sparxians' dislike the Windows Fluent or Office Ribbon interface style ( could just be an 'OZie' thing )... but it's graphical tool users,  "think text", not pictures or animated  timelines...

Kevin [smiley=2vrolijk_08.gif]
my mate says that internally they have parser... but as one adminy personality said " much auto-regenerated material is dificult " ( [smiley=2vrolijk_08.gif] all that converting to text takes it toll on any cognitive system [smiley=2vrolijk_08.gif] to understand... highlighting lines of text in todays debugger environments ( single step.. even point at symbol labels and read values "in text"....

ITS HOW YOU CHOICE TO ILLUSTRATE.... petulant rant over :'(

Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: How to add an Interface element with "Use circ
« Reply #2 on: May 15, 2009, 06:47:36 am »
Is this something to do with not calling refresh after each update...

I'm trying to be helpfull

Kevin [smiley=2vrolijk_08.gif]

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: How to add an Interface element with "Use circ
« Reply #3 on: May 15, 2009, 09:15:04 am »
Quote
newQueueDiagramObject.Style = oldStyle + "Lollipop = 1;";
I don't know if this is the issue, but there probably shouldn't be any spaces in "Lollipop=1;"
The Sparx Team
[email protected]