|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.tools.symbology.milStd2525.SymbolPart
public class SymbolPart
The SymbolPart class represents one part in a hierarchy of pieces needed to represent an actual symbol. A symbol may require geometries from its parents, as each piece further down the hierarchy makes each symbol's meaning more specific, or scoped for a particular task. The top-level SymbolPart represents the entire symbology tree. Descending down through the tree, a SymbolPart representing one of the 5 Scheme sections is next, with the lower levels dependent on the Scheme definitions.
The SymbolPart is smart enough to use the hierarchy.properties file that defines the symbol set and create the symbol tree using the appropriate Code classes. Not all Code classes help define the tree, because some aspects of a symbol are flexible, like the Affiliation (enemy, friend, etc). The SymbolPart tree only defines some aspects of the symbol. Other parts of the symbol are dependent on these flexible variations that are provided to the SymbolPart at the time icons are created.
Field Summary | |
---|---|
protected CGM |
cgm
The symbol geometry object for this SymbolPart. |
protected java.lang.String |
cgmName
The file containing the symbol geometry for this SymbolPart. |
static java.lang.String |
CGMProperty
Property file property for cgm file too represent the symbol. |
protected java.lang.String |
code
The part of the symbol code unique to this symbol part. |
protected CodePosition |
codePosition
The Object that describes the location of this symbol part in the symbol hierarchy as defined by the 15 digit symbol code. |
protected static boolean |
DEBUG
|
static java.lang.String |
DEFAULT_SYMBOL_CODE
|
static java.lang.String |
NameProperty
Property file property for pretty name 'name' |
protected SymbolPart |
parent
The parent SymbolPart to this one. |
protected int |
positionShift
Some positions need to shift for entries that don't follow the conventions on the specification. |
protected java.lang.String |
prettyName
The pretty name for a symbol represented by this SymbolPart at this point in the hierarchy. |
protected java.util.List |
subs
A list of children SymbolParts relative to this one. |
static char |
UNUSED
|
static char |
WILD
|
Constructor Summary | |
---|---|
protected |
SymbolPart()
|
|
SymbolPart(CodePosition codePosition,
java.lang.String symbolCode,
java.util.Properties props,
SymbolPart parent)
The most-used constructor, used by CodePosition objects to create the different levels of the SymbolPart tree. |
|
SymbolPart(CodePosition codePosition,
java.lang.String symbolCode,
java.util.Properties props,
SymbolPart parent,
int start,
int end,
boolean shiftIfNecessary)
A different constructor used by OptionPositions. |
Method Summary | |
---|---|
boolean |
codeMatches(java.lang.String queryCode)
A query method that answers if the given 15 digit code applies to this symbol part. |
java.lang.String |
getCode()
Gets the part of the SymbolCode that is unique to this SymbolPart. |
CodeOptions |
getCodeOptions()
|
CodePosition |
getCodePosition()
|
CodeScheme |
getCodeScheme()
|
java.lang.String |
getDescription()
The starting command for retrieving the description with this SymbolPart being the top of the tree. |
java.lang.String |
getDescription(int level)
A method used by the tree to provide a string representation of how all the SymbolParts are connected. |
SymbolPart |
getParent()
Retrieves the SymbolPart's parent in the SymbolPart tree. |
java.lang.String |
getPrettyName()
Sets the descriptive name if this SymbolPart. |
java.util.List |
getSubs()
Gets a list of SymbolPart tree for more specific representations of what this SymbolPart represents. |
java.lang.String |
getSymbolCode()
Retrieves the 15 character symbol code for this SymbolPart. |
protected java.lang.StringBuffer |
getSymbolCode(java.lang.StringBuffer symbolCode)
A SymbolPart tree method that gets the SymbolPart's parents contribution for the symbol code. |
java.lang.StringBuffer |
getSymbolCodeMask()
A 15 character string of spaces, where spaces won't overwrite the current character when this symbol writes to a getSymbolCode() string. |
void |
paintIcon(java.awt.Graphics2D g,
CodeOptions co,
java.awt.Dimension di)
|
void |
setCode(java.lang.String c)
Sets the part of the SymbolCode that is unique to this SymbolPart. |
void |
setParent(SymbolPart par)
Sets the SymbolPart's parent in the SymbolPart tree. |
void |
setPrettyName(java.lang.String pn)
Sets the descriptive name if this SymbolPart. |
void |
setSubs(java.util.List set)
Sets a list of SymbolPart tree for more specific representations of what this SymbolPart represents. |
java.lang.String |
toString()
Get a simple string representation of this SymbolPart, including the 15 digit code and the pretty name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_SYMBOL_CODE
public static final java.lang.String NameProperty
public static final java.lang.String CGMProperty
protected CodePosition codePosition
protected java.lang.String code
protected java.lang.String prettyName
protected java.lang.String cgmName
protected CGM cgm
protected java.util.List subs
protected SymbolPart parent
protected int positionShift
protected static boolean DEBUG
public static final char UNUSED
public static final char WILD
Constructor Detail |
---|
protected SymbolPart()
public SymbolPart(CodePosition codePosition, java.lang.String symbolCode, java.util.Properties props, SymbolPart parent)
codePosition
- CodePosition object that corresponds to the
SymbolPart. CodePosition object with lower position
numbers tend to define more general symbols.symbolCode
- the 15 character symbol string that defines
this SymbolPart. This string is associated with a
hierarchy number in the Properties.props
- the Properties object contains all the information
about the symbol tree.parent
- the SymbolPart that is above this one in the
SymbolPart tree.public SymbolPart(CodePosition codePosition, java.lang.String symbolCode, java.util.Properties props, SymbolPart parent, int start, int end, boolean shiftIfNecessary)
codePosition
- CodePosition object that corresponds to the
SymbolPart. CodePosition object with lower position
numbers tend to define more general symbols.symbolCode
- the 15 character symbol string that defines
this SymbolPart. This string is associated with a
hierarchy number in the Properties.props
- the Properties object contains all the information
about the symbol tree.parent
- the SymbolPart that is above this one in the
SymbolPart tree.Method Detail |
---|
public void setCode(java.lang.String c)
public java.lang.String getCode()
public void setPrettyName(java.lang.String pn)
public java.lang.String getPrettyName()
public void setParent(SymbolPart par)
public SymbolPart getParent()
public void setSubs(java.util.List set)
public java.util.List getSubs()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDescription(int level)
public java.lang.String getDescription()
public java.lang.String getSymbolCode()
public java.lang.StringBuffer getSymbolCodeMask()
protected java.lang.StringBuffer getSymbolCode(java.lang.StringBuffer symbolCode)
public CodePosition getCodePosition()
public CodeOptions getCodeOptions()
public CodeScheme getCodeScheme()
public boolean codeMatches(java.lang.String queryCode)
queryCode
-
public void paintIcon(java.awt.Graphics2D g, CodeOptions co, java.awt.Dimension di)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |