Landon,

  I just used a menu item.  See the attached jpeg.  I don't see any
problem with a pop-up on the ZoomBar though.  I needed units for
another reason and I didn't have time to fully implement a spatial
reference system.

  I only mention SkyJUMP's code to perhaps save you little time
implementing the custom units for US.  My implementation of
EnglishSystem is below.

Larry

package com.vividsolutions.jump.workbench.ui.plugin.scalebar;

import java.util.ArrayList;
import java.util.Collection;


/**
 * This will eventually implement an interface called MeasurementSystem.
 */
public class EnglishSystem {
    private double modelUnitsPerFoot;

    public EnglishSystem(double modelUnitsPerFoot) {
        this.modelUnitsPerFoot = modelUnitsPerFoot;
    }

    public Collection createUnits() {
        ArrayList units = new ArrayList();

        units.add(new Unit("mi",  5280d * modelUnitsPerFoot));
        units.add(new Unit("ft",     1d * modelUnitsPerFoot));
        units.add(new Unit("in", 1d/12d * modelUnitsPerFoot));

        return units;
    }
}



On Feb 4, 2008 2:56 PM, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
> Larry,
>
> I was going to allow the user to select the units throught a pop-up
> menu that could be pulled up on the ZoomBar. I agree that it would be
> better to associate the Unit System with a Task. But if we do this,
> why not assign a Spatial Reference System instead?
>
> But maybe I don't want to get that complicated.
>
> How did you assign the distance unit system to the Task window? Did
> you do this directly in the Task window?
>
> Landon
>
>
> On Feb 4, 2008 12:23 PM, Larry Becker <[EMAIL PROTECTED]> wrote:
> > Hi Sunburned,
> >
> >  SkyJUMP has a ZoomBar that displays metric and US units based on the
> > setting of the Task Units.  OpenJump doesn't have a method of setting
> > the task units.  What are you doing to do to determine it?
> >
> > regards,
> >
> > Larry
> >
> >
> > On Feb 4, 2008 2:18 PM, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
> > > I'm doing some work at home with the ZoomBar for OpenJUMP. From the
> > > source code comments it appears that some of the supporting code for
> > > the ZoomBar was never fully implemented. The ZoomBar was going to work
> > > with additional code that defined unit systems.  (Right now it works
> > > with a model of the metric unit system contained in a collection to
> > > figure out the best label to display to the right of the JSlider on
> > > the zoom bar.)
> > >
> > > I'm in the process of completing the original implementation. This
> > > will involve defining classes/interfaces for units and unit systems.
> > > When complete this will allow the ZoomBar to support labels for units
> > > sytems in addition to the metric unit system. (For example: US Feet
> > > and Latitude/Longitude.)
> > >
> > > I'd like to know the best place to keep this code. I really don't
> > > think it belongs in the same package as the ZoomBar, because it is
> > > pretty generic. Do we have a package I should use for utility code in
> > > OpenJUMP? I was thinking of org.openjump.util.units for this
> > > particular code.
> > >
> > > Are there any objections to that?
> > >
> > > The Sunburned Surveyor
> > >
> > > -------------------------------------------------------------------------
> > > This SF.net email is sponsored by: Microsoft
> > > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > > _______________________________________________
> > > Jump-pilot-devel mailing list
> > > Jump-pilot-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> > >
> >
> >
> >
> > --
> > http://amusingprogrammer.blogspot.com/
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > Jump-pilot-devel mailing list
> > Jump-pilot-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>



-- 
http://amusingprogrammer.blogspot.com/

<<attachment: units.JPG>>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to