From: amwaterhouse Date: Wed, 25 Apr 2007 14:05:45 +0000 (+0000) Subject: alignmentProperties added X-Git-Tag: Release_2_3~179 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9ca6b95ab67df6eaeea56765cc293133da436e76;p=jalview.git alignmentProperties added --- diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 83d2499..34cc78f 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -40,6 +40,8 @@ public class Alignment HiddenSequences hiddenSequences = new HiddenSequences(this); + public Hashtable alignmentProperties; + private void initAlignment(SequenceI[] seqs) { int i = 0; @@ -702,4 +704,21 @@ public class Alignment return cal; } + public void setProperty(Object key, Object value) + { + if(alignmentProperties==null) + alignmentProperties = new Hashtable(); + + alignmentProperties.put(key,value); + } + + public Object getProperty(Object key) + { + if(alignmentProperties!=null) + return alignmentProperties.get(key); + else + return null; + } + + } diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 3ad05ea..04eab48 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -57,12 +57,12 @@ public class AlignmentAnnotation /** * Score associated with label and description. */ - public float score; + public float score= Float.NaN; /** * flag indicating if annotation has a score. */ public boolean hasScore=false; - + public GraphLine threshold; // Graphical hints and tips @@ -96,6 +96,8 @@ public class AlignmentAnnotation public static final int LINE_GRAPH = 2; + public boolean belowAlignment = true; + public static int getGraphValueFromString(String string) { @@ -118,7 +120,8 @@ public class AlignmentAnnotation * * @param label DOCUMENT ME! * @param description DOCUMENT ME! - * @param annotations DOCUMENT ME! + * @param annotations DOCUMENT ME!about:blank +Loading... */ public AlignmentAnnotation(String label, String description, Annotation[] annotations) @@ -223,11 +226,13 @@ public class AlignmentAnnotation * if appropriate. */ private void validateRangeAndDisplay() { + if (annotations==null) { visible=false; // try to prevent renderer from displaying. return; // this is a non-annotation row annotation - ie a sequence score. } + int graphType = graph; float min = graphMin; float max = graphMax; @@ -617,7 +622,7 @@ public class AlignmentAnnotation this.score = score; } /** - * + * * @return true if annotation has an associated score */ public boolean hasScore() diff --git a/src/jalview/datamodel/AlignmentI.java b/src/jalview/datamodel/AlignmentI.java index a43b259..96b1972 100755 --- a/src/jalview/datamodel/AlignmentI.java +++ b/src/jalview/datamodel/AlignmentI.java @@ -165,7 +165,7 @@ public interface AlignmentI /** * Adds a new AlignmentAnnotation to this alignment - * @note Care should be taken to ensure that annotation is at + * @note Care should be taken to ensure that annotation is at * least as wide as the longest sequence in the alignment * for rendering purposes. */ @@ -226,7 +226,7 @@ public interface AlignmentI /** * Set the associated dataset for the alignment, or create one. - * @param dataset The dataset alignment or null to construct one. + * @param dataset The dataset alignment or null to construct one. */ public void setDataset(Alignment dataset); @@ -243,4 +243,8 @@ public interface AlignmentI * @return CigarArray */ public CigarArray getCompactAlignment(); + + public void setProperty(Object key, Object value); + + public Object getProperty(Object key); }