Skip to main content



      Home
Home » Modeling » Papyrus » Change Message font to bold (using EdgeImpl)
Change Message font to bold (using EdgeImpl) [message #1466836] Sun, 09 November 2014 10:08 Go to next message
Eclipse UserFriend
Hi everyone,

I have access to the CSSEdgeImpl of a Message (Sequence Diagram), but I cannot change the Edge color (like Connector or Shape, which I can).

Because of this Edge color "problem", I want to get the "name" of the message and put it in bold.

How can I access the "bold" attribute and change it?

index.php/fa/19816/0/


And this is the code showing how I access the CSSEdge/Connector/ShapeImpl:
IEditorPart editorPart = window.getActivePage().getActiveEditor();
		
		if (editorPart instanceof PapyrusMultiDiagramEditor) {
			PapyrusMultiDiagramEditor papyrusEditor = (PapyrusMultiDiagramEditor) editorPart;
			
			// Get the services registry from the editor
			ServicesRegistry papyrusEditorRegistry = (ServicesRegistry) papyrusEditor.getAdapter(ServicesRegistry.class);
			
			// variable with the element found in Papyrus' Editor
			EObject elementFound = UMLElement.findUmlElementInPapyrus(papyrusEditorRegistry, umlElementID);
			
			try {
				// Get access to the editor
				IMultiDiagramEditor editor = papyrusEditor;
				ServicesRegistry editorRegistry = editor.getServicesRegistry();
				
				// Show the UML element in editor
				OpenElementService openElement = editorRegistry.getService(OpenElementService.class);
				openElement.openSemanticElement(elementFound);
				
			} catch (ServiceException | PartInitException e) {
				e.printStackTrace();
			}
			
                       // code to change color...
		}
Re: Change Message font to bold (using EdgeImpl) [message #1470616 is a reply to message #1466836] Wed, 12 November 2014 08:33 Go to previous messageGo to next message
Eclipse UserFriend
Hi Vinicius,

We should really use "Connectors" everywhere, instead of "Edges". That's probably something to fix in a consistent way for the next version of Papyrus.

Edges can be customized by adding a new child style (e.g. myEdge.getStyles().add(NotationFactory.eINSTANCE.createLineStyle()), but I'm not sure the diagram will properly use them (They may). If they don't, this also needs to be fixed.

We're currently (for Papyrus 1.1) in the process of unifying diagram implementations. One of the goals is to allow a proper and consistent customizability of all diagram elements, so this kind of thing is definitely in the scope

The LineStyle can be used to set the LineColor and LineWidth, whereas the FontStyle can be used for Font Color, Bold, and some other properties.

Regards,
Camille
Re: Change Message font to bold (using EdgeImpl) [message #1470942 is a reply to message #1470616] Wed, 12 November 2014 14:06 Go to previous message
Eclipse UserFriend
Hi Camille,

thanks for reply me.
Previous Topic:OCL Inheritance
Next Topic:[Reopened] Import package from user model fails
Goto Forum:
  


Current Time: Tue Jul 08 09:44:25 EDT 2025

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

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

Back to the top