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(@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)
Creates a new instance.
|
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.
|
@NotNull java.awt.Component |
getComponent()
Returns the component to show in the object chooser.
|
G |
getSelection()
Returns the selected game object.
|
@NotNull java.util.List<G> |
getSelections()
Returns the selected game objects.
|
@NotNull java.lang.String |
getTitle()
Returns the title to display in the object chooser.
|
boolean |
isLockAllPickmaps()
Returns whether all pickmaps are locked.
|
boolean |
isMatching(G gameObject)
Returns whether the current selection matches the given game object.
|
void |
openPickmapMap()
Opens the active pickmap as a normal map for extensive editing.
|
void |
revertPickmap()
Invoked when user wants to revert the current pickmap to previously saved
state.
|
void |
savePickmap()
Saves the current active pickmap.
|
void |
setAction(@NotNull javax.swing.Action action,
@NotNull 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)
Sets whether all pickmaps are locked.
|
void |
setPopupMenu(@NotNull javax.swing.JPopupMenu popupMenu)
Sets the popup menu to show.
|
public PickmapChooserControl(@NotNull @NotNull PickmapChooserModel<G,A,R> pickmapChooserModel, @NotNull @NotNull PickmapSettings pickmapSettings, @NotNull @NotNull NewMapDialogFactory<G,A,R> newMapDialogFactory, @NotNull @NotNull MapFolderTree<G,A,R> mapFolderTree, @NotNull @NotNull MapManager<G,A,R> mapManager, @NotNull @NotNull java.awt.Component parent, @NotNull @NotNull MapViewsManager<G,A,R> mapViewsManager, @NotNull @NotNull FileControl<G,A,R> fileControl, @NotNull @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 @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()
ObjectChooserTab
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@NotNull public @NotNull java.awt.Component getComponent()
ObjectChooserTab
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)
ObjectChooserTab
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)
ObjectChooserTab
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 @NotNull java.util.List<G> getSelections()
ObjectChooserTab
getSelections
in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
@NotNull public @NotNull java.lang.String getTitle()
ObjectChooserTab
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 @NotNull javax.swing.Action action, @NotNull @NotNull java.lang.String name)
EditorAction
Action
instance for this editor action.setAction
in interface EditorAction
action
- the action instancename
- the name of the action