Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Feature: Added Evepraisal to the loopup menu and new copy+ menu w…
- Loading branch information
Showing
32 changed files
with
336 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,5 @@ | |
|
||
public interface ItemType { | ||
public Item getItem(); | ||
public long getItemCount(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
src/main/java/net/nikr/eve/jeveasset/gui/shared/menu/JMenuCopyPlus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright 2009-2018 Contributors (see credits.txt) | ||
* | ||
* This file is part of jEveAssets. | ||
* | ||
* jEveAssets is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* jEveAssets is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with jEveAssets; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
*/ | ||
package net.nikr.eve.jeveasset.gui.shared.menu; | ||
|
||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
import java.text.DecimalFormat; | ||
import java.util.Map; | ||
import javax.swing.JMenuItem; | ||
import net.nikr.eve.jeveasset.Program; | ||
import net.nikr.eve.jeveasset.data.sde.Item; | ||
import net.nikr.eve.jeveasset.gui.images.Images; | ||
import net.nikr.eve.jeveasset.gui.shared.components.JTextDialog; | ||
import net.nikr.eve.jeveasset.gui.shared.menu.MenuManager.JAutoMenu; | ||
import net.nikr.eve.jeveasset.i18n.GuiShared; | ||
|
||
public class JMenuCopyPlus<T> extends JAutoMenu<T> { | ||
|
||
private final DecimalFormat number = new DecimalFormat("0"); | ||
private final JTextDialog jTextDialog; | ||
private final JMenuItem jEveMultiBuy; | ||
|
||
|
||
public JMenuCopyPlus(Program program) { | ||
super(GuiShared.get().copyPlus(), program); | ||
setIcon(Images.EDIT_COPY.getIcon()); | ||
|
||
jTextDialog = new JTextDialog(program.getMainWindow().getFrame()); | ||
|
||
jEveMultiBuy = new JMenuItem(GuiShared.get().copyEveMultiBuy()); | ||
jEveMultiBuy.setIcon(Images.MISC_EVE.getIcon()); | ||
jEveMultiBuy.addActionListener(new ActionListener() { | ||
@Override | ||
public void actionPerformed(ActionEvent e) { | ||
StringBuilder builder = new StringBuilder(); | ||
for (Map.Entry<Item, Long> entry : menuData.getItemCounts().entrySet()) { | ||
builder.append(entry.getKey().getTypeName()); | ||
builder.append(" "); | ||
builder.append(number.format(entry.getValue())); | ||
builder.append("\r\n"); | ||
} | ||
jTextDialog.exportText(builder.toString()); | ||
} | ||
}); | ||
add(jEveMultiBuy); | ||
} | ||
|
||
@Override | ||
protected void updateMenuData() { | ||
jEveMultiBuy.setEnabled(!menuData.getItemCounts().isEmpty()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.