From: amwaterhouse Date: Wed, 25 Apr 2007 14:06:31 +0000 (+0000) Subject: View Properties X-Git-Tag: Release_2_3~177 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5d03e861fb4d2846d73a76979cd6f4b94d0f3751;p=jalview.git View Properties --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index c60355c..bcb5771 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -911,7 +911,8 @@ public class AlignFrame new AnnotationExporter().exportAnnotations( alignPanel, viewport.showAnnotation ? viewport.alignment.getAlignmentAnnotation() : null, - viewport.alignment.getGroups() + viewport.alignment.getGroups(), + ((Alignment)viewport.alignment).alignmentProperties ); } @@ -2266,6 +2267,51 @@ public class AlignFrame alignPanel.setAnnotationVisible(annotationPanelMenuItem.isSelected()); } + public void alignmentProperties() + { + JEditorPane editPane = new JEditorPane("text/html",""); + editPane.setEditable(false); + StringBuffer contents = new StringBuffer(""); + + float avg = 0; + int min=Integer.MAX_VALUE, max=0; + for(int i=0; imax) + max = size; + if(sizeSequences: "+ viewport.alignment.getHeight()); + contents.append("
Minimum Sequence Length: "+min); + contents.append("
Maximum Sequence Length: "+max); + contents.append("
Average Length: "+(int)avg); + + if (((Alignment)viewport.alignment).alignmentProperties != null) + { + Hashtable props = ((Alignment)viewport.alignment).alignmentProperties; + Enumeration en = props.keys(); + contents.append("

"); + while(en.hasMoreElements()) + { + String key = en.nextElement().toString(); + contents.append(""); + } + contents.append("
"+key+""+props.get(key)+"
"); + } + editPane.setText(contents.toString()+""); + JInternalFrame frame = new JInternalFrame(); + frame.add(editPane); + + Desktop.instance.addInternalFrame(frame,"Alignment Properties: "+getTitle(),500,400); + } + + /** * DOCUMENT ME! * diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 1b89d71..bf45112 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -145,6 +145,7 @@ public class GAlignFrame protected JMenuItem gatherViews = new JMenuItem(); protected JMenuItem expandViews = new JMenuItem(); JMenuItem pageSetup = new JMenuItem(); + JMenuItem alignmentProperties = new JMenuItem(); public GAlignFrame() { try @@ -1236,6 +1237,14 @@ public class GAlignFrame pageSetup_actionPerformed(e); } }); + alignmentProperties.setText("Alignment Properties..."); + alignmentProperties.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + alignmentProperties(); + } + }); alignFrameMenuBar.add(fileMenu); alignFrameMenuBar.add(editMenu); @@ -1289,6 +1298,8 @@ public class GAlignFrame viewMenu.add(showSeqFeatures); viewMenu.add(featureSettings); viewMenu.addSeparator(); + viewMenu.add(alignmentProperties); + viewMenu.addSeparator(); viewMenu.add(overviewMenuItem); colourMenu.add(applyToAllGroups); colourMenu.add(textColour); @@ -1814,4 +1825,9 @@ public class GAlignFrame { } + + public void alignmentProperties() + { + + } }