public class ExtentHistory extends java.lang.Object implements 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.
Modifier and Type | Class and Description |
---|---|
static class |
ExtentHistory.RegisterPersistence |
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 |
getCurrent()
Returns the current extent.
|
java.awt.geom.Rectangle2D |
getNext()
Returns the last next extent from the history.
|
java.awt.geom.Rectangle2D |
getPrev()
Returns the last previous extent from the history.
|
boolean |
hasNext()
Returns
true if there are next extents registered. |
boolean |
hasPrevious()
Returns
true if there are previous extents registered. |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
put(java.awt.geom.Rectangle2D ext)
Appends the specified extent at the end of the array of previous zooms.
|
void |
saveToState(PersistentState state)
Returns information of this object.
|
java.awt.geom.Rectangle2D |
setNextExtent()
Adds the current extent to the previous extent history and sets the last
next extent as the new current extent.
|
java.awt.geom.Rectangle2D |
setPreviousExtent()
Adds the current extent to the next extent history and sets the last
previous extent as the new current extent.
|
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 void put(java.awt.geom.Rectangle2D ext)
Appends the specified extent at the end of the array of previous zooms.
ext
- the new extentpublic boolean hasPrevious()
Returns true
if there are previous extents registered.
true
if there are previous extents registered;
false
otherwisepublic boolean hasNext()
Returns true
if there are next extents registered.
true
if there are next extents registered;
false
otherwisepublic java.awt.geom.Rectangle2D getPrev()
Returns the last previous extent from the history.
public java.awt.geom.Rectangle2D getNext()
Returns the last next extent from the history.
public java.awt.geom.Rectangle2D setPreviousExtent()
Adds the current extent to the next extent history and sets the last previous extent as the new current extent.
public java.awt.geom.Rectangle2D setNextExtent()
Adds the current extent to the previous extent history and sets the last next extent as the new current extent.
public java.awt.geom.Rectangle2D getCurrent()
Returns the current extent.
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public void saveToState(PersistentState state) throws PersistenceException
Returns information of this object. All information is stored as
properties:
Properties:
saveToState
in interface Persistent
PersistenceException