![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: May 2007
Location: Milan, Genoa (Italy)
Posts: 112
|
Thanks to the hints by patmurris, I've been able to understand the usage of icons. I used them to put waypoints (path) and photos on WW.
![]() In order to render photos, I had to do some changes to WW (by copying and changing two classes). In facts, WWIcon is based on a string path which points to an external picture resource, while my thumbnails are generated in-memory. The changes are small - I think that they could be incorporated in WW for more flexibility. Anyone interested? Should I post them here?
__________________
-- Fabrizio Giudici, Ph.D. - Java Architect, Project Manager Tidalwave s.a.s. - "We make Java work. Everywhere." weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog Fabrizio.Giudici@tidalwave.it - mobile: +39 348.150.6941 |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Jan 2006
Location: Colorado, USA
Posts: 18
|
fabrizio,
great job. please do post them here. we can get the community to try to incorporate them into a running set of documentation. h |
|
|
|
|
|
#3 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
|
Keep in mind the WWJ SDK is a kind of pre-alpha version and a lot may evolve before a stable release comes out. So some of the code produced now may just break or become obsolete with future release.
Also, there is no clear protocol to submit code to the WWJ team at NLT... |
|
|
|
|
|
#4 |
|
God. Root. What is difference?
Join Date: Sep 2004
Location: Eastern Pennsylvania
Posts: 2,856
|
I am working on it... hopefully we can just setup something on the SF SVN.
__________________
![]() Earth is Square blog PUBLIC NOTICE AS REQUIRED BY LAW: Any use of this forum post, in any manner whatsoever, will increase the amount of disorder in the universe. Although no liability is implied herein, the consumer is warned that this process will ultimately lead to the heat death of the universe. |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: May 2007
Location: Milan, Genoa (Italy)
Posts: 112
|
Ok, I'll post the code this evening... see you later.
__________________
-- Fabrizio Giudici, Ph.D. - Java Architect, Project Manager Tidalwave s.a.s. - "We make Java work. Everywhere." weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog Fabrizio.Giudici@tidalwave.it - mobile: +39 348.150.6941 |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: May 2007
Posts: 5
|
what do you use to place your waypoints? UserFacingIcon ? I am am trying to plot waypoints in a seperate thread (to "simulate" real time) but if I play with the camera too much while my waypoints are being plotted they disappear. are you plotting your points in real time or just all at once?
|
|
|
|
|
|
#7 |
|
Senior Member
Join Date: May 2007
Location: Milan, Genoa (Italy)
Posts: 112
|
Sorry for the delay, I've been busy. I'll try to post the code in the afternoon. See you later.
PS For waypoints, I have both things: plot everything at once and in sequence. Nevertheless I've got some troubles with the latter. See you later in the afternoon.
__________________
-- Fabrizio Giudici, Ph.D. - Java Architect, Project Manager Tidalwave s.a.s. - "We make Java work. Everywhere." weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog Fabrizio.Giudici@tidalwave.it - mobile: +39 348.150.6941 |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: May 2007
Location: Milan, Genoa (Italy)
Posts: 112
|
Here are the changes I suggest. As I anticipated, my problem is that WWIcon describes the image in terms of the "path" property, a string pointing to the image resource name. This is not good if you have a dynamic image which is created in memory or loaded from a different storage than the codebase.
So, first I suggest to add a method to WWIcon: Code:
public BufferedImage getImage() 1. The iconTextures cache should be indexed by Object and not by String private java.util.HashMap<Object, Texture> iconTextures = new java.util.HashMap<Object, Texture>(); 2. Changes in the drawIcon() method: Code:
Object key = icon.getImage();
if (key == null)
{
key = icon.getPath();
}
Texture iconTexture = this.iconTextures.get(key);
if (iconTexture == null)
iconTexture = this.initializeTexture(dc, icon);
Code:
Texture iconTexture = null;
BufferedImage image = icon.getImage();
if (image != null)
{
iconTexture = TextureIO.newTexture(image, true);
this.iconTextures.put(image, iconTexture);
}
else
{
// ... the current code that loads the icon
}
iconTexture.bind();
Code:
if (icon == null || (icon.getPath() == null && icon.getImage() == null))
return false;
My implementation can be found here: https://bluemarine.dev.java.net/sour...=1968&view=log
__________________
-- Fabrizio Giudici, Ph.D. - Java Architect, Project Manager Tidalwave s.a.s. - "We make Java work. Everywhere." weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog Fabrizio.Giudici@tidalwave.it - mobile: +39 348.150.6941 |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|