Class Modifier2
java.lang.Object
armyc2.c5isr.JavaTacticalRenderer.Modifier2
This class handles everything having to do with text for a
tactical graphic. Note: labels are handled the same as text modifiers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
AddModifiers2
(TGLight tg, IPointConversion converter) Called by the renderer after tg.Pixels has been filled with the calculated points.static void
AddModifiersGeo
(TGLight tg, Graphics2D g2d, Object clipBounds, IPointConversion converter) Calculate modifiers identical to addModifiers except use geodesic calculations for the center point.static Shape2
BuildModifierShape
(TGLight tg, POINT2 pt0, POINT2 pt1, int stringWidth, int stringHeight, double lineFactor, boolean isTextFlipped) Returns a Shape object for the text background for labels and modifiersstatic Shape2
createTextOutline
(Shape2 originalText) Creates text outline as a shapestatic void
DisplayModifiers
(TGLight tg, Graphics2D g2d) Deprecated.static void
DisplayModifiers2
(TGLight tg, Graphics2D g2d, ArrayList<Shape2> shapes, boolean isTextFlipped, IPointConversion converter) Displays the modifiers to a Graphics2D from a BufferedImageprotected boolean
Deprecated.POINT2[]
static void
GetIntegralTextShapes
(TGLight tg, Graphics2D g2d, ArrayList<Shape2> shapes) For BOUNDARY and other line types which require breaks for the integral text.static void
Returns symbol MBR.static Shape
getTextShape
(Graphics2D g2d, String str, Font font, AffineTransform tx) Builds a shape object to wrap textstatic void
RemoveModifiers
(TGLight tg, Graphics2D g2d, boolean isTextFlipped, int iteration) removes text modifiers for CPOF tactical areas which do not fit inside the symbol MBRprotected void
set_IsIntegral
(boolean value) Deprecated.protected void
set_TextPath
(POINT2[] value)
-
Method Details
-
get_TextPath
-
set_TextPath
-
set_IsIntegral
Deprecated. -
get_IsIntegral
Deprecated. -
GetMBR
Returns symbol MBR. Assumes points have been initialized with value of 0th point- Parameters:
tg
- the tactical graphic objectptUl
- OUT - MBR upper leftptUr
- OUT - MBR upper rightptLr
- OUT - MBR lower rightptLl
- OUT - MBR lower left
-
RemoveModifiers
public static void RemoveModifiers(TGLight tg, Graphics2D g2d, boolean isTextFlipped, int iteration) removes text modifiers for CPOF tactical areas which do not fit inside the symbol MBR- Parameters:
tg
-g2d
-isTextFlipped
- true if text is flipped from the last segment orientationiteration
- the instance count for this modifier
-
AddModifiersGeo
public static void AddModifiersGeo(TGLight tg, Graphics2D g2d, Object clipBounds, IPointConversion converter) Calculate modifiers identical to addModifiers except use geodesic calculations for the center point.- Parameters:
tg
-g2d
-clipBounds
-converter
-
-
AddModifiers2
Called by the renderer after tg.Pixels has been filled with the calculated points. The modifier path depends on points calculated by CELineArray.- Parameters:
tg
-
-
DisplayModifiers
Deprecated.Displays the tg modifiers using a client Graphics2D, this is an option provided to clients for displaying modifiers without using shapes- Parameters:
tg
- the tactical graphicg2d
- the graphics object for drawing
-
BuildModifierShape
public static Shape2 BuildModifierShape(TGLight tg, POINT2 pt0, POINT2 pt1, int stringWidth, int stringHeight, double lineFactor, boolean isTextFlipped) Returns a Shape object for the text background for labels and modifiers- Parameters:
tg
- the tactical graphic objectpt0
- 1st point of segmentpt1
- last point of segmentstringWidth
- string widthstringHeight
- string heightlineFactor
- number of text lines above or below the segmentisTextFlipped
- true if text is flipped- Returns:
- the modifier shape
-
GetIntegralTextShapes
For BOUNDARY and other line types which require breaks for the integral text. Currently only boundary uses this- Parameters:
tg
-g2d
- the graphics object for drawingshapes
- the shape array
-
DisplayModifiers2
public static void DisplayModifiers2(TGLight tg, Graphics2D g2d, ArrayList<Shape2> shapes, boolean isTextFlipped, IPointConversion converter) Displays the modifiers to a Graphics2D from a BufferedImage- Parameters:
tg
- the tactical graphicg2d
- the Graphic for drawingshapes
- the shape arrayisTextFlipped
- true if text is flippedconverter
- to convert between geographic and pixel coordinates
-
getTextShape
Builds a shape object to wrap text- Parameters:
g2d
- the Graphic object for drawingstr
- text to wrapfont
- the draw fonttx
- the drawing transform, text rotation and translation- Returns:
-
createTextOutline
Creates text outline as a shape- Parameters:
originalText
- the original text- Returns:
- text shape
-