X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequencePoint.java;h=3db7ceee9924dced6a1acaddaa69040c3e62b7c5;hb=b04c79d1a830aa7ae7b88b2a5ddd07c9216c826f;hp=7fcb713bac79a2fa14aa491170b0cfb592730ec7;hpb=97fbcf746cdd6c998871adcf8e737d43e5307387;p=jalview.git diff --git a/src/jalview/datamodel/SequencePoint.java b/src/jalview/datamodel/SequencePoint.java index 7fcb713..3db7cee 100755 --- a/src/jalview/datamodel/SequencePoint.java +++ b/src/jalview/datamodel/SequencePoint.java @@ -21,8 +21,10 @@ package jalview.datamodel; /** - * A bean that models a point with (x, y, z) coordinates and a reference to a - * sequence + * A bean that models a set of (x, y, z) values and a reference to a sequence. + * As used in Principal Component Analysis, the (x, y, z) values are the + * sequence's score for the currently selected first, second and third + * dimensions of the PCA. */ public class SequencePoint { @@ -32,7 +34,7 @@ public class SequencePoint private final SequenceI sequence; /* - * x, y, z position in 3-D space + * x, y, z values */ public Point coord; @@ -67,30 +69,21 @@ public class SequencePoint } /** - * Applies a negative translation of the 'shift' (x, y, z) coordinates + * Applies a translation to the (x, y, z) coordinates * * @param centre */ - public void translateBack(Point shift) + public void translate(float x, float y, float z) { - float x = coord.x - shift.x; - float y = coord.y - shift.y; - float z = coord.z - shift.z; - - coord = new Point(x, y, z); + coord = new Point(coord.x + x, coord.y + y, coord.z + z); } /** - * Applies a positive translation of the 'shift' (x, y, z) coordinates - * - * @param centre + * string representation for ease of inspection in debugging or logging only */ - public void translate(Point shift) + @Override + public String toString() { - float x = coord.x + shift.x; - float y = coord.y + shift.y; - float z = coord.z + shift.z; - - coord = new Point(x, y, z); + return sequence.getName() + " " + coord.toString(); } }