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

A dialog to ask the user for a map to open. More...

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

Public Member Functions

void goMapApply ()
 Action method for apply. More...
 
void goMapCancel ()
 Action method for cancel. More...
 
 GoMapDialog (@NotNull final Window parent, @NotNull final MapsIndex mapsIndex, @NotNull final MapViewsManager< G, A, R > mapViewsManager)
 Creates a new instance. More...
 
void goMapScrollBottom ()
 Action method for scroll bottom. More...
 
void goMapScrollDown ()
 Action method for scroll down. More...
 
void goMapScrollPageDown ()
 Action method for scroll page down. More...
 
void goMapScrollPageUp ()
 Action method for scroll page up. More...
 
void goMapScrollTop ()
 Action method for scroll top. More...
 
void goMapScrollUp ()
 Action method for scroll up. More...
 
void goMapSelectDown ()
 Action method for select down. More...
 
void goMapSelectUp ()
 Action method for select up. More...
 
void showDialog ()
 Opens the dialog. More...
 

Private Member Functions

void doSearch ()
 Updates the maps display from the map name input field. More...
 
boolean goMap ()
 Opens the selected maps. More...
 

Private Attributes

final DelayedChangeManager delayedChangeManager
 A DelayedChangeManager for updating search results after mapsIndex changes. More...
 
final JDialog dialog
 The JDialog instance. More...
 
boolean dialogShown
 Whether dialog is currently shown. More...
 
final IndexListener< MapFileindexListener
 The IndexListener attached to mapsIndex to update search results after index changes. More...
 
final JTextComponent input
 The map name input field. More...
 
final JList< MapFilelist = new JList<>(listModel)
 The JList showing the matching maps. More...
 
final DefaultListModel< MapFilelistModel = new DefaultListModel<>()
 The list model containing the search results. More...
 
final Comparator< MapFilemapNameComparator
 A Comparator that orders map files by map name. More...
 
final MapsIndex mapsIndex
 The MapsIndex for looking up maps. More...
 
final MapViewsManager< G, A, R > mapViewsManager
 The MapViewsManager for opening maps. More...
 
final WindowListener windowListener
 The WindowListener attached to dialog to track opening/closing the dialog. More...
 

Static Private Attributes

static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
 The ActionBuilder. More...
 

Detailed Description

A dialog to ask the user for a map to open.

Author
Andreas Kirschbaum

Definition at line 71 of file GoMapDialog.java.

Constructor & Destructor Documentation

◆ GoMapDialog()

Member Function Documentation

◆ doSearch()

◆ goMap()

boolean net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goMap ( )
private

◆ goMapApply()

◆ goMapCancel()

void net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goMapCancel ( )

Action method for cancel.

Definition at line 418 of file GoMapDialog.java.

◆ goMapScrollBottom()

void net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goMapScrollBottom ( )

Action method for scroll bottom.

Definition at line 501 of file GoMapDialog.java.

◆ goMapScrollDown()

void net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goMapScrollDown ( )

Action method for scroll down.

Definition at line 438 of file GoMapDialog.java.

◆ goMapScrollPageDown()

void net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goMapScrollPageDown ( )

Action method for scroll page down.

Definition at line 470 of file GoMapDialog.java.

◆ goMapScrollPageUp()

void net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goMapScrollPageUp ( )

Action method for scroll page up.

Definition at line 449 of file GoMapDialog.java.

◆ goMapScrollTop()

void net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goMapScrollTop ( )

Action method for scroll top.

Definition at line 491 of file GoMapDialog.java.

◆ goMapScrollUp()

void net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goMapScrollUp ( )

Action method for scroll up.

Definition at line 427 of file GoMapDialog.java.

◆ goMapSelectDown()

void net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goMapSelectDown ( )

Action method for select down.

Definition at line 524 of file GoMapDialog.java.

◆ goMapSelectUp()

void net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goMapSelectUp ( )

Action method for select up.

Definition at line 511 of file GoMapDialog.java.

◆ showDialog()

void net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.showDialog ( )

Opens the dialog.

Definition at line 366 of file GoMapDialog.java.

Member Data Documentation

◆ ACTION_BUILDER

final ActionBuilder net.sf.gridarta.gui.dialog.gomap.GoMapDialog< 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

The ActionBuilder.

Definition at line 77 of file GoMapDialog.java.

◆ delayedChangeManager

final DelayedChangeManager net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.delayedChangeManager
private
Initial value:
= new DelayedChangeManager(100, 1000, new DelayedChangeListener() {
@Override
public void change() {
if (!dialogShown) {
return;
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (dialogShown) {
}
}
});
}
})

A DelayedChangeManager for updating search results after mapsIndex changes.

Definition at line 243 of file GoMapDialog.java.

◆ dialog

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

The JDialog instance.

}

Definition at line 83 of file GoMapDialog.java.

◆ dialogShown

boolean net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.dialogShown
private

Whether dialog is currently shown.

Definition at line 118 of file GoMapDialog.java.

◆ indexListener

final IndexListener<MapFile> net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.indexListener
private
Initial value:
= new IndexListener<MapFile>() {
@Override
public void valueAdded(@NotNull final MapFile value) {
}
@Override
public void valueRemoved(@NotNull final MapFile value) {
}
@Override
public void nameChanged() {
}
@Override
public void pendingChanged() {
}
@Override
public void indexingFinished() {
}
}

The IndexListener attached to mapsIndex to update search results after index changes.

The listener is attached only if dialogShown is set; if the dialog is closed, changes are not tracked.

Definition at line 156 of file GoMapDialog.java.

◆ input

final JTextComponent net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.input
private

The map name input field.

Definition at line 89 of file GoMapDialog.java.

◆ list

final JList<MapFile> net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.list = new JList<>(listModel)
private

The JList showing the matching maps.

Definition at line 113 of file GoMapDialog.java.

◆ listModel

final DefaultListModel<MapFile> net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.listModel = new DefaultListModel<>()
private

The list model containing the search results.

Definition at line 107 of file GoMapDialog.java.

◆ mapNameComparator

final Comparator<MapFile> net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapNameComparator
private
Initial value:
= new Comparator<MapFile>() {
@Override
public int compare(@NotNull final MapFile o1, @NotNull final MapFile o2) {
final String name1 = mapsIndex.getName(o1);
final String name2 = mapsIndex.getName(o2);
if (name1 == null) {
return name2 == null ? 0 : -1;
}
if (name2 == null) {
return +1;
}
final int cmp = name1.compareToIgnoreCase(name2);
if (cmp != 0) {
return cmp;
}
return o1.getFile().compareTo(o2.getFile());
}
}

A Comparator that orders map files by map name.

Definition at line 124 of file GoMapDialog.java.

Referenced by net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doSearch().

◆ mapsIndex

◆ mapViewsManager

◆ windowListener

final WindowListener net.sf.gridarta.gui.dialog.gomap.GoMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.windowListener
private

The WindowListener attached to dialog to track opening/closing the dialog.

Registers indexListener to mapsIndex when the dialog is opened and de-registers when the dialog is closed.

Definition at line 192 of file GoMapDialog.java.


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