|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.MapHandlerChild com.bbn.openmap.OMComponent com.bbn.openmap.tools.symbology.milStd2525.SymbolReferenceLibrary
public class SymbolReferenceLibrary
The SymbolReferenceLibrary is a organizational class for creating and managing a SymbolPart tree. It can handle requests for decoding a Symbol code and providing a SymbolPart for that code, and can fetch ImageIcons for codes and SymbolParts. This is the class you can put in the MapHandler for other components to use in order to create symbols. The DemoLayer, for instance, uses the MapHandler.findAndInit() method to find it and create a space shuttle icon.
This SymbolReferenceLibrary has one property that lets you specify the SymbolImageMaker it should use to create image icons.
symbolreferencelibrary.class=com.bbn.openmap.tools.symbology.milStd2525.SymbolReferenceLibrary # properties to use for GIF image data files symbolreferencelibrary.imageMakerClass=com.bbn.openmap.tools.symbology.milStd2525.GIFSymbolImageMaker # optional property used as a path to the parent of the data files if it's not in the classpath. symbolreferencelibrary.path=<path to image data file directory> # optional background color for icons if you want something other than clear. symbolreferencelibrary.background=AAGGRRBB # properties to use for SVG image data files obtained from DISA. You need to have Batik jars in # your classpath to use the SVG files, as well as the omsvg.jar file symbolreferencelibrary.imageMakerClass=com.bbn.openmap.tools.symbology.milStd2525.SVGSymbolImageMaker # optional property used as a path to the parent of the data files if it's not in the classpath. symbolreferencelibrary.path=<path to image data file directory> # optional background color for icons if you want something other than clear. symbolreferencelibrary.background=AAGGRRBB
Field Summary | |
---|---|
protected SymbolPart |
head
|
protected static SymbolReferenceLibrary |
library
|
protected CodePositionTree |
positionTree
|
protected CodeOptions |
symbolAttributes
|
protected SymbolImageMaker |
symbolImageMaker
|
static java.lang.String |
SymbolImageMakerClassProperty
|
Fields inherited from class com.bbn.openmap.OMComponent |
---|
i18n, propertyPrefix |
Fields inherited from class com.bbn.openmap.MapHandlerChild |
---|
beanContextChildSupport, isolated |
Fields inherited from interface com.bbn.openmap.PropertyConsumer |
---|
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
Constructor Summary | |
---|---|
SymbolReferenceLibrary()
A constructor used when the SymbolImageMaker will be set later, either via the setProperties method or programmatically. |
|
SymbolReferenceLibrary(SymbolImageMaker sim)
Create a SymbolReferenceLibrary with a SymbolImageMaker to use to create images from a data source. |
Method Summary | |
---|---|
java.util.Properties |
findAndLoadProperties(java.lang.String propertiesResource)
|
CodeOptions |
getCodeOptions()
|
CodeOptions |
getCodeOptions(SymbolPart sp,
CodeOptions co)
Given a SymbolPart, return what options are available for it. |
java.lang.String |
getDescription()
Returns a huge, multi-line string listing all of the symbols, their names and their relation to each other. |
SymbolPart |
getHead()
The SymbolParts in the library are stored in a tree hierarchy, and this method gets the top level one representing the MIL-STD-2525 tree. |
javax.swing.ImageIcon |
getIcon(java.lang.String symbolCode,
java.awt.Dimension di)
Return an image given a SymbolCode and dimension. |
javax.swing.ImageIcon |
getIcon(SymbolPart sp,
CodeOptions co,
java.awt.Dimension di)
Return an image for a particular SymbolPart, its options and dimensions. |
java.lang.String |
getSymbolCode(SymbolPart sp,
CodeOptions co)
Return the 15 character character string representing a SymbolPart with CodeOptions. |
SymbolImageMaker |
getSymbolImageMaker()
|
SymbolPart |
getSymbolPartForCode(java.lang.String code)
Check to see if code exists, if it's valid. |
protected SymbolPart |
getSymbolPartForCodeStartingAt(SymbolPart node,
java.lang.String code)
|
protected void |
initialize(java.util.Properties props,
SymbolImageMaker sim)
|
static void |
main(java.lang.String[] argv)
|
void |
setProperties(java.lang.String prefix,
java.util.Properties props)
Sets the properties for the OMComponent. |
SymbolImageMaker |
setSymbolImageMaker(java.lang.String classname)
|
void |
setSymbolImageMaker(SymbolImageMaker symbolImageMaker)
|
Methods inherited from class com.bbn.openmap.OMComponent |
---|
getProperties, getPropertyInfo, getPropertyPrefix, setProperties, setPropertyPrefix |
Methods inherited from class com.bbn.openmap.MapHandlerChild |
---|
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, findAndInit, findAndUndo, firePropertyChange, fireVetoableChange, getBeanContext, isIsolated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, setIsolated |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SymbolImageMakerClassProperty
protected SymbolPart head
protected CodePositionTree positionTree
protected static SymbolReferenceLibrary library
protected CodeOptions symbolAttributes
protected SymbolImageMaker symbolImageMaker
Constructor Detail |
---|
public SymbolReferenceLibrary()
public SymbolReferenceLibrary(SymbolImageMaker sim)
sim
- Method Detail |
---|
public java.util.Properties findAndLoadProperties(java.lang.String propertiesResource)
protected void initialize(java.util.Properties props, SymbolImageMaker sim)
public void setProperties(java.lang.String prefix, java.util.Properties props)
OMComponent
setProperties
in interface PropertyConsumer
setProperties
in class OMComponent
prefix
- the token to prefix the property namesprops
- the Properties
objectpublic SymbolImageMaker setSymbolImageMaker(java.lang.String classname)
public CodeOptions getCodeOptions()
public CodeOptions getCodeOptions(SymbolPart sp, CodeOptions co)
sp
- The SymbolPart in question.co
- Current settings that may be in use.public javax.swing.ImageIcon getIcon(java.lang.String symbolCode, java.awt.Dimension di)
public javax.swing.ImageIcon getIcon(SymbolPart sp, CodeOptions co, java.awt.Dimension di)
public java.lang.String getSymbolCode(SymbolPart sp, CodeOptions co)
public SymbolPart getHead()
public java.lang.String getDescription()
public SymbolPart getSymbolPartForCode(java.lang.String code)
code
-
protected SymbolPart getSymbolPartForCodeStartingAt(SymbolPart node, java.lang.String code)
public static void main(java.lang.String[] argv)
public SymbolImageMaker getSymbolImageMaker()
public void setSymbolImageMaker(SymbolImageMaker symbolImageMaker)
symbolImageMaker
- The symbolImageMaker to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |