X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2FApp.java;h=e57dcf6d5d15364fd6c5ede5f509d28728531404;hb=88f2c3647ed9e055090484f01a959d4581f85e7d;hp=686b3dee485d4b3ffcd58203f2a3e5445be9bb17;hpb=8c8868ae29b3252f02e094c02307384cf61ba667;p=GpsPrune.git diff --git a/tim/prune/App.java b/tim/prune/App.java index 686b3de..e57dcf6 100644 --- a/tim/prune/App.java +++ b/tim/prune/App.java @@ -41,6 +41,7 @@ import tim.prune.load.MediaLinkInfo; import tim.prune.load.TrackNameList; import tim.prune.save.ExifSaver; import tim.prune.save.FileSaver; +import tim.prune.tips.TipManager; import tim.prune.undo.*; @@ -59,7 +60,7 @@ public class App private FileLoader _fileLoader = null; private JpegLoader _jpegLoader = null; private FileSaver _fileSaver = null; - private Stack _undoStack = null; + private UndoStack _undoStack = null; private boolean _mangleTimestampsConfirmed = false; private Viewport _viewport = null; private ArrayList _dataFiles = null; @@ -78,7 +79,7 @@ public class App public App(JFrame inFrame) { _frame = inFrame; - _undoStack = new Stack(); + _undoStack = new UndoStack(); _track = new Track(); _trackInfo = new TrackInfo(_track); FunctionLibrary.initialise(this); @@ -119,6 +120,22 @@ public class App return _undoStack; } + + /** + * Show the specified tip if appropriate + * @param inTipNumber tip number from TipManager + */ + public void showTip(int inTipNumber) + { + String key = TipManager.fireTipTrigger(inTipNumber); + if (key != null && !key.equals("")) + { + JOptionPane.showMessageDialog(_frame, I18nManager.getText(key), + I18nManager.getText("tip.title"), JOptionPane.INFORMATION_MESSAGE); + } + } + + /** * Load the specified data files one by one * @param inDataFiles arraylist containing File objects to load @@ -511,8 +528,8 @@ public class App // ensure track's field list contains point's fields _track.extendFieldList(inPoint.getFieldList()); _trackInfo.selectPoint(inIndex); - final int selStart = _trackInfo.getSelection().getStart(); - final int selEnd = _trackInfo.getSelection().getEnd(); + final int selStart = _trackInfo.getSelection().getStart(); + final int selEnd = _trackInfo.getSelection().getEnd(); if (selStart < inIndex && selEnd > inIndex) { // Extend end of selection by 1 @@ -894,6 +911,12 @@ public class App UpdateMessageBroker.informSubscribers(); } + /** + * @return the current data status, used for later comparison + */ + public DataStatus getCurrentDataStatus() { + return new DataStatus(_undoStack.size(), _undoStack.getNumTimesDeleted()); + } /** * Show a map url in an external browser