From befc2756a022ebd4621bce1269d3341f754943d5 Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Tue, 3 Oct 2023 16:41:28 +0200 Subject: [PATCH 1/8] Release: Making ready for next release iteration 7.9.0 --- pom.xml | 2 +- src/main/java/net/nikr/eve/jeveasset/Program.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 914c2f1a8..fb6576732 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ net.nikr jeveassets jar - 7.8.0 + 7.9.0-SNAPSHOT jeveassets jEveAssets is an out-of-game asset manager for Eve-Online, written in Java http://eve.nikr.net/jeveasset diff --git a/src/main/java/net/nikr/eve/jeveasset/Program.java b/src/main/java/net/nikr/eve/jeveasset/Program.java index c58fdbf51..e3a9bbc03 100644 --- a/src/main/java/net/nikr/eve/jeveasset/Program.java +++ b/src/main/java/net/nikr/eve/jeveasset/Program.java @@ -126,7 +126,7 @@ private enum ProgramAction { TIMER } //Major.Minor.Bugfix [Release Candidate n] [BETA n] [DEV BUILD #n]; - public static final String PROGRAM_VERSION = "7.8.0"; + public static final String PROGRAM_VERSION = "7.9.0 DEV BUILD 1"; public static final String PROGRAM_NAME = "jEveAssets"; public static final String PROGRAM_HOMEPAGE = "https://eve.nikr.net/jeveasset"; private static final boolean PROGRAM_DEV_BUILD = false; From 28cfd0b25f5676d4fd2ded827d3fd7033087b932 Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Sat, 7 Oct 2023 01:23:54 +0200 Subject: [PATCH 2/8] Bug Fix: Added advanced contracting to the slots tool (Reported by MagnarM) --- src/main/java/net/nikr/eve/jeveasset/gui/tabs/slots/Slots.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/slots/Slots.java b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/slots/Slots.java index c3bd47fba..2cf959638 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/slots/Slots.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/slots/Slots.java @@ -178,6 +178,7 @@ public final void count(OwnerType ownerType) { marketOrdersMax = marketOrdersMax + (skill.getActiveSkillLevel() * 32); break; case 25235: //Contracting (+4) + case 73912: //Advanced Contracting (+4) contractCharacterMax = contractCharacterMax + (skill.getActiveSkillLevel() * 4); break; case 25233: //Corporation Contracting (+10) From dfed65ba605c4d1efd3108a8f062e91a7dc3b97c Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Wed, 18 Oct 2023 19:45:49 +0200 Subject: [PATCH 3/8] Bug Fix: Removed outbid auto-update due to impact on ESI --- .../gui/dialogs/update/TaskDialog.java | 45 ++----- .../tabs/orders/MarketOrdersErrorDialog.java | 126 ------------------ .../gui/tabs/orders/MarketOrdersTab.java | 100 +------------- .../nikr/eve/jeveasset/i18n/TabsOrders.java | 6 - .../io/esi/EsiPublicMarketOrdersGetter.java | 2 +- .../eve/jeveasset/i18n/TabsOrders.properties | 6 - 6 files changed, 14 insertions(+), 271 deletions(-) delete mode 100644 src/main/java/net/nikr/eve/jeveasset/gui/tabs/orders/MarketOrdersErrorDialog.java diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/update/TaskDialog.java b/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/update/TaskDialog.java index 0fba397a7..aec0df37d 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/update/TaskDialog.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/update/TaskDialog.java @@ -27,19 +27,25 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Collections; -import java.util.Date; import java.util.List; -import javax.swing.*; +import javax.swing.GroupLayout; import javax.swing.GroupLayout.ParallelGroup; import javax.swing.GroupLayout.SequentialGroup; -import javax.swing.text.BadLocationException; -import javax.swing.text.StyledDocument; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.JScrollPane; +import javax.swing.JTextPane; +import javax.swing.SwingUtilities; +import javax.swing.WindowConstants; import net.nikr.eve.jeveasset.Program; import net.nikr.eve.jeveasset.data.settings.Colors; import net.nikr.eve.jeveasset.gui.frame.StatusPanel; import net.nikr.eve.jeveasset.gui.frame.StatusPanel.Progress; import net.nikr.eve.jeveasset.gui.frame.StatusPanel.UpdateType; -import net.nikr.eve.jeveasset.gui.shared.Formatter; import net.nikr.eve.jeveasset.gui.shared.components.JLockWindow; import net.nikr.eve.jeveasset.gui.shared.components.JLockWindow.LockWorkerAdaptor; import net.nikr.eve.jeveasset.i18n.DialoguesUpdate; @@ -291,10 +297,6 @@ public void task() { public void gui() { jOK.setEnabled(true); jMinimize.setEnabled(false); //Should not minimize after completed - if (completed instanceof TasksCompletedAdvanced) { - StyledDocument doc = ((TasksCompletedAdvanced) completed).getStyledDocument(); - updateErrorDocument(doc); - } } @Override public void hidden() { @@ -313,10 +315,6 @@ public void task() { @Override public void gui() { setVisible(false); - if (completed instanceof TasksCompletedAdvanced) { - StyledDocument doc = ((TasksCompletedAdvanced) completed).getStyledDocument(); - updateErrorDocument(doc); - } } @Override public void hidden() { @@ -328,26 +326,6 @@ public void hidden() { } } - private void updateErrorDocument(StyledDocument doc) { - if (doc == null) { - return; - } - int length = doc.getLength(); - for (UpdateTask task : updateTasks) { - task.insertLog(doc); - } - if (doc.getLength() > length) { //If changed - try { - doc.insertString(length, Formatter.columnDate(new Date()) + "\n\r", null); - if (length > 0) { - doc.insertString(length, "\n\r", null); - } - } catch (BadLocationException ex) { - //Shouldn't be possible.... - } - } - } - private Window getTopWindow(Window in) { for (Window window : in.getOwnedWindows()) { if (window.isVisible()) { @@ -558,6 +536,5 @@ public static interface TasksCompleted { public static interface TasksCompletedAdvanced extends TasksCompleted { public void tasksHidden(TaskDialog taskDialog); - public StyledDocument getStyledDocument(); } } diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/orders/MarketOrdersErrorDialog.java b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/orders/MarketOrdersErrorDialog.java deleted file mode 100644 index 0d28da380..000000000 --- a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/orders/MarketOrdersErrorDialog.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2009-2023 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.tabs.orders; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.GroupLayout; -import javax.swing.JButton; -import javax.swing.JComponent; -import javax.swing.JScrollPane; -import javax.swing.JTextPane; -import javax.swing.text.DefaultStyledDocument; -import javax.swing.text.StyledDocument; -import net.nikr.eve.jeveasset.Program; -import net.nikr.eve.jeveasset.data.settings.Colors; -import net.nikr.eve.jeveasset.gui.images.Images; -import net.nikr.eve.jeveasset.gui.shared.components.JDialogCentered; -import net.nikr.eve.jeveasset.i18n.TabsOrders; - - -public class MarketOrdersErrorDialog extends JDialogCentered { - - public static enum ErrorLevel { - CLEAR, INFO, WARN, ERROR - } - - private final JButton jClose; - private final StyledDocument document; - private ErrorLevel errorLevel = ErrorLevel.CLEAR; - - public MarketOrdersErrorDialog(Program program) { - super(program, TabsOrders.get().logTitle(), Images.UPDATE_DONE_ERROR.getImage()); - - document = new DefaultStyledDocument(); - JTextPane jText = new JTextPane(document); - jText.setEditable(false); - jText.setOpaque(false); - jText.setBackground(Colors.COMPONENT_TRANSPARENT.getColor()); - - jClose = new JButton(TabsOrders.get().logClose()); - jClose.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - setVisible(false); - } - }); - - JButton jClear = new JButton(TabsOrders.get().logClear()); - jClear.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - jText.setText(""); - errorLevel = ErrorLevel.CLEAR; - } - }); - - JScrollPane jTextScroll = new JScrollPane(jText); - - layout.setHorizontalGroup( - layout.createParallelGroup(GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jClear, Program.getButtonsWidth(), Program.getButtonsWidth(), Program.getButtonsWidth()) - ) - .addComponent(jTextScroll, 500, 500, Integer.MAX_VALUE) - .addGroup(layout.createSequentialGroup() - .addGap(0, 0, Integer.MAX_VALUE) - .addComponent(jClose, Program.getButtonsWidth(), Program.getButtonsWidth(), Program.getButtonsWidth()) - ) - ); - layout.setVerticalGroup( - layout.createSequentialGroup() - .addComponent(jClear, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) - .addComponent(jTextScroll, 400, 400, Integer.MAX_VALUE) - .addComponent(jClose, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) - ); - } - - public StyledDocument getDocument() { - return document; - } - - public void setErrorLevel(ErrorLevel errorLevel) { - if (this.errorLevel.ordinal() < errorLevel.ordinal()) { - this.errorLevel = errorLevel; - } - } - - public ErrorLevel getErrorLevel() { - return errorLevel; - } - - @Override - protected JComponent getDefaultFocus() { - return jClose; - } - - @Override - protected JButton getDefaultButton() { - return jClose; - } - - @Override - protected void windowShown() {} - - @Override - protected void save() {} - -} diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/orders/MarketOrdersTab.java b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/orders/MarketOrdersTab.java index d0124b219..3cafba42c 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/orders/MarketOrdersTab.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/orders/MarketOrdersTab.java @@ -55,7 +55,6 @@ import javax.swing.GroupLayout; import javax.swing.Icon; import javax.swing.JButton; -import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JLabel; @@ -65,7 +64,6 @@ import javax.swing.JRadioButtonMenuItem; import javax.swing.JScrollPane; import javax.swing.Timer; -import javax.swing.text.StyledDocument; import net.nikr.eve.jeveasset.Program; import net.nikr.eve.jeveasset.data.api.accounts.EsiOwner; import net.nikr.eve.jeveasset.data.api.accounts.OwnerType; @@ -105,7 +103,6 @@ import net.nikr.eve.jeveasset.gui.shared.table.JAutoColumnTable; import net.nikr.eve.jeveasset.gui.shared.table.PaddingTableCellRenderer; import net.nikr.eve.jeveasset.gui.shared.table.TableFormatFactory; -import net.nikr.eve.jeveasset.gui.tabs.orders.MarketOrdersErrorDialog.ErrorLevel; import net.nikr.eve.jeveasset.gui.tabs.orders.OutbidProcesser.OutbidProcesserInput; import net.nikr.eve.jeveasset.gui.tabs.orders.OutbidProcesser.OutbidProcesserOutput; import net.nikr.eve.jeveasset.i18n.DialoguesUpdate; @@ -123,9 +120,7 @@ public class MarketOrdersTab extends JMainTabPrimary { private enum MarketOrdersAction { UPDATE, - AUTO_UPDATE, ORDER_TYPE, - ERROR_LOG, ORDER_RANGE } @@ -133,12 +128,9 @@ private enum MarketOrdersAction { private final JAutoColumnTable jTable; private final JButton jUpdate; - private final JButton jErrors; - private final JCheckBox jAutoUpdate; private final JButton jClearNew; private final JComboBox jOrderRangeNext; private final JComboBox jOrderType; - private final MarketOrdersErrorDialog jMarketOrdersErrorDialog; private final JStatusLabel jSellOrdersTotal; private final JStatusLabel jBuyOrdersTotal; private final JStatusLabel jEscrowTotal; @@ -151,7 +143,6 @@ private enum MarketOrdersAction { private final FileListener fileListener; private static Date lastLogUpdate = null; private static String clipboardData = null; - private java.util.Timer updateTimer; private boolean showUnknownLocationsWarning = true; //Table @@ -169,8 +160,6 @@ public MarketOrdersTab(final Program program) { ListenerClass listener = new ListenerClass(); - jMarketOrdersErrorDialog = new MarketOrdersErrorDialog(program); - JFixedToolBar jToolBar = new JFixedToolBar(); jClearNew = new JButton(TabsOrders.get().clearNew(), Images.UPDATE_DONE_OK.getIcon()); @@ -222,23 +211,11 @@ public void actionPerformed(ActionEvent e) { jToolBar.addSeparator(); - jErrors = new JButton(TabsOrders.get().logOK()); - jErrors.setActionCommand(MarketOrdersAction.ERROR_LOG.name()); - jErrors.addActionListener(listener); - jErrors.setDisabledIcon(Images.EDIT_SET.getIcon()); - jErrors.setEnabled(false); - jToolBar.addButton(jErrors); - jUpdate = new JButton(TabsOrders.get().updateOutbidEsi(), Images.DIALOG_UPDATE.getIcon()); jUpdate.setActionCommand(MarketOrdersAction.UPDATE.name()); jUpdate.addActionListener(listener); jToolBar.addButton(jUpdate); - jAutoUpdate = new JCheckBox(TabsOrders.get().updateOutbidEsiAuto()); - jAutoUpdate.setActionCommand(MarketOrdersAction.AUTO_UPDATE.name()); - jAutoUpdate.addActionListener(listener); - jToolBar.addButton(jAutoUpdate); - //Table Format tableFormat = TableFormatFactory.marketTableFormat(); //Backend @@ -374,32 +351,6 @@ public Collection getLocations() { } } - private void schedule() { - if (jAutoUpdate.isSelected()) { - long delay = Math.max(0, Settings.get().getPublicMarketOrdersNextUpdate().getTime() - System.currentTimeMillis()); - if (updateTimer != null) { //Cancel old tasks - updateTimer.cancel(); - } - updateTimer = new java.util.Timer(); - updateTimer.schedule(new java.util.TimerTask() { - @Override - public void run() { - Program.ensureEDT(new Runnable() { - @Override - public void run() { - updateESI(); - } - }); - updateTimer = null; - } - }, delay); - } else { - if (updateTimer != null) { - updateTimer.cancel(); - } - } - } - public synchronized static Date getLastLogUpdate() { return lastLogUpdate; } @@ -480,32 +431,11 @@ private static void copy(MyMarketOrder marketOrder, Double price) { } } - private void updateErrorLogButton() { - switch (jMarketOrdersErrorDialog.getErrorLevel()) { - case ERROR: - jErrors.setIcon(Images.UPDATE_DONE_ERROR.getIcon()); - jErrors.setEnabled(true); - break; - case WARN: - jErrors.setIcon(Images.UPDATE_DONE_SOME.getIcon()); - jErrors.setEnabled(true); - break; - case INFO: - jErrors.setIcon(Images.UPDATE_DONE_INFO.getIcon()); - jErrors.setEnabled(true); - break; - case CLEAR: - jErrors.setEnabled(false); - break; - } - jErrors.setText(jMarketOrdersErrorDialog.getDocument().getLength() > 0 ? TabsOrders.get().logError() : TabsOrders.get().logOK()); - } - private void updateDates() { Date nextUpdate = Settings.get().getPublicMarketOrdersNextUpdate(); if (Updatable.isUpdatable(nextUpdate)) { jUpdate.setText(TabsOrders.get().updateOutbidEsi()); - jUpdate.setEnabled(!jAutoUpdate.isSelected()); + jUpdate.setEnabled(true); } else { long diff = nextUpdate.getTime() - System.currentTimeMillis(); if (diff < 1000) { @@ -552,9 +482,6 @@ private void updateESI() { OutbidProcesserInput input = new OutbidProcesserInput(program.getProfileData(), Settings.get().getOutbidOrderRange()); if (input.getRegionIDs().isEmpty()) { LOG.info("no active orders found"); - if (jAutoUpdate.isSelected()) { - jAutoUpdate.setSelected(false); - } updateDates(); JOptionPane.showMessageDialog(program.getMainWindow().getFrame(), TabsOrders.get().updateNoActiveMsg(), TabsOrders.get().updateNoActiveTitle(), JOptionPane.PLAIN_MESSAGE); return; @@ -562,7 +489,7 @@ private void updateESI() { final Date currentUpdate = Settings.get().getPublicMarketOrdersNextUpdate(); OutbidProcesserOutput output = new OutbidProcesserOutput(); final PublicMarkerOrdersUpdateTask updateTask = new PublicMarkerOrdersUpdateTask(input, output); - TaskDialog taskDialog = new TaskDialog(program, updateTask, false, jAutoUpdate.isSelected(), jAutoUpdate.isSelected(), StatusPanel.UpdateType.PUBLIC_MARKET_ORDERS, new TaskDialog.TasksCompletedAdvanced() { + TaskDialog taskDialog = new TaskDialog(program, updateTask, false, false, false, StatusPanel.UpdateType.PUBLIC_MARKET_ORDERS, new TaskDialog.TasksCompletedAdvanced() { @Override public void tasksCompleted(TaskDialog taskDialog) { //Set data @@ -591,8 +518,6 @@ public void tasksCompleted(TaskDialog taskDialog) { } //Update time again timer.start(); - //Schedule next update - schedule(); Program.ensureEDT(new Runnable() { @Override public void run() { @@ -624,19 +549,6 @@ public void tasksHidden(TaskDialog taskDialog) { } } } - if (updateTask.hasError()) { - jMarketOrdersErrorDialog.setErrorLevel(ErrorLevel.ERROR); - } else if (updateTask.hasWarning()) { - jMarketOrdersErrorDialog.setErrorLevel(ErrorLevel.WARN); - } else if (updateTask.hasInfo()) { - jMarketOrdersErrorDialog.setErrorLevel(ErrorLevel.INFO); - } - updateErrorLogButton(); - } - - @Override - public StyledDocument getStyledDocument() { - return jMarketOrdersErrorDialog.getDocument(); } }); } @@ -777,17 +689,9 @@ public void actionPerformed(ActionEvent e) { if (MarketOrdersAction.UPDATE.name().equals(e.getActionCommand())) { updateDates(); updateESI(); - } else if (MarketOrdersAction.AUTO_UPDATE.name().equals(e.getActionCommand())) { - if (jAutoUpdate.isSelected()) { - updateDates(); - } - schedule(); } else if (MarketOrdersAction.ORDER_TYPE.name().equals(e.getActionCommand())) { String value = jOrderType.getItemAt(jOrderType.getSelectedIndex()); fileListener.setBuy(TabsOrders.get().updateOutbidFileBuy().equals(value)); - } else if (MarketOrdersAction.ERROR_LOG.name().equals(e.getActionCommand())) { - jMarketOrdersErrorDialog.setVisible(true); - updateErrorLogButton(); } else if (MarketOrdersAction.ORDER_RANGE.name().equals(e.getActionCommand())) { MarketOrderRange range = jOrderRangeNext.getItemAt(jOrderRangeNext.getSelectedIndex()); Settings.lock("Outbid Range"); diff --git a/src/main/java/net/nikr/eve/jeveasset/i18n/TabsOrders.java b/src/main/java/net/nikr/eve/jeveasset/i18n/TabsOrders.java index ba5a87849..5f07add33 100644 --- a/src/main/java/net/nikr/eve/jeveasset/i18n/TabsOrders.java +++ b/src/main/java/net/nikr/eve/jeveasset/i18n/TabsOrders.java @@ -104,11 +104,6 @@ public TabsOrders(final Locale locale) { public abstract String lastEsiUpdateToolTip(); public abstract String lastLogUpdateToolTip(); public abstract String lastClipboardToolTip(); - public abstract String logClear(); - public abstract String logClose(); - public abstract String logError(); - public abstract String logOK(); - public abstract String logTitle(); public abstract String market(); public abstract String marketLogTypeToolTip(); public abstract String none(); @@ -145,7 +140,6 @@ public TabsOrders(final Locale locale) { public abstract String updateNoActiveMsg(); public abstract String updateNoActiveTitle(); public abstract String updateOutbidEsi(); - public abstract String updateOutbidEsiAuto(); public abstract String updateOutbidFileBuy(); public abstract String updateOutbidFileSell(); public abstract String updateOutbidWhen(String time); diff --git a/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiPublicMarketOrdersGetter.java b/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiPublicMarketOrdersGetter.java index 8500850c1..54aa81796 100644 --- a/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiPublicMarketOrdersGetter.java +++ b/src/main/java/net/nikr/eve/jeveasset/io/esi/EsiPublicMarketOrdersGetter.java @@ -103,7 +103,7 @@ public ApiResponse> get(Integer page) throws ApiExcep } }); if (modified) { - addError("last-modified changed while updating", "Cache expired while updating"); + addWarning("last-modified changed while updating", "Cache expired while updating"); } publicMarketOrders = false; Map> orders = EsiConverter.toPublicMarketOrders(responses); diff --git a/src/main/resources/net/nikr/eve/jeveasset/i18n/TabsOrders.properties b/src/main/resources/net/nikr/eve/jeveasset/i18n/TabsOrders.properties index 6b3a2480c..98c7228f3 100644 --- a/src/main/resources/net/nikr/eve/jeveasset/i18n/TabsOrders.properties +++ b/src/main/resources/net/nikr/eve/jeveasset/i18n/TabsOrders.properties @@ -70,11 +70,6 @@ eveUiOpen=Open lastEsiUpdateToolTip=Last Esi update lastLogUpdateToolTip=Last MarketLog update lastClipboardToolTip=Last value copied to the clipboard -logClear=Clear Log -logClose=Close -logError=Error Log -logOK=No Errors -logTitle=Error Log market=Market Orders marketLogTypeToolTip=Order type copied to the clipboard on MarketLog import none=None @@ -115,7 +110,6 @@ updateNoActiveMsg=No active market orders\r\n\ (orders in unknown locations are ignored) updateNoActiveTitle=Update Cancelled updateOutbidEsi=Update -updateOutbidEsiAuto=Auto Update updateOutbidFileBuy=Buy updateOutbidFileSell=Sell updateOutbidWhen={0} From 0d0cab8a2c9d5d5da31f62c1218c01c56d5db03f Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Fri, 20 Oct 2023 12:42:29 +0200 Subject: [PATCH 4/8] Release: 7.8.1 changelog.txt --- changelog.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/changelog.txt b/changelog.txt index dc0799759..7575220fa 100644 --- a/changelog.txt +++ b/changelog.txt @@ -15,6 +15,13 @@ # # # # # # ## # # # # # # # # #### # # # # # # #### #### #### #### #### +________________________________________________________________________________ +_7.8.1__________________________________________________________________________ + +Bug Fixes: +-Removed outbid auto-update due to impact on esi +-Added advanced contracting to the slots tool (Reported by MagnarM) + ________________________________________________________________________________ _7.8.0__________________________________________________________________________ From c554f0828adafe5d9a34af0949b724d01261a8ba Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Mon, 23 Oct 2023 11:49:07 +0200 Subject: [PATCH 5/8] Release: Static Data 2023-10-23 --- data/data.dat | 2 +- data/items.xml | 897 ++++++++++++++++++++++++++++++++++----------- data/jumps.xml | 8 + data/locations.xml | 3 + 4 files changed, 685 insertions(+), 225 deletions(-) diff --git a/data/data.dat b/data/data.dat index e42f071fa..264763074 100644 --- a/data/data.dat +++ b/data/data.dat @@ -1 +1 @@ -2023-06-22 \ No newline at end of file +2023-10-23 \ No newline at end of file diff --git a/data/items.xml b/data/items.xml index fed3dbf95..7a0202216 100644 --- a/data/items.xml +++ b/data/items.xml @@ -84348,8 +84348,8 @@ - - + + @@ -84357,19 +84357,19 @@ - + - + - + - + @@ -84380,7 +84380,7 @@ - + @@ -99531,7 +99531,7 @@ - + @@ -105133,20 +105133,20 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -105196,31 +105196,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -105230,22 +105230,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -105584,14 +105584,14 @@ - - - - - - - - + + + + + + + + @@ -105622,17 +105622,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -106745,102 +106745,102 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -106869,8 +106869,8 @@ - - + + @@ -106887,12 +106887,12 @@ - - - - - - + + + + + + @@ -106933,8 +106933,8 @@ - - + + @@ -106970,42 +106970,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -107479,6 +107473,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -107488,4 +107507,434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/jumps.xml b/data/jumps.xml index 06fcd4a43..e31c7f6a4 100644 --- a/data/jumps.xml +++ b/data/jumps.xml @@ -2470,6 +2470,7 @@ + @@ -3042,6 +3043,7 @@ + @@ -4898,6 +4900,7 @@ + @@ -9699,6 +9702,7 @@ + @@ -13769,4 +13773,8 @@ + + + + diff --git a/data/locations.xml b/data/locations.xml index 487f9c2da..bed232186 100644 --- a/data/locations.xml +++ b/data/locations.xml @@ -69,6 +69,7 @@ + @@ -901,6 +902,7 @@ + @@ -6716,6 +6718,7 @@ + From 26502e844bd25d214d8e1f24ef623ce3cd9b9994 Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Mon, 20 Nov 2023 17:59:31 +0100 Subject: [PATCH 6/8] Release: Static Data 2023-11-20 --- data/data.dat | 2 +- data/items.xml | 475 +++++++++++++++++++++++++++++++++++---------- data/locations.xml | 1 + 3 files changed, 377 insertions(+), 101 deletions(-) diff --git a/data/data.dat b/data/data.dat index 264763074..a2a39cff4 100644 --- a/data/data.dat +++ b/data/data.dat @@ -1 +1 @@ -2023-10-23 \ No newline at end of file +2023-11-20 \ No newline at end of file diff --git a/data/items.xml b/data/items.xml index 7a0202216..a8c61b707 100644 --- a/data/items.xml +++ b/data/items.xml @@ -32283,7 +32283,7 @@ - + @@ -72957,7 +72957,7 @@ - + @@ -72965,7 +72965,7 @@ - + @@ -72973,7 +72973,7 @@ - + @@ -72981,7 +72981,7 @@ - + @@ -82706,22 +82706,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -82779,30 +82779,30 @@ - - - - - - - - - - - - - - - - + + - - - + + + + + + + + + + + + + + + + + + - - + @@ -88018,29 +88018,29 @@ - - - - - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + @@ -89007,30 +89007,30 @@ - - - - - - - - - - - - - - - - + + - - - + + + + + + + + + + + + + + + + + + - - + @@ -90796,8 +90796,8 @@ - - + + @@ -98928,7 +98928,7 @@ - + @@ -98937,7 +98937,7 @@ - + @@ -98946,11 +98946,11 @@ - + - + @@ -98968,7 +98968,7 @@ - + @@ -98979,7 +98979,7 @@ - + @@ -98990,11 +98990,11 @@ - + - + @@ -99014,7 +99014,7 @@ - + @@ -99026,7 +99026,7 @@ - + @@ -99038,11 +99038,11 @@ - + - + @@ -105284,10 +105284,10 @@ - - - - + + + + @@ -107771,6 +107771,7 @@ + @@ -107821,6 +107822,7 @@ + @@ -107841,11 +107843,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -107867,16 +107905,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -107917,6 +107979,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -107937,4 +108027,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/locations.xml b/data/locations.xml index bed232186..16cb53ee8 100644 --- a/data/locations.xml +++ b/data/locations.xml @@ -14947,6 +14947,7 @@ + From a0b33b9159a56b629542c0d55321526fb7230cb2 Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Fri, 5 Jan 2024 11:45:44 +0100 Subject: [PATCH 7/8] Release: Static Data 2024-01-05 --- data/data.dat | 2 +- data/items.xml | 245 ++++++++++++++++++++++++++++++++++++++------- data/locations.xml | 64 ++++++------ 3 files changed, 243 insertions(+), 68 deletions(-) diff --git a/data/data.dat b/data/data.dat index a2a39cff4..057fc0a27 100644 --- a/data/data.dat +++ b/data/data.dat @@ -1 +1 @@ -2023-11-20 \ No newline at end of file +2024-01-05 \ No newline at end of file diff --git a/data/items.xml b/data/items.xml index a8c61b707..cef878f61 100644 --- a/data/items.xml +++ b/data/items.xml @@ -55706,10 +55706,10 @@ - - + + @@ -100444,7 +100444,7 @@ - + @@ -100553,11 +100553,11 @@ - - - - - + + + + + @@ -106155,23 +106155,23 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -106215,17 +106215,17 @@ - - - - - - - - - + + + + + + + + + - + @@ -107470,6 +107470,15 @@ + + + + + + + + + @@ -107905,6 +107914,12 @@ + + + + + + @@ -107933,6 +107948,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -108064,6 +108114,18 @@ + + + + + + + + + + + + @@ -108197,6 +108259,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -108208,8 +108303,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/locations.xml b/data/locations.xml index 16cb53ee8..7e0838c53 100644 --- a/data/locations.xml +++ b/data/locations.xml @@ -3339,7 +3339,7 @@ - + @@ -3962,7 +3962,7 @@ - + @@ -4300,7 +4300,7 @@ - + @@ -6279,7 +6279,7 @@ - + @@ -6287,7 +6287,7 @@ - + @@ -9759,12 +9759,12 @@ - + - - + + @@ -10143,7 +10143,7 @@ - + @@ -11227,7 +11227,7 @@ - + @@ -11467,7 +11467,7 @@ - + @@ -11593,10 +11593,10 @@ - + - - + + @@ -11617,7 +11617,7 @@ - + @@ -12893,9 +12893,9 @@ - + - + @@ -13031,7 +13031,7 @@ - + @@ -13160,7 +13160,7 @@ - + @@ -13257,8 +13257,8 @@ - - + + @@ -13484,7 +13484,7 @@ - + @@ -13589,9 +13589,9 @@ - + - + @@ -13700,7 +13700,7 @@ - + @@ -13720,7 +13720,7 @@ - + @@ -13924,7 +13924,7 @@ - + @@ -14900,11 +14900,11 @@ - + - + @@ -14925,13 +14925,13 @@ - - + + - + From 86c608eb9fc3a1a18da76266b25c04dfb467c20c Mon Sep 17 00:00:00 2001 From: GoldenGnu Date: Thu, 2 May 2024 14:56:12 +0200 Subject: [PATCH 8/8] New Feature: Show/Hide container ItemID in the Assets and Tree tools Issue #401 --- .../eve/jeveasset/data/api/my/MyAsset.java | 11 +- .../jeveasset/data/profile/ProfileData.java | 26 +--- .../eve/jeveasset/data/settings/Settings.java | 15 ++- .../settings/AssetsToolSettingsPanel.java | 18 ++- .../gui/dialogs/settings/JSettingsPanel.java | 1 + .../gui/dialogs/settings/SettingsDialog.java | 4 + .../gui/shared/components/JMainTab.java | 8 ++ .../gui/shared/filter/FilterControl.java | 2 +- .../gui/shared/filter/FilterMatcher.java | 52 ++++++-- .../gui/shared/table/JAutoColumnTable.java | 2 + .../table/containers/AssetContainer.java | 113 ++++++++++++++++++ .../gui/tabs/assets/AssetTableFormat.java | 5 +- .../gui/tabs/journal/JournalTab.java | 4 +- .../gui/tabs/tree/TreeTableFormat.java | 5 +- .../eve/jeveasset/i18n/DialoguesSettings.java | 1 + .../i18n/DialoguesSettings.properties | 1 + .../gui/shared/filter/FilterMatcherTest.java | 9 +- .../io/esi/EsiDeprecationOnlineTest.java | 1 + .../jeveasset/tests/mocks/FakeSettings.java | 10 ++ 19 files changed, 233 insertions(+), 55 deletions(-) create mode 100644 src/main/java/net/nikr/eve/jeveasset/gui/shared/table/containers/AssetContainer.java diff --git a/src/main/java/net/nikr/eve/jeveasset/data/api/my/MyAsset.java b/src/main/java/net/nikr/eve/jeveasset/data/api/my/MyAsset.java index 71f460271..091761079 100644 --- a/src/main/java/net/nikr/eve/jeveasset/data/api/my/MyAsset.java +++ b/src/main/java/net/nikr/eve/jeveasset/data/api/my/MyAsset.java @@ -45,6 +45,7 @@ import net.nikr.eve.jeveasset.data.settings.types.TagsType; import net.nikr.eve.jeveasset.gui.shared.Formatter; import net.nikr.eve.jeveasset.gui.shared.menu.JMenuInfo.InfoItem; +import net.nikr.eve.jeveasset.gui.shared.table.containers.AssetContainer; import net.nikr.eve.jeveasset.gui.tabs.assets.AssetsTab; import net.nikr.eve.jeveasset.i18n.DataModelAsset; import net.nikr.eve.jeveasset.i18n.General; @@ -70,7 +71,7 @@ public class MyAsset extends RawAsset implements Comparable, InfoItem, //Dynamic values private String name; private String itemName = null; - private String container = ""; + private AssetContainer container = new AssetContainer(); private PriceData priceData = new PriceData(); private UserItem userPrice; private long typeCount = 0; @@ -208,6 +209,10 @@ public List getAssets() { } public String getContainer() { + return container.getContainer(); + } + + public AssetContainer getAssetContainer() { return container; } @@ -457,8 +462,8 @@ public void setBlueprint(MyBlueprint blueprint) { updateBlueprint(); } - public void setContainer(final String container) { - this.container = container; + public void updateContainer() { + this.container = new AssetContainer(this); } public void setMarketPriceData(final MarketPriceData marketPriceData) { diff --git a/src/main/java/net/nikr/eve/jeveasset/data/profile/ProfileData.java b/src/main/java/net/nikr/eve/jeveasset/data/profile/ProfileData.java index 2dc916ef7..ada70821a 100644 --- a/src/main/java/net/nikr/eve/jeveasset/data/profile/ProfileData.java +++ b/src/main/java/net/nikr/eve/jeveasset/data/profile/ProfileData.java @@ -1301,7 +1301,7 @@ private void addAssets(final List assets, List addTo, Map found, List assets) } private void updateContainer(MyAsset asset) { - StringBuilder builder = new StringBuilder(); - if (asset.getParents().isEmpty()) { - builder.append(General.get().none()); - } else { - boolean first = true; - for (MyAsset parentAsset : asset.getParents()) { - if (first) { - first = false; - } else { - builder.append(" > "); - } - builder.append(containerName(parentAsset)); - } - } - asset.setContainer(builder.toString().intern()); + asset.updateContainer(); } private void updateStructureAssets(final MyAsset asset, final MyAsset structure) { @@ -1401,14 +1387,6 @@ private void updateStructureAssets(final MyAsset asset, final MyAsset structure) } } - public static String containerName(MyAsset asset) { - if (!asset.isUserName()) { - return asset.getName() + " #" + asset.getItemID(); - } else { - return asset.getName(); - } - } - private static class Match implements Comparable>{ private final T t; private final double amount; diff --git a/src/main/java/net/nikr/eve/jeveasset/data/settings/Settings.java b/src/main/java/net/nikr/eve/jeveasset/data/settings/Settings.java index f13b4e365..1ad78ecdc 100644 --- a/src/main/java/net/nikr/eve/jeveasset/data/settings/Settings.java +++ b/src/main/java/net/nikr/eve/jeveasset/data/settings/Settings.java @@ -99,7 +99,8 @@ public static enum SettingFlag { FLAG_SAVE_CONTRACT_HISTORY, FLAG_SAVE_MINING_HISTORY, FLAG_MANUFACTURING_DEFAULT, - FLAG_EASY_CHART_COLORS + FLAG_EASY_CHART_COLORS, + FLAG_CONTAINERS_SHOW_ITEM_ID } public static enum TransactionProfitPrice { @@ -224,6 +225,7 @@ public String toString() { private Boolean highlightSelectedRows = null; //Assets private Boolean reprocessColors = null; //Assets private Boolean stockpileHalfColors = null; //Stockpile + private Boolean containersShowItemID = null; //Stockpile //Table settings //Filters Saved by ExportFilterControl.saveSettings() //Lock OK @@ -294,6 +296,7 @@ protected Settings() { flags.put(SettingFlag.FLAG_SAVE_MINING_HISTORY, true); flags.put(SettingFlag.FLAG_MANUFACTURING_DEFAULT, true); flags.put(SettingFlag.FLAG_EASY_CHART_COLORS, false); + flags.put(SettingFlag.FLAG_CONTAINERS_SHOW_ITEM_ID, true); cacheFlags(); //Default Filters List filter; @@ -474,6 +477,7 @@ public final void cacheFlags() { filterOnEnter = flags.get(SettingFlag.FLAG_FILTER_ON_ENTER); reprocessColors = flags.get(SettingFlag.FLAG_REPROCESS_COLORS); stockpileHalfColors = flags.get(SettingFlag.FLAG_STOCKPILE_HALF_COLORS); + containersShowItemID = flags.get(SettingFlag.FLAG_CONTAINERS_SHOW_ITEM_ID); } public ReprocessSettings getReprocessSettings() { @@ -852,6 +856,15 @@ public void setEasyChartColors(final boolean easyChartColors) { flags.put(SettingFlag.FLAG_EASY_CHART_COLORS, easyChartColors); } + public boolean isContainersShowItemID() { + return containersShowItemID; + } + + public void setContainersShowItemID(final boolean containersShowItemID) { + flags.put(SettingFlag.FLAG_CONTAINERS_SHOW_ITEM_ID, containersShowItemID); + this.containersShowItemID = containersShowItemID; + } + public boolean isTransactionHistory() { return flags.get(SettingFlag.FLAG_TRANSACTION_HISTORY); } diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/settings/AssetsToolSettingsPanel.java b/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/settings/AssetsToolSettingsPanel.java index 32e7cb06d..b290f80f6 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/settings/AssetsToolSettingsPanel.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/settings/AssetsToolSettingsPanel.java @@ -37,6 +37,7 @@ public class AssetsToolSettingsPanel extends JSettingsPanel { private final JCheckBox jBuyContracts; private final JCheckBox jManufacturing; private final JCheckBox jCopying; + private final JCheckBox jContainerItemID; public AssetsToolSettingsPanel(final Program program, final SettingsDialog settingsDialog) { super(program, settingsDialog, DialoguesSettings.get().assets(), Images.TOOL_ASSETS.getIcon()); @@ -47,6 +48,7 @@ public AssetsToolSettingsPanel(final Program program, final SettingsDialog setti jBuyContracts = new JCheckBox(DialoguesSettings.get().includeBuyContracts()); jManufacturing = new JCheckBox(DialoguesSettings.get().includeManufacturing()); jCopying = new JCheckBox(DialoguesSettings.get().includeCopying()); + jContainerItemID = new JCheckBox(DialoguesSettings.get().showContainerItemID()); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) @@ -56,6 +58,7 @@ public AssetsToolSettingsPanel(final Program program, final SettingsDialog setti .addComponent(jBuyContracts) .addComponent(jManufacturing) .addComponent(jCopying) + .addComponent(jContainerItemID) ); layout.setVerticalGroup( layout.createSequentialGroup() @@ -65,25 +68,35 @@ public AssetsToolSettingsPanel(final Program program, final SettingsDialog setti .addComponent(jBuyContracts, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) .addComponent(jManufacturing, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) .addComponent(jCopying, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) + .addGap(5) + .addComponent(jContainerItemID, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) ); } @Override public UpdateType save() { - boolean update = jSellOrders.isSelected() != Settings.get().isIncludeSellOrders() + boolean fullUpdate = jSellOrders.isSelected() != Settings.get().isIncludeSellOrders() || jBuyOrders.isSelected() != Settings.get().isIncludeBuyOrders() || jSellContracts.isSelected() != Settings.get().isIncludeSellContracts() || jBuyContracts.isSelected() != Settings.get().isIncludeBuyContracts() || jManufacturing.isSelected() != Settings.get().isIncludeManufacturing() || jCopying.isSelected() != Settings.get().isIncludeCopying() ; + boolean updateContainers = jContainerItemID.isSelected() != Settings.get().isContainersShowItemID(); Settings.get().setIncludeSellOrders(jSellOrders.isSelected()); Settings.get().setIncludeBuyOrders(jBuyOrders.isSelected()); Settings.get().setIncludeSellContracts(jSellContracts.isSelected()); Settings.get().setIncludeBuyContracts(jBuyContracts.isSelected()); Settings.get().setIncludeManufacturing(jManufacturing.isSelected()); Settings.get().setIncludeCopying(jCopying.isSelected()); - return update ? UpdateType.FULL_UPDATE : UpdateType.NONE; + Settings.get().setContainersShowItemID(jContainerItemID.isSelected()); + if (fullUpdate) { + return UpdateType.FULL_UPDATE; + } else if (updateContainers) { + return UpdateType.UPDATE_ASSET_TABLES; + } else { + return UpdateType.NONE; + } } @Override @@ -94,6 +107,7 @@ public void load() { jBuyContracts.setSelected(Settings.get().isIncludeBuyContracts()); jManufacturing.setSelected(Settings.get().isIncludeManufacturing()); jCopying.setSelected(Settings.get().isIncludeCopying()); + jContainerItemID.setSelected(Settings.get().isContainersShowItemID()); } } diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/settings/JSettingsPanel.java b/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/settings/JSettingsPanel.java index 8b775c23e..f42c2e8d0 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/settings/JSettingsPanel.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/settings/JSettingsPanel.java @@ -36,6 +36,7 @@ public static enum UpdateType { FULL_UPDATE, UPDATE_OVERVIEW, UPDATE_TAGS, + UPDATE_ASSET_TABLES, FULL_REPAINT, REPAINT_MARKET_ORDERS_TABLE, REPAINT_STOCKPILE_TABLE, diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/settings/SettingsDialog.java b/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/settings/SettingsDialog.java index 3e221e074..02a568d8c 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/settings/SettingsDialog.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/dialogs/settings/SettingsDialog.java @@ -311,6 +311,10 @@ private void save(boolean hideWindow) { program.getStockpileTab().repaintTable(); } } + if (updates.contains(UpdateType.UPDATE_ASSET_TABLES)) { + program.getAssetsTab().tableDataChanged(); + program.getTreeTab().tableDataChanged(); + } if (updates.contains(UpdateType.UPDATE_OVERVIEW)) { program.getOverviewTab().updateData(); } diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/shared/components/JMainTab.java b/src/main/java/net/nikr/eve/jeveasset/gui/shared/components/JMainTab.java index 50fafb686..71720e6db 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/shared/components/JMainTab.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/shared/components/JMainTab.java @@ -124,6 +124,14 @@ public void tableStructureChanged() { } } + public void tableDataChanged() { + beforeUpdateDataKeepCache(); + if (eventTableModel != null) { + eventTableModel.fireTableDataChanged(); + } + afterUpdateData(); + } + public void repaintTable() { if (jTable != null) { jTable.repaint(); diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/shared/filter/FilterControl.java b/src/main/java/net/nikr/eve/jeveasset/gui/shared/filter/FilterControl.java index 00674f9d2..289b16b18 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/shared/filter/FilterControl.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/shared/filter/FilterControl.java @@ -235,7 +235,7 @@ public JMenu getMenu(final JTable jTable, final List items) { column = tableFormat.getShownColumns().get(columnIndex); isNumeric = isNumeric(column); isDate = isDate(column); - text = FilterMatcher.format(tableFormat.getColumnValue(items.get(0), column.name()), false); + text = FilterMatcher.formatFilter(tableFormat.getColumnValue(items.get(0), column.name())); } return new FilterMenu<>(gui, column, text, isNumeric, isDate); } diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/shared/filter/FilterMatcher.java b/src/main/java/net/nikr/eve/jeveasset/gui/shared/filter/FilterMatcher.java index 1b57638a2..5d2a1fd36 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/shared/filter/FilterMatcher.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/shared/filter/FilterMatcher.java @@ -36,6 +36,7 @@ import static net.nikr.eve.jeveasset.gui.shared.filter.Filter.CompareType.NEXT_DAYS; import net.nikr.eve.jeveasset.gui.shared.filter.Filter.LogicType; import net.nikr.eve.jeveasset.gui.shared.table.EnumTableColumn; +import net.nikr.eve.jeveasset.gui.shared.table.containers.AssetContainer; import net.nikr.eve.jeveasset.gui.shared.table.containers.NumberValue; @@ -80,7 +81,7 @@ public class FilterMatcher implements Matcher { if (CompareType.isColumnCompare(compare)) { this.text = text; } else { - this.text = format(text, true); + this.text = formatData(text, true); } empty = !enabled || text == null || text.isEmpty(); and = logic == Filter.LogicType.AND; @@ -137,13 +138,13 @@ public boolean matches(final E item) { case LESS_THAN_COLUMN: return less(column, tableFormat.getColumnValue(item, text)); case EQUALS_COLUMN: - return equals(column, format(tableFormat.getColumnValue(item, text), false)); + return equals(column, formatData(tableFormat.getColumnValue(item, text), false)); case EQUALS_NOT_COLUMN: - return !equals(column, format(tableFormat.getColumnValue(item, text), false)); + return !equals(column, formatData(tableFormat.getColumnValue(item, text), false)); case CONTAINS_COLUMN: - return contains(column, format(tableFormat.getColumnValue(item, text), false)); + return contains(column, formatData(tableFormat.getColumnValue(item, text), false)); case CONTAINS_NOT_COLUMN: - return !contains(column, format(tableFormat.getColumnValue(item, text), false)); + return !contains(column, formatData(tableFormat.getColumnValue(item, text), false)); case BEFORE_COLUMN: return before(column, tableFormat.getColumnValue(item, text)); case AFTER_COLUMN: @@ -168,7 +169,7 @@ public static String buildItemCache(SimpleTableFormat filterControl, E e) Object columnValue = filterControl.getColumnValue(e, testColumn.name()); if (columnValue != null) { builder.append("\n"); - builder.append(format(columnValue, false)); + builder.append(formatData(columnValue, false)); builder.append("\r"); } } @@ -211,7 +212,7 @@ private boolean equals(final Object object1, final String formattedText) { } //Equals (case insentive) - return format(object1, false).equals(formattedText); + return formatData(object1, false).equals(formattedText); } private boolean regex(final Object object1, final Pattern pattern) { @@ -221,7 +222,7 @@ private boolean regex(final Object object1, final Pattern pattern) { } //Rexex - return pattern.matcher(format(object1, false)).find(); + return pattern.matcher(formatData(object1, false)).find(); } private boolean contains(final Object object1, final String formattedText) { @@ -231,7 +232,7 @@ private boolean contains(final Object object1, final String formattedText) { } //Contains (case insentive) - return format(object1, false).contains(formattedText); + return formatData(object1, false).contains(formattedText); } private boolean less(final Object object1, final Object object2) { @@ -462,7 +463,26 @@ private static Date getDate(final Object obj, final boolean userInput) { } } - public static String format(final Object object, final boolean userInput) { + private static AssetContainer getAssetContainer(final Object obj) { + if (obj instanceof AssetContainer) { + return (AssetContainer) obj; + } else { + return null; + } + } + + public static String formatFilter(final Object object) { + return format(object, false); + } + + private static String formatData(final Object object, final boolean userInput) { + if (object == null) { + return null; + } + return format(object, userInput).toLowerCase(); + } + + private static String format(final Object object, final boolean userInput) { if (object == null) { return null; } @@ -470,17 +490,23 @@ public static String format(final Object object, final boolean userInput) { //Number Number number = getNumber(object, userInput); if (number != null) { - return Formatter.compareFormat(number).toLowerCase(); + return Formatter.compareFormat(number); } //Date Date date = getDate(object, userInput); if (date != null) { - return Formatter.columnDate(date).toLowerCase(); + return Formatter.columnDate(date); + } + + //AssetContainer + AssetContainer assetContainer = getAssetContainer(object); + if (assetContainer != null) { + return assetContainer.getContainer(); } //String - return format(object.toString()).toLowerCase(); + return format(object.toString()); } private static String format(String string) { diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/shared/table/JAutoColumnTable.java b/src/main/java/net/nikr/eve/jeveasset/gui/shared/table/JAutoColumnTable.java index 4268c39d2..811e49228 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/shared/table/JAutoColumnTable.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/shared/table/JAutoColumnTable.java @@ -78,6 +78,7 @@ import net.nikr.eve.jeveasset.gui.shared.table.TableCellRenderers.LongCellRenderer; import net.nikr.eve.jeveasset.gui.shared.table.TableCellRenderers.TagsCellRenderer; import net.nikr.eve.jeveasset.gui.shared.table.TableCellRenderers.ToStringCellRenderer; +import net.nikr.eve.jeveasset.gui.shared.table.containers.AssetContainer; import net.nikr.eve.jeveasset.gui.shared.table.containers.DateOnly; import net.nikr.eve.jeveasset.gui.shared.table.containers.ExpirerDate; import net.nikr.eve.jeveasset.gui.shared.table.containers.YesNo; @@ -135,6 +136,7 @@ public JAutoColumnTable(final Program program, final TableModel tableModel) { this.setDefaultRenderer(DateOnly.class, new DateOnlyCellRenderer()); this.setDefaultRenderer(String.class, new ToStringCellRenderer(SwingConstants.LEFT)); this.setDefaultRenderer(Object.class, new ToStringCellRenderer()); + this.setDefaultRenderer(AssetContainer.class, new ToStringCellRenderer(SwingConstants.LEFT)); this.setDefaultRenderer(Tags.class, new TagsCellRenderer()); this.setDefaultRenderer(YesNo.class, new ToStringCellRenderer(SwingConstants.CENTER)); this.setDefaultRenderer(ExpirerDate.class, new ToStringCellRenderer(SwingConstants.CENTER)); diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/shared/table/containers/AssetContainer.java b/src/main/java/net/nikr/eve/jeveasset/gui/shared/table/containers/AssetContainer.java new file mode 100644 index 000000000..e8d43d832 --- /dev/null +++ b/src/main/java/net/nikr/eve/jeveasset/gui/shared/table/containers/AssetContainer.java @@ -0,0 +1,113 @@ +/* + * Copyright 2009-2023 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.table.containers; + +import java.util.Objects; +import net.nikr.eve.jeveasset.data.api.my.MyAsset; +import net.nikr.eve.jeveasset.data.settings.Settings; +import net.nikr.eve.jeveasset.i18n.General; + + +public class AssetContainer implements Comparable{ + + private final String container; + private final String containerSimple; //No ItemID + + public AssetContainer() { + this.container = ""; + this.containerSimple = ""; + } + + public AssetContainer(MyAsset asset) { + StringBuilder builder = new StringBuilder(); + StringBuilder simpleBuilder = new StringBuilder(); + if (asset.getParents().isEmpty()) { + builder.append(General.get().none()); + simpleBuilder.append(General.get().none()); + } else { + boolean first = true; + for (MyAsset parentAsset : asset.getParents()) { + if (first) { + first = false; + } else { + builder.append(" > "); + simpleBuilder.append(" > "); + } + simpleBuilder.append(parentAsset.getName()); + builder.append(parentAsset.getName()); + if (!parentAsset.isUserName()) { + builder.append(" #"); + builder.append(parentAsset.getItemID()); + } + } + } + this.container = builder.toString().intern(); + this.containerSimple = simpleBuilder.toString().intern(); + } + + public String getContainer() { + return container; + } + + @Override + public int compareTo(AssetContainer o) { + return this.container.compareTo(o.container); + } + + @Override + public String toString() { + if (Settings.get().isContainersShowItemID()) { + return container; + } else { + return containerSimple; + } + } + + @Override + public int hashCode() { + int hash = 7; + if (Settings.get().isContainersShowItemID()) { + hash = 37 * hash + Objects.hashCode(this.container); + } else { + hash = 37 * hash + Objects.hashCode(this.containerSimple); + } + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final AssetContainer other = (AssetContainer) obj; + if (Settings.get().isContainersShowItemID()) { + return Objects.equals(this.container, other.container); + } else { + return Objects.equals(this.containerSimple, other.containerSimple); + } + } +} diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/assets/AssetTableFormat.java b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/assets/AssetTableFormat.java index c4a1bdb28..fa31c6be6 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/assets/AssetTableFormat.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/assets/AssetTableFormat.java @@ -27,6 +27,7 @@ import net.nikr.eve.jeveasset.data.api.my.MyAsset; import net.nikr.eve.jeveasset.data.settings.tag.Tags; import net.nikr.eve.jeveasset.gui.shared.table.EnumTableColumn; +import net.nikr.eve.jeveasset.gui.shared.table.containers.AssetContainer; import net.nikr.eve.jeveasset.gui.shared.table.containers.LongInt; import net.nikr.eve.jeveasset.gui.shared.table.containers.Percent; import net.nikr.eve.jeveasset.gui.shared.table.containers.Runs; @@ -198,14 +199,14 @@ public Object getColumnValue(final MyAsset from) { return from.getLocation().getFactionWarfareSystemOwner(); } }, - CONTAINER(String.class, GlazedLists.comparableComparator()) { + CONTAINER(AssetContainer.class, GlazedLists.comparableComparator()) { @Override public String getColumnName() { return TabsAssets.get().columnContainer(); } @Override public Object getColumnValue(final MyAsset from) { - return from.getContainer(); + return from.getAssetContainer(); } }, FLAG(String.class, GlazedLists.comparableComparator()) { diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/journal/JournalTab.java b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/journal/JournalTab.java index 1065899d5..fe60275cf 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/journal/JournalTab.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/journal/JournalTab.java @@ -38,7 +38,6 @@ import javax.swing.GroupLayout; import javax.swing.JButton; import javax.swing.JComponent; -import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; @@ -70,7 +69,6 @@ import net.nikr.eve.jeveasset.gui.tabs.jobs.IndustryJobTableFormat; import net.nikr.eve.jeveasset.gui.tabs.transaction.TransactionTableFormat; import net.nikr.eve.jeveasset.i18n.TabsJournal; -import net.nikr.eve.jeveasset.i18n.TabsTransaction; public class JournalTab extends JMainTabPrimary { @@ -292,7 +290,7 @@ private void addSafe(Set set, Long value) { if (value == null || value < 100) { return; } - set.add(FilterMatcher.format(value, false)); + set.add(FilterMatcher.formatFilter(value)); } private class ListenerClass implements ListEventListener { diff --git a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/tree/TreeTableFormat.java b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/tree/TreeTableFormat.java index 164b75f54..a839af7ac 100644 --- a/src/main/java/net/nikr/eve/jeveasset/gui/tabs/tree/TreeTableFormat.java +++ b/src/main/java/net/nikr/eve/jeveasset/gui/tabs/tree/TreeTableFormat.java @@ -26,6 +26,7 @@ import java.util.Date; import net.nikr.eve.jeveasset.data.settings.tag.Tags; import net.nikr.eve.jeveasset.gui.shared.table.EnumTableColumn; +import net.nikr.eve.jeveasset.gui.shared.table.containers.AssetContainer; import net.nikr.eve.jeveasset.gui.shared.table.containers.HierarchyColumn; import net.nikr.eve.jeveasset.gui.shared.table.containers.LongInt; import net.nikr.eve.jeveasset.gui.shared.table.containers.Percent; @@ -197,14 +198,14 @@ public Object getColumnValue(final TreeAsset from) { return from.getLocation().getFactionWarfareSystemOwner(); } }, - CONTAINER(String.class, GlazedLists.comparableComparator()) { + CONTAINER(AssetContainer.class, GlazedLists.comparableComparator()) { @Override public String getColumnName() { return TabsAssets.get().columnContainer(); } @Override public Object getColumnValue(final TreeAsset from) { - return from.getContainer(); + return from.getAssetContainer(); } }, FLAG(String.class, GlazedLists.comparableComparator()) { diff --git a/src/main/java/net/nikr/eve/jeveasset/i18n/DialoguesSettings.java b/src/main/java/net/nikr/eve/jeveasset/i18n/DialoguesSettings.java index 29dd78693..dd839942a 100644 --- a/src/main/java/net/nikr/eve/jeveasset/i18n/DialoguesSettings.java +++ b/src/main/java/net/nikr/eve/jeveasset/i18n/DialoguesSettings.java @@ -71,6 +71,7 @@ public DialoguesSettings(final Locale locale) { public abstract String includeBuyOrders(); public abstract String includeManufacturing(); public abstract String includeCopying(); + public abstract String showContainerItemID(); // used in OverviewToolSettingsPanel public abstract String overview(); diff --git a/src/main/resources/net/nikr/eve/jeveasset/i18n/DialoguesSettings.properties b/src/main/resources/net/nikr/eve/jeveasset/i18n/DialoguesSettings.properties index 02fff7ab7..23999a596 100644 --- a/src/main/resources/net/nikr/eve/jeveasset/i18n/DialoguesSettings.properties +++ b/src/main/resources/net/nikr/eve/jeveasset/i18n/DialoguesSettings.properties @@ -40,6 +40,7 @@ includeSellOrders=Include market sell orders includeBuyOrders=Include market buy orders includeManufacturing=Include manufacturing output includeCopying=Include blueprint copying output +showContainerItemID=Show Container ItemID (Visual only - filters are compared with ItemID) #Overview overview=Overview diff --git a/src/test/java/net/nikr/eve/jeveasset/gui/shared/filter/FilterMatcherTest.java b/src/test/java/net/nikr/eve/jeveasset/gui/shared/filter/FilterMatcherTest.java index ad308792a..277eeeb9f 100644 --- a/src/test/java/net/nikr/eve/jeveasset/gui/shared/filter/FilterMatcherTest.java +++ b/src/test/java/net/nikr/eve/jeveasset/gui/shared/filter/FilterMatcherTest.java @@ -153,15 +153,16 @@ public static void main(final String[] args) { initLog(); Images.preload(); FilterMatcherTest filterMatcherTest = new FilterMatcherTest(); + filterMatcherTest.testEqualsSingle(); + filterMatcherTest.testRexexSingle(); + filterMatcherTest.testEqualsAll(); + filterMatcherTest.testRexexAll(); long duration = 0; duration += filterMatcherTest.testEqualsSingle(); duration += filterMatcherTest.testRexexSingle(); duration += filterMatcherTest.testEqualsAll(); duration += filterMatcherTest.testRexexAll(); - duration += filterMatcherTest.testEqualsSingle(); - duration += filterMatcherTest.testRexexSingle(); - duration += filterMatcherTest.testEqualsAll(); - duration += filterMatcherTest.testRexexAll(); + System.out.println("Total time:" + duration + "ms"); } private long testEqualsSingle() { diff --git a/src/test/java/net/nikr/eve/jeveasset/io/esi/EsiDeprecationOnlineTest.java b/src/test/java/net/nikr/eve/jeveasset/io/esi/EsiDeprecationOnlineTest.java index c01ee9c40..dbc9da5b5 100644 --- a/src/test/java/net/nikr/eve/jeveasset/io/esi/EsiDeprecationOnlineTest.java +++ b/src/test/java/net/nikr/eve/jeveasset/io/esi/EsiDeprecationOnlineTest.java @@ -158,6 +158,7 @@ public static ApiClient setupAuth() { * @throws net.troja.eve.esi.ApiException */ public static void main(final String... args) throws IOException, URISyntaxException, ApiException { + initLog(); final String state = "somesecret"; final ApiClient client = new ApiClientBuilder().clientID(EsiCallbackURL.LOCALHOST.getA()).build(); final OAuth auth = (OAuth) client.getAuthentication("evesso"); diff --git a/src/test/java/net/nikr/eve/jeveasset/tests/mocks/FakeSettings.java b/src/test/java/net/nikr/eve/jeveasset/tests/mocks/FakeSettings.java index 01e22d71b..6aff6bd3a 100644 --- a/src/test/java/net/nikr/eve/jeveasset/tests/mocks/FakeSettings.java +++ b/src/test/java/net/nikr/eve/jeveasset/tests/mocks/FakeSettings.java @@ -737,4 +737,14 @@ public void setEasyChartColors(boolean easyChartColors) { public boolean isEasyChartColors() { throw new UnsupportedOperationException("not implemented"); } + + @Override + public void setContainersShowItemID(boolean containersShowItemID) { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + public boolean isContainersShowItemID() { + throw new UnsupportedOperationException("not implemented"); + } }