flatscape.util
Class SymbolDB

java.lang.Object
  |
  +--flatscape.util.SymbolDB
All Implemented Interfaces:
Configurable

public class SymbolDB
extends java.lang.Object
implements Configurable

Class to create symbols (e.g. MIL-STD-2525B symbols).

Copyright (c) 2001 Rutgers, The State University of New Jersey

Since:
manifold %Version%
Version:
%Version%, %Time%

Constructor Summary
SymbolDB()
           
 
Method Summary
 java.util.ArrayList build_mod_forest(java.lang.Object parent, org.w3c.dom.Element config)
           
 ModTreeNode build_mod_tree(org.w3c.dom.Element e, ModTreeNode parent_node)
           
 java.lang.Object config(java.lang.Object parent, org.w3c.dom.Element config)
          Called upon loading of the XML configuation files.
 void dump_forest(java.util.ArrayList the_forest)
           
 void dump_tree(ModTreeNode tree_x, int level)
           
 java.util.ArrayList get_forest()
           
 javax.swing.Icon[] getModifierIcons(java.lang.String baseType)
           
 java.lang.String[] getModifiers(java.lang.String baseType)
           
 java.awt.Image getRawSymbol(java.lang.String baseType, java.lang.String[] modifiers)
          Note!
 java.lang.String getSizeCode(java.lang.String name)
           
 java.lang.String getSizeName(java.lang.String code)
           
 java.awt.Image getSymbol(java.lang.String id)
           
 java.awt.Image getSymbol(java.lang.String affiliation, java.lang.String type, java.lang.String modifiers)
           
 javax.swing.JPopupMenu getUnitTypeMenu(java.lang.String affiliation, java.awt.event.ActionListener listener)
           
static java.lang.String parseAffiliation(java.lang.String affiliation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SymbolDB

public SymbolDB()
Method Detail

config

public java.lang.Object config(java.lang.Object parent,
                               org.w3c.dom.Element config)
                        throws java.lang.Exception
Description copied from interface: Configurable
Called upon loading of the XML configuation files. Before this method is called, the no argument constructor is called.

Specified by:
config in interface Configurable
Parameters:
parent - The argument passed into the FConfig.getList method
config - The DOM element representing the XML element that loaded this class.
Returns:
The configured class, usually returns this.
Throws:
java.lang.Exception - Thrown if there is any problem configuring this class.

get_forest

public java.util.ArrayList get_forest()

dump_forest

public void dump_forest(java.util.ArrayList the_forest)

dump_tree

public void dump_tree(ModTreeNode tree_x,
                      int level)

build_mod_forest

public java.util.ArrayList build_mod_forest(java.lang.Object parent,
                                            org.w3c.dom.Element config)

build_mod_tree

public ModTreeNode build_mod_tree(org.w3c.dom.Element e,
                                  ModTreeNode parent_node)

getSizeCode

public java.lang.String getSizeCode(java.lang.String name)
Returns:
size code given size name

getSizeName

public java.lang.String getSizeName(java.lang.String code)
Returns:
size name given size code

getSymbol

public java.awt.Image getSymbol(java.lang.String affiliation,
                                java.lang.String type,
                                java.lang.String modifiers)
Returns:
a symbol specified by the arguments

getSymbol

public java.awt.Image getSymbol(java.lang.String id)
Returns:
a symbol specified by the argument

getUnitTypeMenu

public javax.swing.JPopupMenu getUnitTypeMenu(java.lang.String affiliation,
                                              java.awt.event.ActionListener listener)
Returns:
a JPopupMenu to select a unit type

getRawSymbol

public java.awt.Image getRawSymbol(java.lang.String baseType,
                                   java.lang.String[] modifiers)
Note! This method will not work if called before the Flatscape GUI has been initialized

Returns:
a symbol specified by the arguments

getModifiers

public java.lang.String[] getModifiers(java.lang.String baseType)

getModifierIcons

public javax.swing.Icon[] getModifierIcons(java.lang.String baseType)

parseAffiliation

public static java.lang.String parseAffiliation(java.lang.String affiliation)
Returns:
the affiliation id: U, F, N or H corresponding to the given string


Copyright (c) 2003 Rutgers, The State University of New Jersey