Skip to main content



      Home
Home » Eclipse Projects » GEF » line on figure and more
line on figure and more [message #47759] Thu, 05 December 2002 09:30 Go to next message
Eclipse UserFriend
Hello,

I want to draw simple lines (not even poly lines) on a figure and I
don't want to care about repainting them when dragging a figure to
another location. But simply line.setStart(), 2xline.addPoint() and
rectangle.add(line) does not work. How to achieve this?

Then there is ScrollPane with setVerticalScrollbar(). I created a
ScrollBar, called setSize on it and called
setVerticalScrollBar(ScrollBar) on ScrollPane. When I see the ScrollBar
the size change does not seem to have any effect.

Thank you,

Chris
Re: line on figure and more [message #47948 is a reply to message #47759] Thu, 05 December 2002 15:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

"Chris" <wibni@web.de> wrote in message news:3DEF62F1.3070808@web.de...
> Hello,
>
> I want to draw simple lines (not even poly lines) on a figure and I
> don't want to care about repainting them when dragging a figure to
> another location. But simply line.setStart(), 2xline.addPoint() and
> rectangle.add(line) does not work. How to achieve this?

Use Graphics.drawLine(int, int, int, int); instead of a Figure just to draw
a line.

> Then there is ScrollPane with setVerticalScrollbar(). I created a
> ScrollBar, called setSize on it and called
> setVerticalScrollBar(ScrollBar) on ScrollPane. When I see the ScrollBar
> the size change does not seem to have any effect.
What did you want setSize() to acheive?
Re: line on figure and more [message #48158 is a reply to message #47948] Fri, 06 December 2002 04:18 Go to previous messageGo to next message
Eclipse UserFriend
Randy Hudson wrote:
> "Chris" <wibni@web.de> wrote in message news:3DEF62F1.3070808@web.de...
>
>>Hello,
>>
>>I want to draw simple lines (not even poly lines) on a figure and I
>>don't want to care about repainting them when dragging a figure to
>>another location. But simply line.setStart(), 2xline.addPoint() and
>>rectangle.add(line) does not work. How to achieve this?
>
>
> Use Graphics.drawLine(int, int, int, int); instead of a Figure just to draw
> a line.
This line will not be a part of my figure and when I move my figure the
line won't follow.
Do I have to model my line as a part of the model hierarchy and create
an EditPart for it?

>
>
>>Then there is ScrollPane with setVerticalScrollbar(). I created a
>>ScrollBar, called setSize on it and called
>>setVerticalScrollBar(ScrollBar) on ScrollPane. When I see the ScrollBar
>>the size change does not seem to have any effect.
>
> What did you want setSize() to acheive?
Well, I simply want a thinner scrollbar :)

Thanks,
Chris

>
>
Re: line on figure and more [message #48399 is a reply to message #48158] Fri, 06 December 2002 10:59 Go to previous message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

"Chris" <wibni@web.de> wrote in message news:3DF06B64.4000907@web.de...
> Randy Hudson wrote:
> > "Chris" <wibni@web.de> wrote in message news:3DEF62F1.3070808@web.de...
> >
> >>Hello,
> >>
> >>I want to draw simple lines (not even poly lines) on a figure and I
> >>don't want to care about repainting them when dragging a figure to
> >>another location. But simply line.setStart(), 2xline.addPoint() and
> >>rectangle.add(line) does not work. How to achieve this?
> >
> >
> > Use Graphics.drawLine(int, int, int, int); instead of a Figure just to
draw
> > a line.
> This line will not be a part of my figure and when I move my figure the
> line won't follow.
> Do I have to model my line as a part of the model hierarchy and create
> an EditPart for it?

The line will move if you paint it relative to the figures bounds:

class DiagonalLine extends Figure {

protected void paintFigure(Graphics g) {
g.drawLine(getBounds().getTopLeft(), getBounds().getBottomRight();
}

}

>
> >
> >
> >>Then there is ScrollPane with setVerticalScrollbar(). I created a
> >>ScrollBar, called setSize on it and called
> >>setVerticalScrollBar(ScrollBar) on ScrollPane. When I see the ScrollBar
> >>the size change does not seem to have any effect.
> >
> > What did you want setSize() to acheive?
> Well, I simply want a thinner scrollbar :)
>
> Thanks,
> Chris
>
> >
> >
>
>
Previous Topic:Naive question: can I have both a GEF editor and a property editor on the same model?
Next Topic:attaching label to connection and anchors
Goto Forum:
  


Current Time: Tue Jul 22 03:28:59 EDT 2025

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

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

Back to the top