public interface OMGraphic extends OMGeometry, OMGraphicConstants, java.lang.Cloneable
The OMGraphics are raster and vector graphic objects that know how to position and render themselves on a given x-y window or lat-lon map projection. All you have to do is supply the location data (x/y, lat/lon) and drawing information (color, line width) and the graphic handles the rest.
This class contains parameters that are common to most types of graphics. If a parameter doesn't make sense for a particular graphic type, it is ignored.
The OMGraphics are being updated to be able to provide java.awt.Shape representations of themselves after they have been generated(). The getShape() method returns a java.awt.Shape object. With the Shape object, you can do some spatial analysis (object operations) on the projected OMGraphics. NOTES:
OMBitmap
,
OMCircle
,
OMLine
,
OMPoly
,
OMRect
,
OMRaster
,
OMText
,
OMGraphicList
,
Projection
ADD_GRAPHIC_MASK, BASIC_STROKE, CHANGE_APPEARANCE, clear, DECIMAL_DEGREES, DECLUTTERTYPE_LINE, DECLUTTERTYPE_MOVE, DECLUTTERTYPE_NONE, DECLUTTERTYPE_SPACE, DEFAULT_ROTATIONANGLE, DELETE_GRAPHIC_MASK, DESELECT_GRAPHIC_MASK, DESELECTALL_GRAPHIC_MASK, GRAPHICTYPE_ARC, GRAPHICTYPE_BITMAP, GRAPHICTYPE_CIRCLE, GRAPHICTYPE_ELLIPSE, GRAPHICTYPE_GRAPHIC, GRAPHICTYPE_GRID, GRAPHICTYPE_LINE, GRAPHICTYPE_POINT, GRAPHICTYPE_POLY, GRAPHICTYPE_RASTER, GRAPHICTYPE_RECTANGLE, GRAPHICTYPE_TEXT, INFOLINE, LABEL, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, LOWER_GRAPHIC_MASK, LOWER_TO_BOTTOM_GRAPHIC_MASK, OMGRAPHIC_ELT, OMGRAPHIC_TYPE_ATTR, RADIANS, RAISE_GRAPHIC_MASK, RAISE_TO_TOP_GRAPHIC_MASK, REMOVABLE, RENDERTYPE_LATLON, RENDERTYPE_OFFSET, RENDERTYPE_UNKNOWN, RENDERTYPE_XY, SELECT_GRAPHIC_MASK, SORT_GRAPHICS_MASK, TOOLTIP, UPDATE_GRAPHIC_MASK, UPDATED
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
To support clone operations.
|
void |
deselect()
Set the selected attribute to false, sets the color to the line color.
|
int |
getDeclutterType()
Return the declutter type.
|
java.awt.Color |
getDisplayColor()
Return the color that should be used for display.
|
java.awt.Paint |
getDisplayPaint()
Return the Paint that should be used for display.
|
java.awt.Color |
getFillColor()
Return the background color of the graphic object.
|
java.awt.Paint |
getFillPaint()
Return the fill Paint for this graphic.
|
java.awt.Color |
getLineColor()
Return the normal foreground color of the object.
|
java.awt.Paint |
getLinePaint()
Get the normal line Paint used for the graphic.
|
java.awt.Paint |
getMattingPaint()
Get the Paint used for matting.
|
int |
getRenderType()
Return the render type.
|
java.awt.Color |
getSelectColor()
Return the selected color, which is the line or foreground color used
when the graphic is "selected".
|
java.awt.Paint |
getSelectPaint()
Get the normal select Paint used for the graphic.
|
boolean |
getShowEditablePalette()
Get whether an EditableOMGraphic modifying this graphic should show it's
palette.
|
java.awt.Stroke |
getStroke()
Get the Stroke used for the graphic edge.
|
java.awt.TexturePaint |
getTextureMask()
Return the texture mask Paint for this graphic.
|
boolean |
hasLineTypeChoice()
Used by the GraphicAttributes object to provide a choice on whether the
line type choice can be changed.
|
boolean |
isMatted()
Return whether the OMGraphic has matting around the edge.
|
boolean |
isSelected()
Return whether the OMGraphic is selected.
|
float |
normalizeDistanceForLineWidth(float distance)
A function that takes a float distance, which presumably represents the
pixel distance from a point to a graphic, and subtracts half of the line
width of the graphic from the distance if the graphic line width is
greater than one.
|
boolean |
regenerate(Projection proj)
Invoke this to regenerate a "dirty" graphic.
|
void |
renderLabel(java.awt.Graphics g)
Checks to see if a label should be painted based on what methods were
called in generate(), and renders the label if necessary.
|
void |
select()
Set the selected attribute to true, and sets the color to the select
color.
|
void |
setDeclutterType(int value)
Set the declutter setting for the graphic.
|
void |
setFillPaint(java.awt.Paint paint)
Set the fill Paint for this graphic.
|
void |
setGraphicsColor(java.awt.Graphics g,
java.awt.Paint paint)
Set the Paint in the given Graphics.
|
void |
setGraphicsForEdge(java.awt.Graphics g)
Given a java.awt.Graphics object, set the Stroke and Paint parameters of
it to match the OMGraphic's edge settings.
|
void |
setGraphicsForFill(java.awt.Graphics g)
Given a java.awt.Graphics object, set the Paint to be the OMGraphic's
fillPaint setting.
|
void |
setLabelLocation(java.awt.geom.GeneralPath gp)
Sets the label location at the center of the bounding box of the path.
|
void |
setLabelLocation(int[] xpoints,
int[] ypoints)
Sets the label location at the center of the polygon points.
|
void |
setLabelLocation(java.awt.geom.Point2D p)
Sets the label location at the given point.
|
void |
setLinePaint(java.awt.Paint paint)
Set the line Paint.
|
void |
setMatted(boolean set)
Set whether the OMGraphic should have matting around the edge.
|
void |
setMattingPaint(java.awt.Paint mPaint)
Set the Paint used for matting.
|
void |
setRenderType(int value)
Set the render type of the graphic.
|
void |
setSelected(boolean set)
Calls select() or deselect() depending on the boolean (select is true).
|
void |
setSelectPaint(java.awt.Paint paint)
Set the select Paint.
|
void |
setShowEditablePalette(boolean set)
Set whether an EditableOMGraphic modifying this graphic should show it's
palette.
|
void |
setStroke(java.awt.Stroke s)
Set the Stroke that should be used for the graphic edges.
|
void |
setTextureMask(java.awt.TexturePaint texture)
Set the texture mask for the OMGraphic.
|
boolean |
shouldRenderEdge()
Return true if the edge color/paint should be rendered (not clear, or
doesn't match the fill color).
|
boolean |
shouldRenderFill()
Return true of the fill color/paint should be rendered (not clear).
|
clearAttributes, contains, distance, distanceToEdge, draw, draw, fill, fill, generate, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, isVisible, putAttribute, removeAttribute, render, restore, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible
void setRenderType(int value)
value
- the rendertype for the object.int getRenderType()
getRenderType
in interface OMGeometry
void setDeclutterType(int value)
Right now, this is unimplemented in OpenMap. But for information, DECLUTTERTYPE_NONE means the object has no impact on the placement of objects. DECLUTTERTYPE_SPACE means the object shouldn't have things placed on it, but to draw it where the coordinates dictate. DECLUTTERTYPE_MOVE means to put the object in an open space, and DELCUTTERTYPE_LINE adds the feature that if the object is not drawn where it's coordinates say it should be, then a line should be drawn showing where the original position is.
Decluttering of geometries is not supported. This flag is not used.
value
- the declutter type value.int getDeclutterType()
void setGraphicsForEdge(java.awt.Graphics g)
g
- java.awt.GraphicssetGraphicsColor(java.awt.Graphics, java.awt.Paint)
void setGraphicsForFill(java.awt.Graphics g)
g
- java.awt.GraphicssetGraphicsColor(java.awt.Graphics, java.awt.Paint)
void setGraphicsColor(java.awt.Graphics g, java.awt.Paint paint)
g
- java.awt.Graphicspaint
- java.awt.Paintjava.awt.Color getLineColor()
void setLinePaint(java.awt.Paint paint)
selected
boolean attribute is false.paint
- the real line Paintjava.awt.Paint getLinePaint()
java.awt.Color getSelectColor()
void setSelectPaint(java.awt.Paint paint)
selected
boolean attribute is true.paint
- the real select Paintjava.awt.Paint getSelectPaint()
java.awt.Color getDisplayColor()
selected
boolean attribute.java.awt.Paint getDisplayPaint()
selected
boolean attribute.void select()
select
in interface OMGeometry
void deselect()
deselect
in interface OMGeometry
boolean isSelected()
void setSelected(boolean set)
boolean isMatted()
void setMatted(boolean set)
java.awt.Color getFillColor()
void setFillPaint(java.awt.Paint paint)
paint
- the Paint object.void setTextureMask(java.awt.TexturePaint texture)
java.awt.Paint getFillPaint()
java.awt.TexturePaint getTextureMask()
void setMattingPaint(java.awt.Paint mPaint)
java.awt.Paint getMattingPaint()
void setStroke(java.awt.Stroke s)
s
- the stroke to use for the graphic edge.Stroke
,
BasicStroke
java.awt.Stroke getStroke()
void setShowEditablePalette(boolean set)
boolean getShowEditablePalette()
float normalizeDistanceForLineWidth(float distance)
distance
- pixel distance to the graphic edge with a line width of
one.void setLabelLocation(int[] xpoints, int[] ypoints)
xpoints
- ypoints
- void setLabelLocation(java.awt.geom.Point2D p)
p
- void setLabelLocation(java.awt.geom.GeneralPath gp)
gp
- void renderLabel(java.awt.Graphics g)
g
- boolean shouldRenderFill()
boolean shouldRenderEdge()
boolean regenerate(Projection proj)
generate()
method. It invokes
generate()
only if needToRegenerate() on the
graphic returns true. To force a graphic to be generated, call
generate()
directly.regenerate
in interface OMGeometry
proj
- the ProjectionOMGeometry.generate(com.bbn.openmap.proj.Projection)
boolean hasLineTypeChoice()
java.lang.Object clone()
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details