Skip to content
Snippets Groups Projects
Commit 8f4e5534 authored by tjc's avatar tjc
Browse files

fixes

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@5687 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 9a2fbb75
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/genebuilder/GeneBuilderFrame.java,v 1.20 2007-02-22 19:39:23 tjc Exp $
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/genebuilder/GeneBuilderFrame.java,v 1.21 2007-03-15 11:39:07 tjc Exp $
*/
package uk.ac.sanger.artemis.components.genebuilder;
......@@ -53,6 +53,7 @@ import uk.ac.sanger.artemis.GotoEventSource;
import uk.ac.sanger.artemis.Selection;
import uk.ac.sanger.artemis.components.FeatureEdit;
import uk.ac.sanger.artemis.components.Utilities;
import uk.ac.sanger.artemis.io.GFFEntryInformation;
import uk.ac.sanger.artemis.io.GFFStreamFeature;
import uk.ac.sanger.artemis.io.ChadoCanonicalGene;
import uk.ac.sanger.artemis.io.InvalidRelationException;
......@@ -152,14 +153,16 @@ public class GeneBuilderFrame extends JFrame
all.setTopComponent(top);
if(entry_group != null)
{
JTabbedPane tabpane = new JTabbedPane();
feature_editor = new FeatureEdit(feature, entry_group,
selection, goto_event_source, this);
tabpane.addTab("Annotation", feature_editor);
all.setBottomComponent(tabpane);
}
selection, goto_event_source, this);
else
feature_editor = new FeatureEdit(feature, null,
null, null, this, new GFFEntryInformation());
JTabbedPane tabpane = new JTabbedPane();
tabpane.addTab("Annotation", feature_editor);
all.setBottomComponent(tabpane);
getContentPane().add(all);
addWindowListener(new WindowAdapter()
......
......@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/genebuilder/GeneComponentTree.java,v 1.15 2007-02-05 15:04:15 tjc Exp $
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/genebuilder/GeneComponentTree.java,v 1.16 2007-03-15 11:39:07 tjc Exp $
*/
package uk.ac.sanger.artemis.components.genebuilder;
......@@ -347,7 +347,8 @@ public class GeneComponentTree extends JTree
feature = new uk.ac.sanger.artemis.Feature(embl_feature);
gene_builder.setActiveFeature(feature);
selection.set(feature);
if(selection != null)
selection.set(feature);
}
}
......
......@@ -47,7 +47,9 @@ import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.Box;
import javax.swing.UIManager;
import uk.ac.sanger.artemis.Options;
import uk.ac.sanger.artemis.chado.*;
import uk.ac.sanger.artemis.io.FeatureVector;
import uk.ac.sanger.artemis.io.DatabaseDocumentEntry;
......@@ -128,7 +130,7 @@ public class GeneEdit
Box xbox = Box.createHorizontalBox();
final JTextField gene_text = new JTextField(20);
gene_text.setText("SPAC212.04c"); //"SPAC212.04c");
gene_text.setText("BPSL3413"); //"SPAC212.04c");
xbox.add(gene_text);
xbox.add(schema_list);
gene_text.selectAll();
......@@ -165,9 +167,11 @@ public class GeneEdit
break;
}
}
new GeneBuilderFrame(new uk.ac.sanger.artemis.Feature(gff_gene_feature),
null, null, null);
uk.ac.sanger.artemis.Feature feature =
new uk.ac.sanger.artemis.Feature(gff_gene_feature);
new GeneBuilderFrame(feature, null, null, null);
}
});
xbox.add(findButt);
......@@ -255,6 +259,17 @@ public class GeneEdit
public static void main(String args[])
{
final javax.swing.plaf.FontUIResource font_ui_resource =
Options.getOptions().getFontUIResource();
java.util.Enumeration keys = UIManager.getDefaults().keys();
while(keys.hasMoreElements())
{
Object key = keys.nextElement();
Object value = UIManager.get(key);
if(value instanceof javax.swing.plaf.FontUIResource)
UIManager.put(key, font_ui_resource);
}
new GeneEdit();
}
}
/* OrthologPanel.java
* This file is part of Artemis
*
* Copyright (C) 2007 Genome Research Limited
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/genebuilder/ortholog/OrthologPanel.java,v 1.1 2007-03-15 11:39:07 tjc Exp $
*/
package uk.ac.sanger.artemis.components.genebuilder.ortholog;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.Box;
import javax.swing.JLabel;
import javax.swing.JPanel;
import uk.ac.sanger.artemis.FeatureChangeEvent;
import uk.ac.sanger.artemis.FeatureChangeListener;
import uk.ac.sanger.artemis.Feature;
import uk.ac.sanger.artemis.io.Qualifier;
import uk.ac.sanger.artemis.io.QualifierVector;
public class OrthologPanel extends JPanel
implements FeatureChangeListener
{
private static final long serialVersionUID = 1L;
private QualifierVector orthologQualifiers;
public OrthologPanel(final Feature feature)
{
super(new FlowLayout(FlowLayout.LEFT));
updateFromFeature(feature);
}
/**
* Return true if this is a Ortholog qualifier
* @param qualifier
* @return
*/
public boolean isOrthologTag(final Qualifier qualifier)
{
if(qualifier.getName().equals("ortholog"))
return true;
return false;
}
private Component createOrthologQualifiersComponent()
{
int nrows = 0;
Qualifier idQualifier = orthologQualifiers.getQualifierByName("ID");
Box gffBox = Box.createVerticalBox();
gffBox.add(Box.createVerticalStrut(10));
GridBagLayout grid = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
c.ipady = 5;
JPanel gridPanel = new JPanel(grid);
if(idQualifier != null)
{
final String uniquename = (String)idQualifier.getValues().get(0);
JLabel idField = new JLabel("ID");
c.gridx = 0;
c.gridy = 0;
c.ipadx = 5;
c.anchor = GridBagConstraints.EAST;
gridPanel.add(idField, c);
c.gridx = 1;
c.gridy = 0;
c.ipadx = 0;
c.anchor = GridBagConstraints.WEST;
//gridPanel.add(uniquenameTextField, c);
}
gffBox.add(gridPanel);
return gffBox;
}
public void updateFromFeature(final Feature feature)
{
removeAll();
if(orthologQualifiers != null)
feature.removeFeatureChangeListener(this);
orthologQualifiers = feature.getQualifiers().copy();
orthologQualifiers = new QualifierVector();
final QualifierVector qualifiers = feature.getQualifiers();
for(int i = 0 ; i < qualifiers.size(); ++i)
{
Qualifier qualifier = (Qualifier)qualifiers.elementAt(i);
if(isOrthologTag(qualifier))
orthologQualifiers.addElement(qualifier.copy());
}
feature.addFeatureChangeListener(this);
add(createOrthologQualifiersComponent());
repaint();
revalidate();
}
/**
* Get the latest (edited) controlled vocab qualifiers
* @return
*/
public QualifierVector getOrthologQualifiers()
{
// check editable components for changes
//
return orthologQualifiers;
}
public void featureChanged(FeatureChangeEvent event)
{
updateFromFeature(event.getFeature());
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment