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, _image
Fields inherited from class hec.map.MapGlyph
_changeEvent, _glyphLevel, _listenerList, _map, _mapIdentifier, _mapPanel, _paintOk, _parentGlyph, maxPtArraySz, needsRepaint, xarray, XOR_COLOR, yarray
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a feature to the ChangeListener attribute of the MapGlyph objectvoid
Adds a feature to the GlyphSelectionListener attribute of the MapGlyph objectvoid
This is called when a series of adjustments are finished.void
adjustImage
(DragPoint dragPoint, Point PT0, Point PT1) void
clear the selection of the MapGlyphvoid
clearSelection
(String name) remove the Selection with the name name from the selection listvoid
close()
called when the Glyph is no longer held by the MapPanelint
boolean
containsSelection
(Object object) void
draw this MapGlyph to graphics using the MapScale sclvoid
drawConformingString
(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 linevoid
drawConformingString2
(Graphics g, MapScale scl, WorldLine line, String str, double coord, Font font, Color color, int bank) Draw string that follows the linevoid
drawLine
(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor) void
drawLine
(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize) draw the line on the map.void
drawLine
(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize, boolean isXOR) void
drawLine
(Graphics g, WorldLine line, MapScale scl, double halfwidth, Color fillColor, Color outlineColor, boolean drawPoints, Color pointColor, int halfPointSize, boolean isXOR, float alpha) void
drawLine2D
(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 2dvoid
drawRegion
(Graphics g, MapScale scl, WorldRegion region, boolean drawPts, Color outline, Color fill) void
fillMap
(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 objectfloat
protected ImageGlyphDataRecord
getMap()
Gets the MapObjectInterface that this MapGlyph is drawingGets the MapPanel of the MapGlyph objectint
int
getName()
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 MapGlyphsboolean
get whether this glyph contains child glyphsboolean
hasMap()
return whether the MapGlyph has a MapObjectInterfaceboolean
imageUpdate
(Image img, int infoflags, int x, int y, int width, int height) boolean
intersects
(Graphics2D graphics, MapScale scl, int[] xarray, int[] yarray, int numpts) return whether the line intersects with the scaleboolean
boolean
Gets the AttributeAvailable attribute of the MapGlyph objectboolean
isShown()
Gets whether this MapGlyph is currently drawn in the MapPanelboolean
does the Application hold the write lock for this glyph databoolean
objectDoubleClick
(LocalPt pt, int modifiers) called when the user double clicks on the MapPanel.boolean
objectPopupMenu
(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.void
retmove the ChangeListener cl from the _listenerListvoid
remove the GlyphSelectionListener msl from the _listenerListvoid
protected void
scaleTransform
(AffineTransform af, MapScale scl) void
setAdjustmentEnabled
(boolean b) void
Sets the DataRecord of the MapGlyph's MapIdentifiervoid
setGlyphLevel
(float glyphLevel) void
setMap
(MapObjectInterface map) Sets the MapObjectInterface of the MapGlyph objectvoid
setMapPanel
(MapPanel panel) Sets the MapPanel of the MapGlyph objectvoid
setMaximumScale
(int maxScale) void
setMinimumScale
(int minScale) void
setParentGlyph
(MapGlyph glyph) void
setShown
(boolean shown) Sets whether this MapGlyph will draw in the MapPanelvoid
showMapElement
(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, drawFileName
Methods 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:ImageGlyph
This 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:
adjustFinished
in interfaceIImageGlyph
- Overrides:
adjustFinished
in classImageGlyph
-
adjustImage
- Specified by:
adjustImage
in interfaceIImageGlyph
- Overrides:
adjustImage
in classImageGlyph
-
getDragPoints
- Specified by:
getDragPoints
in interfaceIImageGlyph
- Overrides:
getDragPoints
in classImageGlyph
-
imageUpdate
- Specified by:
imageUpdate
in interfaceImageObserver
- Overrides:
imageUpdate
in classImageGlyph
-
getImageGlyphDataRecord
- Overrides:
getImageGlyphDataRecord
in classImageGlyph
-
compareTo
- Specified by:
compareTo
in interfaceComparable<MapGlyph>
- Overrides:
compareTo
in classMapGlyph
-
getParentGlyph
- Overrides:
getParentGlyph
in classMapGlyph
-
setParentGlyph
- Overrides:
setParentGlyph
in classMapGlyph
-
saveImageCoordinates
public void saveImageCoordinates()- Specified by:
saveImageCoordinates
in interfaceIImageGlyph
- Overrides:
saveImageCoordinates
in classImageGlyph
-
scaleTransform
- Overrides:
scaleTransform
in classImageGlyph
-
addChangeListener
Description copied from class:MapGlyph
Adds a feature to the ChangeListener attribute of the MapGlyph object- Overrides:
addChangeListener
in classMapGlyph
- Parameters:
cl
- The feature to be added to the ChangeListener attribute
-
addGlyphSelectionListener
Description copied from class:MapGlyph
Adds a feature to the GlyphSelectionListener attribute of the MapGlyph object- Overrides:
addGlyphSelectionListener
in classMapGlyph
- Parameters:
msl
- The feature to be added to the GlyphSelectionListener attribute
-
clearSelection
public void clearSelection()Description copied from class:MapGlyph
clear the selection of the MapGlyph- Overrides:
clearSelection
in classMapGlyph
-
clearSelection
Description copied from class:MapGlyph
remove the Selection with the name name from the selection list- Overrides:
clearSelection
in classMapGlyph
- Parameters:
name
- the name of the object to remove
-
close
public void close()Description copied from class:MapGlyph
called when the Glyph is no longer held by the MapPanel -
containsSelection
- Overrides:
containsSelection
in 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:MapGlyph
Draw string rotated to best fit location on a line- Overrides:
drawConformingString
in 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:MapGlyph
Draw string that follows the line- Overrides:
drawConformingString2
in 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:MapGlyph
draw 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:MapGlyph
draw the line using graphics 2d- Overrides:
drawLine2D
in classMapGlyph
-
drawRegion
public void drawRegion(Graphics g, MapScale scl, WorldRegion region, boolean drawPts, Color outline, Color fill) - Overrides:
drawRegion
in classMapGlyph
-
fillMap
public void fillMap(boolean load) Description copied from class:MapGlyph
have the _map load or unload its data.- Overrides:
fillMap
in classImageGlyph
- Parameters:
load
- true if _map is load it's data
-
findGlyphOfClass
Description copied from class:MapGlyph
finds the MapGlyph of type classname in the list of child MapGlyphs- Overrides:
findGlyphOfClass
in classMapGlyph
- Parameters:
classname
- the classname of the child MapGlyphs- Returns:
- the child MapGlyph with the class of classname
-
findObject
Description copied from class:MapGlyph
find the NamedType object held by this MapGlyph that resides as LocalPt pt.- Overrides:
findObject
in classMapGlyph
- Parameters:
pt
- the LocalPt to find an Object at- Returns:
- the NamedType Object at pt.
-
getAttributeSet
Description copied from class:MapGlyph
Gets the AttributeSet of the MapGlyph object- Overrides:
getAttributeSet
in classMapGlyph
- Returns:
- The AttributeSet value
-
getBounds
Description copied from class:MapGlyph
Gets the Bounds of the MapGlyph object- Specified by:
getBounds
in interfaceIImageGlyph
- Overrides:
getBounds
in classMapGlyph
- Returns:
- The Bounds value
-
getDataRecord
Description copied from class:MapGlyph
Gets the DataRecord of the MapGlyph's MapIdentifier object- Overrides:
getDataRecord
in classMapGlyph
- Returns:
- The DataRecord value
-
getDefaultDataRecord
Description copied from class:MapGlyph
Gets the DefaultDataRecord of the MapGlyph object- Overrides:
getDefaultDataRecord
in classImageGlyph
- Returns:
- null unless overridden to return something else
-
getGlyphLevel
public float getGlyphLevel()- Overrides:
getGlyphLevel
in classMapGlyph
-
getMap
Description copied from class:MapGlyph
Gets the MapObjectInterface that this MapGlyph is drawing- Specified by:
getMap
in interfaceIImageGlyph
- Overrides:
getMap
in classMapGlyph
- Returns:
- The Map value
-
getMapPanel
Description copied from class:MapGlyph
Gets the MapPanel of the MapGlyph object- Specified by:
getMapPanel
in interfaceIImageGlyph
- Overrides:
getMapPanel
in classMapGlyph
- Returns:
- The MapPanel value
-
getMaximumScale
public int getMaximumScale()- Specified by:
getMaximumScale
in interfaceIImageGlyph
- Overrides:
getMaximumScale
in classMapGlyph
-
getMinimumScale
public int getMinimumScale()- Specified by:
getMinimumScale
in interfaceIImageGlyph
- Overrides:
getMinimumScale
in classMapGlyph
-
getName
Description copied from class:MapGlyph
Gets the Name of the MapGlyph object -
getSelectedObject
Description copied from class:MapGlyph
override to return the selected glyph object- Overrides:
getSelectedObject
in classMapGlyph
- Returns:
- The Selected Object
-
getSelections
Description copied from class:MapGlyph
override to return more than a wrapper around getSelectedObject()- Overrides:
getSelections
in classMapGlyph
- Returns:
- the first selected object.
-
getToolTipText
Description copied from class:MapGlyph
Gets the ToolTipText of the MapGlyph object- Overrides:
getToolTipText
in classMapGlyph
- Parameters:
wpt
- the WorldPt location of the mouse cursore
- the MouseEvent- Returns:
- The ToolTipText at wpt
-
glyphVector
Description copied from class:MapGlyph
get the MapGlyph's list of child MapGlyphs- Overrides:
glyphVector
in classMapGlyph
- Returns:
- the Vector of child MapGlyphs
-
hasChildGlyphs
public boolean hasChildGlyphs()Description copied from class:MapGlyph
get whether this glyph contains child glyphs- Overrides:
hasChildGlyphs
in classMapGlyph
- Returns:
- true if the MapGlyph holds child MapGlyphs
-
hasMap
public boolean hasMap()Description copied from class:MapGlyph
return whether the MapGlyph has a MapObjectInterface -
intersects
public boolean intersects(Graphics2D graphics, MapScale scl, int[] xarray, int[] yarray, int numpts) Description copied from class:MapGlyph
return whether the line intersects with the scale- Overrides:
intersects
in classMapGlyph
scl
- the MapScale- Returns:
- true if any of the point in the line intersect with the current scale
-
isAttributeAvailable
Description copied from class:MapGlyph
Gets the AttributeAvailable attribute of the MapGlyph object- Overrides:
isAttributeAvailable
in classMapGlyph
- Parameters:
s
- Description- Returns:
- The AttributeAvailable value
-
isShown
public boolean isShown()Description copied from class:MapGlyph
Gets whether this MapGlyph is currently drawn in the MapPanel -
isWriteLocked
public boolean isWriteLocked()Description copied from class:MapGlyph
does the Application hold the write lock for this glyph data- Overrides:
isWriteLocked
in classMapGlyph
- Returns:
- true if the Application holds the write lock for this glyph's data
-
objectDoubleClick
Description copied from class:MapGlyph
called 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:
objectDoubleClick
in 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:MapGlyph
called 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:
objectPopupMenu
in 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:MapGlyph
called 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:
objectSelect
in 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:MapGlyph
retmove the ChangeListener cl from the _listenerList- Overrides:
removeChangeListener
in classMapGlyph
- Parameters:
cl
- Description
-
removeGlyphSelectionListener
Description copied from class:MapGlyph
remove the GlyphSelectionListener msl from the _listenerList- Overrides:
removeGlyphSelectionListener
in classMapGlyph
- Parameters:
msl
- the GlyphSelectionListener to remove
-
setDataRecord
Description copied from class:MapGlyph
Sets the DataRecord of the MapGlyph's MapIdentifier- Overrides:
setDataRecord
in classMapGlyph
- Parameters:
rec
- The new DataRecord value
-
setGlyphLevel
public void setGlyphLevel(float glyphLevel) - Overrides:
setGlyphLevel
in classMapGlyph
-
setMap
Description copied from class:MapGlyph
Sets the MapObjectInterface of the MapGlyph object -
setMapPanel
Description copied from class:MapGlyph
Sets the MapPanel of the MapGlyph object- Overrides:
setMapPanel
in classMapGlyph
- Parameters:
panel
- The new MapPanel value
-
setMaximumScale
public void setMaximumScale(int maxScale) - Specified by:
setMaximumScale
in interfaceIImageGlyph
- Overrides:
setMaximumScale
in classMapGlyph
-
setMinimumScale
public void setMinimumScale(int minScale) - Specified by:
setMinimumScale
in interfaceIImageGlyph
- Overrides:
setMinimumScale
in classMapGlyph
-
setShown
public void setShown(boolean shown) Description copied from class:MapGlyph
Sets whether this MapGlyph will draw in the MapPanel -
showMapElement
Description copied from class:MapGlyph
show or hide the Map Element glyphElement. This base class handled thehec.map.ModelDrawingAttributeSet.SHOWN
flag- Overrides:
showMapElement
in classMapGlyph
- Parameters:
glyphName
- the name of the MapGlyph or child MapGlyphsglyphElement
- the Map Element toshow
- true to show glyphElement
-
toString
Description copied from class:MapGlyph
return's the string representation of this MapGlyph. By Default it's the name of the _map's MapIdentifier -
draw
Description copied from class:MapGlyph
draw this MapGlyph to graphics using the MapScale scl- Overrides:
draw
in classImageGlyph
- Parameters:
graphics
- the Graphics to draw toscl
- The current MapScale
-
isAdjustmentEnabled
public boolean isAdjustmentEnabled()- Specified by:
isAdjustmentEnabled
in interfaceIImageGlyph
- Overrides:
isAdjustmentEnabled
in classImageGlyph
-
setAdjustmentEnabled
public void setAdjustmentEnabled(boolean b) - Specified by:
setAdjustmentEnabled
in interfaceIImageGlyph
- Overrides:
setAdjustmentEnabled
in classImageGlyph
-