Gridarta Editor
net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R > Class Template Reference

Dialog to export a new map file into an image file. More...

+ Inheritance diagram for net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
+ Collaboration diagram for net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:

Public Member Functions

void exportMapAsImageCancel ()
 Action method for cancel. More...
 
void exportMapAsImageCancelExport ()
 Action method for cancel export. More...
 
 ExportMapAsImageDialog (@NotNull final JFrame parent, @NotNull final ExportMapAsImageAction< G, A, R > exportMapAsImageAction, @NotNull final MapControl< G, A, R > mapControl)
 Creates a new instance. More...
 
void exportMapAsImageExport ()
 Action method for okay. More...
 
File getOutputFile ()
 Returns the file for saving the image file. More...
 
boolean isExportMapAsImageIncludeTiledMaps ()
 Returns whether tiled maps are included in the image. More...
 
boolean isIncludeTiledMaps ()
 Returns whether to include tiled maps in the image file. More...
 
void setExportMapAsImageIncludeTiledMaps (final boolean includeTiledMaps)
 Sets whether to include tiled maps in the image. More...
 
void setValue (@Nullable final Object newValue)
 

Static Protected Attributes

static final Preferences PREFERENCES = Preferences.userNodeForPackage(MainControl.class)
 Preferences. More...
 

Private Member Functions

JPanel createPanel ()
 Creates the content panel of the dialog. More...
 

Private Attributes

final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "exportMapAsImageCancel", this))
 The button to cancel the dialog. More...
 
volatile boolean cancelExport
 Whether the currently running export operation should be cancelled. More...
 
final JButton cancelExportButton = new JButton(ACTION_BUILDER.createAction(false, "exportMapAsImageCancelExport", this))
 The button to cancel the export. More...
 
final JDialog dialog
 The dialog instance. More...
 
final JButton exportButton = new JButton(ACTION_BUILDER.createAction(false, "exportMapAsImageExport", this))
 The button to start the export. More...
 
final ExportMapAsImageAction< G, A, R > exportMapAsImageAction
 The action to use for exporting the map. More...
 
boolean includeTiledMaps = true
 Whether tiled maps are included in the image. More...
 
final AbstractButton includeTiledMapsCheckbox = new JCheckBox(ACTION_BUILDER.createToggle(false, "exportMapAsImageIncludeTiledMaps", this))
 Checkbox to select whether tiled maps are included in the image. More...
 
final MapControl< G, A, R > mapControl
 The map to export. More...
 
final JFileField outputFileField
 The file name of the image file. More...
 
final JLabel previewImage = new JLabel()
 The preview image. More...
 
final JLabel previewLabel = new JLabel()
 The preview label. More...
 
final JProgressBar progressBar = new JProgressBar()
 The progress bar. More...
 
final JLabel progressLabel = new JLabel()
 The progress label. More...
 

Static Private Attributes

static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
 Action Builder. More...
 
static final Pattern PATTERN_PATH = Pattern.compile(".*/")
 Matches the path part of a map path. More...
 
static final int PREVIEW_SIZE = 256
 The size of the preview image in pixels. More...
 
static final long serialVersionUID = 1L
 Serial Version UID. More...
 

Detailed Description

Dialog to export a new map file into an image file.

Author
Andreas Kirschbaum

Definition at line 66 of file ExportMapAsImageDialog.java.

Constructor & Destructor Documentation

◆ ExportMapAsImageDialog()

net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.ExportMapAsImageDialog ( @NotNull final JFrame  parent,
@NotNull final ExportMapAsImageAction< G, A, R >  exportMapAsImageAction,
@NotNull final MapControl< G, A, R >  mapControl 
)

Creates a new instance.

Parameters
parentthe parent component of this dialog
exportMapAsImageActionthe action to use for exporting the map
mapControlthe map to export

Definition at line 184 of file ExportMapAsImageDialog.java.

References net.sf.gridarta.model.mapmodel.MapFile.getMapPath(), net.sf.gridarta.model.mapmodel.MapFile.getMapsDir(), and net.sf.gridarta.model.mapmodel.AbsoluteMapPath.getPath().

+ Here is the call graph for this function:

Member Function Documentation

◆ createPanel()

◆ exportMapAsImageCancel()

void net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.exportMapAsImageCancel ( )

Action method for cancel.

Definition at line 333 of file ExportMapAsImageDialog.java.

◆ exportMapAsImageCancelExport()

void net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.exportMapAsImageCancelExport ( )

Action method for cancel export.

Definition at line 341 of file ExportMapAsImageDialog.java.

◆ exportMapAsImageExport()

◆ getOutputFile()

File net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getOutputFile ( )

Returns the file for saving the image file.

Returns
the file

Definition at line 215 of file ExportMapAsImageDialog.java.

References net.sf.gridarta.gui.utils.JFileField.getFile().

+ Here is the call graph for this function:

◆ isExportMapAsImageIncludeTiledMaps()

boolean net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isExportMapAsImageIncludeTiledMaps ( )

Returns whether tiled maps are included in the image.

Returns
whether tiled maps are included in the image

Definition at line 359 of file ExportMapAsImageDialog.java.

◆ isIncludeTiledMaps()

boolean net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isIncludeTiledMaps ( )

Returns whether to include tiled maps in the image file.

Returns
whether to include tiled maps in the image file

Definition at line 224 of file ExportMapAsImageDialog.java.

◆ setExportMapAsImageIncludeTiledMaps()

void net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setExportMapAsImageIncludeTiledMaps ( final boolean  includeTiledMaps)

Sets whether to include tiled maps in the image.

Parameters
includeTiledMapswhether tiled maps are included in the image

Definition at line 367 of file ExportMapAsImageDialog.java.

◆ setValue()

void net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setValue ( @Nullable final Object  newValue)

Definition at line 346 of file ExportMapAsImageDialog.java.

Member Data Documentation

◆ ACTION_BUILDER

final ActionBuilder net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
staticprivate

Action Builder.

Definition at line 82 of file ExportMapAsImageDialog.java.

◆ cancelButton

final JButton net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.cancelButton = new JButton(ACTION_BUILDER.createAction(false, "exportMapAsImageCancel", this))
private

The button to cancel the dialog.

Definition at line 118 of file ExportMapAsImageDialog.java.

◆ cancelExport

volatile boolean net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.cancelExport
private

Whether the currently running export operation should be cancelled.

Definition at line 176 of file ExportMapAsImageDialog.java.

◆ cancelExportButton

final JButton net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.cancelExportButton = new JButton(ACTION_BUILDER.createAction(false, "exportMapAsImageCancelExport", this))
private

The button to cancel the export.

Definition at line 124 of file ExportMapAsImageDialog.java.

◆ dialog

final JDialog net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.dialog
private

The dialog instance.

Definition at line 130 of file ExportMapAsImageDialog.java.

◆ exportButton

final JButton net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.exportButton = new JButton(ACTION_BUILDER.createAction(false, "exportMapAsImageExport", this))
private

The button to start the export.

Definition at line 112 of file ExportMapAsImageDialog.java.

◆ exportMapAsImageAction

final ExportMapAsImageAction<G, A, R> net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.exportMapAsImageAction
private

The action to use for exporting the map.

Definition at line 100 of file ExportMapAsImageDialog.java.

◆ includeTiledMaps

boolean net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.includeTiledMaps = true
private

Whether tiled maps are included in the image.

Definition at line 171 of file ExportMapAsImageDialog.java.

◆ includeTiledMapsCheckbox

final AbstractButton net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.includeTiledMapsCheckbox = new JCheckBox(ACTION_BUILDER.createToggle(false, "exportMapAsImageIncludeTiledMaps", this))
private

Checkbox to select whether tiled maps are included in the image.

Definition at line 136 of file ExportMapAsImageDialog.java.

◆ mapControl

final MapControl<G, A, R> net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapControl
private

The map to export.

Definition at line 106 of file ExportMapAsImageDialog.java.

◆ outputFileField

final JFileField net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.outputFileField
private

The file name of the image file.

Definition at line 142 of file ExportMapAsImageDialog.java.

◆ PATTERN_PATH

final Pattern net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.PATTERN_PATH = Pattern.compile(".*/")
staticprivate

Matches the path part of a map path.

Definition at line 94 of file ExportMapAsImageDialog.java.

◆ PREFERENCES

final Preferences net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.PREFERENCES = Preferences.userNodeForPackage(MainControl.class)
staticprotected

Preferences.

Definition at line 88 of file ExportMapAsImageDialog.java.

◆ PREVIEW_SIZE

final int net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.PREVIEW_SIZE = 256
staticprivate

The size of the preview image in pixels.

Definition at line 71 of file ExportMapAsImageDialog.java.

◆ previewImage

final JLabel net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.previewImage = new JLabel()
private

The preview image.

Definition at line 166 of file ExportMapAsImageDialog.java.

◆ previewLabel

final JLabel net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.previewLabel = new JLabel()
private

The preview label.

Definition at line 160 of file ExportMapAsImageDialog.java.

◆ progressBar

final JProgressBar net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.progressBar = new JProgressBar()
private

The progress bar.

Definition at line 154 of file ExportMapAsImageDialog.java.

◆ progressLabel

final JLabel net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.progressLabel = new JLabel()
private

The progress label.

Definition at line 148 of file ExportMapAsImageDialog.java.

◆ serialVersionUID

final long net.sf.gridarta.gui.dialog.exportmap.ExportMapAsImageDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.serialVersionUID = 1L
staticprivate

Serial Version UID.

Definition at line 76 of file ExportMapAsImageDialog.java.


The documentation for this class was generated from the following file: