![]() |
Gridarta Editor
|
The map preview of the level editor. More...
Public Member Functions | |
MapPreview (@NotNull final Image original) | |
Constructs the user interface. More... | |
void | paintComponent (@NotNull final Graphics g) |
void | zoom0 () throws OutOfMemoryError |
Zoom to 24x24. More... | |
void | zoom100 () throws OutOfMemoryError |
Zoom to 100%. More... | |
void | zoom12 () throws OutOfMemoryError |
Zoom to 12.5%. More... | |
void | zoom150 () throws OutOfMemoryError |
Zoom to 150%. More... | |
void | zoom200 () throws OutOfMemoryError |
Zoom to 200%. More... | |
void | zoom25 () throws OutOfMemoryError |
Zoom to 25%. More... | |
void | zoom250 () throws OutOfMemoryError |
Zoom to 250%. More... | |
void | zoom300 () throws OutOfMemoryError |
Zoom to 300%. More... | |
void | zoom400 () throws OutOfMemoryError |
Zoom to 400%. More... | |
void | zoom50 () throws OutOfMemoryError |
Zoom to 50%. More... | |
void | zoomAlgAreaAveraging () throws OutOfMemoryError |
Zoom Algorithm: Area Averaging. More... | |
void | zoomAlgDefault () throws OutOfMemoryError |
Zoom Algorithm: Default. More... | |
void | zoomAlgFast () throws OutOfMemoryError |
Zoom Algorithm: Fast. More... | |
void | zoomAlgReplicate () throws OutOfMemoryError |
Zoom Algorithm: Replicate. More... | |
void | zoomAlgSmooth () throws OutOfMemoryError |
Zoom Algorithm: Smooth. More... | |
void | zoomClose () |
Close the preview. More... | |
void | zoomSave () throws IOException, OutOfMemoryError |
Zoom save. More... | |
Private Member Functions | |
void | rescale () throws OutOfMemoryError |
Recalculate the image. More... | |
void | setAlgorithm (final int algorithm) |
Set the algorithm. More... | |
void | setScale (final double scale) throws OutOfMemoryError |
Set the scale factor to be used for displaying the image. More... | |
void | setScale (final int width, final int height) |
Set the scale factor to a specific size. More... | |
Private Attributes | |
int | algorithm = Image.SCALE_DEFAULT |
The currently used algorithm. More... | |
final JFrame | frame |
The preview frame. More... | |
int | height |
The currently used height. More... | |
Image | image |
The currently displayed image. More... | |
final Image | original |
The original image. More... | |
int | width |
The currently used width. More... | |
Static Private Attributes | |
static final ActionBuilder | ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta") |
Action Builder. More... | |
static final long | serialVersionUID = 1L |
The serial Version UID. More... | |
The map preview of the level editor.
This allows the user to zoom in and out of the map.
add user definable previews
add zoom increase, zoom decrease
Definition at line 51 of file MapPreview.java.
net.sf.gridarta.gui.misc.MapPreview.MapPreview | ( | @NotNull final Image | original | ) |
Constructs the user interface.
When image is not null it either increases or decreases the zoom. If m_Image is null the the program will wait for a zoom factor to be chosen.
original | the image to be displayed |
Definition at line 109 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.ACTION_BUILDER, net.sf.gridarta.gui.misc.MapPreview.frame, net.sf.gridarta.gui.misc.MapPreview.height, net.sf.gridarta.gui.misc.MapPreview.image, net.sf.gridarta.gui.misc.MapPreview.original, net.sf.gridarta.gui.misc.MapPreview.rescale(), and net.sf.gridarta.gui.misc.MapPreview.width.
void net.sf.gridarta.gui.misc.MapPreview.paintComponent | ( | @NotNull final Graphics | g | ) |
Definition at line 378 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.image.
Referenced by net.sf.gridarta.gui.misc.MapPreview.zoomSave().
|
private |
Recalculate the image.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 359 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.algorithm, net.sf.gridarta.gui.misc.MapPreview.height, net.sf.gridarta.gui.misc.MapPreview.image, net.sf.gridarta.gui.misc.MapPreview.original, and net.sf.gridarta.gui.misc.MapPreview.width.
Referenced by net.sf.gridarta.gui.misc.MapPreview.MapPreview(), net.sf.gridarta.gui.misc.MapPreview.setAlgorithm(), and net.sf.gridarta.gui.misc.MapPreview.setScale().
|
private |
Set the algorithm.
algorithm | algorithm for scale |
Definition at line 349 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.algorithm, and net.sf.gridarta.gui.misc.MapPreview.rescale().
Referenced by net.sf.gridarta.gui.misc.MapPreview.zoomAlgAreaAveraging(), net.sf.gridarta.gui.misc.MapPreview.zoomAlgDefault(), net.sf.gridarta.gui.misc.MapPreview.zoomAlgFast(), net.sf.gridarta.gui.misc.MapPreview.zoomAlgReplicate(), and net.sf.gridarta.gui.misc.MapPreview.zoomAlgSmooth().
|
private |
Set the scale factor to be used for displaying the image.
The viewport size is automatically updated.
scale | scale factor to be used |
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 328 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.height, net.sf.gridarta.gui.misc.MapPreview.original, net.sf.gridarta.gui.misc.MapPreview.rescale(), and net.sf.gridarta.gui.misc.MapPreview.width.
Referenced by net.sf.gridarta.gui.misc.MapPreview.zoom0(), net.sf.gridarta.gui.misc.MapPreview.zoom100(), net.sf.gridarta.gui.misc.MapPreview.zoom12(), net.sf.gridarta.gui.misc.MapPreview.zoom150(), net.sf.gridarta.gui.misc.MapPreview.zoom200(), net.sf.gridarta.gui.misc.MapPreview.zoom25(), net.sf.gridarta.gui.misc.MapPreview.zoom250(), net.sf.gridarta.gui.misc.MapPreview.zoom300(), net.sf.gridarta.gui.misc.MapPreview.zoom400(), and net.sf.gridarta.gui.misc.MapPreview.zoom50().
|
private |
Set the scale factor to a specific size.
width | width for scale |
height | height for scale |
Definition at line 339 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.height, net.sf.gridarta.gui.misc.MapPreview.rescale(), and net.sf.gridarta.gui.misc.MapPreview.width.
void net.sf.gridarta.gui.misc.MapPreview.zoom0 | ( | ) | throws OutOfMemoryError |
Zoom to 24x24.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 138 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setScale().
void net.sf.gridarta.gui.misc.MapPreview.zoom100 | ( | ) | throws OutOfMemoryError |
Zoom to 100%.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 178 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setScale().
void net.sf.gridarta.gui.misc.MapPreview.zoom12 | ( | ) | throws OutOfMemoryError |
Zoom to 12.5%.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 148 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setScale().
void net.sf.gridarta.gui.misc.MapPreview.zoom150 | ( | ) | throws OutOfMemoryError |
Zoom to 150%.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 188 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setScale().
void net.sf.gridarta.gui.misc.MapPreview.zoom200 | ( | ) | throws OutOfMemoryError |
Zoom to 200%.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 198 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setScale().
void net.sf.gridarta.gui.misc.MapPreview.zoom25 | ( | ) | throws OutOfMemoryError |
Zoom to 25%.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 158 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setScale().
void net.sf.gridarta.gui.misc.MapPreview.zoom250 | ( | ) | throws OutOfMemoryError |
Zoom to 250%.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 208 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setScale().
void net.sf.gridarta.gui.misc.MapPreview.zoom300 | ( | ) | throws OutOfMemoryError |
Zoom to 300%.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 218 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setScale().
void net.sf.gridarta.gui.misc.MapPreview.zoom400 | ( | ) | throws OutOfMemoryError |
Zoom to 400%.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 228 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setScale().
void net.sf.gridarta.gui.misc.MapPreview.zoom50 | ( | ) | throws OutOfMemoryError |
Zoom to 50%.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 168 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setScale().
void net.sf.gridarta.gui.misc.MapPreview.zoomAlgAreaAveraging | ( | ) | throws OutOfMemoryError |
Zoom Algorithm: Area Averaging.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 317 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setAlgorithm().
void net.sf.gridarta.gui.misc.MapPreview.zoomAlgDefault | ( | ) | throws OutOfMemoryError |
Zoom Algorithm: Default.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 277 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setAlgorithm().
void net.sf.gridarta.gui.misc.MapPreview.zoomAlgFast | ( | ) | throws OutOfMemoryError |
Zoom Algorithm: Fast.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 287 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setAlgorithm().
void net.sf.gridarta.gui.misc.MapPreview.zoomAlgReplicate | ( | ) | throws OutOfMemoryError |
Zoom Algorithm: Replicate.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 307 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setAlgorithm().
void net.sf.gridarta.gui.misc.MapPreview.zoomAlgSmooth | ( | ) | throws OutOfMemoryError |
Zoom Algorithm: Smooth.
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 297 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.setAlgorithm().
void net.sf.gridarta.gui.misc.MapPreview.zoomClose | ( | ) |
Close the preview.
Definition at line 267 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.frame.
void net.sf.gridarta.gui.misc.MapPreview.zoomSave | ( | ) | throws IOException, OutOfMemoryError |
Zoom save.
IOException | In case of I/O problems. |
OutOfMemoryError | In case this method runs out of memory, which really might happen, so callers are expected to handle this. |
Definition at line 239 of file MapPreview.java.
References net.sf.gridarta.gui.misc.MapPreview.ACTION_BUILDER, net.sf.gridarta.gui.misc.MapPreview.frame, net.sf.gridarta.gui.misc.MapPreview.image, net.sf.gridarta.gui.misc.MapPreview.paintComponent(), and net.sf.gridarta.utils.FileFilters.PNG_FILE_FILTER.
|
staticprivate |
Action Builder.
Definition at line 62 of file MapPreview.java.
Referenced by net.sf.gridarta.gui.misc.MapPreview.MapPreview(), and net.sf.gridarta.gui.misc.MapPreview.zoomSave().
|
private |
The currently used algorithm.
@serial
Definition at line 75 of file MapPreview.java.
Referenced by net.sf.gridarta.gui.misc.MapPreview.rescale(), and net.sf.gridarta.gui.misc.MapPreview.setAlgorithm().
|
private |
The preview frame.
@serial
Definition at line 101 of file MapPreview.java.
Referenced by net.sf.gridarta.gui.misc.MapPreview.MapPreview(), net.sf.gridarta.gui.misc.MapPreview.zoomClose(), and net.sf.gridarta.gui.misc.MapPreview.zoomSave().
|
private |
The currently used height.
@serial
Definition at line 87 of file MapPreview.java.
Referenced by net.sf.gridarta.gui.misc.MapPreview.MapPreview(), net.sf.gridarta.gui.misc.MapPreview.rescale(), and net.sf.gridarta.gui.misc.MapPreview.setScale().
|
private |
The currently displayed image.
@serial
Definition at line 94 of file MapPreview.java.
Referenced by net.sf.gridarta.gui.misc.MapPreview.MapPreview(), net.sf.gridarta.gui.misc.MapPreview.paintComponent(), net.sf.gridarta.gui.misc.MapPreview.rescale(), and net.sf.gridarta.gui.misc.MapPreview.zoomSave().
|
private |
The original image.
@serial
Definition at line 69 of file MapPreview.java.
Referenced by net.sf.gridarta.gui.misc.MapPreview.MapPreview(), net.sf.gridarta.gui.misc.MapPreview.rescale(), and net.sf.gridarta.gui.misc.MapPreview.setScale().
|
staticprivate |
The serial Version UID.
Definition at line 56 of file MapPreview.java.
|
private |
The currently used width.
@serial
Definition at line 81 of file MapPreview.java.
Referenced by net.sf.gridarta.gui.misc.MapPreview.MapPreview(), net.sf.gridarta.gui.misc.MapPreview.rescale(), and net.sf.gridarta.gui.misc.MapPreview.setScale().