From: Jim Procter Date: Tue, 10 Feb 2015 16:21:54 +0000 (+0000) Subject: JAL-845 - portability patch - workaround for lastToken failing for '\' X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=67f546e39d0c247fef34a5fbb7ac841be7bae5be;p=jalview.git JAL-845 - portability patch - workaround for lastToken failing for '\' --- diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 638d3e5..a89174a 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -60,7 +60,6 @@ import jalview.structure.SelectionSource; import jalview.structure.StructureSelectionManager; import jalview.structure.VamsasSource; import jalview.util.MessageManager; -import jalview.util.StringUtils; import jalview.viewmodel.AlignmentViewport; import jalview.ws.params.AutoCalcSetting; @@ -1132,6 +1131,8 @@ public class AlignViewport extends AlignmentViewport implements if (openSplitPane) { + // TODO: move this kind of constructor stuff to a factory/controller + // method ? /* * Open in split pane. DNA sequence above, protein below. */ @@ -1147,10 +1148,10 @@ public class AlignViewport extends AlignmentViewport implements cdnaFrame.setVisible(true); proteinFrame.setVisible(true); String sep = String.valueOf(File.separatorChar); - String proteinShortName = StringUtils.getLastToken( - proteinFrame.getTitle(), sep); - String dnaShortName = StringUtils.getLastToken(cdnaFrame.getTitle(), - sep); + String proteinShortName = proteinFrame.getTitle().substring( + proteinFrame.getTitle().lastIndexOf(sep) + 1); + String dnaShortName = cdnaFrame.getTitle().substring( + cdnaFrame.getTitle().lastIndexOf(sep) + 1); String linkedTitle = MessageManager.formatMessage( "label.linked_view_title", dnaShortName, proteinShortName); JInternalFrame splitFrame = new SplitFrame(cdnaFrame, proteinFrame);