![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jan 2012
Posts: 94
![]() |
Hi there,
I have the requirement to implement some tactical symbols with additional labels, for example the point graphic "Point of Interest". I would like to define my own symbol ID code with its own LabelLayouts as in DefaultLabelLayouts.java, but what would be the best way to do this without changing existing WorldWind code? I could override DefaultLabelLayouts, but TacticalGraphicSymbol uses it as a static field which I would have to reset. In theory it would also be possible to add a LabelLayout from the outside per DefaultLabelLayouts.addLayout(). However, this method is protected. Not quite sure how to handle this, yet... |
|
|
|
|
|
#2 |
|
WW Dev. Team
Join Date: Sep 2010
Location: Boston, MA, USA
Posts: 325
![]() |
Is there a reason that you're using TacticalGraphicSymbol instead of MilStd2525TacticalSymbol? The latter is the "normal" symbol implementation, and the former is a slightly different implementation used for point tactical graphics in 2525C.
If you can use MilStd2525TacticalSymbol, you can override the layoutTextModifiers method to add any additional labels that you require. If you must use TacticalGraphicSymbol, you could override layoutTextModifiers and duplicate the logic for the loop that iterates through the layouts. I'll look into changing that implementation to make it easier to extend the class and add new layouts. |
|
|
|
|
|
#3 | |
|
Member
Join Date: Jan 2012
Posts: 94
![]() |
There was no specific reason to use TacticalGraphicSymbol over MilStd2525TacticalSymbol, it was just the first that we noticed.
I looked through the codes, but I do not understand why there are those two approaches for the same thing. Is there any advantage to use MilStd2525TacticalSymbol over TacticalGraphicSymbol? Quote:
|
|
|
|
|
|
|
#4 |
|
WW Dev. Team
Join Date: Sep 2010
Location: Boston, MA, USA
Posts: 325
![]() |
I've added a method to TacticalGraphicSymbol to look up the layout for a graphic. You can override just this one method to insert your custom layout:
Code:
@Override
protected List<LabelLayout> getLayouts(String sidc)
{
if (needCustomLayout)
// return custom layout
else
return super.getLayouts(sidc);
}
Looking at your first point again, it sounds like you do want to use TacticalGraphicSymbol, since it sounds like you are trying to change the layout of some of the point graphics. I also added a public method to MilStd2525GraphicFactory to allow you to change the implementation class that the factory instantiates without extending the factory itself. Hopefully that will eliminate one of the classes that you need to override. |
|
|
|
|
|
#5 |
|
Member
Join Date: Jan 2012
Posts: 94
![]() |
Thanks a lot, this is very convenient!
In some point in the future we will probably migrate our system to a newer version of WWJ, until then I will have to do without those changes. Still nice to see such courtesy here! |
|
|
|
|
|
#6 |
|
Super Moderator
Join Date: Nov 2006
Location: Mojave & Oxnard California
Posts: 2,621
![]() |
To update I just:
delete src/gov paste in latest gov It took a while to set it up so it could be done that way. Some of the latest changes may be missing but have not seen a problem yet. |
|
|
|
![]() |
| Tags |
| defaultlabellayout, labellayout, symbology |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Change to DRAG select event handling | tag | Feature Discussion | 1 | 06-22-2011 11:41 PM |
| WW1.3.2-Plugin: Layer Edit | canosso | Add-ons & Scripts | 21 | 02-27-2010 04:37 AM |
| Change to WorldWind.cs | James_In_Utah | Developers' Corner | 10 | 03-19-2008 11:51 PM |
| zoom and latitude change | haddazi | Development Help | 1 | 11-14-2007 04:04 AM |
| WW 1.3.2-Plugin: Skripter | canosso | Add-ons & Scripts | 33 | 03-22-2007 02:06 PM |