public class ExtentHistory
extends java.lang.Object
implements org.gvsig.tools.persistence.Persistent
ExtentHistory
is designed for managing a history of extents.
Note: An extent is a re.setMandatory(true)ctangular area, with information of its top-left 2D corner.
Constructor and Description |
---|
ExtentHistory()
Creates a new instance of
ExtentsHistory with an history of 10 extents. |
ExtentHistory(int numEntries)
Creates a new instance of
ExtentsHistory with an history of numEntries extents. |
Modifier and Type | Method and Description |
---|---|
java.awt.geom.Rectangle2D |
get()
Returns the last extent in the history.
|
boolean |
hasPrevious()
Returns
true if there are extents registered. |
void |
loadFromState(org.gvsig.tools.persistence.PersistentState state) |
void |
put(java.awt.geom.Rectangle2D ext)
Appends the specified extent to the end of this history.
|
static void |
registerPersistent() |
java.awt.geom.Rectangle2D |
removePrev()
Extracts (removing) the last extent from the history.
|
void |
saveToState(org.gvsig.tools.persistence.PersistentState state)
Returns information of this object.
|
public ExtentHistory()
Creates a new instance of ExtentsHistory
with an history of 10 extents.
public ExtentHistory(int numEntries)
Creates a new instance of ExtentsHistory
with an history of numEntries
extents.
numEntries
- the maximum number of extents that will store the instancepublic java.awt.geom.Rectangle2D get()
Returns the last extent in the history.
put(Rectangle2D)
,
#getXMLEntity()
public boolean hasPrevious()
Returns true
if there are extents registered.
true
if there are extents registered; false
otherwiseput(Rectangle2D)
,
removePrev()
,
get()
public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
loadFromState
in interface org.gvsig.tools.persistence.Persistent
org.gvsig.tools.persistence.exception.PersistenceException
public void put(java.awt.geom.Rectangle2D ext)
Appends the specified extent to the end of this history.
ext
- the new extentget()
,
hasPrevious()
public static void registerPersistent()
public java.awt.geom.Rectangle2D removePrev()
Extracts (removing) the last extent from the history.
hasPrevious()
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:
saveToState
in interface org.gvsig.tools.persistence.Persistent
org.gvsig.tools.persistence.exception.PersistenceException
Copyright © 2013 gvSIG Association. All rights reserved.