Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Set the Ruler Unit
Set the Ruler Unit [message #221954] Tue, 22 August 2006 10:58 Go to next message
Eclipse UserFriend
Originally posted by: ravi.nawale.yahoo.com

hi all

i want to set the Unit of the my Ruler
that is user define ruler i use gef.RulerProvider

how i Achieve that
Re: Set the Ruler Unit [message #222244 is a reply to message #221954] Mon, 28 August 2006 15:01 Go to previous messageGo to next message
Sebastián Gurin is currently offline Sebastián GurinFriend
Messages: 43
Registered: July 2009
Member
On Tue, 22 Aug 2006 10:58:07 +0000 (UTC)
ravi.nawale@yahoo.com (ravi) wrote:

> hi all
>
> i want to set the Unit of the my Ruler
> that is user define ruler i use gef.RulerProvider
>
> how i Achieve that
>

I think that, at least in gef 3.1.1, the only unit supported is
RulerProvider.UNIT_PIXEL.

See for example the code of in handleUnitsChanged()
org.eclipse.gef.internal.ui.rulers.RulerEditPart:

public void handleUnitsChanged(int newUnit) {
getRulerFigure().setUnit(newUnit);
if (newUnit == RulerProvider.UNIT_PIXELS)
getRulerFigure().setInterval(100, 2);
else
getRulerFigure().setInterval(0, 0);
}

Is this implemented in gef 3.2? It would be nice to implement this...
Re: Set the Ruler Unit [message #222252 is a reply to message #222244] Mon, 28 August 2006 15:15 Go to previous message
Sebastián Gurin is currently offline Sebastián GurinFriend
Messages: 43
Registered: July 2009
Member
excuse me. centimeters work ok thanks to patrik. The conversion betweeen pixels and centimeters is done in org.eclipse.gef.internal.ui.rulers.RulerFigure

Now, I see that inches aren't implemented (at least in gef3.1.1).

For change ruler's units to centimeters you have to:

yourRulerProvider.setUnit(RulerProvider.UNIT_CENTIMETERS)

see the logic example :

LogicEditor.loadProperties() and org.eclipse.gef.examples.logicdesigner.rulers


On Mon, 28 Aug 2006 17:01:44 +0200
Sebastian Gurin <sgurin@montevideo.com.uy> wrote:

> On Tue, 22 Aug 2006 10:58:07 +0000 (UTC)
> ravi.nawale@yahoo.com (ravi) wrote:
>
> > hi all
> >
> > i want to set the Unit of the my Ruler
> > that is user define ruler i use gef.RulerProvider
> >
> > how i Achieve that
> >
>
> I think that, at least in gef 3.1.1, the only unit supported is
> RulerProvider.UNIT_PIXEL.
>
> See for example the code of in handleUnitsChanged()
> org.eclipse.gef.internal.ui.rulers.RulerEditPart:
>
> public void handleUnitsChanged(int newUnit) {
> getRulerFigure().setUnit(newUnit);
> if (newUnit == RulerProvider.UNIT_PIXELS)
> getRulerFigure().setInterval(100, 2);
> else
> getRulerFigure().setInterval(0, 0);
> }
>
> Is this implemented in gef 3.2? It would be nice to implement this...
Previous Topic:Is it possible to print TreeView in elipse GEF?
Next Topic:drag and drop
Goto Forum:
  


Current Time: Thu Sep 26 03:07:53 GMT 2024

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

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

Back to the top