public JMenuLookup(final Program program) { super(GuiShared.get().lookup(), program); ListenerClass listener = new ListenerClass(); this.setIcon(Images.LINK_LOOKUP.getIcon()); jDotlan = new JMenu(GuiShared.get().dotlan()); jDotlan.setIcon(Images.LINK_DOTLAN_EVEMAPS.getIcon()); add(jDotlan); jDotlanStation = new JMenuItem(GuiShared.get().station()); jDotlanStation.setIcon(Images.LOC_STATION.getIcon()); jDotlanStation.setActionCommand(MenuLookupAction.EVEMAPS_DOTLAN_STATION.name()); jDotlanStation.addActionListener(listener); jDotlan.add(jDotlanStation); jDotlanSystem = new JMenuItem(GuiShared.get().system()); jDotlanSystem.setIcon(Images.LOC_SYSTEM.getIcon()); jDotlanSystem.setActionCommand(MenuLookupAction.EVEMAPS_DOTLAN_SYSTEM.name()); jDotlanSystem.addActionListener(listener); jDotlan.add(jDotlanSystem); jDotlanRegion = new JMenuItem(GuiShared.get().region()); jDotlanRegion.setIcon(Images.LOC_REGION.getIcon()); jDotlanRegion.setActionCommand(MenuLookupAction.EVEMAPS_DOTLAN_REGION.name()); jDotlanRegion.addActionListener(listener); jDotlan.add(jDotlanRegion); jDotlanLocations = new JMenuItem(TabsOverview.get().locations()); jDotlanLocations.setIcon(Images.LOC_LOCATIONS.getIcon()); addSeparator(); jEveCentral = new JMenuItem(GuiShared.get().eveCentral()); jEveCentral.setIcon(Images.LINK_EVE_CENTRAL.getIcon()); jEveCentral.setActionCommand(MenuLookupAction.EVE_CENTRAL.name()); jEveCentral.addActionListener(listener); add(jEveCentral); jEveMarketdata = new JMenuItem(GuiShared.get().eveMarketdata()); jEveMarketdata.setIcon(Images.LINK_EVE_MARKETDATA.getIcon()); jEveMarketdata.setActionCommand(MenuLookupAction.EVE_MARKETDATA.name()); jEveMarketdata.addActionListener(listener); add(jEveMarketdata); // Dead /* jEveMarketeer = new JMenuItem(GuiShared.get().eveMarketeer()); jEveMarketeer.setIcon(Images.LINK_EVEMARKETEER.getIcon()); jEveMarketeer.setActionCommand(MenuLookupAction.EVEMARKETEER.name()); jEveMarketeer.addActionListener(listener); add(jEveMarketeer); */ jEveMarkets = new JMenuItem(GuiShared.get().eveMarkets()); jEveMarkets.setIcon(Images.LINK_EVE_MARKETS.getIcon()); jEveMarkets.setActionCommand(MenuLookupAction.EVE_MARKETS.name()); jEveMarkets.addActionListener(listener); add(jEveMarkets); // Dead /* jEveAddicts = new JMenuItem(GuiShared.get().eveAddicts()); jEveAddicts.setIcon(Images.LINK_EVE_ADDICTS.getIcon()); jEveAddicts.setActionCommand(MenuLookupAction.EVE_ADDICTS.name()); jEveAddicts.addActionListener(listener); add(jEveAddicts); */ addSeparator(); jChruker = new JMenuItem(GuiShared.get().chruker()); jChruker.setIcon(Images.LINK_CHRUKER.getIcon()); jChruker.setActionCommand(MenuLookupAction.GAMES_CHRUKER.name()); jChruker.addActionListener(listener); add(jChruker); jEveOnline = new JMenuItem(GuiShared.get().eveOnline()); jEveOnline.setIcon(Images.MISC_EVE.getIcon()); jEveOnline.setActionCommand(MenuLookupAction.EVE_ITEM_DATABASE.name()); jEveOnline.addActionListener(listener); add(jEveOnline); }
@Override public void actionPerformed(final ActionEvent e) { if (MenuLookupAction.EVEMAPS_DOTLAN_STATION.name().equals(e.getActionCommand())) { browseDotlan(program, menuData.getStations(), null, null); } if (MenuLookupAction.EVEMAPS_DOTLAN_SYSTEM.name().equals(e.getActionCommand())) { browseDotlan(program, null, menuData.getSystems(), null); } if (MenuLookupAction.EVEMAPS_DOTLAN_REGION.name().equals(e.getActionCommand())) { browseDotlan(program, null, null, menuData.getRegions()); } if (MenuLookupAction.EVE_CENTRAL.name().equals(e.getActionCommand())) { if (!confirmOpenLinks(program, menuData.getMarketTypeIDs().size())) { return; } for (int marketTypeID : menuData.getMarketTypeIDs()) { DesktopUtil.browse( "http://www.eve-central.com/home/quicklook.html?typeid=" + marketTypeID, program); } } if (MenuLookupAction.EVE_MARKETDATA.name().equals(e.getActionCommand())) { if (!confirmOpenLinks(program, menuData.getMarketTypeIDs().size())) { return; } for (int marketTypeID : menuData.getMarketTypeIDs()) { DesktopUtil.browse( "http://eve-marketdata.com/price_check.php?type_id=" + marketTypeID, program); } } // Dead /* if (MenuLookupAction.EVEMARKETEER.name().equals(e.getActionCommand())) { if (!confirmOpenLinks(program, menuData.getMarketTypeIDs().size())) { return; } for (int marketTypeID : menuData.getMarketTypeIDs()) { DesktopUtil.browse("http://www.evemarketeer.com/item/info/" + marketTypeID, program); } } */ if (MenuLookupAction.EVE_MARKETS.name().equals(e.getActionCommand())) { if (!confirmOpenLinks(program, menuData.getMarketTypeIDs().size())) { return; } for (int marketTypeID : menuData.getMarketTypeIDs()) { DesktopUtil.browse( "http://www.eve-markets.net/detail.php?typeid=" + marketTypeID, program); } } // Dead /* if (MenuLookupAction.EVE_ADDICTS.name().equals(e.getActionCommand())) { if (!confirmOpenLinks(program, menuData.getMarketTypeIDs().size())) { return; } for (int marketTypeID : menuData.getMarketTypeIDs()) { DesktopUtil.browse("http://eve.addicts.nl/?typeID=" + marketTypeID, program); } } */ if (MenuLookupAction.GAMES_CHRUKER.name().equals(e.getActionCommand())) { if (!confirmOpenLinks(program, menuData.getTypeIDs().size())) { return; } for (int typeID : menuData.getTypeIDs()) { DesktopUtil.browse( "http://games.chruker.dk/eve_online/item.php?type_id=" + typeID, program); } } if (MenuLookupAction.EVE_ITEM_DATABASE.name().equals(e.getActionCommand())) { if (!confirmOpenLinks(program, menuData.getTypeNames().size())) { return; } for (String typeName : menuData.getTypeNames()) { DesktopUtil.browse( "http://wiki.eveonline.com/wiki/" + typeName.replace(" ", "_"), program); } } }