Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » can't get Rulers to correctly show centimeters and inches
can't get Rulers to correctly show centimeters and inches [message #158519] Thu, 18 November 2004 17:41 Go to next message
Sean Neeley is currently offline Sean NeeleyFriend
Messages: 22
Registered: July 2009
Junior Member
When I call
RulerProvider.setUnits(RulerProvider.UNIT_CENTIMETERS) or
RulerProvider.setUnits(RulerProvider.UNIT_INCHES)
my horizontal and vertical rulers do not visually show Centimeters or
Inches. There is just a '0' on one end, and the rest of the ruler is
blank (white). UNIX_PIXELS works great. I added a RulerChangeListener,
and I know that notifyUnitsChanged() is being called with the new units
value. I have code identical to LogicRulerProvider in the logic
example. Why aren't my rulers rendering correctly?

Thanks.
- Sean
Re: can't get Rulers to correctly show centimeters and inches [message #158768 is a reply to message #158519] Fri, 19 November 2004 17:24 Go to previous messageGo to next message
Sean Neeley is currently offline Sean NeeleyFriend
Messages: 22
Registered: July 2009
Junior Member
OK, looks like I can correctly switch back and forth from CENTIMETERS to
INCHES to PIXELS if I create a new RulerProvider and new Rulers each
time that I switch. Works great for now.

- Sean

Sean Neeley wrote:
> When I call
> RulerProvider.setUnits(RulerProvider.UNIT_CENTIMETERS) or
> RulerProvider.setUnits(RulerProvider.UNIT_INCHES)
> my horizontal and vertical rulers do not visually show Centimeters or
> Inches. There is just a '0' on one end, and the rest of the ruler is
> blank (white). UNIX_PIXELS works great. I added a RulerChangeListener,
> and I know that notifyUnitsChanged() is being called with the new units
> value. I have code identical to LogicRulerProvider in the logic
> example. Why aren't my rulers rendering correctly?
>
> Thanks.
> - Sean
Re: can't get Rulers to correctly show centimeters and inches [message #159118 is a reply to message #158768] Mon, 22 November 2004 21:05 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Creating new rulers and provider everytime can be expensive. You shouldn't
have to do that.

This problem is because of a bug in RulerEditPart. RulerEditPart sets the
interval to be 100 during creation of the RulerFigure if it detects that it
is displaying pixels. However, later when you change the units to say
inches, or centimeters, it's still displaying them, but will only make a
mark at every 100 inches or centimeters.

RulerEditPart shouldn't be setting the interval and the divisions. I've
been meaning to expose RulerFigure so that clients can customize it as
desired. Please open a bug request.

"Sean Neeley" <sean.neeley@dbcsoftware.com> wrote in message
news:cnlaam$e6k$1@www.eclipse.org...
> OK, looks like I can correctly switch back and forth from CENTIMETERS to
> INCHES to PIXELS if I create a new RulerProvider and new Rulers each
> time that I switch. Works great for now.
>
> - Sean
>
> Sean Neeley wrote:
> > When I call
> > RulerProvider.setUnits(RulerProvider.UNIT_CENTIMETERS) or
> > RulerProvider.setUnits(RulerProvider.UNIT_INCHES)
> > my horizontal and vertical rulers do not visually show Centimeters or
> > Inches. There is just a '0' on one end, and the rest of the ruler is
> > blank (white). UNIX_PIXELS works great. I added a RulerChangeListener,
> > and I know that notifyUnitsChanged() is being called with the new units
> > value. I have code identical to LogicRulerProvider in the logic
> > example. Why aren't my rulers rendering correctly?
> >
> > Thanks.
> > - Sean
Previous Topic:Rotate figures
Next Topic:Added new figures to the diagram.
Goto Forum:
  


Current Time: Fri Apr 26 08:37:00 GMT 2024

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

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

Back to the top