| Summary: | Text Alignment don't respect style | ||
|---|---|---|---|
| Product: | [Modeling] Graphiti | Reporter: | Filippo Rossoni <filippo.rossoni> |
| Component: | Core | Assignee: | Project Inbox <graphiti-inbox> |
| Status: | VERIFIED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | christian.brand, matthias.gorning, michael.wenz |
| Version: | 0.8.0 | Flags: | matthias.gorning:
indigo+
|
| Target Milestone: | 0.8.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=352542 | ||
| Whiteboard: | |||
|
Description
Filippo Rossoni
This is as expected: the method getHorizontalAlignment is just a dumb metamodel method that simply returns the value of that attribute and knows nothing about styles. You should use the method getHorizontalAlignment in IGaService if you are interested in styles as well; this method is also used by the framework when the value is retrieved from an object in the diagram. (In reply to comment #1) > This is as expected: the method getHorizontalAlignment is just a dumb metamodel > method that simply returns the value of that attribute and knows nothing about > styles. You should use the method getHorizontalAlignment in IGaService if you > are interested in styles as well; this method is also used by the framework > when the value is retrieved from an object in the diagram. the real bug is the graphical presentation of Text is not centered if I don't call directly setHorizontalAlignment on Text element (excuse for my engrish) Sorry for the misunderstanding. Now I see the issue, there's a default value for that attribute, so the value from the style is never drawn. Graphiti has some default values for GA attributes. This makes sense for start-up phases when building graphical tools. If you want to work with styles, you have to reset these attributes in the GAs because they have higher priority. In your case you can do the reset as follows: <textGa>.setHorizontalAlignment(Orientation.UNSPECIFIED); Please let us know if this solution is not really valid. (In reply to comment #4) > Graphiti has some default values for GA attributes. This makes sense for > start-up phases when building graphical tools. If you want to work with styles, > you have to reset these attributes in the GAs because they have higher > priority. > In your case you can do the reset as follows: > <textGa>.setHorizontalAlignment(Orientation.UNSPECIFIED); > Please let us know if this solution is not really valid. I want to use style for every GA. Is possible to use default style in place of default value for property. with current implementation i'm forced to reset the property of every created GA or don't use GaService. (In reply to comment #5) > (In reply to comment #4) > > Graphiti has some default values for GA attributes. This makes sense for > > start-up phases when building graphical tools. If you want to work with styles, > > you have to reset these attributes in the GAs because they have higher > > priority. > > In your case you can do the reset as follows: > > <textGa>.setHorizontalAlignment(Orientation.UNSPECIFIED); > > Please let us know if this solution is not really valid. > > I want to use style for every GA. > Is possible to use default style in place of default value for property. > > with current implementation i'm forced to reset the property of every created > GA > or don't use GaService. the problem is also for font,lineWidth,lineStyle,transparency Having a default style is currently not supported by Graphiti. If you would like to see that, please open an enhancement bugzilla requesting that. Sorry for the late reply! Michael One further comment from my side: I've opened a Bugzilla for checking the feasibility of the styles concept as it is implemented today. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=352542 |