X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAppJmol.java;fp=src%2Fjalview%2Fgui%2FAppJmol.java;h=29c388c74df3fd3cb43835fb35de126b447d5ad6;hb=ab506fbc0fa234dc7ce44e1d2af4944df734fe2c;hp=e2e54aaddc253ac2f42d178f7ce70f22da56f0bb;hpb=8f3b3ddf42faa51a857e4483a4177412f64f7600;p=jalview.git diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index e2e54aa..29c388c 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -50,8 +50,11 @@ import java.awt.Font; import java.awt.Graphics; import java.awt.Rectangle; import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; @@ -66,7 +69,7 @@ import javax.swing.JCheckBoxMenuItem; import javax.swing.JColorChooser; import javax.swing.JInternalFrame; import javax.swing.JMenu; -import javax.swing.JOptionPane; +import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JSplitPane; import javax.swing.SwingUtilities; @@ -170,6 +173,8 @@ public class AppJmol extends StructureViewerBase private void initMenus() { + String jmol = MessageManager.getString("label.jmol"); + viewerActionMenu.setText(jmol); seqColour.setSelected(jmb.isColourBySequence()); viewerColour.setSelected(!jmb.isColourBySequence()); if (_colourwith == null) @@ -243,6 +248,35 @@ public class AppJmol extends StructureViewerBase } }); + + JMenuItem writeFeatures = new JMenuItem( + MessageManager.getString("label.create_viewer_attributes")); + writeFeatures.setToolTipText(MessageManager.formatMessage( + "label.create_viewer_attributes_tip", jmol)); + writeFeatures.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + sendFeaturesToViewer(); + } + }); + viewerActionMenu.add(writeFeatures); + + final JMenu fetchAttributes = new JMenu(MessageManager.formatMessage( + "label.fetch_viewer_attributes", jmol)); + fetchAttributes.setToolTipText(MessageManager.formatMessage( + "label.fetch_viewer_attributes_tip", jmol)); + fetchAttributes.addMouseListener(new MouseAdapter() + { + + @Override + public void mouseEntered(MouseEvent e) + { + buildAttributesMenu(fetchAttributes); + } + }); + viewerActionMenu.add(fetchAttributes); } IProgressIndicator progressBar = null; @@ -1031,10 +1065,10 @@ public class AppJmol extends StructureViewerBase setChainMenuItems(jmb.getChainNames()); this.setTitle(jmb.getViewerTitle()); - if (jmb.getPdbFile().length > 1 && jmb.getSequence().length > 1) - { + // if (jmb.getPdbFile().length > 1 && jmb.getSequence().length > 1) + // { viewerActionMenu.setVisible(true); - } + // } if (!jmb.isLoadingFromArchive()) { seqColour_actionPerformed(null); @@ -1143,4 +1177,36 @@ public class AppJmol extends StructureViewerBase return jmb; } + @Override + protected void sendFeaturesToViewer() + { + /* + * Atom properties may also be set directly using {atom expression}.xxxx = y. + */ + } + + @Override + protected void getResidueAttributes(String attName) + { + /* + * getproperty atominfo returns properties for all atoms + * - could parse this for unique/specific property names? + * + * _ipt atomID atomIndex atomno bondCount chain clickabilityFlags colix color coord + * element elemno formalCharge groupID info model name occupancy partialCharge + * polymerLength radius resname resno shape spacefill structure sym temp + * visibilityFlags visible x y z + * + * getproperty chaininfo is residue level info + * no sign of average bfactor for a residue :-( + */ + } + + @Override + protected List getResidueAttributeNames() + { + // TODO Auto-generated method stub + return null; + } + }