@Override public void addMedia(MediaElement media) { if (media instanceof ImageElement) { this.add(media); DataExplorerModel model = (DataExplorerModel) getTagValue(TagW.ExplorerModel); if (model != null) { model.firePropertyChange(new ObservableEvent(ObservableEvent.BasicAction.ADD, model, null, new SeriesEvent(SeriesEvent.Action.ADD_IMAGE, this, media))); } } } };
SeriesEvent event2 = (SeriesEvent) newVal; if (ObservableEvent.BasicAction.ADD.equals(action)) { SeriesEvent.Action action2 = event2.getActionCommand(); Object source = event2.getSource(); Object param = event2.getParam();
SeriesEvent event2 = (SeriesEvent) newVal; SeriesEvent.Action action2 = event2.getActionCommand(); Object source = event2.getSource(); Object param = event2.getParam();
@Override public void addMedia(MediaElement media) { if (media != null) { this.add(media); DataExplorerModel model = (DataExplorerModel) this.getTagValue(TagW.ExplorerModel); if (model != null) { model.firePropertyChange(new ObservableEvent(ObservableEvent.BasicAction.ADD, model, null, new SeriesEvent(SeriesEvent.Action.ADD_IMAGE, this, media))); } } } };
@Override public void addMedia(DicomImageElement media) { if (media != null && media.getMediaReader() instanceof DcmMediaReader) { int insertIndex; synchronized (this) { // add image or multi-frame sorted by Instance Number (0020,0013) order int index = Collections.binarySearch(medias, media, SortSeriesStack.instanceNumber); if (index < 0) { insertIndex = -(index + 1); } else { // Should not happen because the instance number must be unique insertIndex = index + 1; } if (insertIndex < 0 || insertIndex > medias.size()) { insertIndex = medias.size(); } add(insertIndex, media); } DataExplorerModel model = (DataExplorerModel) getTagValue(TagW.ExplorerModel); if (model != null) { model.firePropertyChange(new ObservableEvent(ObservableEvent.BasicAction.ADD, model, null, new SeriesEvent(SeriesEvent.Action.ADD_IMAGE, this, media))); } } }
private void loadArrays(DicomImageElement img, DataExplorerModel model) { // Do not load an image if another process already loading it if (preloading && !img.isLoading()) { Boolean cache = (Boolean) img.getTagValue(TagW.ImageCache); if (cache == null || !cache) { long start = System.currentTimeMillis(); try { img.getImage(); } catch (OutOfMemoryError e) { LOGGER.error("Out of memory when loading image: {}", img, e); //$NON-NLS-1$ CvUtil.runGarbageCollectorAndWait(50); return; } long stop = System.currentTimeMillis(); LOGGER.debug("Reading time: {} ms of image: {}", stop - start, img); //$NON-NLS-1$ if (model != null) { model.firePropertyChange(new ObservableEvent(ObservableEvent.BasicAction.ADD, model, null, new SeriesEvent(SeriesEvent.Action.PRELOADING, series, img))); } } } }
public static boolean setKeyObjectReferenceAllSeries(boolean selectedState, final ViewCanvas<DicomImageElement> view2d) { KOSpecialElement validKOSelection = getValidKOSelection(view2d); if (validKOSelection == null) { return false; // canceled } KOSpecialElement currentSelectedKO = KOManager.getCurrentKOSelection(view2d); if (validKOSelection != currentSelectedKO) { ActionState koSelection = view2d.getEventManager().getAction(ActionW.KO_SELECTION); if (koSelection instanceof ComboItemListener) { ((ComboItemListener) koSelection).setSelectedItem(validKOSelection); } } boolean hasKeyObjectReferenceChanged = false; if (validKOSelection == currentSelectedKO || currentSelectedKO == null) { // KO Toogle State is changed only if KO Selection remains the same, // or if there was no previous KO Selection hasKeyObjectReferenceChanged = validKOSelection.setKeyObjectReference(selectedState, view2d.getSeries()); if (hasKeyObjectReferenceChanged) { DicomModel dicomModel = (DicomModel) view2d.getSeries().getTagValue(TagW.ExplorerModel); // Fire an event since any view in any View2dContainer may have its KO selected state changed if (dicomModel != null) { dicomModel.firePropertyChange(new ObservableEvent(ObservableEvent.BasicAction.UPDATE, view2d, null, new SeriesEvent(SeriesEvent.Action.UPDATE, validKOSelection, "updateAll"))); //$NON-NLS-1$ } } } return hasKeyObjectReferenceChanged; }