Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » activating antialiasing for the SCALED_FEEDBACK_LAYER
activating antialiasing for the SCALED_FEEDBACK_LAYER [message #638998] Sun, 14 November 2010 15:14 Go to next message
Carlo Salinari is currently offline Carlo SalinariFriend
Messages: 66
Registered: October 2010
Member
How do I activate antialiasing for the SCALED_FEEDBACK_LAYER?
Re: activating antialiasing for the SCALED_FEEDBACK_LAYER [message #641706 is a reply to message #638998] Fri, 26 November 2010 22:08 Go to previous message
Carlo Salinari is currently offline Carlo SalinariFriend
Messages: 66
Registered: October 2010
Member
This is a multi-part message in MIME format.
--------------070906010302060109010305
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 11/14/2010 4:14 PM, Carlo Salinari wrote:
> How do I activate antialiasing for the SCALED_FEEDBACK_LAYER?

Seems I've found a workaround.

Subclass the RootEditPart (a ScalableFreeformRootEditPart in my case)
and override the layer-creation methods.

Subclass the FeedbackLayer type (actually a FreeformLayer) with an
AntialiasedFeedbackLayer that overrides the paint method forcing a
graphics.setAntialias(SWT.ON).

Then, back in the RootEditPart, create the layers using the new
antialiased type.

I attach the code. If anybody knows of a better solution, please let me
know it.

cheers,
Carlo

--------------070906010302060109010305
Content-Type: text/plain;
name="AntialiasedFeedbackLayer.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="AntialiasedFeedbackLayer.java"

cGFja2FnZSBza2V0Y2hlci5nZWYuYW50aWFsaWFzaW5nOw0KDQpwdWJsaWMg Y2xhc3MgQW50
aWFsaWFzZWRGZWVkYmFja0xheWVyIGV4dGVuZHMgQW50aWFsaWFzZWRGcmVl Zm9ybUxheWVy
IHsNCg0KfQ0K
--------------070906010302060109010305
Content-Type: text/plain;
name="AntialiasedFreeformLayer.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="AntialiasedFreeformLayer.java"

cGFja2FnZSBza2V0Y2hlci5nZWYuYW50aWFsaWFzaW5nOw0KDQppbXBvcnQg b3JnLmVjbGlw
c2UuZHJhdzJkLkZyZWVmb3JtTGF5ZXI7DQppbXBvcnQgb3JnLmVjbGlwc2Uu ZHJhdzJkLkdy
YXBoaWNzOw0KaW1wb3J0IG9yZy5lY2xpcHNlLnN3dC5TV1Q7DQoNCnB1Ymxp YyBjbGFzcyBB
bnRpYWxpYXNlZEZyZWVmb3JtTGF5ZXIgZXh0ZW5kcyBGcmVlZm9ybUxheWVy IHsNCglwdWJs
aWMgQW50aWFsaWFzZWRGcmVlZm9ybUxheWVyKCkgew0KCQlzZXRFbmFibGVk KGZhbHNlKTsN
Cgl9DQoNCgkvLyB0aGlzIGlzIGEgaGFjayB0byBnbG9iYWxseSBhY3RpdmF0 ZSBhbnRpYWxp
YXNpbmcgaW4gdGhpcyBsYXllcg0KCUBPdmVycmlkZQ0KCXB1YmxpYyB2b2lk IHBhaW50KEdy
YXBoaWNzIGdyYXBoaWNzKSB7DQoJCWdyYXBoaWNzLnNldEFudGlhbGlhcyhT V1QuT04pOw0K
CQlncmFwaGljcy5zZXRUZXh0QW50aWFsaWFzKFNXVC5PTik7DQoJCXN1cGVy LnBhaW50KGdy
YXBoaWNzKTsNCgl9DQoNCn0NCg==
--------------070906010302060109010305
Content-Type: text/plain;
name="MyScalableFreeformRootEditPart.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="MyScalableFreeformRootEditPart.java"

cGFja2FnZSBza2V0Y2hlci5nZWYuYW50aWFsaWFzaW5nOw0KDQppbXBvcnQg b3JnLmVjbGlw
c2UuZHJhdzJkLkZyZWVmb3JtTGF5ZXI7DQppbXBvcnQgb3JnLmVjbGlwc2Uu ZHJhdzJkLkxh
eWVyZWRQYW5lOw0KaW1wb3J0IG9yZy5lY2xpcHNlLmRyYXcyZC5TY2FsYWJs ZUZyZWVmb3Jt
TGF5ZXJlZFBhbmU7DQppbXBvcnQgb3JnLmVjbGlwc2UuZ2VmLmVkaXRwYXJ0 cy5HdWlkZUxh
eWVyOw0Ka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KTsNCgkJcmV0dXJuIGxheWVy czsNCgl9DQoN
Cn0NCg==
--------------070906010302060109010305--
Previous Topic:GEF diagrams are non-portable
Next Topic:[Zest] All the nodes are in the upper left corner - please help
Goto Forum:
  


Current Time: Sun Nov 23 02:19:17 GMT 2014

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

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