flatscape.util
Class MilUtils

java.lang.Object
  |
  +--flatscape.util.MilUtils

public class MilUtils
extends java.lang.Object

Utility functions for mil applications.

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

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

Field Summary
static int S_FRIEND
           
static int S_HOSTILE
           
static int S_NEUTRAL
           
static int S_UNKNOWN
           
static int U_ARMY
           
static int U_ARMY_GROUP
           
static int U_BATTALION
           
static int U_BRIGADE
           
static int U_COMPANY
           
static int U_CORPS
           
static int U_DIVISION
           
static int U_INSTALLATION
           
static int U_PLATOON
           
static int U_REGIMENT
           
static int U_REGION
           
static int U_SECTION
           
static int U_SQUAD
           
static int U_TEAM
           
 
Constructor Summary
MilUtils()
           
 
Method Summary
static void drawSymbol(java.awt.Graphics2D g2, int symbol, int size)
          Draws a MIL-STD-2525B Basic symbol (unknown, neutral, friendly or hostile) with size indicator in the given graphics context.
static java.awt.Shape drawSymbol(java.awt.Graphics2D g2, int symbol, int size, double L)
          Draws a MIL-STD-2525B Basic symbol (unknown, neutral, friendly or hostile) with size indicator in the given graphics context.
static java.awt.Shape drawUnitSizeIndicator(java.awt.Graphics2D g2, int affiliation, int size, double L)
          Draws a MIL-STD-2525B size indicator in the given graphics context, placed dependant on the affiliation.
static int parseAffiliation(java.lang.String affiliation)
           
static int parseSize(java.lang.String size)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

S_UNKNOWN

public static final int S_UNKNOWN
See Also:
Constant Field Values

S_FRIEND

public static final int S_FRIEND
See Also:
Constant Field Values

S_NEUTRAL

public static final int S_NEUTRAL
See Also:
Constant Field Values

S_HOSTILE

public static final int S_HOSTILE
See Also:
Constant Field Values

U_INSTALLATION

public static final int U_INSTALLATION
See Also:
Constant Field Values

U_TEAM

public static final int U_TEAM
See Also:
Constant Field Values

U_SQUAD

public static final int U_SQUAD
See Also:
Constant Field Values

U_SECTION

public static final int U_SECTION
See Also:
Constant Field Values

U_PLATOON

public static final int U_PLATOON
See Also:
Constant Field Values

U_COMPANY

public static final int U_COMPANY
See Also:
Constant Field Values

U_BATTALION

public static final int U_BATTALION
See Also:
Constant Field Values

U_REGIMENT

public static final int U_REGIMENT
See Also:
Constant Field Values

U_BRIGADE

public static final int U_BRIGADE
See Also:
Constant Field Values

U_DIVISION

public static final int U_DIVISION
See Also:
Constant Field Values

U_CORPS

public static final int U_CORPS
See Also:
Constant Field Values

U_ARMY

public static final int U_ARMY
See Also:
Constant Field Values

U_ARMY_GROUP

public static final int U_ARMY_GROUP
See Also:
Constant Field Values

U_REGION

public static final int U_REGION
See Also:
Constant Field Values
Constructor Detail

MilUtils

public MilUtils()
Method Detail

parseAffiliation

public static int parseAffiliation(java.lang.String affiliation)
Returns:
the affiliation constants: S_UNKNOWN, S_FRIEND, S_NEUTRAL or S_HOSTILE corresponding to the given string

parseSize

public static int parseSize(java.lang.String size)
Returns:
the unit size constants: U_INSTALLATIONU_TEAM... U_ARMY_GROUP or U_REGION corresponding to the given string

drawSymbol

public static void drawSymbol(java.awt.Graphics2D g2,
                              int symbol,
                              int size)
Draws a MIL-STD-2525B Basic symbol (unknown, neutral, friendly or hostile) with size indicator in the given graphics context. The symbols are drawn using a scaling factor L = 1.0.

Parameters:
g2 - the graphics context to draw in
symbol - affiliation constants: S_UNKNOWN, S_FRIEND, S_NEUTRAL or S_HOSTILE
size - unit size constants: U_INSTALLATIONU_TEAM... U_ARMY_GROUP or U_REGION

drawSymbol

public static java.awt.Shape drawSymbol(java.awt.Graphics2D g2,
                                        int symbol,
                                        int size,
                                        double L)
Draws a MIL-STD-2525B Basic symbol (unknown, neutral, friendly or hostile) with size indicator in the given graphics context.

Parameters:
g2 - the graphics context to draw in
symbol - affiliation constants: S_UNKNOWN, S_FRIEND, S_NEUTRAL or S_HOSTILE
size - unit size constants: U_INSTALLATIONU_TEAM... U_ARMY_GROUP or U_REGION
L - scaling factor

drawUnitSizeIndicator

public static java.awt.Shape drawUnitSizeIndicator(java.awt.Graphics2D g2,
                                                   int affiliation,
                                                   int size,
                                                   double L)
Draws a MIL-STD-2525B size indicator in the given graphics context, placed dependant on the affiliation.

Parameters:
g2 - the graphics context to draw in
affiliation - affiliation constants: S_UNKNOWN, S_FRIEND, S_NEUTRAL or S_HOSTILE
size - unit size constants: U_INSTALLATIONU_TEAM... U_ARMY_GROUP or U_REGION
L - scaling factor
Returns:
the bounding box of the symbol


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