Monday, December 24, 2007

WWJ Annotated Icons

Suppose you have icons around the globe representing some type of events (traffic, rain, fire, ...) and you want to see more information when click on them with the mouse.

Well, I have created the so called AnnotatedIcons with this idea in mind. Note, as suggested here byt Pat, there is another approach to achieve similar effect based only in annotations (one annotation with two or more annotation attribute styles). Unfortunately :( I had done the major part of code when I known the alternative, and anyway I like AnnotatedIcons :)



As you can see in the image (I have no time to make a video), some icons are rendered and when the mouse is over one its associated annotation is shown with more extended information.

You can take the source code from here.

WWJ Rotable Icons

Reading this thread other developer talk about how useful will be have icons that can be rotated.
I don't know if these contribution success with all expectation but if you can compute the heading desired for your icons then these can be useful for you.
The RotableUserFacingIcon implementation allows to specify the heading rotation of your icons (like the compass).



You can get the source code from here.

Note, this contribution adds a peace of code into the IconRenderer class to allows icon rotation take effect, and also take into account the icon is slightly displaced when it is a rotable icon.

Saturday, December 08, 2007

The new balloon...

I'm glad to present a screenshot about the new balloon application.

For the moment I'm working very hard on the user interface, but it allows to work with the default WWJ BlueMarble and Lansat layers, load images (local or remote) with re-loading option ;) and animate with a temporality associated.

Tuesday, November 27, 2007

WWJ SurfaceImage reloaded

Don't worry this isn't Matrix ;) (I hope it)

I have made a little update on the previous update of SurfaceImage to allow reload of data.
Suppose you have an image file that can be modified by an external process and you want reload it at regular intervals of time to see its changes.
Now you can have it with SurfaceImage reloaded :)

You can get the source code here.

I have added a new reload(boolean useCache) method. Note, it has one boolean parameter to specify if the image must be reloaded from cache (if it is there, I think this option isn't very useful) or reloading it from the original source of data.

Monday, November 26, 2007

A note on LayerSet

Unfortunately I must recognize I am a newbie with my own code :P
Using LayerSet in the Balloon project I get a little headache I want to comment here.
LayerSet extends LayerList class and also implements the Layer interface (in the same way as AbstractLayer).
Take very into account, that if you create a LayerSet an adds a LayerList object, all contained layers in LayerList are copied into the LayerSet, and that's all. If later you modify the LayerList, adding or removing layers, the changes are not propagated to the LayerSet.

Friday, November 23, 2007

WWJ renderable objects

Although it seems a very big change, here I present a WWJ hack to convert more object into Renderable object, that is, objects that implements the Renderable interface.
I have made only three things to achieve this:


  1. Add the next methods to the Renderable interface:

    public boolean isEnabled();
    public void setEnabled(boolean enabled);
    public String getName();
    public void setName(String name);
    public double getOpacity();
    public void setOpacity(double opacity);

    The idea is that a any Renderable object can has a enable/disable state, an opacity value and optionally a name.



  2. Add a default implementation for this method in all affected classes and interfaces. The default implementation doesn't alter the normal behavior of this elements.

    /**
    * Default Renderable implementation.
    */
    public boolean isEnabled()
    {
    return true;
    }

    public void setEnabled(boolean enabled)
    {
    // Do nothing.
    }

    public String getName()
    {
    return null;
    }

    public void setName(String name)
    {
    // Do nothing.
    }

    public double getOpacity()
    {
    return 1;
    }

    public void setOpacity(double opacity)
    {
    // Do nothing.
    }




  3. Added a new class RenderableListLayer, similar to LayerList that can contain any "new" Renderable object, that is, Layers, Icons, Images, etc.
    Here are a peace of code using this class:

    LayerList ll = new LayerList();
    RenderableListLayer main = new RenderableListLayer();

    main.add(new BMNGSurfaceLayer());
    main.add(new LandsatI3());
    main.add(new ScalebarLayer());

    RenderableListLayer rll = new RenderableListLayer();
    rll.add(si1);
    rll.add(si2);
    rll.add(si3);
    rll.add(new CompassLayer());
    rll.add(new WorldMapLayer());

    main.add(rll);
    main.setPickEnabled(false);

    ll.add(main);




Source code can be found here.

Finally it must be necessary to implement the appropriate mechanism to render images, nodes and other Renderable object taking into account its opacity and enable values.

Wednesday, November 21, 2007

WWJ Movable SurfaceImage

Finally I have modified the SurfaceImage class to implement the Movable interface too.
The source code can be found here.

Sunday, November 18, 2007

WWJ remote SurfaceImage updated

Well, after a couple of days improving some things finally here is the until now best version of SurfaceImage ;)

The new features are:
* Local and remote images (except BufferedImage's) are loaded in a separate thread.
* Remote images are cached on disk, to avoid network overhead.
* Added a 'setSector' method to change the image sector position.

You can find the source code here.

JOGL mipmap problem

Working on WWJ SurfaceImage class I get an strange phenomenon with the mipmap option. Here are the differences between using:

textureData = TextureIO.newTextureData(iconStream, false, null);
(mipmap option set to 'false')



textureData = TextureIO.newTextureData(iconStream, true, null);
(mipmap option set to 'true')



All three are PNG images.

Following Ken answer I report it as a possible JOGL bug.

Wednesday, November 14, 2007

WWJ and remote SurfaceImage

Yesterday and today afternoon I was working on the SurfaceImage class. I was modify a bit to allow load remote HTTP images on a Retriever thread. Now you can make things like:

SurfaceImage img = new SurfaceImage("http://openclipart.org/people/yeKcim/yeKcim_pirats_boat.png", Sector.fromDegrees(40, 43, 0, 5));


You can found the code here.