/getdown/files
/getdown/src/getdown/*/target/
/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Build.java
+/getdown/src/getdown/launcher/dependency-reduced-pom.xml
/utils/install4j/jalview-installers-*.install4j
*.swp
/bin
install4jInstallerFileAssociations = file_associations_auto-install4j.xml
install4jBuildDir = build/install4j
install4jMediaTypes = windows,macosArchive,linuxRPM,linuxDeb,unixArchive
+install4jMediaTypes = windows,macosArchive,linuxRPM,linuxDeb,unixArchive,unixInstaller
install4jFaster = false
OSX_KEYSTORE =
<li>
<!-- JAL-3143 -->Timeouts when retrieving data from Ensembl</li>
<li>
+ <!-- JAL-3244 -->'View [Structure] Mappings' and structure superposition in Jmol fail on Windows</li>
+ <li>
+ <!-- JAL-3239 -->Text misaligned in EPS or SVG image export with monospaced font</li>
+ <li>
<!-- JAL-3171 -->Warning of 'Duplicate entry' when saving
Jalview project involving multiple views</li>
<li>
<!-- JAL-2647 -->Input Data menu entry is greyed out when PCA View is restored from a Jalview 2.11 project</li>
<li>
<!-- JAL-3213 -->Alignment panel height can be too small after 'New View'</li>
+ <li>
+ <!-- JAL-3240 -->Display is incorrect after removing gapped columns within hidden columns</li>
</ul>
</td>
</tr>
import java.awt.event.ComponentListener;
import java.io.File;
import java.net.URL;
-import java.security.AccessControlException;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.Hashtable;
*/
private int _modelFileNameMap[];
- // ////////////////////////////////
- // /StructureListener
- // @Override
- public synchronized String[] getPdbFilex()
- {
- if (viewer == null)
- {
- return new String[0];
- }
- if (modelFileNames == null)
- {
- List<String> mset = new ArrayList<>();
- _modelFileNameMap = new int[viewer.ms.mc];
- String m = viewer.ms.getModelFileName(0);
- if (m != null)
- {
- String filePath = m;
- try
- {
- filePath = new File(m).getAbsolutePath();
- } catch (AccessControlException x)
- {
- // usually not allowed to do this in applet
- System.err.println(
- "jmolBinding: Using local file string from Jmol: " + m);
- }
- if (filePath.indexOf("/file:") != -1)
- {
- // applet path with docroot - discard as format won't match pdbfile
- filePath = m;
- }
- mset.add(filePath);
- _modelFileNameMap[0] = 0; // filename index for first model is always 0.
- }
- int j = 1;
- for (int i = 1; i < viewer.ms.mc; i++)
- {
- m = viewer.ms.getModelFileName(i);
- String filePath = m;
- if (m != null)
- {
- try
- {
- filePath = new File(m).getAbsolutePath();
- } catch (AccessControlException x)
- {
- // usually not allowed to do this in applet, so keep raw handle
- // System.err.println("jmolBinding: Using local file string from
- // Jmol: "+m);
- }
- }
-
- /*
- * add this model unless it is read from a structure file we have
- * already seen (example: 2MJW is an NMR structure with 10 models)
- */
- if (!mset.contains(filePath))
- {
- mset.add(filePath);
- _modelFileNameMap[j] = i; // record the model index for the filename
- j++;
- }
- }
- modelFileNames = mset.toArray(new String[mset.size()]);
- }
- return modelFileNames;
- }
-
@Override
public synchronized String[] getStructureFiles()
{
for (String s : files)
{
fileList.append(SPACE).append(QUOTE)
- .append(Platform.escapeString(s)).append(QUOTE);
+ .append(Platform.escapeBackslashes(s)).append(QUOTE);
}
String filesString = fileList.toString();
addingStructures = true; // already files loaded.
for (int c = 0; c < filesInViewer.length; c++)
{
- if (filesInViewer[c].equals(file))
+ if (Platform.pathEquals(filesInViewer[c], file))
{
file = null;
break;
{
filePDB.add(thePdbEntry);
filePDBpos.add(Integer.valueOf(pi));
- files.append(" \"" + Platform.escapeString(file) + "\"");
+ files.append(" \"" + Platform.escapeBackslashes(file) + "\"");
}
}
} catch (OutOfMemoryError oomerror)
import java.awt.FontMetrics;
import java.awt.Graphics;
+import org.jfree.graphics2d.svg.SVGGraphics2D;
+import org.jibble.epsgraphics.EpsGraphics2D;
+
public class SequenceRenderer implements jalview.api.SequenceRenderer
{
final static int CHAR_TO_UPPER = 'A' - 'a';
}
graphics.setColor(av.getTextColour());
- if (monospacedFont && av.getShowText() && allGroups.length == 0
- && !av.getColourText() && av.getThresholdTextColour() == 0)
+ boolean drawAllText = monospacedFont && av.getShowText() && allGroups.length == 0
+ && !av.getColourText() && av.getThresholdTextColour() == 0;
+
+ /*
+ * EPS or SVG misaligns monospaced strings (JAL-3239)
+ * so always draw these one character at a time
+ */
+ if (graphics instanceof EpsGraphics2D
+ || graphics instanceof SVGGraphics2D)
+ {
+ drawAllText = false;
+ }
+ if (drawAllText)
{
if (av.isRenderGaps())
{
String reformatedOldFilename = oldfilenam.replaceAll("/", "\\\\");
filedat = oldFiles.get(new File(reformatedOldFilename));
}
- newFileLoc.append(Platform.escapeString(filedat.getFilePath()));
+ newFileLoc.append(Platform.escapeBackslashes(filedat.getFilePath()));
pdbfilenames.add(filedat.getFilePath());
pdbids.add(filedat.getPdbId());
seqmaps.add(filedat.getSeqList().toArray(new SequenceI[0]));
import jalview.io.StructureFile;
import jalview.util.MappingUtils;
import jalview.util.MessageManager;
+import jalview.util.Platform;
import jalview.ws.sifts.SiftsClient;
import jalview.ws.sifts.SiftsException;
import jalview.ws.sifts.SiftsSettings;
StringBuilder sb = new StringBuilder(64);
for (StructureMapping sm : mappings)
{
- if (sm.pdbfile.equals(pdbfile) && seqs.contains(sm.sequence))
+ if (Platform.pathEquals(sm.pdbfile, pdbfile)
+ && seqs.contains(sm.sequence))
{
sb.append(sm.mappingDetails);
sb.append(NEWLINE);
*/
package jalview.util;
-import java.awt.Toolkit;
import java.awt.event.MouseEvent;
/**
}
/**
- * escape a string according to the local platform's escape character
+ * Answers the input with every backslash replaced with a double backslash (an
+ * 'escaped' single backslash)
*
- * @param file
- * @return escaped file
+ * @param s
+ * @return
*/
- public static String escapeString(String file)
+ public static String escapeBackslashes(String s)
{
- StringBuffer f = new StringBuffer();
- int p = 0, lastp = 0;
- while ((p = file.indexOf('\\', lastp)) > -1)
- {
- f.append(file.subSequence(lastp, p));
- f.append("\\\\");
- lastp = p + 1;
- }
- f.append(file.substring(lastp));
- return f.toString();
+ return s == null ? null : s.replace("\\", "\\\\");
}
/**
}
return e.isControlDown();
}
+
+ /**
+ * A (case sensitive) file path comparator that ignores the difference between /
+ * and \
+ *
+ * @param path1
+ * @param path2
+ * @return
+ */
+ public static boolean pathEquals(String path1, String path2)
+ {
+ if (path1 == null)
+ {
+ return path2 == null;
+ }
+ if (path2 == null)
+ {
+ return false;
+ }
+ String p1 = path1.replace('\\', '/');
+ String p2 = path2.replace('\\', '/');
+ return p1.equals(p2);
+ }
}
*/
package jalview.util;
+import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
import jalview.gui.JvOptionPane;
assertTrue(Platform.isControlDown(new MouseEvent(b, 0, 0L, mods, 0, 0,
0, 0, clickCount, isPopupTrigger, buttonNo), mac));
}
+
+ @Test(groups = "Functional")
+ public void testPathEquals()
+ {
+ assertTrue(Platform.pathEquals(null, null));
+ assertFalse(Platform.pathEquals(null, "apath"));
+ assertFalse(Platform.pathEquals("apath", null));
+ assertFalse(Platform.pathEquals("apath", "APATH"));
+ assertTrue(Platform.pathEquals("apath", "apath"));
+ assertTrue(Platform.pathEquals("apath/a/b", "apath\\a\\b"));
+ }
+
+ @Test(groups = "Functional")
+ public void testEscapeBackslashes()
+ {
+ assertNull(Platform.escapeBackslashes(null));
+ assertEquals(Platform.escapeBackslashes("hello world"), "hello world");
+ assertEquals(Platform.escapeBackslashes("hello\\world"), "hello\\\\world");
+ }
}