Package hec.map.image
Class ImageGlyphProxy
java.lang.Object
hec.map.MapGlyph
hec.map.image.ImageGlyph
hec.map.image.ImageGlyphProxy
- All Implemented Interfaces:
IImageGlyph,ImageObserver,Comparable<MapGlyph>
-
Nested Class Summary
Nested classes/interfaces inherited from class hec.map.MapGlyph
MapGlyph.Selection -
Field Summary
Fields inherited from class hec.map.image.ImageGlyph
_adjustmentEnabled, _imageFields inherited from class hec.map.MapGlyph
_changeEvent, _glyphLevel, _listenerList, _map, _mapIdentifier, _mapPanel, _paintOk, _parentGlyph, maxPtArraySz, needsRepaint, xarray, XOR_COLOR, yarrayFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a feature to the ChangeListener attribute of the MapGlyph objectvoidAdds a feature to the GlyphSelectionListener attribute of the MapGlyph objectvoidThis is called when a series of adjustments are finished.voidadjustImage(DragPoint dragPoint, Point PT0, Point PT1) voidclear the selection of the MapGlyphvoidclearSelection(String name) remove the Selection with the name name from the selection listvoidclose()called when the Glyph is no longer held by the MapPanelintbooleancontainsSelection(Object object) voiddraw this MapGlyph to graphics using the MapScale sclvoiddrawConformingString(Graphics g, MapScale scl, WorldLine line, String str, double coord, int baseoffset, Font font, Color color, int bank, float priority) Draw string rotated to best fit location on a linevoiddrawConformingString2(Graphics g, MapScale scl, WorldLine line, String str, double coord, Font font, Color color, int bank) Draw string that follows the linevoiddrawLine(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor) voiddrawLine(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize) draw the line on the map.voiddrawLine(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize, boolean isXOR) voiddrawLine(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize, boolean isXOR, float alpha) voiddrawLine2D(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize, boolean isXOR) draw the line using graphics 2dvoiddrawRegion(Graphics g, MapScale scl, WorldRegion region, boolean drawPts, Color outline, Color fill) voidfillMap(boolean load) have the _map load or unload its data.findGlyphOfClass(String classname) finds the MapGlyph of type classname in the list of child MapGlyphsfindObject(LocalPt pt) find the NamedType object held by this MapGlyph that resides as LocalPt pt.Gets the AttributeSet of the MapGlyph objectGets the Bounds of the MapGlyph objectGets the DataRecord of the MapGlyph's MapIdentifier objectGets the DefaultDataRecord of the MapGlyph objectfloatprotected ImageGlyphDataRecordgetMap()Gets the MapObjectInterface that this MapGlyph is drawingGets the MapPanel of the MapGlyph objectintintgetName()Gets the Name of the MapGlyph objectoverride to return the selected glyph objectoverride to return more than a wrapper around getSelectedObject()getToolTipText(WorldPt wpt, MouseEvent e) Gets the ToolTipText of the MapGlyph objectget the MapGlyph's list of child MapGlyphsbooleanget whether this glyph contains child glyphsbooleanhasMap()return whether the MapGlyph has a MapObjectInterfacebooleanimageUpdate(Image img, int infoflags, int x, int y, int width, int height) booleanintersects(Graphics2D graphics, MapScale scl, int[] xarray, int[] yarray, int numpts) return whether the line intersects with the scalebooleanbooleanGets the AttributeAvailable attribute of the MapGlyph objectbooleanisShown()Gets whether this MapGlyph is currently drawn in the MapPanelbooleandoes the Application hold the write lock for this glyph databooleanobjectDoubleClick(LocalPt pt, int modifiers) called when the user double clicks on the MapPanel.booleanobjectPopupMenu(LocalPt pt, int modifiers) called when the user right clicks on the map panel.objectSelect(LocalPt pt, int modifiers) called when the user single clicks on the MapPanel.voidretmove the ChangeListener cl from the _listenerListvoidremove the GlyphSelectionListener msl from the _listenerListvoidprotected voidscaleTransform(AffineTransform af, MapScale scl) voidsetAdjustmentEnabled(boolean b) voidSets the DataRecord of the MapGlyph's MapIdentifiervoidsetGlyphLevel(float glyphLevel) voidsetMap(MapObjectInterface map) Sets the MapObjectInterface of the MapGlyph objectvoidsetMapPanel(MapPanel panel) Sets the MapPanel of the MapGlyph objectvoidsetMaximumScale(int maxScale) voidsetMinimumScale(int minScale) voidsetParentGlyph(MapGlyph glyph) voidsetShown(boolean shown) Sets whether this MapGlyph will draw in the MapPanelvoidshowMapElement(String glyphName, String glyphElement, boolean show) show or hide the Map Element glyphElement.toString()return's the string representation of this MapGlyph.Methods inherited from class hec.map.image.ImageGlyph
drawBorder, drawDragPoints, drawFileNameMethods inherited from class hec.map.MapGlyph
checkXYArraySize, drawRegion, fireGlyphSelectionChanged, fireStateChanged, getDescription, init, isAltDown, isControlDown, isMetaDown, isPaintOk, isRepaintNeeded, isShiftDown, reInit, setPaintOk, setRepaintNeeded, shouldReturn, transformArrays, transformLocalToWorldArrays, transformLookup, transformPoint, transformPointToLocal, transformPointToWorld, transformRect, transformRect, transformRectToLocal, transformWorldToLocalArrays
-
Constructor Details
-
ImageGlyphProxy
public ImageGlyphProxy() -
ImageGlyphProxy
-
-
Method Details
-
adjustFinished
public void adjustFinished()Description copied from class:ImageGlyphThis is called when a series of adjustments are finished. This allows the glyph to hold off on the expensive paints until elements that are calling "adjustImage()" are done with their work.- Specified by:
adjustFinishedin interfaceIImageGlyph- Overrides:
adjustFinishedin classImageGlyph
-
adjustImage
- Specified by:
adjustImagein interfaceIImageGlyph- Overrides:
adjustImagein classImageGlyph
-
getDragPoints
- Specified by:
getDragPointsin interfaceIImageGlyph- Overrides:
getDragPointsin classImageGlyph
-
imageUpdate
- Specified by:
imageUpdatein interfaceImageObserver- Overrides:
imageUpdatein classImageGlyph
-
getImageGlyphDataRecord
- Overrides:
getImageGlyphDataRecordin classImageGlyph
-
compareTo
- Specified by:
compareToin interfaceComparable<MapGlyph>- Overrides:
compareToin classMapGlyph
-
getParentGlyph
- Overrides:
getParentGlyphin classMapGlyph
-
setParentGlyph
- Overrides:
setParentGlyphin classMapGlyph
-
saveImageCoordinates
public void saveImageCoordinates()- Specified by:
saveImageCoordinatesin interfaceIImageGlyph- Overrides:
saveImageCoordinatesin classImageGlyph
-
scaleTransform
- Overrides:
scaleTransformin classImageGlyph
-
addChangeListener
Description copied from class:MapGlyphAdds a feature to the ChangeListener attribute of the MapGlyph object- Overrides:
addChangeListenerin classMapGlyph- Parameters:
cl- The feature to be added to the ChangeListener attribute
-
addGlyphSelectionListener
Description copied from class:MapGlyphAdds a feature to the GlyphSelectionListener attribute of the MapGlyph object- Overrides:
addGlyphSelectionListenerin classMapGlyph- Parameters:
msl- The feature to be added to the GlyphSelectionListener attribute
-
clearSelection
public void clearSelection()Description copied from class:MapGlyphclear the selection of the MapGlyph- Overrides:
clearSelectionin classMapGlyph
-
clearSelection
Description copied from class:MapGlyphremove the Selection with the name name from the selection list- Overrides:
clearSelectionin classMapGlyph- Parameters:
name- the name of the object to remove
-
close
public void close()Description copied from class:MapGlyphcalled when the Glyph is no longer held by the MapPanel -
containsSelection
- Overrides:
containsSelectionin classMapGlyph
-
drawConformingString
public void drawConformingString(Graphics g, MapScale scl, WorldLine line, String str, double coord, int baseoffset, Font font, Color color, int bank, float priority) Description copied from class:MapGlyphDraw string rotated to best fit location on a line- Overrides:
drawConformingStringin classMapGlyph- Parameters:
g- the Graphics to draw toscl- the Current MapScaleline- the line to fit the string tostr- the string to drawcoord- the location relative to the line to draw.baseoffset- the offset from line to draw strfont- the Font to render str withcolor- the foreground color to render str withbank- the side of line to draw the string onpriority- the Priority to give to this string. -1 means to always draw.- See Also:
-
drawConformingString2
public void drawConformingString2(Graphics g, MapScale scl, WorldLine line, String str, double coord, Font font, Color color, int bank) Description copied from class:MapGlyphDraw string that follows the line- Overrides:
drawConformingString2in classMapGlyph- Parameters:
g- the Graphics to draw toscl- the Current MapScaleline- the line to fit the string tostr- the string to drawcoord- the location relative to the line to draw.font- the Font to render str withcolor- the foreground color to render str withbank- the side of line to draw the string on- See Also:
-
drawLine
-
drawLine
public void drawLine(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize) Description copied from class:MapGlyphdraw the line on the map. This will draw the line in chunks if the line is too large. If the outline color is specified, and the line gets drawn in segments where the segments meet there will be a line between them. -
drawLine
-
drawLine
-
drawLine2D
public void drawLine2D(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize, boolean isXOR) Description copied from class:MapGlyphdraw the line using graphics 2d- Overrides:
drawLine2Din classMapGlyph
-
drawRegion
public void drawRegion(Graphics g, MapScale scl, WorldRegion region, boolean drawPts, Color outline, Color fill) - Overrides:
drawRegionin classMapGlyph
-
fillMap
public void fillMap(boolean load) Description copied from class:MapGlyphhave the _map load or unload its data.- Overrides:
fillMapin classImageGlyph- Parameters:
load- true if _map is load it's data
-
findGlyphOfClass
Description copied from class:MapGlyphfinds the MapGlyph of type classname in the list of child MapGlyphs- Overrides:
findGlyphOfClassin classMapGlyph- Parameters:
classname- the classname of the child MapGlyphs- Returns:
- the child MapGlyph with the class of classname
-
findObject
Description copied from class:MapGlyphfind the NamedType object held by this MapGlyph that resides as LocalPt pt.- Overrides:
findObjectin classMapGlyph- Parameters:
pt- the LocalPt to find an Object at- Returns:
- the NamedType Object at pt.
-
getAttributeSet
Description copied from class:MapGlyphGets the AttributeSet of the MapGlyph object- Overrides:
getAttributeSetin classMapGlyph- Returns:
- The AttributeSet value
-
getBounds
Description copied from class:MapGlyphGets the Bounds of the MapGlyph object- Specified by:
getBoundsin interfaceIImageGlyph- Overrides:
getBoundsin classMapGlyph- Returns:
- The Bounds value
-
getDataRecord
Description copied from class:MapGlyphGets the DataRecord of the MapGlyph's MapIdentifier object- Overrides:
getDataRecordin classMapGlyph- Returns:
- The DataRecord value
-
getDefaultDataRecord
Description copied from class:MapGlyphGets the DefaultDataRecord of the MapGlyph object- Overrides:
getDefaultDataRecordin classImageGlyph- Returns:
- null unless overridden to return something else
-
getGlyphLevel
public float getGlyphLevel()- Overrides:
getGlyphLevelin classMapGlyph
-
getMap
Description copied from class:MapGlyphGets the MapObjectInterface that this MapGlyph is drawing- Specified by:
getMapin interfaceIImageGlyph- Overrides:
getMapin classMapGlyph- Returns:
- The Map value
-
getMapPanel
Description copied from class:MapGlyphGets the MapPanel of the MapGlyph object- Specified by:
getMapPanelin interfaceIImageGlyph- Overrides:
getMapPanelin classMapGlyph- Returns:
- The MapPanel value
-
getMaximumScale
public int getMaximumScale()- Specified by:
getMaximumScalein interfaceIImageGlyph- Overrides:
getMaximumScalein classMapGlyph
-
getMinimumScale
public int getMinimumScale()- Specified by:
getMinimumScalein interfaceIImageGlyph- Overrides:
getMinimumScalein classMapGlyph
-
getName
Description copied from class:MapGlyphGets the Name of the MapGlyph object -
getSelectedObject
Description copied from class:MapGlyphoverride to return the selected glyph object- Overrides:
getSelectedObjectin classMapGlyph- Returns:
- The Selected Object
-
getSelections
Description copied from class:MapGlyphoverride to return more than a wrapper around getSelectedObject()- Overrides:
getSelectionsin classMapGlyph- Returns:
- the first selected object.
-
getToolTipText
Description copied from class:MapGlyphGets the ToolTipText of the MapGlyph object- Overrides:
getToolTipTextin classMapGlyph- Parameters:
wpt- the WorldPt location of the mouse cursore- the MouseEvent- Returns:
- The ToolTipText at wpt
-
glyphVector
Description copied from class:MapGlyphget the MapGlyph's list of child MapGlyphs- Overrides:
glyphVectorin classMapGlyph- Returns:
- the Vector of child MapGlyphs
-
hasChildGlyphs
public boolean hasChildGlyphs()Description copied from class:MapGlyphget whether this glyph contains child glyphs- Overrides:
hasChildGlyphsin classMapGlyph- Returns:
- true if the MapGlyph holds child MapGlyphs
-
hasMap
public boolean hasMap()Description copied from class:MapGlyphreturn whether the MapGlyph has a MapObjectInterface -
intersects
public boolean intersects(Graphics2D graphics, MapScale scl, int[] xarray, int[] yarray, int numpts) Description copied from class:MapGlyphreturn whether the line intersects with the scale- Overrides:
intersectsin classMapGlyphscl- the MapScale- Returns:
- true if any of the point in the line intersect with the current scale
-
isAttributeAvailable
Description copied from class:MapGlyphGets the AttributeAvailable attribute of the MapGlyph object- Overrides:
isAttributeAvailablein classMapGlyph- Parameters:
s- Description- Returns:
- The AttributeAvailable value
-
isShown
public boolean isShown()Description copied from class:MapGlyphGets whether this MapGlyph is currently drawn in the MapPanel -
isWriteLocked
public boolean isWriteLocked()Description copied from class:MapGlyphdoes the Application hold the write lock for this glyph data- Overrides:
isWriteLockedin classMapGlyph- Returns:
- true if the Application holds the write lock for this glyph's data
-
objectDoubleClick
Description copied from class:MapGlyphcalled when the user double clicks on the MapPanel. If the MapGlyph can process the event successfully then it should return true. Otherwise the MapPanel will pass the event to the next MapGlyph.- Overrides:
objectDoubleClickin classMapGlyph- Parameters:
pt- the location that the right click took placemodifiers- the MouseEvent Modifiers. Useful to see if the Shift/Control/Alt keys were pressed- Returns:
- true if the MapGlyph has handled this event. this class always returns false
-
objectPopupMenu
Description copied from class:MapGlyphcalled when the user right clicks on the map panel. If the MapGlyph can process the event successfully then it should return true. Otherwise the MapPanel will pass the event to the next MapGlyph.- Overrides:
objectPopupMenuin classMapGlyph- Parameters:
pt- the location that the right click took placemodifiers- the MouseEvent Modifiers. Useful to see if the Shift/Control/Alt keys were pressed- Returns:
- true if the MapGlyph has handled this event. this class always returns false
-
objectSelect
Description copied from class:MapGlyphcalled when the user single clicks on the MapPanel. If the MapGlyph can process the event successfully then it should return true. Otherwise the MapPanel will pass the event to the next MapGlyph.- Overrides:
objectSelectin classMapGlyph- Parameters:
pt- the location that the single click took placemodifiers- the MouseEvent Modifiers. Useful to see if the Shift/Control/Alt keys were pressed- Returns:
- The object at pt. this class always returns false
-
removeChangeListener
Description copied from class:MapGlyphretmove the ChangeListener cl from the _listenerList- Overrides:
removeChangeListenerin classMapGlyph- Parameters:
cl- Description
-
removeGlyphSelectionListener
Description copied from class:MapGlyphremove the GlyphSelectionListener msl from the _listenerList- Overrides:
removeGlyphSelectionListenerin classMapGlyph- Parameters:
msl- the GlyphSelectionListener to remove
-
setDataRecord
Description copied from class:MapGlyphSets the DataRecord of the MapGlyph's MapIdentifier- Overrides:
setDataRecordin classMapGlyph- Parameters:
rec- The new DataRecord value
-
setGlyphLevel
public void setGlyphLevel(float glyphLevel) - Overrides:
setGlyphLevelin classMapGlyph
-
setMap
Description copied from class:MapGlyphSets the MapObjectInterface of the MapGlyph object -
setMapPanel
Description copied from class:MapGlyphSets the MapPanel of the MapGlyph object- Overrides:
setMapPanelin classMapGlyph- Parameters:
panel- The new MapPanel value
-
setMaximumScale
public void setMaximumScale(int maxScale) - Specified by:
setMaximumScalein interfaceIImageGlyph- Overrides:
setMaximumScalein classMapGlyph
-
setMinimumScale
public void setMinimumScale(int minScale) - Specified by:
setMinimumScalein interfaceIImageGlyph- Overrides:
setMinimumScalein classMapGlyph
-
setShown
public void setShown(boolean shown) Description copied from class:MapGlyphSets whether this MapGlyph will draw in the MapPanel -
showMapElement
Description copied from class:MapGlyphshow or hide the Map Element glyphElement. This base class handled thehec.map.ModelDrawingAttributeSet.SHOWNflag- Overrides:
showMapElementin classMapGlyph- Parameters:
glyphName- the name of the MapGlyph or child MapGlyphsglyphElement- the Map Element toshow- true to show glyphElement
-
toString
Description copied from class:MapGlyphreturn's the string representation of this MapGlyph. By Default it's the name of the _map's MapIdentifier -
draw
Description copied from class:MapGlyphdraw this MapGlyph to graphics using the MapScale scl- Overrides:
drawin classImageGlyph- Parameters:
graphics- the Graphics to draw toscl- The current MapScale
-
isAdjustmentEnabled
public boolean isAdjustmentEnabled()- Specified by:
isAdjustmentEnabledin interfaceIImageGlyph- Overrides:
isAdjustmentEnabledin classImageGlyph
-
setAdjustmentEnabled
public void setAdjustmentEnabled(boolean b) - Specified by:
setAdjustmentEnabledin interfaceIImageGlyph- Overrides:
setAdjustmentEnabledin classImageGlyph
-