X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignViewport.java;h=d4ba5eae69dad4b57ff26efb783afb33910bd380;hb=ea49c8f1b0d681ec87547fc4055eb35a1165aee3;hp=088d4273b8397893f8fd4fea13df5e64b43218c1;hpb=1deb6329192c4750c104d4da8c70f9cb6e3c5a42;p=jalview.git diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 088d427..d4ba5ea 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -61,8 +61,9 @@ public class AlignViewport SequenceGroup selectionGroup; int charHeight; int charWidth; + boolean validCharWidth; int wrappedWidth; - Font font = new Font("SansSerif", Font.PLAIN, 10); + Font font; AlignmentI alignment; ColumnSelection colSel = new ColumnSelection(); int threshold; @@ -71,12 +72,22 @@ public class AlignViewport boolean scaleAboveWrapped = false; boolean scaleLeftWrapped = true; boolean scaleRightWrapped = true; + boolean hasHiddenColumns = false; + boolean hasHiddenRows = false; + + boolean cursorMode = 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; AlignmentAnnotation consensus; AlignmentAnnotation conservation; AlignmentAnnotation quality; + boolean autoCalculateConsensus = true; /** DOCUMENT ME!! */ public int ConsPercGaps = 25; // JBPNote : This should be a scalable property! @@ -90,6 +101,8 @@ public class AlignViewport boolean antiAlias = false; + boolean padGaps = false; + public AlignViewport(AlignmentI al, boolean dataset) { @@ -124,6 +137,10 @@ public class AlignViewport showQuality = Cache.getDefault("SHOW_QUALITY", true); showIdentity = Cache.getDefault("SHOW_IDENTITY", true); + autoCalculateConsensus = Cache.getDefault("AUTO_CALC_CONSENSUS", true); + + padGaps = Cache.getDefault("PAD_GAPS", false); + String fontName = Cache.getDefault("FONT_NAME", "SansSerif"); String fontStyle = Cache.getDefault("FONT_STYLE", Font.PLAIN + "") ; String fontSize = Cache.getDefault("FONT_SIZE", "10"); @@ -178,11 +195,16 @@ 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! */ @@ -296,12 +318,19 @@ public class AlignViewport } catch (OutOfMemoryError error) { - 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); + javax.swing.SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + 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(); @@ -381,12 +410,20 @@ public class AlignViewport }catch(OutOfMemoryError error) { - 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); + javax.swing.SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop, + "Out of memory calc45ulating 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(); } @@ -588,6 +625,7 @@ public class AlignViewport java.awt.FontMetrics fm = c.getFontMetrics(font); setCharHeight(fm.getHeight()); setCharWidth(fm.charWidth('M')); + validCharWidth = true; } /** @@ -1064,7 +1102,6 @@ public class AlignViewport { globalColourScheme.setThreshold(globalColourScheme.getThreshold(), ignoreGapsInConsensusCalculation); } - } public boolean getIgnoreGapsConsensus() @@ -1081,4 +1118,23 @@ public class AlignViewport { return isDataset; } + + public void hideSequence(SequenceI seq) + { + alignment.getHiddenSequences().hideSequence(seq); + hasHiddenRows = true; + } + + public void showSequence(int index) + { + alignment.getHiddenSequences().showSequence(index); + + if(alignment.getHiddenSequences().getSize()<1) + hasHiddenRows = false; + } + + public int adjustForHiddenSeqs(int alignmentIndex) + { + return alignment.getHiddenSequences().adjustForHiddenSeqs(alignmentIndex); + } }