From: <mg...@us...> - 2008-03-24 19:51:57
|
Revision: 1652 http://obo.svn.sourceforge.net/obo/?rev=1652&view=rev Author: mgibson Date: 2008-03-24 12:51:55 -0700 (Mon, 24 Mar 2008) Log Message: ----------- added comparison config to test.cfg for nicole to try out both comparison field and annot id field annot id field should be added automatically if using comparisons but not done yet theres a non functioning plus button coming soon Modified Paths: -------------- phenote/trunk/conf/test.cfg phenote/trunk/src/java/phenote/gui/ComparisonCharacterGui.java phenote/trunk/src/java/phenote/gui/ComparisonGui.java phenote/trunk/src/java/phenote/gui/field/FieldPanel.java Modified: phenote/trunk/conf/test.cfg =================================================================== --- phenote/trunk/conf/test.cfg 2008-03-24 16:35:50 UTC (rev 1651) +++ phenote/trunk/conf/test.cfg 2008-03-24 19:51:55 UTC (rev 1652) @@ -17,7 +17,9 @@ <ns:templatechooser title="Phylogeny Chooser" adapter="phenote.charactertemplate.TreeChooser" field="Taxon"/> </ns:group> <ns:group name="default" title="Default Group" container="window" interface="default"/> + + <ns:field name="Annot ID" datatag="ANNOT_ID" type="AUTO_ANNOT_ID"/> <ns:field name="Publication" syntax-abbrev="PUB" enable="true" groups="default specimen-list"/> <ns:field name="Taxon" syntax-abbrev="GT" enable="true" groups="default specimen-list"> <ns:ontology name="Taxon" file="finkandfink_Taxa.obo" namespace="teleost-taxonomy"/> @@ -40,5 +42,8 @@ <ns:field name="Textual Description" syntax-abbrev="Desc" enable="true" groups="default"/> <ns:field name="Image URI" syntax-abbrev="URI" enable="true" groups="default"/> <ns:field name="Notes" syntax-abbrev="Notes" enable="true" groups="default"/> + + <ns:field name="Annot ID" datatag="ANNOT_ID" type="AUTO_ANNOT_ID"/> + <ns:field name="Comparison" datatag="comparison" type="COMPARISON"/> </ns:phenote-configuration> \ No newline at end of file Modified: phenote/trunk/src/java/phenote/gui/ComparisonCharacterGui.java =================================================================== --- phenote/trunk/src/java/phenote/gui/ComparisonCharacterGui.java 2008-03-24 16:35:50 UTC (rev 1651) +++ phenote/trunk/src/java/phenote/gui/ComparisonCharacterGui.java 2008-03-24 19:51:55 UTC (rev 1652) @@ -43,7 +43,8 @@ /** gives thumbs up to CHAR_FLAVOR data - character drag & drop from table - and imports it on dropping */ + and imports it on dropping + this is actually controller stuff that could be put in separate class? */ private class CharDropHandler extends TransferHandler { public boolean canImport(JComponent c, DataFlavor[] flavors) { for (DataFlavor f : flavors) @@ -94,4 +95,6 @@ } return sb.toString().trim(); } + + } Modified: phenote/trunk/src/java/phenote/gui/ComparisonGui.java =================================================================== --- phenote/trunk/src/java/phenote/gui/ComparisonGui.java 2008-03-24 16:35:50 UTC (rev 1651) +++ phenote/trunk/src/java/phenote/gui/ComparisonGui.java 2008-03-24 19:51:55 UTC (rev 1652) @@ -11,6 +11,7 @@ import java.util.Observable; import java.util.Observer; import javax.swing.AbstractListModel; +import javax.swing.Box; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JDialog; @@ -39,7 +40,9 @@ import phenote.gui.field.ReadOnlyFieldGui; import phenote.gui.field.RelationCompList; -/** a gui for making comparisons between 2 statements/annotations */ +/** a gui for making comparisons between 2 statements/annotations + there is comparison controller stuff in here - listens to gui elements and modifies + model*/ class ComparisonGui { @@ -53,6 +56,7 @@ /** eventually may do a list of comparisons? */ private Comparison currentComparison; private ComparisonListModel compListModel = new ComparisonListModel(); + private FieldPanel fieldPanel; ComparisonGui(Frame owner) { //, CharacterI c1, CharacterI c2) { try { init(owner); } @@ -74,18 +78,20 @@ dialog = new JDialog(owner,"Statement Comparison",modal); dialog.setAlwaysOnTop(true); - FieldPanel fieldPanel = FieldPanel.makeBasicPanel(); + fieldPanel = FieldPanel.makeBasicPanel(); dialog.add(fieldPanel); - addSubjectGui(fieldPanel); + addHelpText(); + addSubjectGui(); + // Relationship - dislpay rel if comp already made addRelGui(fieldPanel); // throws CharFieldException if no rel ontology - addObjectGui(fieldPanel); + addObjectGui(); // Buttons OK & Cancel - addButtons(fieldPanel); + addButtons(); dialog.add(createListGui(),BorderLayout.EAST); @@ -95,11 +101,17 @@ dialog.pack(); // ? } - private void addSubjectGui(FieldPanel fieldPanel) { + private void addHelpText() { + String m = "Drag rows from Annotation table and drop on Subject & Object fields:"; + fieldPanel.addLabelForWholeRow(m); + fieldPanel.addLabelForWholeRow(" "); // cheap vert spacing + } + + private void addSubjectGui() { subjectGui = addField(fieldPanel,"Subject"); subjectGui.addObserver(new SubjectObserver()); } - private void addObjectGui(FieldPanel fieldPanel) { + private void addObjectGui() { objectGui = addField(fieldPanel,"Object"); objectGui.addObserver(new ObjectObserver()); } @@ -134,15 +146,19 @@ return listScroll; } - private void addButtons(FieldPanel fieldPanel) { - List<JButton> buttons = new ArrayList<JButton>(2); + private void addButtons() { + List<JComponent> buttons = new ArrayList<JComponent>(4); JButton ok = new JButton("OK"); ok.addActionListener(new OkListener()); buttons.add(ok); JButton cancel = new JButton("Cancel"); cancel.addActionListener(new CancelListener()); buttons.add(cancel); - fieldPanel.addButtonRow(buttons); + JButton addComp = new JButton("+"); + buttons.add(new Box.Filler(new Dimension(10,0),new Dimension(200,0), + new Dimension(400,0))); + buttons.add(addComp); + fieldPanel.addComponentRow(buttons); } // OK Modified: phenote/trunk/src/java/phenote/gui/field/FieldPanel.java =================================================================== --- phenote/trunk/src/java/phenote/gui/field/FieldPanel.java 2008-03-24 16:35:50 UTC (rev 1651) +++ phenote/trunk/src/java/phenote/gui/field/FieldPanel.java 2008-03-24 19:51:55 UTC (rev 1652) @@ -322,7 +322,17 @@ fieldPanel.add(buttonPanel,constraints); } + public void addComponentRow(List<JComponent> comps) { + JPanel compPanel = new JPanel(); + for (JComponent c : comps) + compPanel.add(c); + GridBagConstraints constraints = getConstraintsNewRow(); + constraints.gridwidth = 5; + constraints.gridx = 1; // scoot it over a little? + fieldPanel.add(compPanel,constraints); + } + public SearchParamPanel getSearchParamPanel() { if (searchParamPanel == null) searchParamPanel = new SearchParamPanel(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |