|
Re: ruler marks < 0 [message #138059 is a reply to message #138025] |
Mon, 14 June 2004 20:17 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Place something in negative coordinates in the logic example to see this
behavior.
"Steven Melzer" <smelzer@paymentech.com> wrote in message
news:cakqsa$d4$1@eclipse.org...
> can you create a ruler that starts with a mark < 0.
>
> i believe the answer is no. i am looking in the RulerFigure's paint
> method and the marks are based on the clipped rectangle. a rectangle
> cannot have a negative value, so i assume the marks cannot either. i am
> looking at:
>
> int startMark = (int)(clippedBounds.y / (dotsPerUnit * unitsPerMajorMark))
> * divsPerMajorMark;
>
> specifically.
>
> i would like to add an 'offset' to the line:
>
> String num = "" + (div / divsPerMajorMark) * unitsPerMajorMark;
>
> that would print numbers less than 0. right now i'd imagine that i have
> to subclass RulerFigure and just copy and paste the paint method and make
> the small change.
>
> i have 2 questions:
> 1) is this correct?
> 2) i am not sure how to inject my RulerFigure. i assume i need to
> ultimately subclass the RulerComposite to tell it to use my RulerEditPart
> and RulerFigure, but i cannot tell where RulerComposite gets created.
>
> thanks,
> steve
>
|
|
|
Re: ruler marks < 0 [message #138129 is a reply to message #138025] |
Tue, 15 June 2004 06:57 |
Eclipse User |
|
|
|
Originally posted by: eostroukhov.hotmail.com
I had to do a lot of tweaking to the rulers - adding offset was one of them.
Right now rulers are limited in the way they can be customized but I do hope
that in the post-GEF3.0 they will be reworked. I filed the bug
https://bugs.eclipse.org - you can try to borrow some code there.
Eugene
"Steven Melzer" <smelzer@paymentech.com> wrote in message
news:cakqsa$d4$1@eclipse.org...
> can you create a ruler that starts with a mark < 0.
>
> i believe the answer is no. i am looking in the RulerFigure's paint
> method and the marks are based on the clipped rectangle. a rectangle
> cannot have a negative value, so i assume the marks cannot either. i am
> looking at:
>
> int startMark = (int)(clippedBounds.y / (dotsPerUnit * unitsPerMajorMark))
> * divsPerMajorMark;
>
> specifically.
>
> i would like to add an 'offset' to the line:
>
> String num = "" + (div / divsPerMajorMark) * unitsPerMajorMark;
>
> that would print numbers less than 0. right now i'd imagine that i have
> to subclass RulerFigure and just copy and paste the paint method and make
> the small change.
>
> i have 2 questions:
> 1) is this correct?
> 2) i am not sure how to inject my RulerFigure. i assume i need to
> ultimately subclass the RulerComposite to tell it to use my RulerEditPart
> and RulerFigure, but i cannot tell where RulerComposite gets created.
>
> thanks,
> steve
>
|
|
|
Powered by
FUDForum. Page generated in 0.02615 seconds