X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignViewport.java;h=cb977d0de63c59c6d8ecbd45473feef06bbc75dd;hb=e25f63a72efddff9e071abdeff0ae5599431e4f8;hp=24d50d446e8c8bbf2febcd17eccafa92cc08789c;hpb=98eb909d0a4fe04ff6ad93f71086f1127fe4a530;p=jalview.git diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 24d50d4..cb977d0 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -43,7 +43,7 @@ public class AlignViewport int endRes; int startSeq; int endSeq; - boolean showFullId = false; + boolean showJVSuffix = true; boolean showText = true; boolean showColourText = false; boolean showBoxes = true; @@ -61,8 +61,7 @@ public class AlignViewport SequenceGroup selectionGroup; int charHeight; int charWidth; - int chunkWidth; - int chunkHeight; + int wrappedWidth; Font font = new Font("SansSerif", Font.PLAIN, 10); AlignmentI alignment; ColumnSelection colSel = new ColumnSelection(); @@ -72,6 +71,12 @@ public class AlignViewport boolean scaleAboveWrapped = false; boolean scaleLeftWrapped = true; boolean scaleRightWrapped = true; + boolean hasHiddenColumns = false; + + // The following vector holds the features which are + // currently visible, in the correct order or rendering + Hashtable featuresDisplayed = null; + /** DOCUMENT ME!! */ public Vector vconsensus; @@ -87,6 +92,17 @@ public class AlignViewport boolean ignoreGapsInConsensusCalculation = false; + boolean isDataset = false; + + boolean antiAlias = false; + + + public AlignViewport(AlignmentI al, boolean dataset) + { + isDataset = dataset; + setAlignment(al); + init(); + } /** * Creates a new AlignViewport object. * @@ -95,20 +111,19 @@ public class AlignViewport public AlignViewport(AlignmentI al) { setAlignment(al); + init(); + } + + void init() + { this.startRes = 0; - this.endRes = al.getWidth() - 1; + this.endRes = alignment.getWidth() - 1; this.startSeq = 0; - this.endSeq = al.getHeight() - 1; + this.endSeq = alignment.getHeight() - 1; - updateFromPreferences(); - } + antiAlias = Cache.getDefault("ANTI_ALIAS", false); - /** - * DOCUMENT ME! - */ - public void updateFromPreferences() - { - showFullId = Cache.getDefault("SHOW_FULL_ID", true); + showJVSuffix = Cache.getDefault("SHOW_JVSUFFIX", true); showAnnotation = Cache.getDefault("SHOW_ANNOTATIONS", true); showConservation = Cache.getDefault("SHOW_CONSERVATION", true); @@ -138,8 +153,11 @@ public class AlignViewport // We must set conservation and consensus before setting colour, // as Blosum and Clustal require this to be done - updateConservation(); - updateConsensus(); + if(vconsensus==null && !isDataset) + { + updateConservation(); + updateConsensus(); + } if (jalview.bin.Cache.getProperty("DEFAULT_COLOUR") != null) { @@ -166,16 +184,24 @@ public class AlignViewport * * @param b DOCUMENT ME! */ - public void showSequenceFeatures(boolean b) + public void setShowSequenceFeatures(boolean b) { showSequenceFeatures = b; } + public boolean getShowSequenceFeatures() + { + return showSequenceFeatures; + } + /** * DOCUMENT ME! */ public void updateConservation() { + if(alignment.isNucleotide()) + return; + try{ Conservation cons = new jalview.analysis.Conservation("All", jalview.schemes.ResidueProperties.propHash, 3, @@ -253,7 +279,7 @@ public class AlignViewport ConsPercGaps + "% gaps", annotations, 0f, // cons.qualityRange[0].floatValue(), 11f, // cons.qualityRange[1].floatValue() - 1); + AlignmentAnnotation.BAR_GRAPH); if (showConservation) { @@ -265,7 +291,7 @@ public class AlignViewport qannotations, cons.qualityRange[0].floatValue(), cons.qualityRange[1].floatValue(), - 1); + AlignmentAnnotation.BAR_GRAPH); if (showQuality) { @@ -278,10 +304,18 @@ public class AlignViewport quality.annotations = qannotations; quality.graphMax = cons.qualityRange[1].floatValue(); } - }catch(OutOfMemoryError error) + } + catch (OutOfMemoryError error) { - System.out.println("Out of memory calculating conservation."); + javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop, + "Out of memory calculating conservation!!" + + + "\nSee help files for increasing Java Virtual Machine memory." + , "Out of memory", + javax.swing.JOptionPane.WARNING_MESSAGE); + System.out.println("Conservation calculation: " + error); System.gc(); + } } @@ -341,7 +375,7 @@ public class AlignViewport if (consensus == null) { consensus = new AlignmentAnnotation("Consensus", "PID", - annotations, 0f, 100f, 1); + annotations, 0f, 100f,AlignmentAnnotation.BAR_GRAPH); if (showIdentity) { @@ -358,7 +392,13 @@ public class AlignViewport }catch(OutOfMemoryError error) { - System.out.println("Out of memory calculating consensus."); + javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop, + "Out of memory calculating consensus!!" + + + "\nSee help files for increasing Java Virtual Machine memory." + , "Out of memory", + javax.swing.JOptionPane.WARNING_MESSAGE); + System.out.println("Consensus calculation: " + error); System.gc(); } @@ -616,9 +656,9 @@ public class AlignViewport * * @param w DOCUMENT ME! */ - public void setChunkWidth(int w) + public void setWrappedWidth(int w) { - this.chunkWidth = w; + this.wrappedWidth = w; } /** @@ -626,30 +666,11 @@ public class AlignViewport * * @return DOCUMENT ME! */ - public int getChunkWidth() + public int getWrappedWidth() { - return chunkWidth; + return wrappedWidth; } - /** - * DOCUMENT ME! - * - * @param h DOCUMENT ME! - */ - public void setChunkHeight(int h) - { - this.chunkHeight = h; - } - - /** - * DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - public int getChunkHeight() - { - return chunkHeight; - } /** * DOCUMENT ME! @@ -916,9 +937,9 @@ public class AlignViewport * * @return DOCUMENT ME! */ - public boolean getShowFullId() + public boolean getShowJVSuffix() { - return showFullId; + return showJVSuffix; } /** @@ -926,11 +947,12 @@ public class AlignViewport * * @param b DOCUMENT ME! */ - public void setShowFullId(boolean b) + public void setShowJVSuffix(boolean b) { - showFullId = b; + showJVSuffix = b; } + /** * DOCUMENT ME! * @@ -1060,4 +1082,14 @@ public class AlignViewport { return ignoreGapsInConsensusCalculation; } + + public void setDataset(boolean b) + { + isDataset = b; + } + + public boolean isDataset() + { + return isDataset; + } }