Skip to main content



      Home
Home » Eclipse Projects » GEF » Create a Diamond Class using Polygon Class in GEF
Create a Diamond Class using Polygon Class in GEF [message #24136] Sat, 05 October 2002 14:04 Go to next message
Eclipse UserFriend
Originally posted by: sy_cheung.yahoo.com

public class ConditionalFigure extends Polygon {


Hi,

I create a Diamond Class by extending the Polygon class in GEF. And in
the constructor of the Diamond class, I add the 4 points of the Diamond
by calling the setPoints() method.

But when I draw this figure, eclipse workbrench will use up 100% of the
CPU. My question is if this is the right approach of creating a Diamond
class? I try create a Rectangle class and rotate it 90 degree, but there
is no rotate method in the Rectangle class.

Thank you for any help.
//////////////////////////////////////////////////////////// //////////

public class Diamond extends Polygon {

public Diamond {

PointList pList = new PointList(4);
pList.addPoint(8, 0);
pList.addPoint(0, 8);
pList.addPoint(8, 8);
pList.addPoint(16, 8);

setPoints(pList);
}
Re: Create a Diamond Class using Polygon Class in GEF [message #24360 is a reply to message #24136] Sun, 06 October 2002 16:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sy_cheung.yahoo.com

Hi,

Is there an example of using Polygon/Polyline in GEF?
I try to create Diamond class by extending the Polygon class, in the
constructor of the Diamond, it add points for the Diamond,
but when it is being drawn, GEF runns in a infinite loop.

Here is what I did:

public Diamond {

PointList pList = new PointList(4);
pList.addPoint(8, 0);
pList.addPoint(0, 8);
pList.addPoint(8, 8);
pList.addPoint(16, 8);

setPoints(pList);
}


Thanks for any help.

Sam wrote:
> public class ConditionalFigure extends Polygon {
>
>
> Hi,
>
> I create a Diamond Class by extending the Polygon class in GEF. And in
> the constructor of the Diamond class, I add the 4 points of the Diamond
> by calling the setPoints() method.
>
> But when I draw this figure, eclipse workbrench will use up 100% of the
> CPU. My question is if this is the right approach of creating a Diamond
> class? I try create a Rectangle class and rotate it 90 degree, but there
> is no rotate method in the Rectangle class.
>
> Thank you for any help.
> //////////////////////////////////////////////////////////// //////////
>
> public class Diamond extends Polygon {
>
> public Diamond {
>
> PointList pList = new PointList(4);
> pList.addPoint(8, 0);
> pList.addPoint(0, 8);
> pList.addPoint(8, 8);
> pList.addPoint(16, 8);
>
> setPoints(pList);
> }
>
Re: Create a Diamond Class using Polygon Class in GEF [message #24400 is a reply to message #24360] Sun, 06 October 2002 17:23 Go to previous messageGo to next message
Eclipse UserFriend
Sam,

Look at PolygonDecoration for some inspiration, that is a fastest way to
create something similar. You may also take a look at attached example
(small image + some code) for a customised versions of Polyline/Polygone.

Rotations are rather primitive and if you need to rotate/move/scale complex
figures you will need to write your own version of Transform (at least I
have such feeling). Using current implementation keep in mind that your
center of rotation always have (0,0) coordinate and define you figures
accordingly.

Regards,

as

"Sam" <sy_cheung@yahoo.com> wrote in message
news:3DA0983B.6030104@yahoo.com...
> Hi,
>
> Is there an example of using Polygon/Polyline in GEF?
> I try to create Diamond class by extending the Polygon class, in the
> constructor of the Diamond, it add points for the Diamond,
> but when it is being drawn, GEF runns in a infinite loop.
>
> Here is what I did:
>
> public Diamond {
>
> PointList pList = new PointList(4);
> pList.addPoint(8, 0);
> pList.addPoint(0, 8);
> pList.addPoint(8, 8);
> pList.addPoint(16, 8);
>
> setPoints(pList);
> }
>
>
> Thanks for any help.
>
> Sam wrote:
> > public class ConditionalFigure extends Polygon {
> >
> >
> > Hi,
> >
> > I create a Diamond Class by extending the Polygon class in GEF. And in
> > the constructor of the Diamond class, I add the 4 points of the Diamond
> > by calling the setPoints() method.
> >
> > But when I draw this figure, eclipse workbrench will use up 100% of the
> > CPU. My question is if this is the right approach of creating a Diamond
> > class? I try create a Rectangle class and rotate it 90 degree, but there
> > is no rotate method in the Rectangle class.
> >
> > Thank you for any help.
> > //////////////////////////////////////////////////////////// //////////
> >
> > public class Diamond extends Polygon {
> >
> > public Diamond {
> >
> > PointList pList = new PointList(4);
> > pList.addPoint(8, 0);
> > pList.addPoint(0, 8);
> > pList.addPoint(8, 8);
> > pList.addPoint(16, 8);
> >
> > setPoints(pList);
> > }
> >
>










Re: Create a Diamond Class using Polygon Class in GEF [message #24485 is a reply to message #24400] Sun, 06 October 2002 17:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sy_cheung2.yahoo.com

Alex,

Thanks for your help.

I notice you have 2 class PolylineEx and PolygonEx.
What are the difference between these 2 classes and the Polyline and Polygon
in org.eclipse.draw2d.

Thanks. again.


"Alex Selkov" <as@empproject.com> wrote in message
news:anq8a8$ptt$1@rogue.oti.com...
> Sam,
>
> Look at PolygonDecoration for some inspiration, that is a fastest way to
> create something similar. You may also take a look at attached example
> (small image + some code) for a customised versions of Polyline/Polygone.
>
> Rotations are rather primitive and if you need to rotate/move/scale
complex
> figures you will need to write your own version of Transform (at least I
> have such feeling). Using current implementation keep in mind that your
> center of rotation always have (0,0) coordinate and define you figures
> accordingly.
>
> Regards,
>
> as
>
> "Sam" <sy_cheung@yahoo.com> wrote in message
> news:3DA0983B.6030104@yahoo.com...
> > Hi,
> >
> > Is there an example of using Polygon/Polyline in GEF?
> > I try to create Diamond class by extending the Polygon class, in the
> > constructor of the Diamond, it add points for the Diamond,
> > but when it is being drawn, GEF runns in a infinite loop.
> >
> > Here is what I did:
> >
> > public Diamond {
> >
> > PointList pList = new PointList(4);
> > pList.addPoint(8, 0);
> > pList.addPoint(0, 8);
> > pList.addPoint(8, 8);
> > pList.addPoint(16, 8);
> >
> > setPoints(pList);
> > }
> >
> >
> > Thanks for any help.
> >
> > Sam wrote:
> > > public class ConditionalFigure extends Polygon {
> > >
> > >
> > > Hi,
> > >
> > > I create a Diamond Class by extending the Polygon class in GEF. And in
> > > the constructor of the Diamond class, I add the 4 points of the
Diamond
> > > by calling the setPoints() method.
> > >
> > > But when I draw this figure, eclipse workbrench will use up 100% of
the
> > > CPU. My question is if this is the right approach of creating a
Diamond
> > > class? I try create a Rectangle class and rotate it 90 degree, but
there
> > > is no rotate method in the Rectangle class.
> > >
> > > Thank you for any help.
> > > //////////////////////////////////////////////////////////// //////////
> > >
> > > public class Diamond extends Polygon {
> > >
> > > public Diamond {
> > >
> > > PointList pList = new PointList(4);
> > > pList.addPoint(8, 0);
> > > pList.addPoint(0, 8);
> > > pList.addPoint(8, 8);
> > > pList.addPoint(16, 8);
> > >
> > > setPoints(pList);
> > > }
> > >
> >
>
>
>
Re: Create a Diamond Class using Polygon Class in GEF [message #24525 is a reply to message #24485] Sun, 06 October 2002 18:49 Go to previous messageGo to next message
Eclipse UserFriend
setBounds, setScale, setRotation

"Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
news:anq9aj$qbn$1@rogue.oti.com...
> Alex,
>
> Thanks for your help.
>
> I notice you have 2 class PolylineEx and PolygonEx.
> What are the difference between these 2 classes and the Polyline and
Polygon
> in org.eclipse.draw2d.
>
> Thanks. again.
>
>
> "Alex Selkov" <as@empproject.com> wrote in message
> news:anq8a8$ptt$1@rogue.oti.com...
> > Sam,
> >
> > Look at PolygonDecoration for some inspiration, that is a fastest way to
> > create something similar. You may also take a look at attached example
> > (small image + some code) for a customised versions of
Polyline/Polygone.
> >
> > Rotations are rather primitive and if you need to rotate/move/scale
> complex
> > figures you will need to write your own version of Transform (at least
I
> > have such feeling). Using current implementation keep in mind that your
> > center of rotation always have (0,0) coordinate and define you figures
> > accordingly.
> >
> > Regards,
> >
> > as
> >
> > "Sam" <sy_cheung@yahoo.com> wrote in message
> > news:3DA0983B.6030104@yahoo.com...
> > > Hi,
> > >
> > > Is there an example of using Polygon/Polyline in GEF?
> > > I try to create Diamond class by extending the Polygon class, in the
> > > constructor of the Diamond, it add points for the Diamond,
> > > but when it is being drawn, GEF runns in a infinite loop.
> > >
> > > Here is what I did:
> > >
> > > public Diamond {
> > >
> > > PointList pList = new PointList(4);
> > > pList.addPoint(8, 0);
> > > pList.addPoint(0, 8);
> > > pList.addPoint(8, 8);
> > > pList.addPoint(16, 8);
> > >
> > > setPoints(pList);
> > > }
> > >
> > >
> > > Thanks for any help.
> > >
> > > Sam wrote:
> > > > public class ConditionalFigure extends Polygon {
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I create a Diamond Class by extending the Polygon class in GEF. And
in
> > > > the constructor of the Diamond class, I add the 4 points of the
> Diamond
> > > > by calling the setPoints() method.
> > > >
> > > > But when I draw this figure, eclipse workbrench will use up 100% of
> the
> > > > CPU. My question is if this is the right approach of creating a
> Diamond
> > > > class? I try create a Rectangle class and rotate it 90 degree, but
> there
> > > > is no rotate method in the Rectangle class.
> > > >
> > > > Thank you for any help.
> > > >
//////////////////////////////////////////////////////////// //////////
> > > >
> > > > public class Diamond extends Polygon {
> > > >
> > > > public Diamond {
> > > >
> > > > PointList pList = new PointList(4);
> > > > pList.addPoint(8, 0);
> > > > pList.addPoint(0, 8);
> > > > pList.addPoint(8, 8);
> > > > pList.addPoint(16, 8);
> > > >
> > > > setPoints(pList);
> > > > }
> > > >
> > >
> >
> >
> >
>
>
Re: Create a Diamond Class using Polygon Class in GEF [message #24725 is a reply to message #24525] Sun, 06 October 2002 21:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

"Alex Selkov" <as@empproject.com> wrote in message
news:anqdbb$rkb$1@rogue.oti.com...
> setBounds, setScale, setRotation

The original draw2d versions are different. The intended usage there is
that you set the POINTS, and the bounds of the figure are a side-effect of
setting the points.

I haven't looked at Alex's implementation yet, But I'm guessing that in his
implementation, you provide a PointList relative to 0,0, and that PointList
is stretched and translated until it fills the bounds of the figure. We'd
like to provide this in draw2d as well. Any suggestions on distinguishing
the two names?

> "Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
> news:anq9aj$qbn$1@rogue.oti.com...
> > Alex,
> >
> > Thanks for your help.
> >
> > I notice you have 2 class PolylineEx and PolygonEx.
> > What are the difference between these 2 classes and the Polyline and
> Polygon
> > in org.eclipse.draw2d.
> >
> > Thanks. again.
> >
> >
> > "Alex Selkov" <as@empproject.com> wrote in message
> > news:anq8a8$ptt$1@rogue.oti.com...
> > > Sam,
> > >
> > > Look at PolygonDecoration for some inspiration, that is a fastest way
to
> > > create something similar. You may also take a look at attached example
> > > (small image + some code) for a customised versions of
> Polyline/Polygone.
> > >
> > > Rotations are rather primitive and if you need to rotate/move/scale
> > complex
> > > figures you will need to write your own version of Transform (at
least
> I
> > > have such feeling). Using current implementation keep in mind that
your
> > > center of rotation always have (0,0) coordinate and define you figures
> > > accordingly.
> > >
> > > Regards,
> > >
> > > as
> > >
> > > "Sam" <sy_cheung@yahoo.com> wrote in message
> > > news:3DA0983B.6030104@yahoo.com...
> > > > Hi,
> > > >
> > > > Is there an example of using Polygon/Polyline in GEF?
> > > > I try to create Diamond class by extending the Polygon class, in the
> > > > constructor of the Diamond, it add points for the Diamond,
> > > > but when it is being drawn, GEF runns in a infinite loop.
> > > >
> > > > Here is what I did:
> > > >
> > > > public Diamond {
> > > >
> > > > PointList pList = new PointList(4);
> > > > pList.addPoint(8, 0);
> > > > pList.addPoint(0, 8);
> > > > pList.addPoint(8, 8);
> > > > pList.addPoint(16, 8);
> > > >
> > > > setPoints(pList);
> > > > }
> > > >
> > > >
> > > > Thanks for any help.
> > > >
> > > > Sam wrote:
> > > > > public class ConditionalFigure extends Polygon {
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > > I create a Diamond Class by extending the Polygon class in GEF.
And
> in
> > > > > the constructor of the Diamond class, I add the 4 points of the
> > Diamond
> > > > > by calling the setPoints() method.
> > > > >
> > > > > But when I draw this figure, eclipse workbrench will use up 100%
of
> > the
> > > > > CPU. My question is if this is the right approach of creating a
> > Diamond
> > > > > class? I try create a Rectangle class and rotate it 90 degree, but
> > there
> > > > > is no rotate method in the Rectangle class.
> > > > >
> > > > > Thank you for any help.
> > > > >
> //////////////////////////////////////////////////////////// //////////
> > > > >
> > > > > public class Diamond extends Polygon {
> > > > >
> > > > > public Diamond {
> > > > >
> > > > > PointList pList = new PointList(4);
> > > > > pList.addPoint(8, 0);
> > > > > pList.addPoint(0, 8);
> > > > > pList.addPoint(8, 8);
> > > > > pList.addPoint(16, 8);
> > > > >
> > > > > setPoints(pList);
> > > > > }
> > > > >
> > > >
> > >
> > >
> > >
> >
> >
>
>
Re: Create a Diamond Class using Polygon Class in GEF [message #24799 is a reply to message #24725] Mon, 07 October 2002 08:29 Go to previous messageGo to next message
Eclipse UserFriend
You are right, I simply use your Decoration as a prototype. My Polyline is
compatible with draw2d version because I use inverse trasfomation in
addPoint/setPoint. All of my code looks ugly and cry for refactoring because
a lot of functionality can be pulled up. For example two identical versions
of Polygone distingushed only by the name of superclass. PolygonDecorations
and PolylineDecorations can be trivial classes. Currently it's difficult to
suggest a good name prior to refactoring... A small number of interfaces may
be also a useful addition (Rotatable, Scalable etc)

And notifications also looks complicated from a user perspective:
firePropertyChange in Polyline to support connections looks unnatural for
generic Polyline figure, fireMoved must be fired when I change
shape/orientation to support attached connections correctly... I think that
your future article about complex figures must touch this issue.


"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:anqlo3$uav$1@rogue.oti.com...
>
> "Alex Selkov" <as@empproject.com> wrote in message
> news:anqdbb$rkb$1@rogue.oti.com...
> > setBounds, setScale, setRotation
>
> The original draw2d versions are different. The intended usage there is
> that you set the POINTS, and the bounds of the figure are a side-effect of
> setting the points.
>
> I haven't looked at Alex's implementation yet, But I'm guessing that in
his
> implementation, you provide a PointList relative to 0,0, and that
PointList
> is stretched and translated until it fills the bounds of the figure. We'd
> like to provide this in draw2d as well. Any suggestions on distinguishing
> the two names?
>
> > "Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
> > news:anq9aj$qbn$1@rogue.oti.com...
> > > Alex,
> > >
> > > Thanks for your help.
> > >
> > > I notice you have 2 class PolylineEx and PolygonEx.
> > > What are the difference between these 2 classes and the Polyline and
> > Polygon
> > > in org.eclipse.draw2d.
> > >
> > > Thanks. again.
> > >
> > >
> > > "Alex Selkov" <as@empproject.com> wrote in message
> > > news:anq8a8$ptt$1@rogue.oti.com...
> > > > Sam,
> > > >
> > > > Look at PolygonDecoration for some inspiration, that is a fastest
way
> to
> > > > create something similar. You may also take a look at attached
example
> > > > (small image + some code) for a customised versions of
> > Polyline/Polygone.
> > > >
> > > > Rotations are rather primitive and if you need to rotate/move/scale
> > > complex
> > > > figures you will need to write your own version of Transform (at
> least
> > I
> > > > have such feeling). Using current implementation keep in mind that
> your
> > > > center of rotation always have (0,0) coordinate and define you
figures
> > > > accordingly.
> > > >
> > > > Regards,
> > > >
> > > > as
> > > >
> > > > "Sam" <sy_cheung@yahoo.com> wrote in message
> > > > news:3DA0983B.6030104@yahoo.com...
> > > > > Hi,
> > > > >
> > > > > Is there an example of using Polygon/Polyline in GEF?
> > > > > I try to create Diamond class by extending the Polygon class, in
the
> > > > > constructor of the Diamond, it add points for the Diamond,
> > > > > but when it is being drawn, GEF runns in a infinite loop.
> > > > >
> > > > > Here is what I did:
> > > > >
> > > > > public Diamond {
> > > > >
> > > > > PointList pList = new PointList(4);
> > > > > pList.addPoint(8, 0);
> > > > > pList.addPoint(0, 8);
> > > > > pList.addPoint(8, 8);
> > > > > pList.addPoint(16, 8);
> > > > >
> > > > > setPoints(pList);
> > > > > }
> > > > >
> > > > >
> > > > > Thanks for any help.
> > > > >
> > > > > Sam wrote:
> > > > > > public class ConditionalFigure extends Polygon {
> > > > > >
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I create a Diamond Class by extending the Polygon class in GEF.
> And
> > in
> > > > > > the constructor of the Diamond class, I add the 4 points of the
> > > Diamond
> > > > > > by calling the setPoints() method.
> > > > > >
> > > > > > But when I draw this figure, eclipse workbrench will use up 100%
> of
> > > the
> > > > > > CPU. My question is if this is the right approach of creating a
> > > Diamond
> > > > > > class? I try create a Rectangle class and rotate it 90 degree,
but
> > > there
> > > > > > is no rotate method in the Rectangle class.
> > > > > >
> > > > > > Thank you for any help.
> > > > > >
> > //////////////////////////////////////////////////////////// //////////
> > > > > >
> > > > > > public class Diamond extends Polygon {
> > > > > >
> > > > > > public Diamond {
> > > > > >
> > > > > > PointList pList = new PointList(4);
> > > > > > pList.addPoint(8, 0);
> > > > > > pList.addPoint(0, 8);
> > > > > > pList.addPoint(8, 8);
> > > > > > pList.addPoint(16, 8);
> > > > > >
> > > > > > setPoints(pList);
> > > > > > }
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: Create a Diamond Class using Polygon Class in GEF [message #25243 is a reply to message #24725] Mon, 07 October 2002 19:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sy_cheung2.yahoo.com

I am using the Polygon in the original draw2d version. And I define the
points of the Diamond in the constructor,
But when the diamond is being painted, i will run into an infinte loop.
Could you please tell me if there is any thing wrong with the following
code, if not, why I will run into an infinite loop when I paint this?

Thanks for your help.

public Diamond extends Polygon {

public Diamond {
PointList pList = new PointList(4);
pList.addPoint(8, 0);
pList.addPoint(0, 8);
pList.addPoint(8, 8);
pList.addPoint(16, 8);

setPoints(pList);
}
....



"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:anqlo3$uav$1@rogue.oti.com...
>
> "Alex Selkov" <as@empproject.com> wrote in message
> news:anqdbb$rkb$1@rogue.oti.com...
> > setBounds, setScale, setRotation
>
> The original draw2d versions are different. The intended usage there is
> that you set the POINTS, and the bounds of the figure are a side-effect of
> setting the points.
>
> I haven't looked at Alex's implementation yet, But I'm guessing that in
his
> implementation, you provide a PointList relative to 0,0, and that
PointList
> is stretched and translated until it fills the bounds of the figure. We'd
> like to provide this in draw2d as well. Any suggestions on distinguishing
> the two names?
>
> > "Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
> > news:anq9aj$qbn$1@rogue.oti.com...
> > > Alex,
> > >
> > > Thanks for your help.
> > >
> > > I notice you have 2 class PolylineEx and PolygonEx.
> > > What are the difference between these 2 classes and the Polyline and
> > Polygon
> > > in org.eclipse.draw2d.
> > >
> > > Thanks. again.
> > >
> > >
> > > "Alex Selkov" <as@empproject.com> wrote in message
> > > news:anq8a8$ptt$1@rogue.oti.com...
> > > > Sam,
> > > >
> > > > Look at PolygonDecoration for some inspiration, that is a fastest
way
> to
> > > > create something similar. You may also take a look at attached
example
> > > > (small image + some code) for a customised versions of
> > Polyline/Polygone.
> > > >
> > > > Rotations are rather primitive and if you need to rotate/move/scale
> > > complex
> > > > figures you will need to write your own version of Transform (at
> least
> > I
> > > > have such feeling). Using current implementation keep in mind that
> your
> > > > center of rotation always have (0,0) coordinate and define you
figures
> > > > accordingly.
> > > >
> > > > Regards,
> > > >
> > > > as
> > > >
> > > > "Sam" <sy_cheung@yahoo.com> wrote in message
> > > > news:3DA0983B.6030104@yahoo.com...
> > > > > Hi,
> > > > >
> > > > > Is there an example of using Polygon/Polyline in GEF?
> > > > > I try to create Diamond class by extending the Polygon class, in
the
> > > > > constructor of the Diamond, it add points for the Diamond,
> > > > > but when it is being drawn, GEF runns in a infinite loop.
> > > > >
> > > > > Here is what I did:
> > > > >
> > > > > public Diamond {
> > > > >
> > > > > PointList pList = new PointList(4);
> > > > > pList.addPoint(8, 0);
> > > > > pList.addPoint(0, 8);
> > > > > pList.addPoint(8, 8);
> > > > > pList.addPoint(16, 8);
> > > > >
> > > > > setPoints(pList);
> > > > > }
> > > > >
> > > > >
> > > > > Thanks for any help.
> > > > >
> > > > > Sam wrote:
> > > > > > public class ConditionalFigure extends Polygon {
> > > > > >
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I create a Diamond Class by extending the Polygon class in GEF.
> And
> > in
> > > > > > the constructor of the Diamond class, I add the 4 points of the
> > > Diamond
> > > > > > by calling the setPoints() method.
> > > > > >
> > > > > > But when I draw this figure, eclipse workbrench will use up 100%
> of
> > > the
> > > > > > CPU. My question is if this is the right approach of creating a
> > > Diamond
> > > > > > class? I try create a Rectangle class and rotate it 90 degree,
but
> > > there
> > > > > > is no rotate method in the Rectangle class.
> > > > > >
> > > > > > Thank you for any help.
> > > > > >
> > //////////////////////////////////////////////////////////// //////////
> > > > > >
> > > > > > public class Diamond extends Polygon {
> > > > > >
> > > > > > public Diamond {
> > > > > >
> > > > > > PointList pList = new PointList(4);
> > > > > > pList.addPoint(8, 0);
> > > > > > pList.addPoint(0, 8);
> > > > > > pList.addPoint(8, 8);
> > > > > > pList.addPoint(16, 8);
> > > > > >
> > > > > > setPoints(pList);
> > > > > > }
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: Create a Diamond Class using Polygon Class in GEF [message #25324 is a reply to message #25243] Mon, 07 October 2002 21:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

You'll have to post a complete testcase and/or stacktrace.

"Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
news:ant52m$b5c$1@rogue.oti.com...
> I am using the Polygon in the original draw2d version. And I define the
> points of the Diamond in the constructor,
> But when the diamond is being painted, i will run into an infinte loop.
> Could you please tell me if there is any thing wrong with the following
> code, if not, why I will run into an infinite loop when I paint this?
>
> Thanks for your help.
>
> public Diamond extends Polygon {
>
> public Diamond {
> PointList pList = new PointList(4);
> pList.addPoint(8, 0);
> pList.addPoint(0, 8);
> pList.addPoint(8, 8);
> pList.addPoint(16, 8);
>
> setPoints(pList);
> }
> ...
>
Re: Create a Diamond Class using Polygon Class in GEF [message #25644 is a reply to message #25324] Tue, 08 October 2002 11:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sy_cheung2.yahoo.com

During the infinite loop, I suspend the main loop, this is the first stack
trace:

Thread [main] (Suspended)
java.util.ArrayList.indexOf(java.lang.Object) line: 216 [local variables
unavailable]
java.util.ArrayList.contains(java.lang.Object) line: 197

org.eclipse.draw2d.DeferredUpdateManager.addInvalidFigure(or g.eclipse.draw2d
..IFigure) line: 59

org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure(or
g.eclipse.draw2d.Figure).revalidate() line: 1011
org.eclipse.draw2d.FreeformViewport(org.eclipse.draw2d.Figur e).revalidate()
line: 1013

org.eclipse.draw2d.FreeformLayeredPane(org.eclipse.draw2d.Fi gure).revalidate
() line: 1013
org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). revalidate()
line: 1013
org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). revalidate()
line: 1013
org.eclipse.draw2d.FreeformLayer$1.figureMoved(org.eclipse.d raw2d.IFigure)
line: 22
org.projectd.test.figures.Diamond(org.eclipse.draw2d.Figure) .fireMoved()
line: 301

org.projectd.test.figures.Diamond(org.eclipse.draw2d.Figure) .setBounds(org.e
clipse.draw2d.geometry.Rectangle) line: 1056

org.eclipse.draw2d.FreeformLayout(org.eclipse.draw2d.XYLayou t).layout(org.ec
lipse.draw2d.IFigure) line: 97
org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). layout() line:
778
org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). validate()
line: 1320
org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). validate()
line: 1322

org.eclipse.draw2d.FreeformLayeredPane(org.eclipse.draw2d.Fi gure).validate()
line: 1322
org.eclipse.draw2d.FreeformLayeredPane.validate() line: 42
org.eclipse.draw2d.FreeformViewport(org.eclipse.draw2d.Figur e).validate()
line: 1322
org.eclipse.draw2d.FreeformViewport(org.eclipse.draw2d.Viewp ort).validate()
line: 325

org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure(or
g.eclipse.draw2d.Figure).validate() line: 1322

org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure.va
lidate() line: 332
org.eclipse.draw2d.DeferredUpdateManager.validateFigures() line: 161
org.eclipse.draw2d.DeferredUpdateManager.performUpdate() line: 90
org.eclipse.draw2d.DeferredUpdateManager$UpdateRequest.run() line: 37
org.eclipse.swt.widgets.RunnableLock.run() line: 31

org.eclipse.ui.internal.UISynchronizer(org.eclipse.swt.widge ts.Synchronizer)
..runAsyncMessages() line: 94
org.eclipse.swt.widgets.Display.runAsyncMessages() line: 1599
org.eclipse.swt.widgets.Display.readAndDispatch() line: 1372
org.eclipse.ui.internal.Workbench.runEventLoop() line: 1272
org.eclipse.ui.internal.Workbench.run(java.lang.Object) line: 1255
org.eclipse.core.internal.boot.InternalBootLoader.run(java.l ang.String,
java.net.URL, java.lang.String, java.lang.String[], java.lang.Runnable)
line: 775
org.eclipse.core.boot.BootLoader.run(java.lang.String, java.net.URL,
java.lang.String, java.lang.String[]) line: 432
EclipseRuntimeLauncher.main(java.lang.String[]) line: 24

and the I resume it, the cpu goes up to 100% again, and here is the second
stack trace:

Thread [main] (Suspended)

org.eclipse.draw2d.FreeformHelper.updateFreeformBounds(org.e clipse.draw2d.ge
ometry.Rectangle) line: 26

org.eclipse.draw2d.FreeformLayer.updateFreeformBounds(org.ec lipse.draw2d.geo
metry.Rectangle) line: 44

org.eclipse.draw2d.FreeformHelper.updateFreeformBounds(org.e clipse.draw2d.ge
ometry.Rectangle) line: 27

org.eclipse.draw2d.FreeformLayer.updateFreeformBounds(org.ec lipse.draw2d.geo
metry.Rectangle) line: 44

org.eclipse.draw2d.FreeformHelper.updateFreeformBounds(org.e clipse.draw2d.ge
ometry.Rectangle) line: 27

org.eclipse.draw2d.FreeformLayeredPane.updateFreeformBounds( org.eclipse.draw
2d.geometry.Rectangle) line: 36
org.eclipse.draw2d.FreeformViewport.readjustScrollBars() line: 31
org.eclipse.draw2d.FreeformViewport(org.eclipse.draw2d.Viewp ort).validate()
line: 326

org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure(or
g.eclipse.draw2d.Figure).validate() line: 1322

org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure.va
lidate() line: 332
org.eclipse.draw2d.DeferredUpdateManager.validateFigures() line: 161
org.eclipse.draw2d.DeferredUpdateManager.performUpdate() line: 90
org.eclipse.draw2d.DeferredUpdateManager$UpdateRequest.run() line: 37
org.eclipse.swt.widgets.RunnableLock.run() line: 31

org.eclipse.ui.internal.UISynchronizer(org.eclipse.swt.widge ts.Synchronizer)
..runAsyncMessages() line: 94
org.eclipse.swt.widgets.Display.runAsyncMessages() line: 1599
org.eclipse.swt.widgets.Display.readAndDispatch() line: 1372
org.eclipse.ui.internal.Workbench.runEventLoop() line: 1272
org.eclipse.ui.internal.Workbench.run(java.lang.Object) line: 1255
org.eclipse.core.internal.boot.InternalBootLoader.run(java.l ang.String,
java.net.URL, java.lang.String, java.lang.String[], java.lang.Runnable)
line: 775
org.eclipse.core.boot.BootLoader.run(java.lang.String, java.net.URL,
java.lang.String, java.lang.String[]) line: 432
EclipseRuntimeLauncher.main(java.lang.String[]) line: 24

"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:anta54$d7h$1@rogue.oti.com...
> You'll have to post a complete testcase and/or stacktrace.
>
> "Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
> news:ant52m$b5c$1@rogue.oti.com...
> > I am using the Polygon in the original draw2d version. And I define the
> > points of the Diamond in the constructor,
> > But when the diamond is being painted, i will run into an infinte loop.
> > Could you please tell me if there is any thing wrong with the following
> > code, if not, why I will run into an infinite loop when I paint this?
> >
> > Thanks for your help.
> >
> > public Diamond extends Polygon {
> >
> > public Diamond {
> > PointList pList = new PointList(4);
> > pList.addPoint(8, 0);
> > pList.addPoint(0, 8);
> > pList.addPoint(8, 8);
> > pList.addPoint(16, 8);
> >
> > setPoints(pList);
> > }
> > ...
> >
>
>
Re: Create a Diamond Class using Polygon Class in GEF [message #25676 is a reply to message #25644] Tue, 08 October 2002 11:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sy_cheung2.yahoo.com

"Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
news:anur3c$9bq$1@rogue.oti.com...
> During the infinite loop, I suspend the main loop, this is the first stack
> trace:
>
> Thread [main] (Suspended)
> java.util.ArrayList.indexOf(java.lang.Object) line: 216 [local variables
> unavailable]
> java.util.ArrayList.contains(java.lang.Object) line: 197
>
>
org.eclipse.draw2d.DeferredUpdateManager.addInvalidFigure(or g.eclipse.draw2d
> .IFigure) line: 59
>
>
org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure(or
> g.eclipse.draw2d.Figure).revalidate() line: 1011
>
org.eclipse.draw2d.FreeformViewport(org.eclipse.draw2d.Figur e).revalidate()
> line: 1013
>
>
org.eclipse.draw2d.FreeformLayeredPane(org.eclipse.draw2d.Fi gure).revalidate
> () line: 1013
> org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). revalidate()
> line: 1013
> org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). revalidate()
> line: 1013
>
org.eclipse.draw2d.FreeformLayer$1.figureMoved(org.eclipse.d raw2d.IFigure)
> line: 22
> org.projectd.test.figures.Diamond(org.eclipse.draw2d.Figure) .fireMoved()
> line: 301
>
>
org.projectd.test.figures.Diamond(org.eclipse.draw2d.Figure) .setBounds(org.e
> clipse.draw2d.geometry.Rectangle) line: 1056
>
>
org.eclipse.draw2d.FreeformLayout(org.eclipse.draw2d.XYLayou t).layout(org.ec
> lipse.draw2d.IFigure) line: 97
> org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). layout()
line:
> 778
> org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). validate()
> line: 1320
> org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). validate()
> line: 1322
>
>
org.eclipse.draw2d.FreeformLayeredPane(org.eclipse.draw2d.Fi gure).validate()
> line: 1322
> org.eclipse.draw2d.FreeformLayeredPane.validate() line: 42
> org.eclipse.draw2d.FreeformViewport(org.eclipse.draw2d.Figur e).validate()
> line: 1322
>
org.eclipse.draw2d.FreeformViewport(org.eclipse.draw2d.Viewp ort).validate()
> line: 325
>
>
org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure(or
> g.eclipse.draw2d.Figure).validate() line: 1322
>
>
org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure.va
> lidate() line: 332
> org.eclipse.draw2d.DeferredUpdateManager.validateFigures() line: 161
> org.eclipse.draw2d.DeferredUpdateManager.performUpdate() line: 90
> org.eclipse.draw2d.DeferredUpdateManager$UpdateRequest.run() line: 37
> org.eclipse.swt.widgets.RunnableLock.run() line: 31
>
>
org.eclipse.ui.internal.UISynchronizer(org.eclipse.swt.widge ts.Synchronizer)
> .runAsyncMessages() line: 94
> org.eclipse.swt.widgets.Display.runAsyncMessages() line: 1599
> org.eclipse.swt.widgets.Display.readAndDispatch() line: 1372
> org.eclipse.ui.internal.Workbench.runEventLoop() line: 1272
> org.eclipse.ui.internal.Workbench.run(java.lang.Object) line: 1255
> org.eclipse.core.internal.boot.InternalBootLoader.run(java.l ang.String,
> java.net.URL, java.lang.String, java.lang.String[], java.lang.Runnable)
> line: 775
> org.eclipse.core.boot.BootLoader.run(java.lang.String, java.net.URL,
> java.lang.String, java.lang.String[]) line: 432
> EclipseRuntimeLauncher.main(java.lang.String[]) line: 24
>
> and the I resume it, the cpu goes up to 100% again, and here is the second
> stack trace:
>
> Thread [main] (Suspended)
>
>
org.eclipse.draw2d.FreeformHelper.updateFreeformBounds(org.e clipse.draw2d.ge
> ometry.Rectangle) line: 26
>
>
org.eclipse.draw2d.FreeformLayer.updateFreeformBounds(org.ec lipse.draw2d.geo
> metry.Rectangle) line: 44
>
>
org.eclipse.draw2d.FreeformHelper.updateFreeformBounds(org.e clipse.draw2d.ge
> ometry.Rectangle) line: 27
>
>
org.eclipse.draw2d.FreeformLayer.updateFreeformBounds(org.ec lipse.draw2d.geo
> metry.Rectangle) line: 44
>
>
org.eclipse.draw2d.FreeformHelper.updateFreeformBounds(org.e clipse.draw2d.ge
> ometry.Rectangle) line: 27
>
>
org.eclipse.draw2d.FreeformLayeredPane.updateFreeformBounds( org.eclipse.draw
> 2d.geometry.Rectangle) line: 36
> org.eclipse.draw2d.FreeformViewport.readjustScrollBars() line: 31
>
org.eclipse.draw2d.FreeformViewport(org.eclipse.draw2d.Viewp ort).validate()
> line: 326
>
>
org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure(or
> g.eclipse.draw2d.Figure).validate() line: 1322
>
>
org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure.va
> lidate() line: 332
> org.eclipse.draw2d.DeferredUpdateManager.validateFigures() line: 161
> org.eclipse.draw2d.DeferredUpdateManager.performUpdate() line: 90
> org.eclipse.draw2d.DeferredUpdateManager$UpdateRequest.run() line: 37
> org.eclipse.swt.widgets.RunnableLock.run() line: 31
>
>
org.eclipse.ui.internal.UISynchronizer(org.eclipse.swt.widge ts.Synchronizer)
> .runAsyncMessages() line: 94
> org.eclipse.swt.widgets.Display.runAsyncMessages() line: 1599
> org.eclipse.swt.widgets.Display.readAndDispatch() line: 1372
> org.eclipse.ui.internal.Workbench.runEventLoop() line: 1272
> org.eclipse.ui.internal.Workbench.run(java.lang.Object) line: 1255
> org.eclipse.core.internal.boot.InternalBootLoader.run(java.l ang.String,
> java.net.URL, java.lang.String, java.lang.String[], java.lang.Runnable)
> line: 775
> org.eclipse.core.boot.BootLoader.run(java.lang.String, java.net.URL,
> java.lang.String, java.lang.String[]) line: 432
> EclipseRuntimeLauncher.main(java.lang.String[]) line: 24
>
> "Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
> news:anta54$d7h$1@rogue.oti.com...
> > You'll have to post a complete testcase and/or stacktrace.
> >
> > "Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
> > news:ant52m$b5c$1@rogue.oti.com...
> > > I am using the Polygon in the original draw2d version. And I define
the
> > > points of the Diamond in the constructor,
> > > But when the diamond is being painted, i will run into an infinte
loop.
> > > Could you please tell me if there is any thing wrong with the
following
> > > code, if not, why I will run into an infinite loop when I paint this?
> > >
> > > Thanks for your help.
> > >
> > > public Diamond extends Polygon {
> > >
> > > public Diamond {
> > > PointList pList = new PointList(4);
> > > pList.addPoint(8, 0);
> > > pList.addPoint(0, 8);
> > > pList.addPoint(8, 8);
> > > pList.addPoint(16, 8);
> > >
> > > setPoints(pList);
> > > }
> > > ...
> > >
> >
> >
>
>
Re: Create a Diamond Class using Polygon Class in GEF [message #25985 is a reply to message #25644] Wed, 09 October 2002 10:12 Go to previous message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

Do you have the Scrollbars set to ALWAYS be visible? FreeformFigures can
cause a cycle in the layout if the scrollbars automatically pop in and out.
this might be causing the problem. This limitation was mention, albeit
poorly, in a previous post on the newsgroup.

"Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
news:anur3c$9bq$1@rogue.oti.com...
> During the infinite loop, I suspend the main loop, this is the first stack
> trace:
>
> Thread [main] (Suspended)
> java.util.ArrayList.indexOf(java.lang.Object) line: 216 [local variables
> unavailable]
> java.util.ArrayList.contains(java.lang.Object) line: 197
>
>
org.eclipse.draw2d.DeferredUpdateManager.addInvalidFigure(or g.eclipse.draw2d
> .IFigure) line: 59
>
>
org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure(or
> g.eclipse.draw2d.Figure).revalidate() line: 1011
>
org.eclipse.draw2d.FreeformViewport(org.eclipse.draw2d.Figur e).revalidate()
> line: 1013
>
>
org.eclipse.draw2d.FreeformLayeredPane(org.eclipse.draw2d.Fi gure).revalidate
> () line: 1013
> org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). revalidate()
> line: 1013
> org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). revalidate()
> line: 1013
>
org.eclipse.draw2d.FreeformLayer$1.figureMoved(org.eclipse.d raw2d.IFigure)
> line: 22
> org.projectd.test.figures.Diamond(org.eclipse.draw2d.Figure) .fireMoved()
> line: 301
>
>
org.projectd.test.figures.Diamond(org.eclipse.draw2d.Figure) .setBounds(org.e
> clipse.draw2d.geometry.Rectangle) line: 1056
>
>
org.eclipse.draw2d.FreeformLayout(org.eclipse.draw2d.XYLayou t).layout(org.ec
> lipse.draw2d.IFigure) line: 97
> org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). layout()
line:
> 778
> org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). validate()
> line: 1320
> org.eclipse.draw2d.FreeformLayer(org.eclipse.draw2d.Figure). validate()
> line: 1322
>
>
org.eclipse.draw2d.FreeformLayeredPane(org.eclipse.draw2d.Fi gure).validate()
> line: 1322
> org.eclipse.draw2d.FreeformLayeredPane.validate() line: 42
> org.eclipse.draw2d.FreeformViewport(org.eclipse.draw2d.Figur e).validate()
> line: 1322
>
org.eclipse.draw2d.FreeformViewport(org.eclipse.draw2d.Viewp ort).validate()
> line: 325
>
>
org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure(or
> g.eclipse.draw2d.Figure).validate() line: 1322
>
>
org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure.va
> lidate() line: 332
> org.eclipse.draw2d.DeferredUpdateManager.validateFigures() line: 161
> org.eclipse.draw2d.DeferredUpdateManager.performUpdate() line: 90
> org.eclipse.draw2d.DeferredUpdateManager$UpdateRequest.run() line: 37
> org.eclipse.swt.widgets.RunnableLock.run() line: 31
>
>
org.eclipse.ui.internal.UISynchronizer(org.eclipse.swt.widge ts.Synchronizer)
> .runAsyncMessages() line: 94
> org.eclipse.swt.widgets.Display.runAsyncMessages() line: 1599
> org.eclipse.swt.widgets.Display.readAndDispatch() line: 1372
> org.eclipse.ui.internal.Workbench.runEventLoop() line: 1272
> org.eclipse.ui.internal.Workbench.run(java.lang.Object) line: 1255
> org.eclipse.core.internal.boot.InternalBootLoader.run(java.l ang.String,
> java.net.URL, java.lang.String, java.lang.String[], java.lang.Runnable)
> line: 775
> org.eclipse.core.boot.BootLoader.run(java.lang.String, java.net.URL,
> java.lang.String, java.lang.String[]) line: 432
> EclipseRuntimeLauncher.main(java.lang.String[]) line: 24
>
> and the I resume it, the cpu goes up to 100% again, and here is the second
> stack trace:
>
> Thread [main] (Suspended)
>
>
org.eclipse.draw2d.FreeformHelper.updateFreeformBounds(org.e clipse.draw2d.ge
> ometry.Rectangle) line: 26
>
>
org.eclipse.draw2d.FreeformLayer.updateFreeformBounds(org.ec lipse.draw2d.geo
> metry.Rectangle) line: 44
>
>
org.eclipse.draw2d.FreeformHelper.updateFreeformBounds(org.e clipse.draw2d.ge
> ometry.Rectangle) line: 27
>
>
org.eclipse.draw2d.FreeformLayer.updateFreeformBounds(org.ec lipse.draw2d.geo
> metry.Rectangle) line: 44
>
>
org.eclipse.draw2d.FreeformHelper.updateFreeformBounds(org.e clipse.draw2d.ge
> ometry.Rectangle) line: 27
>
>
org.eclipse.draw2d.FreeformLayeredPane.updateFreeformBounds( org.eclipse.draw
> 2d.geometry.Rectangle) line: 36
> org.eclipse.draw2d.FreeformViewport.readjustScrollBars() line: 31
>
org.eclipse.draw2d.FreeformViewport(org.eclipse.draw2d.Viewp ort).validate()
> line: 326
>
>
org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure(or
> g.eclipse.draw2d.Figure).validate() line: 1322
>
>
org.eclipse.draw2d.FigureCanvas$InternalLightweightSystem$Pr oxyRootFigure.va
> lidate() line: 332
> org.eclipse.draw2d.DeferredUpdateManager.validateFigures() line: 161
> org.eclipse.draw2d.DeferredUpdateManager.performUpdate() line: 90
> org.eclipse.draw2d.DeferredUpdateManager$UpdateRequest.run() line: 37
> org.eclipse.swt.widgets.RunnableLock.run() line: 31
>
>
org.eclipse.ui.internal.UISynchronizer(org.eclipse.swt.widge ts.Synchronizer)
> .runAsyncMessages() line: 94
> org.eclipse.swt.widgets.Display.runAsyncMessages() line: 1599
> org.eclipse.swt.widgets.Display.readAndDispatch() line: 1372
> org.eclipse.ui.internal.Workbench.runEventLoop() line: 1272
> org.eclipse.ui.internal.Workbench.run(java.lang.Object) line: 1255
> org.eclipse.core.internal.boot.InternalBootLoader.run(java.l ang.String,
> java.net.URL, java.lang.String, java.lang.String[], java.lang.Runnable)
> line: 775
> org.eclipse.core.boot.BootLoader.run(java.lang.String, java.net.URL,
> java.lang.String, java.lang.String[]) line: 432
> EclipseRuntimeLauncher.main(java.lang.String[]) line: 24
>
> "Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
> news:anta54$d7h$1@rogue.oti.com...
> > You'll have to post a complete testcase and/or stacktrace.
> >
> > "Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
> > news:ant52m$b5c$1@rogue.oti.com...
> > > I am using the Polygon in the original draw2d version. And I define
the
> > > points of the Diamond in the constructor,
> > > But when the diamond is being painted, i will run into an infinte
loop.
> > > Could you please tell me if there is any thing wrong with the
following
> > > code, if not, why I will run into an infinite loop when I paint this?
> > >
> > > Thanks for your help.
> > >
> > > public Diamond extends Polygon {
> > >
> > > public Diamond {
> > > PointList pList = new PointList(4);
> > > pList.addPoint(8, 0);
> > > pList.addPoint(0, 8);
> > > pList.addPoint(8, 8);
> > > pList.addPoint(16, 8);
> > >
> > > setPoints(pList);
> > > }
> > > ...
> > >
> >
> >
>
>
Previous Topic:Shouldn't getDragTracker() return always the same instance of a DragTracker?
Next Topic:draw2d: findMouseEventTarget
Goto Forum:
  


Current Time: Sun May 11 10:50:58 EDT 2025

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

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

Back to the top