public class PickmapChooserControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements EditorAction, ObjectChooserTab<G,A,R>
Constructor and Description |
---|
PickmapChooserControl(PickmapChooserModel<G,A,R> pickmapChooserModel,
PickmapSettings pickmapSettings,
NewMapDialogFactory<G,A,R> newMapDialogFactory,
MapFolderTree<G,A,R> mapFolderTree,
MapManager<G,A,R> mapManager,
java.awt.Component parent,
MapViewsManager<G,A,R> mapViewsManager,
FileControl<G,A,R> fileControl,
PickmapChooserView<G,A,R> pickmapChooserView)
Create a PickmapChooserControl.
|
Modifier and Type | Method and Description |
---|---|
void |
addNewPickmap()
Invoked when user wants to open a new pickmap.
|
boolean |
canExit()
Invoked when the user wants to exit the application.
|
void |
deletePickmap()
Invoked when the user wants to delete the active pickmap.
|
java.awt.Component |
getComponent()
Returns the component to show in the object chooser.
|
PickmapState<G,A,R> |
getSelectedPickmap()
Returns the selected pickmap.
|
G |
getSelection()
Returns the selected game object.
|
java.util.List<G> |
getSelections()
Returns the selected game objects.
|
java.lang.String |
getTitle()
Returns the title to display in the object chooser.
|
boolean |
isLockAllPickmaps()
Return whether all pickmaps are locked.
|
boolean |
isMatching(G gameObject)
Returns whether the current selection matches the given game object.
|
void |
openPickmapMap()
Open active pickmap as normal map for extensive editing.
|
void |
revertPickmap()
Invoked when user wants to revert the current pickmap to previously saved
state.
|
void |
savePickmap()
Save current active pickmap.
|
void |
setAction(javax.swing.Action action,
java.lang.String name)
Sets the
Action instance for this editor action. |
void |
setActive(boolean active)
Called whenever this tab becomes active or inactive.
|
void |
setLockAllPickmaps(boolean lockAllPickmaps)
Set whether all pickmaps are locked.
|
void |
setPopupMenu(javax.swing.JPopupMenu popupMenu)
Sets the popup menu to show.
|
public PickmapChooserControl(@NotNull PickmapChooserModel<G,A,R> pickmapChooserModel, @NotNull PickmapSettings pickmapSettings, @NotNull NewMapDialogFactory<G,A,R> newMapDialogFactory, @NotNull MapFolderTree<G,A,R> mapFolderTree, @NotNull MapManager<G,A,R> mapManager, @NotNull java.awt.Component parent, @NotNull MapViewsManager<G,A,R> mapViewsManager, @NotNull FileControl<G,A,R> fileControl, @NotNull PickmapChooserView<G,A,R> pickmapChooserView)
pickmapChooserModel
- the pickmap chooser model to controlpickmapSettings
- the pickmap settings to usenewMapDialogFactory
- the factory for creating new pickmapsmapFolderTree
- the map folder tree instancemapManager
- the map manager instanceparent
- the parent componentmapViewsManager
- the map viewsfileControl
- the file control instancepickmapChooserView
- the view for this controllerpublic void setPopupMenu(@NotNull javax.swing.JPopupMenu popupMenu)
popupMenu
- the popup menu to use@ActionMethod public boolean isLockAllPickmaps()
true
if all pickmaps are locked@Nullable public G getSelection()
getSelection
in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
null
if no game
objects are selectedpublic boolean canExit()
true
if exiting the application is allowed@Nullable public PickmapState<G,A,R> getSelectedPickmap()
@NotNull public java.awt.Component getComponent()
getComponent
in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
public void setActive(boolean active)
setActive
in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
active
- whether this tab is activepublic boolean isMatching(@NotNull G gameObject)
isMatching
in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
gameObject
- the game object to compare to@NotNull public java.util.List<G> getSelections()
getSelections
in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
@NotNull public java.lang.String getTitle()
getTitle
in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
@ActionMethod public void addNewPickmap()
@ActionMethod public void openPickmapMap()
@ActionMethod public void deletePickmap()
@ActionMethod public void savePickmap()
@ActionMethod public void revertPickmap()
@ActionMethod public void setLockAllPickmaps(boolean lockAllPickmaps)
lockAllPickmaps
- true
if all pickmaps are lockedpublic void setAction(@NotNull javax.swing.Action action, @NotNull java.lang.String name)
Action
instance for this editor action.setAction
in interface EditorAction
action
- the action instancename
- the name of the action