Class ExtentHistory
- All Implemented Interfaces:
org.gvsig.tools.persistence.Persistent
ExtentHistory is designed for managing a history of extents.
Note: An extent is a rectangular area, with information of its top-left 2D corner.
- Author:
- Vicente Caballero Navarro
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofExtentsHistorywith an history of 10 extents.ExtentHistory(int numEntries) Creates a new instance ofExtentsHistorywith an history ofnumEntriesextents. -
Method Summary
Modifier and TypeMethodDescriptionReturns the current extent.getNext()Returns the last next extent from the history.getPrev()Returns the last previous extent from the history.booleanhasNext()Returnstrueif there are next extents registered.booleanReturnstrueif there are previous extents registered.voidloadFromState(org.gvsig.tools.persistence.PersistentState state) voidput(Rectangle2D ext) Appends the specified extent at the end of the array of previous zooms.voidsaveToState(org.gvsig.tools.persistence.PersistentState state) Returns information of this object.Adds the current extent to the previous extent history and sets the last next extent as the new current extent.Adds the current extent to the next extent history and sets the last previous extent as the new current extent.
-
Constructor Details
-
ExtentHistory
public ExtentHistory()Creates a new instance of
ExtentsHistorywith an history of 10 extents. -
ExtentHistory
public ExtentHistory(int numEntries) Creates a new instance of
ExtentsHistorywith an history ofnumEntriesextents.- Parameters:
numEntries- the maximum number of extents that will store the instance
-
-
Method Details
-
put
Appends the specified extent at the end of the array of previous zooms.
- Parameters:
ext- the new extent
-
hasPrevious
public boolean hasPrevious()Returns
trueif there are previous extents registered.- Returns:
trueif there are previous extents registered;falseotherwise
-
hasNext
public boolean hasNext()Returns
trueif there are next extents registered.- Returns:
trueif there are next extents registered;falseotherwise
-
getPrev
Returns the last previous extent from the history.
- Returns:
- the last previous extent from the history
-
getNext
Returns the last next extent from the history.
- Returns:
- the last next extent from the history
-
setPreviousExtent
Adds the current extent to the next extent history and sets the last previous extent as the new current extent.
- Returns:
- the last previous extent as the new current extent
-
setNextExtent
Adds the current extent to the previous extent history and sets the last next extent as the new current extent.
- Returns:
- the last next extent as the new current extent
-
getCurrent
Returns the current extent.
- Returns:
- the current extent
-
loadFromState
public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
loadFromStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
saveToState
public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException Returns information of this object. All information is stored as properties:
Properties:
- className: name of this class.
- num: number of extents registered.
- numrec: maximum number of extents that can register.
- extents: .
- Specified by:
saveToStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-