System.arraycopy(rtnval, 0, result, 1, rtnval.length);
return result;
}
-
- public static void main(String args[])
- {
- // Short test to see if checkBpType works
- ArrayList<String> test = new ArrayList<String>();
- test.add("A");
- test.add("c");
- test.add("g");
- test.add("T");
- test.add("U");
- for (String i : test)
- {
- for (String j : test)
- {
- System.out.println(i + "-" + j + ": "
- + Rna.isCanonicalOrWobblePair(i.charAt(0), j.charAt(0)));
- }
- }
- }
}
g.drawString(getTitle(), 10, 10);
}
- public static void main(String[] args)
- {
- Frame f = new Frame("TitledPanel Tester");
-
- TitledPanel p = new TitledPanel("Title of Panel");
- p.add(new Label("Label 1"));
- p.add(new Label("Label 2"));
- p.add(new Label("Label 3"));
- f.add(p);
-
- f.addWindowListener(new WindowAdapter()
- {
- public void windowClosing(WindowEvent e)
- {
- System.exit(0);
- }
- });
- f.setBounds(300, 300, 300, 300);
- f.setVisible(true);
- }
-
public String getTitle()
{
return title;
return allDefaultDisplayedStructureDataColumns;
}
- @SuppressWarnings("unchecked")
-public static void main(String[] args) {
-
-
- // check for transpiler fix associated with JSONParser yylex.java use of charAt()
- // instead of codePointAt()
-
- String s = "e";
- char c = 'c';
- char f = 'f';
- s += c | f;
- int x = c&f;
- int y = 2 & c;
- int z = c ^ 5;
- String result = s +x + y + z;
- assert (result == "e103982102");
- try
- {
- Map<String, Object> jsonObj = (Map<String, Object>) JSONUtils.parse("{\"a\":3}");
- System.out.println(jsonObj);
- } catch (ParseException e)
- {
- e.printStackTrace();
- }
-
- }
-
}
import jalview.datamodel.Point;
+import java.io.PrintStream;
import java.util.HashMap;
import java.util.Map;
public enum Axis
{
X, Y, Z
- };
+ }
float[][] matrix;
/**
* Prints the matrix in rows of space-delimited values
*/
- public void print()
+ public void print(PrintStream ps)
{
- System.out.println(
- matrix[0][0] + " " + matrix[0][1] + " " + matrix[0][2]);
-
- System.out.println(
- matrix[1][0] + " " + matrix[1][1] + " " + matrix[1][2]);
-
- System.out.println(
- matrix[2][0] + " " + matrix[2][1] + " " + matrix[2][2]);
+ ps.println(matrix[0][0] + " " + matrix[0][1] + " " + matrix[0][2]);
+ ps.println(matrix[1][0] + " " + matrix[1][1] + " " + matrix[1][2]);
+ ps.println(matrix[2][0] + " " + matrix[2][1] + " " + matrix[2][2]);
}
/**
}
/**
- * DOCUMENT ME!
- *
- * @param args
- * DOCUMENT ME!
- */
- public static void main(String[] args)
- {
- RotatableMatrix m = new RotatableMatrix();
-
- m.setValue(0, 0, 1);
-
- m.setValue(0, 1, 0);
-
- m.setValue(0, 2, 0);
-
- m.setValue(1, 0, 0);
-
- m.setValue(1, 1, 2);
-
- m.setValue(1, 2, 0);
-
- m.setValue(2, 0, 0);
-
- m.setValue(2, 1, 0);
-
- m.setValue(2, 2, 1);
-
- m.print();
-
- RotatableMatrix n = new RotatableMatrix();
-
- n.setValue(0, 0, 2);
-
- n.setValue(0, 1, 1);
-
- n.setValue(0, 2, 1);
-
- n.setValue(1, 0, 2);
-
- n.setValue(1, 1, 1);
-
- n.setValue(1, 2, 1);
-
- n.setValue(2, 0, 2);
-
- n.setValue(2, 1, 1);
-
- n.setValue(2, 2, 1);
-
- n.print();
-
- // m.postMultiply(n.matrix);
- // m.print();
- // m.rotate(45,'z',new RotatableMatrix(3,3));
- float[] vect = new float[3];
-
- vect[0] = 2;
-
- vect[1] = 4;
-
- vect[2] = 6;
-
- vect = m.vectorMultiply(vect);
-
- System.out.println(vect[0] + " " + vect[1] + " " + vect[2]);
- }
-
- /**
* Performs a vector multiplication whose result is the Point representing the
* input point's value vector post-multiplied by this matrix.
*
}
}
- public static void main(String[] args)
- {
- System.out.println("A".matches("(-*[a-zA-Z]-*){1}[a-zA-Z-]*"));
- }
-
protected String getServiceActionKey()
{
return "MsaWS";
import jalview.math.RotatableMatrix.Axis;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
}
@Test(groups = "Functional")
+ public void testPrint()
+ {
+ String expected = "0.5 1.0 1.5\n1.0 2.0 3.0\n1.5 3.0 4.5\n";
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ PrintStream ps = new PrintStream(os, true);
+ rm.print(ps);
+ String result = new String(os.toByteArray());
+ assertEquals(result, expected);
+ }
+
+ @Test(groups = "Functional")
public void testPreMultiply()
{
float[][] pre = new float[3][3];
package test;
-import jalview.gui.Desktop;
import jalview.gui.JvOptionPane;
-import jalview.util.MessageManager;
+import jalview.util.JSONUtils;
import java.awt.BorderLayout;
import java.awt.ComponentOrientation;
import javax.swing.WindowConstants;
import javax.swing.border.TitledBorder;
+import org.json.simple.parser.ParseException;
+
/**
* A class with a main method entry point for ad hoc tests of JalviewJS
* behaviour. The J2S transpiler should generate an html entry point for this
{
public static void main(String[] args)
{
- new JalviewJSTest().doTest5();
+ new JalviewJSTest().doTest6();
}
+ void doTest6()
+ {
+ /*
+ * check for transpiler fix associated with JSONParser yylex.java use of charAt()
+ * instead of codePointAt(); moved here from PDBFTSRestClient
+ */
+
+ String s = "e";
+ char c = 'c';
+ char f = 'f';
+ s += c | f;
+ int x = c & f;
+ int y = 2 & c;
+ int z = c ^ 5;
+ String result = s + x + y + z;
+ System.out.println("Expected " + "e103982102, found " + result);
+ try
+ {
+ Map<String, Object> jsonObj = (Map<String, Object>) JSONUtils
+ .parse("{\"a\":3}");
+ System.out.println(jsonObj);
+ } catch (ParseException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
/**
* Dialog message truncation
*/
ImageIcon icon = new ImageIcon(getClass().getResource(name));
while(icon.getImageLoadStatus() == MediaTracker.LOADING)
- try {
- Thread.sleep(10);
- } catch (InterruptedException e) {
- }
+ {
+ try {
+ Thread.sleep(10);
+ } catch (InterruptedException e) {
+ }
+ }
return icon;
}
}