line on figure and more [message #47759] |
Thu, 05 December 2002 09:30  |
Eclipse User |
|
|
|
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 #48399 is a reply to message #48158] |
Fri, 06 December 2002 10:59  |
Eclipse User |
|
|
|
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
>
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03196 seconds