本文整理汇总了Java中net.imagej.display.DataView类的典型用法代码示例。如果您正苦于以下问题:Java DataView类的具体用法?Java DataView怎么用?Java DataView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataView类属于net.imagej.display包,在下文中一共展示了DataView类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: changeDisplayMode
import net.imagej.display.DataView; //导入依赖的package包/类
/** Update the color mode */
private void changeDisplayMode() {
ColorMode m;
switch(displayMode.getSelectedIndex()) {
default:
case 0:
m = ColorMode.COMPOSITE;
break;
case 1:
m = ColorMode.GRAYSCALE;
break;
case 2:
m = ColorMode.COLOR;
}
for(DataView v : imageDisplay) {
if(!DatasetView.class.isInstance(v)) continue;
((DatasetView)v).setColorMode(m);
}
imageDisplay.update();
}
示例2: selectionChanged
import net.imagej.display.DataView; //导入依赖的package包/类
/**
* Responds to the JHotDraw figure selection event by selecting and
* deselecting views whose state has changed.
*
* @param event Event indicating that the figure selections have changed.
*/
@Override
public void selectionChanged(FigureSelectionEvent event) {
final Set<Figure> newSelection = event.getNewSelection();
final Set<Figure> oldSelection = event.getOldSelection();
for (final DataView view : getDisplay()) {
final FigureView figureView = getFigureView(view);
if (figureView != null) {
final Figure figure = figureView.getFigure();
if (newSelection.contains(figure)) {
view.setSelected(true);
}
else if (oldSelection.contains(figure)) {
view.setSelected(false);
}
}
}
}
示例3: getDataView
import net.imagej.display.DataView; //导入依赖的package包/类
@Override
public DataView getDataView() {
return overlayView;
}
示例4: addFast
import net.imagej.display.DataView; //导入依赖的package包/类
/** Add {@code Data} to the display <em>without</em> rebuilding.
* The display must be rebuilt with a call to {@link #rebuildNow() rebuildNow()}
* after {@code Data} addition is complete. This method offers
* a significant performance improvement over repeated calls
* to {@link #add(java.lang.Object) Display.add()}. */
public void addFast(Data data, ImageDisplayService ids) {
DataView dataView;
if (ids == null) {
throw new IllegalStateException(
"An ImageDisplayService is required to display Data objects");
}
dataView = ids.createDataView(data);
if (dataView == null) {
throw new IllegalArgumentException("Unable to create data view!");
}
add(dataView);
}
示例5: registerBrightnessContrast
import net.imagej.display.DataView; //导入依赖的package包/类
/** Register a Brightness/Contrast dialog */
public void registerBrightnessContrast(BrightnessContrastRoi bc) {
bcDialog = bc;
if(imageDisplay == null || bcDialog == null) return;
for(DataView v : imageDisplay) {
if(!DatasetView.class.isInstance(v)) continue;
bcDialog.setView((DatasetView)v);
return;
}
}
示例6: flagOverlayChanges
import net.imagej.display.DataView; //导入依赖的package包/类
/** Check to see if an ROI change should set the {@code changed} flag */
private void flagOverlayChanges(ObjectEvent e) {
if(imageDisplay==null)
return;
if(e instanceof OverlayCreatedEvent && (!loadingImage)) {
changed = true; // A bit hacky and non-specific, but the OverlayCreatedEvent is fired before the overlay is added to the display!
return;
}
for(DataView dv : imageDisplay) {
if(e.getObject() == dv.getData())
changed = true;
}
}
示例7: linkOverlay
import net.imagej.display.DataView; //导入依赖的package包/类
/**
* Links a new {@link Overlay} and {@link OverlayView}, created by the given
* {@link JHotDrawAdapter}, to the specified JHotDraw {@link Figure} of a
* particular {@link ImageDisplay}.
*/
public <F extends Figure> void linkOverlay(final F figure,
final JHotDrawAdapter<F> adapter, final ImageDisplay display)
{
final Overlay overlay = adapter.createNewOverlay();
final DataView view = imageDisplayService.createDataView(overlay);
if (!(view instanceof OverlayView)) {
throw new IllegalStateException("Unexpected data view: " + view);
}
final OverlayView overlayView = (OverlayView) view;
adapter.updateOverlay(figure, overlayView);
eventService.publish(new FigureCreatedEvent(overlayView, figure, display));
}
示例8: getActiveOverlay
import net.imagej.display.DataView; //导入依赖的package包/类
@SuppressWarnings("unused")
private Overlay getActiveOverlay() {
final ImageDisplay activeDisplay =
imageDisplayService.getActiveImageDisplay();
if (activeDisplay == null) return null;
final List<DataView> views = activeDisplay;
for (DataView view : views) {
if (view.isSelected() && (view instanceof OverlayView))
return ((OverlayView) view).getData();
}
return null;
}
示例9: onEvent
import net.imagej.display.DataView; //导入依赖的package包/类
@EventHandler
protected void onEvent(final DataViewSelectedEvent event) {
final DataView view = event.getView();
final FigureView figureView = getFigureView(view);
if (figureView == null) return; // not one of this canvas's views
final Figure figure = figureView.getFigure();
if (!drawingView.getSelectedFigures().contains(figure)) {
drawingView.addToSelection(figure);
}
}
示例10: getDataView
import net.imagej.display.DataView; //导入依赖的package包/类
/** Gets the linked ImageJ data view. */
public DataView getDataView();
示例11: getFigureView
import net.imagej.display.DataView; //导入依赖的package包/类
private FigureView getFigureView(final DataView dataView) {
for (final FigureView figureView : figureViews) {
if (figureView.getDataView() == dataView) return figureView;
}
return null;
}