public final class ZoomStack
extends java.lang.Object
implements java.lang.Cloneable
ZoomStack
class provides a container accessing, loading and saving the zoom stack.
Note that this class cannot be subclassed!
Constructor and Description |
---|
ZoomStack()
Constructs a
ZoomStack object. |
Modifier and Type | Method and Description |
---|---|
void |
addThumbnail(java.awt.Image thumbnail)
Adds a thumbnail to the thumbnail list.
|
void |
clear()
Initialises the zoom stack.
|
java.lang.Object |
clone()
Clones (deep copy) the current zoom stack.
|
int |
getNrOfZoomLevels()
Returns the number of available zoom levels.
|
org.sm.smtools.math.complex.ComplexNumber |
getP1(int zoomLevel)
Returns P1 (lower-left corner in the complex plane) from a specified zoom level.
|
org.sm.smtools.math.complex.ComplexNumber |
getP2(int zoomLevel)
Returns P2 (upper-right corner in the complex plane) from a specified zoom level.
|
java.awt.Image |
getThumbnail(int zoomLevel)
Returns a thumbnail from the thumbnail list.
|
org.sm.smtools.math.complex.ComplexNumber |
getTopP1()
Returns P1 (lower-left corner in the complex plane) at the top of the zoom stack.
|
org.sm.smtools.math.complex.ComplexNumber |
getTopP2()
Returns P2 (upper-right corner in the complex plane) at the top of the zoom stack.
|
int |
getZoomLevel()
Returns the current zoom level (i.e., the number of steps zoomed in).
|
boolean |
isDirty()
Returns whether or not the zoom stack is dirty and needs a fresh thumbnail.
|
boolean |
isEmpty()
Checks if the zoom stack is empty (or contains 1 item or less).
|
void |
load(java.lang.String filename)
Loads the zoom stack from a CSV-file.
|
void |
modifyTop(org.sm.smtools.math.complex.ComplexNumber p1,
org.sm.smtools.math.complex.ComplexNumber p2)
Modifies the top of the zoom stack.
|
void |
pop()
Pops an item of the zoom stack.
|
void |
push(org.sm.smtools.math.complex.ComplexNumber p1,
org.sm.smtools.math.complex.ComplexNumber p2)
Pushes an item on the zoom stack.
|
void |
save(java.lang.String filename)
Saves the zoom stack to a CSV-file.
|
public void addThumbnail(java.awt.Image thumbnail)
thumbnail
- the thumbnail to add to the thumbnail listpublic void clear()
public java.lang.Object clone()
clone
in class java.lang.Object
public int getNrOfZoomLevels()
public org.sm.smtools.math.complex.ComplexNumber getP1(int zoomLevel)
zoomLevel
- the specified zoom levelpublic org.sm.smtools.math.complex.ComplexNumber getP2(int zoomLevel)
zoomLevel
- the specified zoom levelpublic java.awt.Image getThumbnail(int zoomLevel)
zoomLevel
- the zoom level to get the thumbnail frompublic org.sm.smtools.math.complex.ComplexNumber getTopP1()
public org.sm.smtools.math.complex.ComplexNumber getTopP2()
public int getZoomLevel()
public boolean isDirty()
boolean
indicating whether or not the zoom stack is dirty and needs a fresh thumbnailpublic boolean isEmpty()
true
if the zoom stack is empty, false
otherwisepublic void load(java.lang.String filename) throws org.sm.smtools.exceptions.FileDoesNotExistException, org.sm.smtools.exceptions.FileParseException, java.lang.NumberFormatException
filename
- the name of the file to load the zoom stack fromorg.sm.smtools.exceptions.FileDoesNotExistException
- -org.sm.smtools.exceptions.FileParseException
- -java.lang.NumberFormatException
- -public void modifyTop(org.sm.smtools.math.complex.ComplexNumber p1, org.sm.smtools.math.complex.ComplexNumber p2)
p1
- the new lower-left corner in the complex planep2
- the new upper-right corner in the complex planepublic void pop()
public void push(org.sm.smtools.math.complex.ComplexNumber p1, org.sm.smtools.math.complex.ComplexNumber p2)
p1
- the lower-left corner in the complex plane of the specified zoom levelp2
- the upper-right corner in the complex plane of the specified zoom levelpublic void save(java.lang.String filename) throws org.sm.smtools.exceptions.FileCantBeCreatedException, org.sm.smtools.exceptions.FileWriteException
filename
- the name of the file to save the zoom stack toorg.sm.smtools.exceptions.FileCantBeCreatedException
- -org.sm.smtools.exceptions.FileWriteException
- -