当前位置: 首页>>代码示例>>Java>>正文


Java DataView类代码示例

本文整理汇总了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();
}
 
开发者ID:bnanes,项目名称:slideset,代码行数:21,代码来源:RoiEditor.java

示例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);
			}
		}
	}
}
 
开发者ID:imagej,项目名称:imagej-ui-swing,代码行数:24,代码来源:JHotDrawImageCanvas.java

示例3: getDataView

import net.imagej.display.DataView; //导入依赖的package包/类
@Override
public DataView getDataView() {
	return overlayView;
}
 
开发者ID:imagej,项目名称:imagej-ui-swing,代码行数:5,代码来源:OverlayFigureView.java

示例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);
  }
 
开发者ID:bnanes,项目名称:slideset,代码行数:18,代码来源:FastUpdateImageDisplay.java

示例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;
    }
}
 
开发者ID:bnanes,项目名称:slideset,代码行数:11,代码来源:RoiEditor.java

示例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;
    }
}
 
开发者ID:bnanes,项目名称:slideset,代码行数:14,代码来源:RoiEditor.java

示例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));
}
 
开发者ID:imagej,项目名称:imagej-ui-swing,代码行数:19,代码来源:JHotDrawService.java

示例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;
}
 
开发者ID:imagej,项目名称:imagej-ui-swing,代码行数:13,代码来源:SwingOverlayManager.java

示例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);
	}
}
 
开发者ID:imagej,项目名称:imagej-ui-swing,代码行数:12,代码来源:JHotDrawImageCanvas.java

示例10: getDataView

import net.imagej.display.DataView; //导入依赖的package包/类
/** Gets the linked ImageJ data view. */
public DataView getDataView();
 
开发者ID:imagej,项目名称:imagej-ui-swing,代码行数:3,代码来源:FigureView.java

示例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;
}
 
开发者ID:imagej,项目名称:imagej-ui-swing,代码行数:7,代码来源:JHotDrawImageCanvas.java


注:本文中的net.imagej.display.DataView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。