- if (i == 0 && j == 1)
- {
- names.add(new String(""));
- }
- else
- {
- names.add(orderName);
- }
- }
- for (int i = 0, l = alorders.size(); i < l; i++)
- {
- af.addSortByOrderMenuItem(
- WebServiceName + ((String) names.get(i)) + " Ordering",
- (AlignmentOrder) alorders.get(i));
- }
- }
+ // initialise with same renderer settings as in parent alignframe.
+ af.getFeatureRenderer().transferSettings(this.featureSettings);
+
+ if (alorders.size() > 0)
+ {
+ addSortByMenuItems(af, alorders);
+ }
+
+ // TODO: refactor retrieve and show as new splitFrame as Desktop method
+
+ /*
+ * If alignment was requested from one half of a SplitFrame, show in a
+ * SplitFrame with the other pane similarly aligned.
+ */
+ AlignFrame requestedBy = getRequestingAlignFrame();
+ if (requestedBy != null
+ && requestedBy.getSplitViewContainer() != null
+ && requestedBy.getSplitViewContainer().getComplement(
+ requestedBy) != null)
+ {
+ AlignmentI complement = requestedBy.getSplitViewContainer()
+ .getComplement(requestedBy);
+ String complementTitle = requestedBy.getSplitViewContainer()
+ .getComplementTitle(requestedBy);
+ // becomes null if the alignment window was closed before the alignment
+ // job finished.
+ AlignmentI copyComplement = new Alignment(complement);
+ // todo should this be done by copy constructor?
+ copyComplement.setGapCharacter(complement.getGapCharacter());
+ // share the same dataset (and the mappings it holds)
+ copyComplement.setDataset(complement.getDataset());
+ copyComplement.alignAs(al);
+ if (copyComplement.getHeight() > 0)
+ {
+ af.setTitle(alTitle);
+ AlignFrame af2 = new AlignFrame(copyComplement,
+ AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
+ af2.setTitle(complementTitle);
+ String linkedTitle = MessageManager
+ .getString("label.linked_view_title");
+ JInternalFrame splitFrame = new SplitFrame(al.isNucleotide() ? af
+ : af2, al.isNucleotide() ? af2 : af);
+ Desktop.addInternalFrame(splitFrame, linkedTitle, -1, -1);
+ return;