Package hec.clientapp.model
Class StreamAlignment
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.clientapp.model.Manager
hec.clientapp.model.StreamAlignment
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,LockableObject,hec.map.MapObjectInterface,hec.map.streamAlignment.StreamAlignmentIfc,hec.map.streamAlignment.StreamAlignmentNodeIfc,MessagePrinter,TsRecordContainer,Serializable,Cloneable,Comparable,Observer,mil.army.usace.hec.rmi.csinterface.CallBackInterface,rma.lang.Modifiable
public class StreamAlignment
extends Manager
implements hec.map.MapObjectInterface, hec.map.streamAlignment.StreamAlignmentIfc
Stream coordinate system for model discretizations.
- See Also:
-
Field Summary
FieldsFields inherited from class hec.clientapp.model.Manager
_callBack, _dssFileManagerWrapper, _identifier, _lastModifiedTime, _modifiableListeners, _proxyList, _readOnly, _reloadFailed, _reloadOk, _uiWrapper, _userInterface, _wkspPath, _Workspace, LASTMODIFIED_STRINGFields inherited from class hec.lang.NamedType
_description, _ignoreModifiedEvents, _index, _isValid, _modified, _name, defaultDescription, defaultName, DESCRIPTION_CHANGED, NAME_CHANGED, RENAME_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidconnectAlignment(double tolerance) Iterates through the stream alignment connecting the stream elements together.booleanconnectNode(StreamElement elem, StreamNode node, double tol) voidconnectReach(StreamElement elem, double tol) createReach(StreamPolyLine line, double tol) booleanDeletes all elements, nodes, and reaches.booleandeleteReach(int index) booleandeleteReach(String name) voiddeleteStreamNode(StreamNode node) doublefindDistanceBetween(StreamElement upstreamElement, double upstreamCoordinateLoc, StreamElement downstreamElement, double downstreamCoordinateLoc) Get the distance (in terms of Stream Stationing) from (upstreamElement, upstreamCoordinateLoc) to (downstreamElement, downstreamCoordinateLoc) following a path along the StreamElements and junctions in the StreamAlignmentfindDownstreamNode(StreamElement stream, double coord) findNearestReach(hec.map.WorldPt wpt, hec.map.WorldPt wptbest) finds the stream element nearest the given point.findNearestReach(hec.map.WorldPt wpt, hec.map.WorldPt wptbest, double[] mindist) finds the stream element nearest the given point.findNearestStreamNode(StreamElement stream, hec.map.WorldPt wpt) findReach(int idx) findReach(hec.map.WorldPt wpt, double tol) Finds a Reach that Contains the given World PointfindReach(hec.map.WorldPt wpt, double tol, StreamElement rch0) Finds a Reach that Contains the given World Point for creating reachesfindReach(StreamNode node, hec.map.WorldPt wpt, double tol) Finds a reach that contains the given world point but does not have the given node.findStreamJunction(StreamElement stream, hec.map.WorldPt wpt, double tol) look for a stream junction on the given stream near the given pointfindStreamNode(StreamElement stream, hec.map.WorldPt wpt, double tol) look for a stream node on the given stream near the given pointfindUpstreamNode(StreamElement stream, double coord) hec.map.crs.CoordinateReferenceSystemReturns the coordinate reference system that describes the location of this map.hec.map.streamAlignment.StreamAlignmentPropshec.map.WorldRectGets the Extent attribute of the MapObjectInterface objectgetFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.getJunction(int id) hec.map.MapIdentifierGets the MapIdentifier attribute of the MapObjectInterface objectintgetNode(int id) getReach(int id) getStreamSegmentsByNodes(Vector nodeVec, Vector ndirVec, Vector segVec) develops a set of stream segments bounded by the given nodes, also determines whether the nodes are inflow points or outflow points relative to the bounded segments.voidinit()voidload()Method to tell the Map Object to load its data into memorynewStreamNode(StreamElement reach) booleanreadFile(Identifier id) voidbooleanremoveReachFromJunction(String name, boolean upStream) voidsetCoordinateReferenceSystem(hec.map.crs.CoordinateReferenceSystem crs) voidsetExtent(hec.map.WorldRect rc) Sets the Extent attribute of the MapObjectInterface objectbooleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.voidsetMapIdentifier(hec.map.MapIdentifier id) Sets the MapIdentifier attribute of the MapObjectInterface objectvoidunload()Method to tell the Map Object to unload, because the map is donevoidbooleanwriteFile(Identifier id) Methods inherited from class hec.clientapp.model.Manager
addModifiableListener, backupFile, computeComplete, copyFile, deleteFile, deleting, finalize, getCallback, getCommonDataList, getDirectory, getDSSFileManager, getDSSFileManagerWrapper, getFileManager, getFilename, getGmtOffset, getIdentifier, getInputITSDataSet, getInputTSDataSet, getLastModifiedTime, getLastModifiedTimeString, getModTime, getModTime, getOutputITSDataSet, getOutputTSDataSet, getPath, getProxyList, getReadOnly, getRelativePath, getReloadOk, getSaveAsId, getSaveAsId, getUnitSystem, getUserInterface, getWorkspace, getWorkspacePath, hasLock, isCanceled, isForecastManager, loadComplete, loadSaveAsFile, makeAbsolutePath, makeAbsolutePath, makeAbsolutePathFromWatershed, makeRelativePath, makeRelativePathFromWatershed, modifiyForSaveAs, newFile, newTSRecordProxy, newTSRecordProxy, notify, notifyModifiableListeners, openFile, printErrorMessage, printLogMessage, printMessage, printSeparator, printStatus, printTableRow, printWarningMessage, refreshData, reLoadChildManagers, reLoadFile, reLoadFile, removeCallBack, removeModifiableListener, renamed, saveChildManagers, saveManager, saveManagerAs, saveManagerAs, setIdentifier, setLastModifiedTime, setLastModifiedTime, setLineAttributes, setLocked, setManagersModifiedTime, setModified, setModifiedFalse, setPath, setProgress, setProxyList, setReadOnly, setReloadOk, setUserInterface, setUserInterface, setWorkspace, toString, unloading, writeLastModTimeMethods inherited from class hec.lang.NamedType
clone, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getIgnoreModifiedEvents, getIndex, getName, isModified, isValid, readResolve, rename, set, setDescription, setIgnoreModifiedEvents, setIndex, setName, setValid, update, useRecursiveModifiedTestMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hec.map.MapObjectInterface
getNameMethods inherited from interface rma.lang.Modifiable
isModifiedMethods inherited from interface hec.map.streamAlignment.StreamAlignmentIfc
addModifiableListener, removeModifiableListener, setLocked, setModified
-
Field Details
-
FILE_NAME
- See Also:
-
-
Constructor Details
-
StreamAlignment
public StreamAlignment()
-
-
Method Details
-
init
public void init() -
addPropertyChangeListener
- Specified by:
addPropertyChangeListenerin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
removePropertyChangeListener
- Specified by:
removePropertyChangeListenerin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
getElementVector
- Specified by:
getElementVectorin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
getNodeVector
- Specified by:
getNodeVectorin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
getDrawProp
public hec.map.streamAlignment.StreamAlignmentProps getDrawProp()- Specified by:
getDrawPropin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
getJunctionVector
- Specified by:
getJunctionVectorin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
newStreamElement
- Specified by:
newStreamElementin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
newStreamNode
- Specified by:
newStreamNodein interfacehec.map.streamAlignment.StreamAlignmentIfc
-
deleteStreamNode
- Specified by:
deleteStreamNodein interfacehec.map.streamAlignment.StreamAlignmentIfc
-
newStreamJunction
- Specified by:
newStreamJunctionin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
findNearestReach
finds the stream element nearest the given point. returns the nearest stream element or null ptnbest to the nearest point on the stream- Specified by:
findNearestReachin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
findNearestReach
public StreamElement findNearestReach(hec.map.WorldPt wpt, hec.map.WorldPt wptbest, double[] mindist) finds the stream element nearest the given point. returns the nearest stream element or null ptnbest to the nearest point on the stream, mindist must have a size of at least 1- Specified by:
findNearestReachin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
findReach
Finds a Reach that Contains the given World Point- Specified by:
findReachin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
findReach
Finds a reach that contains the given world point but does not have the given node. -
findReach
Finds a Reach that Contains the given World Point for creating reaches- Specified by:
findReachin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
findReach
- Specified by:
findReachin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
findReach
- Specified by:
findReachin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
deleteReach
public boolean deleteReach(int index) -
deleteReach
- Specified by:
deleteReachin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
deleteAll
public boolean deleteAll()Deletes all elements, nodes, and reaches.- Specified by:
deleteAllin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
getReach
- Specified by:
getReachin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
getJunction
- Specified by:
getJunctionin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
getNode
- Specified by:
getNodein interfacehec.map.streamAlignment.StreamAlignmentNodeIfc
-
createReach
- Specified by:
createReachin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
connectAlignment
public void connectAlignment(double tolerance) Iterates through the stream alignment connecting the stream elements together.- Specified by:
connectAlignmentin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
connectReach
- Specified by:
connectReachin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
connectNode
- Specified by:
connectNodein interfacehec.map.streamAlignment.StreamAlignmentIfc
-
unload
public void unload()Description copied from interface:hec.map.MapObjectInterfaceMethod to tell the Map Object to unload, because the map is done- Specified by:
unloadin interfacehec.map.MapObjectInterface
-
load
Description copied from interface:hec.map.MapObjectInterfaceMethod to tell the Map Object to load its data into memory- Specified by:
loadin interfacehec.map.MapObjectInterface- Throws:
IOException- Description of Exception
-
readFile
-
writeFile
-
setMapIdentifier
public void setMapIdentifier(hec.map.MapIdentifier id) Description copied from interface:hec.map.MapObjectInterfaceSets the MapIdentifier attribute of the MapObjectInterface object- Specified by:
setMapIdentifierin interfacehec.map.MapObjectInterface- Parameters:
id- The new MapIdentifier value
-
getMapIdentifier
public hec.map.MapIdentifier getMapIdentifier()Description copied from interface:hec.map.MapObjectInterfaceGets the MapIdentifier attribute of the MapObjectInterface object- Specified by:
getMapIdentifierin interfacehec.map.MapObjectInterface- Returns:
- The MapIdentifier value
-
setExtent
public void setExtent(hec.map.WorldRect rc) Description copied from interface:hec.map.MapObjectInterfaceSets the Extent attribute of the MapObjectInterface object- Specified by:
setExtentin interfacehec.map.MapObjectInterface- Parameters:
rc- The new Extent value
-
getExtent
public hec.map.WorldRect getExtent()Description copied from interface:hec.map.MapObjectInterfaceGets the Extent attribute of the MapObjectInterface object- Specified by:
getExtentin interfacehec.map.MapObjectInterface- Returns:
- The Extent value
-
updateJunctionLocations
public void updateJunctionLocations()- Specified by:
updateJunctionLocationsin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
findStreamJunction
look for a stream junction on the given stream near the given point- Specified by:
findStreamJunctionin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
findStreamNode
look for a stream node on the given stream near the given point- Specified by:
findStreamNodein interfacehec.map.streamAlignment.StreamAlignmentIfc
-
findNearestStreamNode
- Specified by:
findNearestStreamNodein interfacehec.map.streamAlignment.StreamAlignmentIfc
-
findDownstreamNode
- Specified by:
findDownstreamNodein interfacehec.map.streamAlignment.StreamAlignmentIfc
-
findUpstreamNode
- Specified by:
findUpstreamNodein interfacehec.map.streamAlignment.StreamAlignmentIfc
-
removeReachFromJunction
- Specified by:
removeReachFromJunctionin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
getStreamSegmentsByNodes
develops a set of stream segments bounded by the given nodes, also determines whether the nodes are inflow points or outflow points relative to the bounded segments. An error message is returned if the set of nodes do not form a closed pool.- Specified by:
getStreamSegmentsByNodesin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
findDistanceBetween
public double findDistanceBetween(StreamElement upstreamElement, double upstreamCoordinateLoc, StreamElement downstreamElement, double downstreamCoordinateLoc) Get the distance (in terms of Stream Stationing) from (upstreamElement, upstreamCoordinateLoc) to (downstreamElement, downstreamCoordinateLoc) following a path along the StreamElements and junctions in the StreamAlignment- Parameters:
upstreamElement- A non-null StreamElement in this StreamAlignmentupstreamCoordinateLoc- A coordinate location (1 to 0) on upstreamElementdownstreamElement- A non-null StreamElement in this StreamAlignment that is the same as, or downstream of upstreamElementdownstreamCoordinateLoc- A coordinate location (1 to 0) on downstreamElement. If upstreamElement == downstreamElement, this value must be less than upstreamCoordinateLoc- Returns:
- The distance, in terms of Stream Stationing, from (upstreamElement, upstreamCoordinateLoc) to (downstreamElement, downstreamCoordinateLoc), or HEC_UNDEFINED_DOUBLE if a valid path cannot be found.
-
getNextLineIndex
public int getNextLineIndex()- Specified by:
getNextLineIndexin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
getCoordinateReferenceSystem
public hec.map.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()Description copied from interface:hec.map.MapObjectInterfaceReturns the coordinate reference system that describes the location of this map. Users can return NULL if they don't have CoordinateReferenceSystem.- Specified by:
getCoordinateReferenceSystemin interfacehec.map.MapObjectInterface- Returns:
-
setCoordinateReferenceSystem
public void setCoordinateReferenceSystem(hec.map.crs.CoordinateReferenceSystem crs) - Specified by:
setCoordinateReferenceSystemin interfacehec.map.streamAlignment.StreamAlignmentIfc
-
getNextDefaultElementName
- Specified by:
getNextDefaultElementNamein interfacehec.map.streamAlignment.StreamAlignmentIfc
-
getFieldObject
Description copied from interface:FieldAccessorThis method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObjectin interfaceFieldAccessor- Overrides:
getFieldObjectin classManager- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessorThis allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObjectin interfaceFieldAccessor- Overrides:
setFieldObjectin classManager- Parameters:
fld- The java field object representing the member field to be setfobj- The data to set in that field- Returns:
- returns true if successful
-