int startSeq;\r
int endSeq;\r
\r
- boolean showFullId = true;\r
+ boolean showDBPrefix = true;\r
+ boolean showJVSuffix = true;\r
boolean showText = true;\r
boolean showColourText = false;\r
boolean showBoxes = true;\r
String param = applet.getParameter("showFullId");\r
if (param != null)\r
{\r
- showFullId = Boolean.valueOf(param).booleanValue();\r
+ showJVSuffix = Boolean.valueOf(param).booleanValue();\r
}\r
\r
param = applet.getParameter("showAnnotation");\r
return colourAppliesToAllGroups;\r
}\r
\r
- public boolean getShowFullId()\r
+ public boolean getShowJVSuffix()\r
{\r
- return showFullId;\r
+ return showJVSuffix;\r
}\r
\r
- public void setShowFullId(boolean b)\r
+ public void setShowJVSuffix(boolean b)\r
{\r
- showFullId = b;\r
+ showJVSuffix = b;\r
+ }\r
+\r
+ public boolean getShowDBPrefix()\r
+ {\r
+ return showDBPrefix;\r
+ }\r
+\r
+ public void setShowDBPrefix(boolean b)\r
+ {\r
+ showDBPrefix = b;\r
}\r
\r
public boolean getShowAnnotation()\r
while (i < al.getHeight() && al.getSequenceAt(i) != null)\r
{\r
SequenceI s = al.getSequenceAt(i);\r
- if (av.getShowFullId())\r
- {\r
- id = s.getDisplayId();\r
- }\r
- else\r
- {\r
- id = s.getName();\r
- }\r
+ id = s.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
\r
if (fm.stringWidth(id) > idWidth)\r
{\r
gg.setColor(Color.black);\r
}\r
\r
- String string = s.getName();\r
- if (av.getShowFullId())\r
- {\r
- string = s.getDisplayId();\r
- }\r
+ String string = s.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
\r
gg.drawString(string, 0,\r
((i - starty) * charHeight) + ypos +\r
av.charHeight);\r
\r
gg.setColor(currentTextColor);\r
- String string = av.alignment.getSequenceAt(i).getName();\r
- if (av.getShowFullId())\r
- {\r
- string = av.alignment.getSequenceAt(i).getDisplayId();\r
- }\r
+ String string = av.alignment.getSequenceAt(i)\r
+ .getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
+\r
gg.drawString(string, 0,\r
((i - starty) * av.charHeight) +\r
av.charHeight - (av.charHeight / 5));\r
gg.setColor(Color.black);\r
}\r
\r
- String string = s.getName();\r
\r
- if (av.getShowFullId())\r
- {\r
- string = s.getDisplayId();\r
- }\r
-\r
- gg.drawString(string, 0,\r
- (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));\r
+ gg.drawString( s.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix()),\r
+ 0, (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));\r
}\r
\r
/**\r
\r
gg.setColor(currentTextColor);\r
\r
- String string = av.alignment.getSequenceAt(i).getName();\r
-\r
- if (av.getShowFullId())\r
- {\r
- string = av.alignment.getSequenceAt(i).getDisplayId();\r
- }\r
+ String string = av.alignment.getSequenceAt(i).getDisplayId(\r
+ av.getShowDBPrefix(), av.getShowJVSuffix());\r
\r
gg.drawString(string, 0,\r
(((i - starty) * av.charHeight) + av.charHeight) -\r
import java.net.*;\r
\r
import java.util.*;\r
+\r
import java.util.jar.*;\r
\r
import javax.swing.*;\r
view.setShowBoxes(av.getShowBoxes());\r
view.setShowColourText(av.getColourText());\r
view.setShowConservation(av.showConservation);\r
- view.setShowFullId(av.getShowFullId());\r
+ view.setShowFullId(av.getShowJVSuffix());\r
view.setShowIdentity(av.showIdentity);\r
view.setShowQuality(av.showQuality);\r
view.setShowSequenceFeatures(av.showSequenceFeatures);\r
af.viewport.setConservationSelected(view.getConservationSelected());\r
af.conservationMenuItem.setSelected(view.getConservationSelected());\r
\r
- af.viewport.setShowFullId(view.getShowFullId());\r
- af.fullSeqId.setSelected(view.getShowFullId());\r
+ af.viewport.setShowJVSuffix(view.getShowFullId());\r
+ af.seqLimits.setSelected(view.getShowFullId());\r
\r
af.viewport.setFont(new java.awt.Font(view.getFontName(),\r
view.getFontStyle(), view.getFontSize()));\r
Desktop.addInternalFrame(frame, "Preferences", 480, 390);\r
frame.setMinimumSize(new Dimension(480,390));\r
\r
- fullID.setSelected( Cache.getDefault("SHOW_FULL_ID", true));\r
+ dbRef.setSelected( Cache.getDefault("SHOW_DBREF", true));\r
+ seqLimit.setSelected( Cache.getDefault("SHOW_JVSUFFIX", true));\r
fullScreen.setSelected( Cache.getDefault("SHOW_FULLSCREEN", false));\r
annotations.setSelected( Cache.getDefault("SHOW_ANNOTATIONS", true));\r
\r
public void ok_actionPerformed(ActionEvent e)\r
{\r
\r
- Cache.applicationProperties.setProperty("SHOW_FULL_ID", Boolean.toString(fullID.isSelected()));\r
+ Cache.applicationProperties.setProperty("SHOW_DBREF", Boolean.toString(dbRef.isSelected()));\r
+ Cache.applicationProperties.setProperty("SHOW_JVSUFFIX", Boolean.toString(seqLimit.isSelected()));\r
Cache.applicationProperties.setProperty("SHOW_FULLSCREEN", Boolean.toString(fullScreen.isSelected()));\r
\r
Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", Boolean.toString(annotations.isSelected()));\r
seq = alignment.getSequenceAt(i);\r
groups = alignment.findAllGroups(seq);\r
\r
- if (av.getShowFullId())\r
- {\r
- out.println("<tr><td nowrap>" + seq.getDisplayId() +\r
- " </td>");\r
- }\r
- else\r
- {\r
- out.println("<tr><td nowrap>" + seq.getName() +\r
+ String id = seq.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
+\r
+ out.println("<tr><td nowrap>" + id +\r
" </td>");\r
- }\r
+\r
\r
for (int res = 0; res < seq.getLength(); res++)\r
{\r
seq = al.getSequenceAt(s);\r
groups = al.findAllGroups(seq);\r
\r
- if (av.getShowFullId())\r
- {\r
- out.println("<td nowrap>" + seq.getDisplayId() +\r
- " </td>");\r
- }\r
- else\r
- {\r
- out.println("<td nowrap>" + seq.getName() +\r
+ String id = seq.getDisplayId(av.getShowDBPrefix(), av.getShowJVSuffix());\r
+\r
+ out.println("<td nowrap>" + id +\r
" </td>");\r
- }\r
+\r
\r
for (int res = startRes; res < endRes; res++)\r
{\r
sequence.setStart(jal.getDataset().getSequenceAt(i).getStart());\r
sequence.setEnd(jal.getDataset().getSequenceAt(i).getEnd());\r
\r
+\r
+ if(jal.getDataset().getSequenceAt(i).getSequenceFeatures()!=null)\r
+ {\r
+ int sfSize = jal.getDataset().getSequenceAt(i).getSequenceFeatures().size();\r
+\r
+ for (int sf = 0; sf < sfSize; sf++)\r
+ {\r
+ jalview.datamodel.SequenceFeature feature =\r
+ (jalview.datamodel.SequenceFeature)\r
+ jal.getDataset().getSequenceAt(i).getSequenceFeatures().elementAt(sf);\r
+\r
+ DataSetAnnotations dsa = new DataSetAnnotations();\r
+ dsa.setType(feature.getType());\r
+ dsa.setBegin(feature.getBegin());\r
+ dsa.setEnd(feature.getEnd());\r
+ dsa.setDescription(feature.getDescription());\r
+ dsa.setStatus(feature.getStatus());\r
+ dsa.addProvenance(dummyProvenance());\r
+ dsa.setSeqRef(sequence);\r
+ dsa.setId("sf"+(time++));\r
+ dataset.addDataSetAnnotations(dsa);\r
+ }\r
+ }\r
+\r
if(jal.getDataset().getSequenceAt(i).getDBRef()!=null)\r
{\r
java.util.Vector entries = jal.getDataset().getSequenceAt(i).getDBRef();\r
dataset.getSequence(i).getEnd() );\r
seqs[i].setVamsasId(dataset.getSequence(i).getId());\r
\r
+ if (dataset.getDataSetAnnotations() != null)\r
+ {\r
+ for (int dsa = 0; dsa < dataset.getDataSetAnnotationsCount(); dsa++)\r
+ {\r
+ if (dataset.getDataSetAnnotations(dsa).getSeqRef() ==\r
+ dataset.getSequence(i))\r
+ {\r
+ seqs[i].addSequenceFeature(new jalview.datamodel.\r
+ SequenceFeature(\r
+ dataset.getDataSetAnnotations(dsa).getType(),\r
+ dataset.getDataSetAnnotations(dsa).getDescription(),\r
+ dataset.getDataSetAnnotations(dsa).getStatus(),\r
+ dataset.getDataSetAnnotations(dsa).getBegin(),\r
+ dataset.getDataSetAnnotations(dsa).getEnd()));\r
+ }\r
+ }\r
+ }\r
dbref = dataset.getSequence(i).getDbRef();\r
\r
if(dbref.length>0)\r
dbref[db].getAccessionId().toString()));\r
}\r
}\r
-\r
}\r
jalview.datamodel.Alignment jdataset = new jalview.datamodel.Alignment(seqs);\r
////////////////////////////////////////////////\r
Alignment alignment = dataset.getAlignment(0);\r
iSize = alignment.getAlignmentSequenceCount();\r
seqs = new jalview.datamodel.Sequence[iSize];\r
+ String id;\r
+ int j, jSize = jdataset.getHeight();\r
for (i = 0; i < iSize; i++)\r
{\r
seqs[i] = new jalview.datamodel.Sequence(\r
alignment.getAlignmentSequence(i).getSequence(),\r
alignment.getAlignmentSequence(i).getStart(),\r
alignment.getAlignmentSequence(i).getEnd());\r
+\r
+ id = ( (Sequence) alignment.getAlignmentSequence(i).getRefid()).getId();\r
+\r
+ for(j=0; j<jSize; j++)\r
+ {\r
+ if(jdataset.getSequenceAt(j).getVamsasId().equals(id))\r
+ {\r
+ seqs[i].setDatasetSequence( jdataset.getSequenceAt(j) );\r
+ break;\r
+ }\r
+ }\r
}\r
jalview.datamodel.Alignment jal = new jalview.datamodel.Alignment(seqs);\r
jal.setDataset(jdataset);\r
{\r
AlignmentAnnotations[] an = alignment.getAlignmentAnnotations();\r
\r
- for (int j = 0; j < an.length; j++)\r
+ for (j = 0; j < an.length; j++)\r
{\r
boolean topaliBreakpoint = false;\r
\r
public JCheckBoxMenuItem applyToAllGroups = new JCheckBoxMenuItem();\r
JMenuItem createPNG = new JMenuItem();\r
protected JMenuItem font = new JMenuItem();\r
- public JCheckBoxMenuItem fullSeqId = new JCheckBoxMenuItem();\r
+ public JCheckBoxMenuItem seqLimits = new JCheckBoxMenuItem();\r
JMenuItem epsFile = new JMenuItem();\r
JMenuItem LoadtreeMenuItem = new JMenuItem();\r
public JCheckBoxMenuItem scaleAbove = new JCheckBoxMenuItem();\r
protected JCheckBoxMenuItem showTranslation = new JCheckBoxMenuItem();\r
protected JTabbedPane tabbedPane = new JTabbedPane();\r
protected JMenuItem featureSettings = new JMenuItem();\r
+ public JCheckBoxMenuItem seqDBRef = new JCheckBoxMenuItem();\r
\r
public GAlignFrame()\r
{\r
font_actionPerformed(e);\r
}\r
});\r
- fullSeqId.setText("Show Full Sequence ID");\r
- fullSeqId.setState( jalview.bin.Cache.getDefault("SHOW_FULL_ID",true));\r
- fullSeqId.addActionListener(new java.awt.event.ActionListener()\r
+\r
+ seqLimits.setText("Show Sequence Limits");\r
+ seqLimits.setState( jalview.bin.Cache.getDefault("SHOW_JVSUFFIX",true));\r
+ seqLimits.addActionListener(new java.awt.event.ActionListener()\r
{\r
public void actionPerformed(ActionEvent e)\r
{\r
- fullSeqId_actionPerformed(e);\r
+ seqLimit_actionPerformed(e);\r
}\r
});\r
epsFile.setText("EPS");\r
featureSettings_actionPerformed(e);\r
}\r
});\r
+ seqDBRef.setState( jalview.bin.Cache.getDefault("SHOW_DBPREFIX",true));\r
+ seqDBRef.setText("Show Sequence DB Refs");\r
+ seqDBRef.addActionListener(new ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent e)\r
+ {\r
+ seqDBRef_actionPerformed(e);\r
+ }\r
+ });\r
alignFrameMenuBar.add(fileMenu);\r
alignFrameMenuBar.add(editMenu);\r
alignFrameMenuBar.add(searchMenu);\r
viewMenu.add(font);\r
viewMenu.addSeparator();\r
viewMenu.add(wrapMenuItem);\r
- viewMenu.add(fullSeqId);\r
+ viewMenu.add(seqDBRef);\r
+ viewMenu.add(seqLimits);\r
viewMenu.add(scaleAbove);\r
viewMenu.add(scaleLeft);\r
viewMenu.add(scaleRight);\r
{\r
}\r
\r
- protected void fullSeqId_actionPerformed(ActionEvent e)\r
+ protected void seqLimit_actionPerformed(ActionEvent e)\r
{\r
}\r
\r
+ public void seqDBRef_actionPerformed(ActionEvent e)\r
+ {\r
+\r
+ }\r
+\r
+\r
public void createEPS(java.io.File f)\r
{\r
}\r
{\r
\r
}\r
+\r
}\r
BorderLayout borderLayout1 = new BorderLayout();\r
protected JCheckBox quality = new JCheckBox();\r
JPanel visualTab = new JPanel();\r
- protected JCheckBox fullID = new JCheckBox();\r
+ protected JCheckBox dbRef = new JCheckBox();\r
protected JCheckBox fullScreen = new JCheckBox();\r
protected JCheckBox conservation = new JCheckBox();\r
protected JCheckBox identity = new JCheckBox();\r
JPanel jPanel11 = new JPanel();\r
GridLayout gridLayout3 = new GridLayout();\r
Font verdana11 = new java.awt.Font("Verdana", Font.PLAIN, 11);\r
+ protected JCheckBox seqLimit = new JCheckBox();\r
/**\r
* Creates a new GPreferences object.\r
*/\r
quality.setText("Quality");\r
visualTab.setBorder(new TitledBorder("Open new alignment"));\r
visualTab.setLayout(null);\r
- fullID.setFont(verdana11);\r
- fullID.setHorizontalAlignment(SwingConstants.RIGHT);\r
- fullID.setHorizontalTextPosition(SwingConstants.LEFT);\r
- fullID.setMargin(new Insets(4, 2, 2, 0));\r
- fullID.setText("Full Sequence ID");\r
+ dbRef.setFont(verdana11);\r
+ dbRef.setHorizontalAlignment(SwingConstants.RIGHT);\r
+ dbRef.setHorizontalTextPosition(SwingConstants.LEFT);\r
+ dbRef.setMargin(new Insets(4, 2, 2, 0));\r
+ dbRef.setText("DB refs (Uniprot|H456)");\r
fullScreen.setFont(verdana11);\r
fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);\r
fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);\r
gapLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
gapLabel.setText("Gap Symbol ");\r
colour.setFont(verdana11);\r
- colour.setBounds(new Rectangle(148, 171, 154, 21));\r
+ colour.setBounds(new Rectangle(173, 169, 154, 21));\r
colourLabel.setFont(verdana11);\r
colourLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
colourLabel.setText("Colour ");\r
fontStyleCB.setFont(verdana11);\r
fontStyleCB.setBounds(new Rectangle(365, 111, 70, 21));\r
fontNameCB.setFont(verdana11);\r
- fontNameCB.setBounds(new Rectangle(148, 111, 169, 21));\r
+ fontNameCB.setBounds(new Rectangle(169, 111, 148, 21));\r
gapSymbolCB.setFont(verdana11);\r
- gapSymbolCB.setBounds(new Rectangle(148, 141, 67, 21));\r
+ gapSymbolCB.setBounds(new Rectangle(171, 136, 67, 21));\r
startupCheckbox.setText("Open file");\r
startupCheckbox.setFont(verdana11);\r
startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);\r
startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);\r
startupCheckbox.setSelected(true);\r
startupFileTextfield.setFont(verdana11);\r
- startupFileTextfield.setBounds(new Rectangle(148, 232, 302, 20));\r
+ startupFileTextfield.setBounds(new Rectangle(170, 232, 271, 20));\r
startupFileTextfield.addMouseListener(new MouseAdapter()\r
{\r
public void mouseClicked(MouseEvent e)\r
jPanel1.setBorder(titledBorder1);\r
jPanel1.setLayout(gridBagLayout1);\r
sortby.setFont(verdana11);\r
- sortby.setBounds(new Rectangle(148, 200, 302, 21));\r
+ sortby.setBounds(new Rectangle(171, 200, 272, 21));\r
sortLabel.setFont(verdana11);\r
sortLabel.setHorizontalAlignment(SwingConstants.RIGHT);\r
sortLabel.setText("Sort by ");\r
- jPanel2.setBounds(new Rectangle(7, 17, 138, 242));\r
+ jPanel2.setBounds(new Rectangle(7, 17, 158, 242));\r
jPanel2.setLayout(gridLayout2);\r
gridLayout2.setRows(8);\r
jPanel3.setBounds(new Rectangle(147, 46, 274, 26));\r
pileupjv.setHorizontalAlignment(SwingConstants.CENTER);\r
pirjv.setFont(verdana11);\r
pirjv.setHorizontalAlignment(SwingConstants.CENTER);\r
+ seqLimit.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+ seqLimit.setHorizontalTextPosition(SwingConstants.LEADING);\r
+ seqLimit.setText("Sequence Limits (/1-350)");\r
+ seqLimit.setBounds(new Rectangle(183, 81, 178, 23));\r
jPanel2.add(fullScreen);\r
jPanel2.add(annotations);\r
- jPanel2.add(fullID);\r
+ jPanel2.add(dbRef);\r
jPanel2.add(fontLabel);\r
jPanel2.add(gapLabel);\r
jPanel2.add(colourLabel);\r
jPanel2.add(sortLabel);\r
jPanel2.add(startupCheckbox);\r
+ visualTab.add(gapSymbolCB);\r
+ visualTab.add(colour);\r
+ visualTab.add(seqLimit);\r
visualTab.add(jPanel3);\r
jPanel3.add(conservation);\r
jPanel3.add(quality);\r
jPanel3.add(identity);\r
visualTab.add(sortby);\r
- visualTab.add(colour);\r
visualTab.add(startupFileTextfield);\r
visualTab.add(fontNameCB);\r
visualTab.add(fontSizeCB);\r
visualTab.add(fontStyleCB);\r
- visualTab.add(gapSymbolCB);\r
visualTab.add(jPanel2);\r
-\r
linkPanel.add(editLinkButtons, BorderLayout.EAST);\r
editLinkButtons.add(newLink, null);\r
editLinkButtons.add(editLink, null);\r
\r
tabbedPane.add(visualTab, "Visual");\r
tabbedPane.add(connectTab,"Connections");\r
- tabbedPane.add(exportTab, "File");\r
+ tabbedPane.add(exportTab, "Output");\r
jPanel11.add(jLabel2);\r
jPanel11.add(jLabel1);\r
jPanel11.add(jLabel10);\r