Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Custom line style plays havoc with GuideLineFigure painting
Custom line style plays havoc with GuideLineFigure painting [message #194078] Tue, 30 August 2005 15:58 Go to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

I added a Border with a custom line style to a Figure. The result was that
painting of guide lines got completely messed up.
It's easy to reproduce even with the Logic example:
a) Modify LEDFigure (or any other Figure) constructor and add the following
code:
setBorder(new LineBorder() {
public void paint(IFigure figure, Graphics graphics, Insets insets)
{
//Save state
graphics.pushState();
int lineStyle = graphics.getLineStyle();
graphics.setLineStyle(SWT.LINE_CUSTOM);
graphics.setLineDash(new int[]{16,8});
super.paint(figure,graphics,insets);
graphics.setLineDash(null);
graphics.setLineStyle(lineStyle);

//Restore the state
graphics.popState();
}
});
b) Run the example, and open an existing or create a new Logic diagram.
c) Turn on the ruler display. Create a few guides.
d) Add the LED figure to the diagram.
e) Drag it around, crossing the guide lines.
f) See the guide lines appearing and disappearing randomly.
g) When drag is completed, all guide lines disappear which were touched or
crossed during the drag.

Note that the custom paint method restored the graphics state when it
completed.

Randy/Pratik: Any idea what's going on? Should I just go ahead and file a
report in Bugzilla?
---
Sunil
Re: Custom line style plays havoc with GuideLineFigure painting [message #194111 is a reply to message #194078] Tue, 30 August 2005 19:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

A bugzilla is already opened for this. It is probably an SWT bug.

"Sunil Kamath" <sunil_kamath@nohotspammail.com> wrote in message
news:df1vo6$81t$1@news.eclipse.org...
>I added a Border with a custom line style to a Figure. The result was that
>painting of guide lines got completely messed up.
> It's easy to reproduce even with the Logic example:
> a) Modify LEDFigure (or any other Figure) constructor and add the
> following code:
> setBorder(new LineBorder() {
> public void paint(IFigure figure, Graphics graphics, Insets insets)
> {
> //Save state
> graphics.pushState();
> int lineStyle = graphics.getLineStyle();
> graphics.setLineStyle(SWT.LINE_CUSTOM);
> graphics.setLineDash(new int[]{16,8});
> super.paint(figure,graphics,insets);
> graphics.setLineDash(null);
> graphics.setLineStyle(lineStyle);
>
> //Restore the state
> graphics.popState();
> }
> });
> b) Run the example, and open an existing or create a new Logic diagram.
> c) Turn on the ruler display. Create a few guides.
> d) Add the LED figure to the diagram.
> e) Drag it around, crossing the guide lines.
> f) See the guide lines appearing and disappearing randomly.
> g) When drag is completed, all guide lines disappear which were touched or
> crossed during the drag.
>
> Note that the custom paint method restored the graphics state when it
> completed.
>
> Randy/Pratik: Any idea what's going on? Should I just go ahead and file a
> report in Bugzilla?
> ---
> Sunil
>
Re: Custom line style plays havoc with GuideLineFigure painting [message #194138 is a reply to message #194111] Tue, 30 August 2005 20:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Randy Hudson" <none@us.ibm.com> wrote in message
news:df2dl3$qbg$1@news.eclipse.org...
>A bugzilla is already opened for this. It is probably an SWT bug.
>

Thanks, I found it:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=105618

OK, I will vote for it, if that helps.
---
Sunil

> "Sunil Kamath" <sunil_kamath@nohotspammail.com> wrote in message
> news:df1vo6$81t$1@news.eclipse.org...
>>I added a Border with a custom line style to a Figure. The result was that
>>painting of guide lines got completely messed up.
>> It's easy to reproduce even with the Logic example:
>> a) Modify LEDFigure (or any other Figure) constructor and add the
>> following code:
>> setBorder(new LineBorder() {
>> public void paint(IFigure figure, Graphics graphics, Insets
>> insets)
>> {
>> //Save state
>> graphics.pushState();
>> int lineStyle = graphics.getLineStyle();
>> graphics.setLineStyle(SWT.LINE_CUSTOM);
>> graphics.setLineDash(new int[]{16,8});
>> super.paint(figure,graphics,insets);
>> graphics.setLineDash(null);
>> graphics.setLineStyle(lineStyle);
>>
>> //Restore the state
>> graphics.popState();
>> }
>> });
>> b) Run the example, and open an existing or create a new Logic diagram.
>> c) Turn on the ruler display. Create a few guides.
>> d) Add the LED figure to the diagram.
>> e) Drag it around, crossing the guide lines.
>> f) See the guide lines appearing and disappearing randomly.
>> g) When drag is completed, all guide lines disappear which were touched
>> or crossed during the drag.
>>
>> Note that the custom paint method restored the graphics state when it
>> completed.
>>
>> Randy/Pratik: Any idea what's going on? Should I just go ahead and file a
>> report in Bugzilla?
>> ---
>> Sunil
>>
>
>
Re: Custom line style plays havoc with GuideLineFigure painting [message #215689 is a reply to message #194138] Mon, 08 May 2006 20:58 Go to previous message
Youval Bronicki is currently offline Youval BronickiFriend
Messages: 14
Registered: July 2009
Junior Member
Hi,

Is anybody aware of progress with this problem, or at least a workaround?

Thanks,

Youval

Sunil Kamath wrote:
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:df2dl3$qbg$1@news.eclipse.org...
>
>>A bugzilla is already opened for this. It is probably an SWT bug.
>>
>
>
> Thanks, I found it:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=105618
>
> OK, I will vote for it, if that helps.
> ---
> Sunil
>
>
>>"Sunil Kamath" <sunil_kamath@nohotspammail.com> wrote in message
>>news:df1vo6$81t$1@news.eclipse.org...
>>
>>>I added a Border with a custom line style to a Figure. The result was that
>>>painting of guide lines got completely messed up.
>>>It's easy to reproduce even with the Logic example:
>>>a) Modify LEDFigure (or any other Figure) constructor and add the
>>>following code:
>>>setBorder(new LineBorder() {
>>> public void paint(IFigure figure, Graphics graphics, Insets
>>>insets)
>>> {
>>> //Save state
>>> graphics.pushState();
>>> int lineStyle = graphics.getLineStyle();
>>> graphics.setLineStyle(SWT.LINE_CUSTOM);
>>> graphics.setLineDash(new int[]{16,8});
>>> super.paint(figure,graphics,insets);
>>> graphics.setLineDash(null);
>>> graphics.setLineStyle(lineStyle);
>>>
>>> //Restore the state
>>> graphics.popState();
>>> }
>>> });
>>>b) Run the example, and open an existing or create a new Logic diagram.
>>>c) Turn on the ruler display. Create a few guides.
>>>d) Add the LED figure to the diagram.
>>>e) Drag it around, crossing the guide lines.
>>>f) See the guide lines appearing and disappearing randomly.
>>>g) When drag is completed, all guide lines disappear which were touched
>>>or crossed during the drag.
>>>
>>>Note that the custom paint method restored the graphics state when it
>>>completed.
>>>
>>>Randy/Pratik: Any idea what's going on? Should I just go ahead and file a
>>>report in Bugzilla?
>>>---
>>>Sunil
>>>
>>
>>
>
>
Previous Topic:BlockFlow width
Next Topic:JGraph Porting with eclipse
Goto Forum:
  


Current Time: Thu Apr 25 14:22:25 GMT 2024

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

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

Back to the top