From: Nomi H. <no...@us...> - 2003-01-31 17:31:51
|
Update of /cvsroot/gmod/apollo/src/java/apollo/gui In directory sc8-pr-cvs1:/tmp/cvs-serv10076/apollo/gui Modified Files: AnnotationEditor.java Log Message: method to decide if the current selections allow us to move exons to another transcript Index: AnnotationEditor.java =================================================================== RCS file: /cvsroot/gmod/apollo/src/java/apollo/gui/AnnotationEditor.java,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** AnnotationEditor.java 28 Jan 2003 22:29:08 -0000 1.88 --- AnnotationEditor.java 31 Jan 2003 17:31:45 -0000 1.89 *************** *** 345,348 **** --- 345,365 ---- /** + * Determine if the current selections are compatible + * with moving exons to another transcript. + * Want a whole transcript plus one or more exons from another transcript. + * !! This is not working right yet. + */ + public boolean moveExonsAllowed() { + if ((annotSet.getTranscripts().size() == 2) && + (cursorSet.getFeature(0) instanceof Transcript || + cursorSet.getFeature(1) instanceof Transcript)) { + return true; + } + // System.out.println("moveExonsAllowed: getTranscripts().size = " + annotSet.getTranscripts().size() + ", cursorset 0 is a " + (cursorSet.getFeature(0)).getClass().getName() + ", 1 is a " + (cursorSet.getFeature(0)).getClass().getName()); // DEL + return false; + } + + + /** * The default mergeTranscripts method. This merges a single transcript selected * from the cursorSet (under the cursor) and a single transcript from in the *************** *** 351,355 **** public void mergeTranscripts() { if (mergeTranscriptsAllowed()) { - Vector combinedTranscripts = new Vector(); combinedTranscripts.addElement(annotSet.getTranscripts().elementAt(0)); --- 368,371 ---- *************** *** 1792,1800 **** */ public void mergeTranscriptWithExons() { ! // !! The if below fires if we've selected transcripts that are not on opposite strands. ! // It's correct that those can't be merged, but the error message is misleading. if (annotSet.getTranscripts().size() < 2) { showMessage(JOptionPane.ERROR_MESSAGE, ! "Can only add exons from other transcripts."); return; } --- 1808,1815 ---- */ public void mergeTranscriptWithExons() { ! // The if below fires if we've selected transcripts that are not on opposite strands. if (annotSet.getTranscripts().size() < 2) { showMessage(JOptionPane.ERROR_MESSAGE, ! "Can only add exons from other transcripts.\nYou must select a transcript plus some exons on the SAME strand."); return; } |