Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Filled attribute always true?
Filled attribute always true? [message #1461272] Tue, 04 November 2014 11:43 Go to next message
John Cole is currently offline John ColeFriend
Messages: 66
Registered: June 2013
Member
Hello!

I encountered a problem regarding the filled attribute of a GraphicsAlgorithm.

For test purposes I tried to work with an unfilled rectangle. In the object tree of the Eclipse debugger the attribute filled is set to false. But when I try to readout the attribute using

boolean filled = ga.isSetFilled();


where ga is the GraphicsAlgorithm, filled is always set to true.

Is it a bug or am I just doing something wrong?
Re: Filled attribute always true? [message #1461391 is a reply to message #1461272] Tue, 04 November 2014 14:08 Go to previous messageGo to next message
John Cole is currently offline John ColeFriend
Messages: 66
Registered: June 2013
Member
I have to correct myself. It was necessary to cast the GraphicsAlgorithm to a special one, before using.

Rectangle r = (Rectangle) ga;
boolean isFilled = r.getFilled();


So this works now.

But I have another question, similar to this. What should I do, if I want to detect whether a gradient is set for a specific GraphicsAlgorithm, e.g. a Rectangle. So I am missing something like...

Rectangle r = (Rectangle) ga;
boolean isGradient = r.getIsGradient();


... so that I could check whether a gradient is set and if so, I would work with the fore- and background to set the gradient for the new element.

[Updated on: Tue, 04 November 2014 14:16]

Report message to a moderator

Re: Filled attribute always true? [message #1463384 is a reply to message #1461391] Thu, 06 November 2014 14:08 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
John,

a gradient is defined using a so called RenderingStyle, so you need to check
the attribute renderingStyle. Have you seen this page in the docu that
describes how to define gradients? It might help to understand what needs to
be set.
http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.graphiti.doc%2Fresources%2Fdocu%2Fgfw%2Fcolor-schemas.htm&cp=27_1_8

Michael
Previous Topic:How can I combine nested feature calls in one command
Next Topic:DefaultMarkerBehavior woes
Goto Forum:
  


Current Time: Tue Mar 19 06:54:02 GMT 2024

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

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

Back to the top