- }
-
- private final String AAconsToggle = "AACons Calculations",
- AAconsToggleTooltip = "When checked, AACons calculations are updated automatically.",
- AAeditSettings = "Change AACons Settings...",
- AAeditSettingsTooltip = "Modify settings for AACons calculations.";
-
- // private final enableAAConsCalculation(final AlignFrame alignFrame, )
- private void registerAAConsWSInstance(final JMenu wsmenu,
- final Jws2Instance service, final AlignFrame alignFrame)
- {
- // register this in the AACons settings set
- JCheckBoxMenuItem _aaConsEnabled = null;
- for (int i = 0; i < wsmenu.getItemCount(); i++)
- {
- JMenuItem item = wsmenu.getItem(i);
- if (item instanceof JCheckBoxMenuItem
- && item.getText().equals(AAconsToggle))
- {
- _aaConsEnabled = (JCheckBoxMenuItem) item;
- }
- }
- // is there an aaCons worker already present - if so, set it to use the
- // given service handle
- {
- List<AlignCalcWorkerI> aaconsClient = alignFrame.getViewport()
- .getCalcManager()
- .getRegisteredWorkersOfClass(AAConsClient.class);
- if (aaconsClient != null && aaconsClient.size() > 0)
- {
- AAConsClient worker = (AAConsClient) aaconsClient.get(0);
- if (!worker.service.hosturl.equals(service.hosturl))
- {
- // javax.swing.SwingUtilities.invokeLater(new Runnable()
- {
- // @Override
- // public void run()
- {
- removeCurrentAAConsWorkerFor(alignFrame);
- buildCurrentAAConsWorkerFor(alignFrame, service);
- }
- }//);
- }
- }
- }
-
- // is there a service already registered ? there shouldn't be if we are
- // being called correctly
- if (_aaConsEnabled == null)