Gridarta 9263
API Documentation

net.sf.gridarta.gui.dialog.bookmarks
Class BookmarkActions<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>

java.lang.Object
  extended by net.sf.gridarta.gui.dialog.bookmarks.BookmarkActions<G,A,R>

public class BookmarkActions<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends Object

Implements actions for managing bookmarks.

Author:
Andreas Kirschbaum

Field Summary
private  Action aAddBookmark
          The Action for "add bookmark".
private static net.sf.japi.swing.action.ActionBuilder ACTION_BUILDER
          The ActionBuilder instance.
private  AbstractMapMenuPreferences bookmarksMapMenuPreferences
          The AbstractMapMenuPreferences for adding new bookmarks.
private  ManageBookmarksDialog<G,A,R> manageBookmarksDialog
          The ManageBookmarksDialog instance.
private  MapImageCache<G,A,R> mapImageCache
          The MapImageCache for creating map previews.
private  MapMenu mapMenu
          The MapMenu defining the bookmarks menu entries.
private  MapViewManager<G,A,R> mapViewManager
          The MapViewManager instance.
private  Component parentComponent
          The parent component for dialogs.
 
Constructor Summary
BookmarkActions(AbstractMapMenuPreferences bookmarksMapMenuPreferences, MapMenu mapMenu, MapViewManager<G,A,R> mapViewManager, Component parentComponent, MapImageCache<G,A,R> mapImageCache)
          Creates a new instance.
 
Method Summary
 void addBookmark()
          Action method for "addBookmark".
private  boolean doAddBookmark(boolean performAction)
          Preforms the action "add bookmark".
 void manageBookmarks()
          Action method for "manage bookmarks".
private  void updateActions()
          Updates the enabled state of all actions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_BUILDER

@NotNull
private static final net.sf.japi.swing.action.ActionBuilder ACTION_BUILDER
The ActionBuilder instance.


bookmarksMapMenuPreferences

@NotNull
private final AbstractMapMenuPreferences bookmarksMapMenuPreferences
The AbstractMapMenuPreferences for adding new bookmarks.


mapMenu

@NotNull
private final MapMenu mapMenu
The MapMenu defining the bookmarks menu entries.


mapImageCache

@NotNull
private final MapImageCache<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> mapImageCache
The MapImageCache for creating map previews.


mapViewManager

@NotNull
private final MapViewManager<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> mapViewManager
The MapViewManager instance.


parentComponent

@NotNull
private final Component parentComponent
The parent component for dialogs.


aAddBookmark

@NotNull
private final Action aAddBookmark
The Action for "add bookmark".


manageBookmarksDialog

@Nullable
private ManageBookmarksDialog<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> manageBookmarksDialog
The ManageBookmarksDialog instance. Set to null if not yet created.

Constructor Detail

BookmarkActions

public BookmarkActions(@NotNull
                       AbstractMapMenuPreferences bookmarksMapMenuPreferences,
                       @NotNull
                       MapMenu mapMenu,
                       @NotNull
                       MapViewManager<G,A,R> mapViewManager,
                       @NotNull
                       Component parentComponent,
                       @NotNull
                       MapImageCache<G,A,R> mapImageCache)
Creates a new instance.

Parameters:
bookmarksMapMenuPreferences - the map menu preferences defining the bookmarks menu entries
mapMenu - the map menu definition the bookmarks menu entries
mapViewManager - the map view manager instance
parentComponent - the parent component for dialogs
mapImageCache - the map image cache for creating map previews
Method Detail

addBookmark

@ActionMethod
public void addBookmark()
Action method for "addBookmark". Creates a new bookmark for the currently opened map.


manageBookmarks

@ActionMethod
public void manageBookmarks()
Action method for "manage bookmarks". Opens the dialog for editing existing bookmarks.


updateActions

private void updateActions()
Updates the enabled state of all actions.


doAddBookmark

private boolean doAddBookmark(boolean performAction)
Preforms the action "add bookmark".

Parameters:
performAction - whether the action should be performed
Returns:
whether the action has or can be performed

Gridarta 9263
API Documentation

SourceForge.net Logo Support This Project freshmeat.net Valid CSS! Feedback: webmaster