Extending the Rulers [message #114940] |
Fri, 30 January 2004 11:19  |
Eclipse User |
|
|
|
Originally posted by: brian.fernandes.codito.com
I thought this might be better off in it's own thread.
I went through the RulerClasses, so I know a little more about them now.
I will need a ruler with
1) My own units.
2) Display values in Hex instead of Decimal
3) Offset the starting value - instead of a ruler starting at 0, I want it
to start at a value based on my model (because I'm clipping diagrams)
4) Since the ruler text can be quite large for large diagrams, I'd like the
text markers spaced wider apart, with more line markers. (I think this is
currently taken care of ?)
I had a look at RulerFigure and I probably need to chage stuff in
RulerFigure#paintFigure - lots of complex stuff happening there :)
Now I guess I have to extend RulerFigure to do what I want it to do.. but if
I want my RulerFigure to be used... then
I have to extend RulerEditPart, RulerEditPartFactory, and RulerComposite. Am
I right here ? or is there a simpler way to do this ?
once I do all this.. I suppose my issues can be tackled as follows... (with
ref. to the questions above)
1) return an appropriate value for getDPU ?
2) Simple conversion before drawText
Am I right here ?
Would appreciate any further suggestions,
Thanks,
Brian.
|
|
|
Re: Extending the Rulers [message #114993 is a reply to message #114940] |
Fri, 30 January 2004 12:17   |
Eclipse User |
|
|
|
"Brian Fernandes" <brian.fernandes@codito.com> wrote in message
news:bve02a$t1d$1@eclipse.org...
> I thought this might be better off in it's own thread.
>
> I went through the RulerClasses, so I know a little more about them now.
>
> I will need a ruler with
> 1) My own units.
> 2) Display values in Hex instead of Decimal
> 3) Offset the starting value - instead of a ruler starting at 0, I want it
> to start at a value based on my model (because I'm clipping diagrams)
> 4) Since the ruler text can be quite large for large diagrams, I'd like
the
> text markers spaced wider apart, with more line markers. (I think this is
> currently taken care of ?)
Yes, you can do this using the setInterval(int, int) method.
>
> I had a look at RulerFigure and I probably need to chage stuff in
> RulerFigure#paintFigure - lots of complex stuff happening there :)
>
> Now I guess I have to extend RulerFigure to do what I want it to do.. but
if
> I want my RulerFigure to be used... then
> I have to extend RulerEditPart, RulerEditPartFactory, and RulerComposite.
Am
> I right here ? or is there a simpler way to do this ?
Yes. This is all internal API, and so you have no other choice. At least
for now.
>
> once I do all this.. I suppose my issues can be tackled as follows...
(with
> ref. to the questions above)
> 1) return an appropriate value for getDPU ?
> 2) Simple conversion before drawText
The conversion should happen earlier. String "num" should be assigned the
hex value instead of the decimal value. These two steps will suffice if you
set proper intervals using the setInterval(...) method.
>
> Am I right here ?
>
> Would appreciate any further suggestions,
> Thanks,
> Brian.
>
>
>
>
>
>
>
>
|
|
|
Re: Extending the Rulers [message #115067 is a reply to message #114993] |
Sat, 31 January 2004 08:05  |
Eclipse User |
|
|
|
Originally posted by: brian.fernandes.codito.com
I begun extending RulerComposite, and so that I can use my own
RulerEditPartFactory;
from the initial overview, what I will finish with is going to be an almost
identical copy of the existing RulerEditPartFactory.
Copying code is definitely a bad idea, especially now as the Rulers are
still being developed - but in the future, assuming somebody wants a
customized ruler, isn't this a bit much to copy ? Are you going to change
the architecture so that it is easier to use your own customized ruler or
have I missed out some simpler way using my own RulerEditPartFactory ?(I am
constantly in doubt of my Java Skills)
Thanks,
Brian.
|
|
|
Powered by
FUDForum. Page generated in 0.03371 seconds