|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSonarGUI
GlobalNavigation.MapGUI
public class MapGUI
Extends LocalNavigation.SonarGUI
to display map-related
data (first read the doc for that class).
New methods (and corresponding ROS messages) have been added to draw rectangles and polygons.
Nested Class Summary | |
---|---|
protected class |
MapGUI.Poly
A visual polygon. |
protected class |
MapGUI.Rect
A visual rectangle. |
Field Summary | |
---|---|
static java.lang.String |
APPNAME
The application name. |
static java.awt.Color |
DEFAULT_POLY_COLOR
Default color for MapGUI.Poly s. |
static java.awt.Color |
DEFAULT_RECT_COLOR
Default color for MapGUI.Rect s. |
static int |
ERASE_POLYS
Bitfield constant for GUIEraseMessage . |
static int |
ERASE_RECTS
Bitfield constant for GUIEraseMessage . |
static float |
POLY_LINE_WIDTH
Line width of the lines making up a MapGUI.Poly in
pixels. |
protected java.awt.Color |
polyColor
The current MapGUI.Poly color. |
protected java.util.Set<MapGUI.Poly> |
polys
All the MapGUI.Poly s. |
protected boolean |
polysEnabled
Whether to paint the polys. |
static float |
RECT_LINE_WIDTH
Line width of the lines making up a MapGUI.Rect in
pixels. |
protected java.awt.Color |
rectColor
The current MapGUI.Rect color. |
protected java.util.Set<MapGUI.Rect> |
rects
All the MapGUI.Rect s. |
protected boolean |
rectsEnabled
Whether to paint the rects. |
Constructor Summary | |
---|---|
MapGUI()
See LocalNavigation.SonarGUI() . |
|
MapGUI(int poseSaveInterval)
See LocalNavigation.SonarGUI(int) . |
|
MapGUI(int poseSaveInterval,
double maxTV,
double maxRV)
Consruct a new MapGUI. |
Method Summary | |
---|---|
void |
addPoly(java.util.List<java.awt.geom.Point2D.Double> vertices,
boolean closed,
boolean filled,
java.awt.Color color)
Add a polygon for display. |
void |
addRect(double x,
double y,
double width,
double height,
boolean filled,
java.awt.Color color)
Add a rect for display. |
void |
addRect(java.awt.geom.Rectangle2D.Double r,
boolean filled,
java.awt.Color color)
Add a rect for display. |
void |
erasePolys()
Erase all previously polys. |
void |
eraseRects()
Erase all previously plotted rects. |
java.lang.String |
getAppName()
|
void |
onStart(Node node)
Hook called by ROS to start the gui |
protected void |
paintInWorldOverGridUnderPosesHook(java.awt.Graphics2D g2d)
|
protected void |
paintPolys(java.awt.Graphics2D g2d)
Paint all polys . |
protected void |
paintRects(java.awt.Graphics2D g2d)
Paint all rects . |
void |
testGraphicsHook()
|
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 APPNAME
The application name.
public static final int ERASE_RECTS
Bitfield constant for GUIEraseMessage
.
public static final int ERASE_POLYS
Bitfield constant for GUIEraseMessage
.
public static final float RECT_LINE_WIDTH
Line width of the lines making up a MapGUI.Rect
in
pixels.
public static final float POLY_LINE_WIDTH
Line width of the lines making up a MapGUI.Poly
in
pixels.
public static final java.awt.Color DEFAULT_RECT_COLOR
Default color for MapGUI.Rect
s.
public static final java.awt.Color DEFAULT_POLY_COLOR
Default color for MapGUI.Poly
s.
protected boolean rectsEnabled
Whether to paint the rects.
protected boolean polysEnabled
Whether to paint the polys.
protected java.awt.Color rectColor
The current MapGUI.Rect
color.
protected java.awt.Color polyColor
The current MapGUI.Poly
color.
protected java.util.Set<MapGUI.Rect> rects
All the MapGUI.Rect
s.
protected java.util.Set<MapGUI.Poly> polys
All the MapGUI.Poly
s.
Constructor Detail |
---|
public MapGUI(int poseSaveInterval, double maxTV, double maxRV)
Consruct a new MapGUI.
See LocalNavigation.SonarGUI(int, double, double)
.
public MapGUI(int poseSaveInterval)
See LocalNavigation.SonarGUI(int)
.
public MapGUI()
See LocalNavigation.SonarGUI()
.
Method Detail |
---|
public java.lang.String getAppName()
Default impl returns APPNAME
.
public void addRect(double x, double y, double width, double height, boolean filled, java.awt.Color color)
Add a rect for display.
x
- the llc x coord in world frame (m)y
- the llc y coord in world frame (m)width
- the width in world frame (m)height
- the height in world frame (m)filled
- whether to fill the rectcolor
- the rect color or null to use currentpublic void addRect(java.awt.geom.Rectangle2D.Double r, boolean filled, java.awt.Color color)
Add a rect for display.
r
- the rectfilled
- whether to fill the rectcolor
- the rect color or null to use currentpublic void addPoly(java.util.List<java.awt.geom.Point2D.Double> vertices, boolean closed, boolean filled, java.awt.Color color)
Add a polygon for display.
vertices
- the vertices in ccw orderclosed
- whether to close the polyfilled
- whether to fill the polycolor
- the poly color or null to use currentpublic void eraseRects()
Erase all previously plotted rects.
public void erasePolys()
Erase all previously polys.
protected void paintInWorldOverGridUnderPosesHook(java.awt.Graphics2D g2d)
This impl paintRects(java.awt.Graphics2D)
, paintPolys(java.awt.Graphics2D)
, iff each is
enabled.
protected void paintRects(java.awt.Graphics2D g2d)
Paint all rects
.
g2d
- the graphics contextprotected void paintPolys(java.awt.Graphics2D g2d)
Paint all polys
.
g2d
- the graphics contextpublic void onStart(Node node)
public void testGraphicsHook() throws java.lang.InterruptedException
This impl tests the map graphics.
java.lang.InterruptedException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |