Search in sources :

Example 21 with DatasetView

use of net.imagej.display.DatasetView in project imagej-ui-swing by imagej.

the class JHotDrawImageCanvas method rebuild.

// -- Internal methods --
void rebuild() {
    for (final DataView dataView : getDisplay()) {
        FigureView figureView = getFigureView(dataView);
        if (figureView == null) {
            if (dataView instanceof DatasetView) {
                figureView = new DatasetFigureView(this.displayViewer, (DatasetView) dataView);
            } else if (dataView instanceof OverlayView) {
                figureView = new OverlayFigureView(this.displayViewer, (OverlayView) dataView);
            } else {
                log.error("Don't know how to make a figure view for " + dataView.getClass().getName());
                continue;
            }
            figureViews.add(figureView);
        }
    }
    int idx = 0;
    while (idx < figureViews.size()) {
        final FigureView figureView = figureViews.get(idx);
        if (!getDisplay().contains(figureView.getDataView())) {
            figureViews.remove(idx);
            figureView.dispose();
        } else {
            idx++;
        }
    }
}
Also used : DataView(net.imagej.display.DataView) DatasetView(net.imagej.display.DatasetView) OverlayView(net.imagej.display.OverlayView) Point(java.awt.Point)

Aggregations

DatasetView (net.imagej.display.DatasetView)21 Dataset (net.imagej.Dataset)13 Overlay (net.imagej.overlay.Overlay)11 DoubleType (net.imglib2.type.numeric.real.DoubleType)8 Position (net.imagej.Position)4 ColorTable (net.imglib2.display.ColorTable)4 Point (java.awt.Point)2 ImageDisplay (net.imagej.display.ImageDisplay)2 Graphics2D (java.awt.Graphics2D)1 Image (java.awt.Image)1 BufferedImage (java.awt.image.BufferedImage)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 DataView (net.imagej.display.DataView)1 OverlayView (net.imagej.display.OverlayView)1 OptionsCompatibility (net.imagej.options.OptionsCompatibility)1 OptionsMisc (net.imagej.options.OptionsMisc)1 DefaultResultsTable (net.imagej.table.DefaultResultsTable)1 ARGBScreenImage (net.imglib2.display.screenimage.awt.ARGBScreenImage)1 ArrayImgFactory (net.imglib2.img.array.ArrayImgFactory)1