org.weasis.core.ui.docking.UIManager类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中org.weasis.core.ui.docking.UIManager类的一些代码示例,展示了UIManager类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UIManager类的具体详情如下:
包路径:org.weasis.core.ui.docking.UIManager
类名称:UIManager

UIManager介绍

暂无

代码示例

代码示例来源:origin: nroduit/Weasis

@Deactivate
  protected void deactivate(ComponentContext context) {
    UIManager.closeSeriesViewerType(AuContainer.class);
  }
}

代码示例来源:origin: nroduit/Weasis

@Override
public List<Action> getOpenActions() {
  DataExplorerView dicomView = UIManager.getExplorerplugin(DicomExplorer.NAME);
  if (dicomView == null) {
    return Arrays.asList(preferencesAction);
  }
  // In case DICOM explorer has been loaded get the first import action
  return dicomView.getOpenImportDialogAction().subList(0, 1);
}

代码示例来源:origin: nroduit/Weasis

public static void openSequenceInDefaultPlugin(List<? extends MediaSeries<? extends MediaElement>> series,
  DataExplorerModel model, boolean compareEntryToBuildNewViewer, boolean removeOldSeries) {
  ArrayList<String> mimes = new ArrayList<>();
  for (MediaSeries<?> s : series) {
    String mime = s.getMimeType();
    if (mime != null && !mimes.contains(mime)) {
      mimes.add(mime);
    }
  }
  for (String mime : mimes) {
    SeriesViewerFactory plugin = UIManager.getViewerFactory(mime);
    if (plugin != null) {
      ArrayList<MediaSeries<? extends MediaElement>> seriesList = new ArrayList<>();
      for (MediaSeries<? extends MediaElement> s : series) {
        if (mime.equals(s.getMimeType())) {
          seriesList.add(s);
        }
      }
      openSequenceInPlugin(plugin, seriesList, model, compareEntryToBuildNewViewer, removeOldSeries);
    }
  }
}

代码示例来源:origin: nroduit/Weasis

SOPInstanceReference ref = imgRef.getSopInstanceReference();
if (ref != null) {
  DataExplorerView dicomView = org.weasis.core.ui.docking.UIManager.getExplorerplugin(DicomExplorer.NAME);
  DicomModel model = null;
  if (dicomView != null) {
          ref.getReferencedFrameNumber());
        keyReferences.addKeyObject(koRef);
        SeriesViewerFactory plugin = UIManager.getViewerFactory(DicomMediaIO.SERIES_MIMETYPE);
        if (plugin != null && !(plugin instanceof MimeSystemAppFactory)) {
          addGraphicstoView(s.getMedia(0, null, null), imgRef);

代码示例来源:origin: nroduit/Weasis

public Component getExplorerViewComponent() {
  return Optional.ofNullable(acquireExplorer).map(AcquireExplorer::getCentralPane).map(Component.class::cast)
    .orElse(UIManager.getApplicationWindow());
}

代码示例来源:origin: nroduit/Weasis

public static void closeSeriesViewerType(Class<? extends SeriesViewer<?>> clazz) {
  final List<ViewerPlugin<?>> pluginsToRemove = new ArrayList<>();
  synchronized (UIManager.VIEWER_PLUGINS) {
    for (final ViewerPlugin<?> plugin : UIManager.VIEWER_PLUGINS) {
      if (clazz.isInstance(plugin)) {
        // Do not close Series directly, it can produce deadlock.
        pluginsToRemove.add(plugin);
      }
    }
  }
  closeSeriesViewer(pluginsToRemove);
}

代码示例来源:origin: nroduit/Weasis

JPopupMenu popupMenu = new JPopupMenu();
List<SeriesViewerFactory> plugins = UIManager.getViewerFactoryList(new String[] { series.getMimeType() });
if (!selList.contains(series)) {
  selList.setSelectionInterval(series, series);

代码示例来源:origin: nroduit/Weasis

DataExplorerView dicomView = UIManager.getExplorerplugin(DicomExplorer.NAME);
DataExplorerModel model = null;
SeriesSelectionModel selList = null;
      SeriesViewerFactory plugin = UIManager.getViewerFactory(selPlugin);
      if (plugin != null && !(plugin instanceof MimeSystemAppFactory)) {
        ViewerPluginBuilder.openSequenceInPlugin(plugin, seq, model, true, true);

代码示例来源:origin: nroduit/Weasis

private boolean tryDownloadingAgain(DownloadException e) {
  if (retryNb.getAndIncrement() == 0) {
    return true;
  }
  boolean[] ret = { false };
  GuiExecutor.instance().invokeAndWait(() -> {
    int confirm = JOptionPane.showConfirmDialog(UIManager.getApplicationWindow(), getErrorMessage(e),
      Messages.getString("LoadRemoteDicomManifest.net_err_msg"), JOptionPane.YES_NO_OPTION); //$NON-NLS-1$
    ret[0] = JOptionPane.YES_OPTION == confirm;
  });
  return ret[0];
}

代码示例来源:origin: nroduit/Weasis

UIManager.closeSeriesViewer(pluginsToRemove);

代码示例来源:origin: nroduit/Weasis

private boolean dropDicomFiles(List<File> files) {
    if (files != null) {
      DataExplorerView dicomView = UIManager.getExplorerplugin(DicomExplorer.NAME);
      if (dicomView == null) {
        return false;
      }
      DicomModel model = (DicomModel) dicomView.getDataExplorerModel();
      LoadLocalDicom dicom = new LoadLocalDicom(files.stream().toArray(File[]::new), true, model);
      DicomModel.LOADING_EXECUTOR.execute(dicom);
      return true;
    }
    return false;
  }
}

代码示例来源:origin: nroduit/Weasis

public static void openSequenceInDefaultPlugin(MediaSeries<MediaElement> series, DataExplorerModel model,
  boolean compareEntryToBuildNewViewer, boolean removeOldSeries) {
  if (series != null) {
    String mime = series.getMimeType();
    SeriesViewerFactory plugin = UIManager.getViewerFactory(mime);
    if (plugin == null) {
      plugin = DefaultMimeAppFactory.getInstance();
    }
    openSequenceInPlugin(plugin, series, model == null ? DefaultDataModel : model, compareEntryToBuildNewViewer,
      removeOldSeries);
  }
}

代码示例来源:origin: nroduit/Weasis

@Deactivate
  protected void deactivate(ComponentContext context) {
    UIManager.closeSeriesViewerType(WaveContainer.class);
  }
}

代码示例来源:origin: nroduit/Weasis

if (fileChooser.showOpenDialog(UIManager.getApplicationWindow()) != JFileChooser.APPROVE_OPTION
  || (selectedFiles = fileChooser.getSelectedFiles()) == null) {
  return;

代码示例来源:origin: nroduit/Weasis

public static void closeSeriesViewer(AuContainer container) {
  // Unregister the PropertyChangeListener
  DataExplorerView dicomView = UIManager.getExplorerplugin(DicomExplorer.NAME);
  if (dicomView != null) {
    dicomView.getDataExplorerModel().removePropertyChangeListener(container);
  }
}

代码示例来源:origin: nroduit/Weasis

public void openrelatedSeries(KOSpecialElement koSpecialElement, MediaSeriesGroup patient) {
  if (koSpecialElement != null && patient != null) {
    SeriesViewerFactory plugin = UIManager.getViewerFactory(DicomMediaIO.SERIES_MIMETYPE);
    if (plugin != null && !(plugin instanceof MimeSystemAppFactory)) {
      Set<String> koSet = koSpecialElement.getReferencedSeriesInstanceUIDSet();
      List<MediaSeries<MediaElement>> seriesList = new ArrayList<>();
      for (MediaSeriesGroup st : this.getChildren(patient)) {
        for (MediaSeriesGroup s : this.getChildren(st)) {
          if (koSet.contains(TagD.getTagValue(s, Tag.SeriesInstanceUID))) {
            seriesList.add((MediaSeries<MediaElement>) s);
          }
        }
      }
      if (!seriesList.isEmpty()) {
        String uid = UUID.randomUUID().toString();
        Map<String, Object> props = Collections.synchronizedMap(new HashMap<String, Object>());
        props.put(ViewerPluginBuilder.CMP_ENTRY_BUILD_NEW_VIEWER, false);
        props.put(ViewerPluginBuilder.BEST_DEF_LAYOUT, false);
        props.put(ViewerPluginBuilder.ICON,
          new ImageIcon(getClass().getResource("/icon/16x16/key-images.png"))); //$NON-NLS-1$
        props.put(ViewerPluginBuilder.UID, uid);
        ViewerPluginBuilder builder = new ViewerPluginBuilder(plugin, seriesList, this, props);
        ViewerPluginBuilder.openSequenceInPlugin(builder);
        this.firePropertyChange(
          new ObservableEvent(ObservableEvent.BasicAction.SELECT, uid, null, koSpecialElement));
      }
    }
  }
}

代码示例来源:origin: nroduit/Weasis

@Deactivate
protected void deactivate(ComponentContext context) {
  UIManager.closeSeriesViewerType(SRContainer.class);
}

代码示例来源:origin: nroduit/Weasis

if (fileChooser.showOpenDialog(UIManager.getApplicationWindow()) != JFileChooser.APPROVE_OPTION
  || (selectedFiles = fileChooser.getSelectedFiles()) == null) {
  return;

代码示例来源:origin: nroduit/Weasis

public static void closeSeriesViewer(View2dContainer view2dContainer) {
  // Unregister the PropertyChangeListener
  DataExplorerView dicomView = UIManager.getExplorerplugin(DicomExplorer.NAME);
  if (dicomView != null) {
    dicomView.getDataExplorerModel().removePropertyChangeListener(view2dContainer);
  }
}

代码示例来源:origin: nroduit/Weasis

@Override
public void mouseClicked(MouseEvent e) {
  if (e.getClickCount() == 2) {
    final SeriesSelectionModel selList = getSeriesSelectionModel();
    selList.setOpenningSeries(true);
    Map<String, Object> props = Collections.synchronizedMap(new HashMap<String, Object>());
    props.put(ViewerPluginBuilder.CMP_ENTRY_BUILD_NEW_VIEWER, true);
    props.put(ViewerPluginBuilder.BEST_DEF_LAYOUT, false);
    props.put(ViewerPluginBuilder.OPEN_IN_SELECTION, true);
    String mime = series.getMimeType();
    SeriesViewerFactory plugin = UIManager.getViewerFactory(mime);
    if (plugin == null) {
      plugin = DefaultMimeAppFactory.getInstance();
    }
    ArrayList<MediaSeries<MediaElement>> list = new ArrayList<>(1);
    list.add(series);
    ViewerPluginBuilder builder = new ViewerPluginBuilder(plugin, list, dicomModel, props);
    ViewerPluginBuilder.openSequenceInPlugin(builder);
    selList.setOpenningSeries(false);
  }
}

相关文章