Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Disable Image Decorators(Disable Image Decorators when collapsing)
Disable Image Decorators [message #1228548] Tue, 07 January 2014 13:27 Go to next message
Victor Lopez is currently offline Victor LopezFriend
Messages: 21
Registered: August 2013
Junior Member
Hello everybody,

I have implemented my collapse function. When I collapse a rectangle, everything inside it has do dissapear (I change the height of the rectangle and everything inside the rectangle dissapears, perfect). The problem is that the decorators of the connections (the connections belong to the diagram not to the rectangle) remains visible.

Here it is what I have:

if (pCollapse.getValue().equals("false")) {
				cs.getGraphicsAlgorithm().setHeight(40);
				for(Shape s : cs.getChildren()){
					if(s.getLink()!=null) {
						for(Object ob : getFeatureProvider().getAllBusinessObjectsForPictogramElement(s.getLink().getPictogramElement())){
							if(ob instanceof transML.AnalysisLang.Object){
								for(Object f : ((transML.AnalysisLang.Object) ob).getFeatures()){
									if(f instanceof Reference){
										for(PictogramElement pe : getFeatureProvider().getAllPictogramElementsForBusinessObject(f)){
											pe.setVisible(false);
											if(pe instanceof FreeFormConnection){
												FreeFormConnection ffc = ((FreeFormConnection)pe);
												for(ConnectionDecorator cd : ffc.getConnectionDecorators()){
													cd.setVisible(false);
												}
											}
											
										}
									}
								}
							}
							
						}
						
					}
				}
				pCollapse.setValue("true");
			}
			
			else if (pCollapse.getValue().equals("true")) {
				for (Property p2 : cs.getProperties()) {
					if (p2.getKey().equals("PATTERN_HEIGHT")) {
						cs.getGraphicsAlgorithm().setHeight(
								Integer.parseInt(p2.getValue())+AddPatternFeature.TEXT_SPACE);
						
						for(Shape s : cs.getChildren()){
							if(s.getLink()!=null) {
								for(Object ob : getFeatureProvider().getAllBusinessObjectsForPictogramElement(s.getLink().getPictogramElement())){
									if(ob instanceof transML.AnalysisLang.Object){
										for(Object f : ((transML.AnalysisLang.Object) ob).getFeatures()){
											if(f instanceof Reference){
												for(PictogramElement pe : getFeatureProvider().getAllPictogramElementsForBusinessObject(f)){
													pe.setVisible(true);
													if(pe instanceof FreeFormConnection){
														FreeFormConnection ffc = ((FreeFormConnection)pe);
														for(ConnectionDecorator cd : ffc.getConnectionDecorators()){
															cd.setVisible(true);
														}
													}
												}
											}
										}
									}
									
								}
								
							}
						}
						pCollapse.setValue("false");
					}
				}
			}


I tried to setActive(false) and then setActive(true) to the connection decorators. It worked but when I expand the collapse rectangle, the connection line and the connection arrow are separated. I can click and move the arrow like if it does not belong to the line and 2 decorators appears (1 on the line and the other on the arrow. The same one).


Please any ideas?

Best regards.

Victor.
Re: Disable Image Decorators [message #1228574 is a reply to message #1228548] Tue, 07 January 2014 14:20 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1921
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hi Victor,

from a first glance into the coding it seems that for connection decorators
the check for isVisible is missing on refresh. Would you please file a
bugzilla to track the issue?

Michael
Re: Disable Image Decorators [message #1229376 is a reply to message #1228574] Thu, 09 January 2014 10:10 Go to previous messageGo to next message
Victor Lopez is currently offline Victor LopezFriend
Messages: 21
Registered: August 2013
Junior Member
Thanks for the answer. I think I explained wrong myself. When I say connection decorators I mean the decorators implemented in the ToolBehaviourProvider (the warning and error icons that are asociated to the connection in this case).

If it is clear now I will file it.

Wink
Re: Disable Image Decorators [message #1231000 is a reply to message #1229376] Mon, 13 January 2014 15:21 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1921
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Victor,

sorry, connections and decorators put me in the wrong direction...

You will have to find out by yourself, if the representation is collapsed or
not when providing the decorators in your tool behavior provider. Maybe you
should set a custom property "collapsed" to distinguish more easily.
Graphiti itself only triggers the refresh of the decorators but cannot tell
if they should be hidden in that special case.

Michael
Previous Topic:ScrollingGraphicalViewer: Auto right scroll when width increases
Next Topic:Using Graphiti to draw projects of a rich domain model
Goto Forum:
  


Current Time: Tue Aug 04 20:55:41 GMT 2020

Powered by FUDForum. Page generated in 0.01892 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top