Search in sources :

Example 1 with MapsManager

use of delta.games.lotro.maps.data.MapsManager in project lotro-companion by dmorcellet.

the class MainFrameController method doMap.

private void doMap() {
    WindowController controller = _windowsManager.getWindow(MapWindowController.IDENTIFIER);
    if (controller == null) {
        File mapsDir = Config.getInstance().getMapsDir();
        MapsManager mapsManager = new MapsManager(mapsDir);
        mapsManager.load();
        controller = new MapWindowController(mapsManager);
        _windowsManager.registerWindow(controller);
        controller.getWindow().setLocationRelativeTo(getFrame());
    }
    controller.bringToFront();
}
Also used : MapsManager(delta.games.lotro.maps.data.MapsManager) MapWindowController(delta.games.lotro.maps.ui.MapWindowController) File(java.io.File) CharacterLevelWindowController(delta.games.lotro.gui.stats.levelling.CharacterLevelWindowController) ReputationSynopsisWindowController(delta.games.lotro.gui.stats.reputation.synopsis.ReputationSynopsisWindowController) WarbandsWindowController(delta.games.lotro.gui.stats.warbands.WarbandsWindowController) WindowController(delta.common.ui.swing.windows.WindowController) DefaultWindowController(delta.common.ui.swing.windows.DefaultWindowController) DeedsExplorerWindowController(delta.games.lotro.gui.deed.DeedsExplorerWindowController) MapWindowController(delta.games.lotro.maps.ui.MapWindowController) CraftingSynopsisWindowController(delta.games.lotro.gui.stats.crafting.synopsis.CraftingSynopsisWindowController)

Example 2 with MapsManager

use of delta.games.lotro.maps.data.MapsManager in project lotro-tools by dmorcellet.

the class MainLinkEditor method main.

/**
 * Main method for this test.
 * @param args Not used.
 */
public static void main(String[] args) {
    File rootDir = new File("../lotro-maps-db");
    final MapsManager mapsManager = new MapsManager(rootDir);
    mapsManager.load();
    Filter<Marker> filter = new Filter<Marker>() {

        public boolean accept(Marker item) {
            return false;
        }
    };
    MapBundle bundle = mapsManager.getMapByKey("breeland");
    MapCanvas canvas = new MapCanvas(mapsManager);
    final NavigationManager navigationManager = new NavigationManager(canvas);
    NavigationListener listener = new NavigationListener() {

        public void mapChangeRequest(String key) {
            navigationManager.setMap(mapsManager.getMapByKey(key).getMap());
        }
    };
    navigationManager.setNavigationListener(listener);
    /*LinkCreationInterator interactor=*/
    new LinkCreationInterator(mapsManager, canvas);
    canvas.setFilter(filter);
    String key = bundle.getKey();
    canvas.setMap(key);
    navigationManager.setMap(bundle.getMap());
    JFrame f = new JFrame();
    String title = bundle.getLabel();
    f.setTitle(title);
    f.getContentPane().add(canvas);
    f.pack();
    f.setVisible(true);
    f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
Also used : MapsManager(delta.games.lotro.maps.data.MapsManager) NavigationManager(delta.games.lotro.maps.ui.NavigationManager) MapCanvas(delta.games.lotro.maps.ui.MapCanvas) Filter(delta.common.utils.collections.filters.Filter) JFrame(javax.swing.JFrame) NavigationListener(delta.games.lotro.maps.ui.NavigationListener) Marker(delta.games.lotro.maps.data.Marker) MapBundle(delta.games.lotro.maps.data.MapBundle) File(java.io.File)

Example 3 with MapsManager

use of delta.games.lotro.maps.data.MapsManager in project lotro-tools by dmorcellet.

the class MainMapsCleaner method doIt.

private void doIt() {
    File rootDir = new File("../lotro-maps-db");
    MapsManager mapsManager = new MapsManager(rootDir);
    mapsManager.load();
    // Clean unused categories
    cleanEmptyCategories(mapsManager);
    MarkersMerge merge = new MarkersMerge();
    merge.doIt(mapsManager);
    // Write map files (for XML data migration, for instance extraction of links to separate files)
    mapsManager.saveMaps();
}
Also used : MapsManager(delta.games.lotro.maps.data.MapsManager) File(java.io.File)

Aggregations

MapsManager (delta.games.lotro.maps.data.MapsManager)3 File (java.io.File)3 DefaultWindowController (delta.common.ui.swing.windows.DefaultWindowController)1 WindowController (delta.common.ui.swing.windows.WindowController)1 Filter (delta.common.utils.collections.filters.Filter)1 DeedsExplorerWindowController (delta.games.lotro.gui.deed.DeedsExplorerWindowController)1 CraftingSynopsisWindowController (delta.games.lotro.gui.stats.crafting.synopsis.CraftingSynopsisWindowController)1 CharacterLevelWindowController (delta.games.lotro.gui.stats.levelling.CharacterLevelWindowController)1 ReputationSynopsisWindowController (delta.games.lotro.gui.stats.reputation.synopsis.ReputationSynopsisWindowController)1 WarbandsWindowController (delta.games.lotro.gui.stats.warbands.WarbandsWindowController)1 MapBundle (delta.games.lotro.maps.data.MapBundle)1 Marker (delta.games.lotro.maps.data.Marker)1 MapCanvas (delta.games.lotro.maps.ui.MapCanvas)1 MapWindowController (delta.games.lotro.maps.ui.MapWindowController)1 NavigationListener (delta.games.lotro.maps.ui.NavigationListener)1 NavigationManager (delta.games.lotro.maps.ui.NavigationManager)1 JFrame (javax.swing.JFrame)1