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


Java Display.repaint方法代码示例

本文整理汇总了Java中ini.trakem2.display.Display.repaint方法的典型用法代码示例。如果您正苦于以下问题:Java Display.repaint方法的具体用法?Java Display.repaint怎么用?Java Display.repaint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ini.trakem2.display.Display的用法示例。


在下文中一共展示了Display.repaint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resetNonActive

import ini.trakem2.display.Display; //导入方法依赖的package包/类
/** Reset temporary changes such as from dragging B&C sliders and so on, in the current slice (the current Patch). */
public void resetNonActive() {
	Utils.log2("PatchStack: calling reset");
	// remake the awt for the patch, flush the previous awt
	Loader loader = patch[currentSlice-1].getProject().getLoader();
	for (int i=0; i<patch.length; i++) {
		if (currentSlice-1 == i || !called[i]) continue;
		called[i] = false;
		ImagePlus imp = loader.fetchImagePlus(patch[i]);
		ImageProcessor ip = imp.getProcessor();
		switch (imp.getType()) { // as in ij.plugin.frame.ContrastAdjuster.reset(ImagePlus, ImageProcessor)
			case ImagePlus.COLOR_RGB:
				ip.reset(); break;
			case ImagePlus.GRAY16:
			case ImagePlus.GRAY32:
				ip.resetMinAndMax(); break;
		}
		patch[i].setMinAndMax(ip.getMin(), ip.getMax());
		patch[i].getProject().getLoader().decacheAWT(patch[i].getId());
		Display.repaint(patch[i].getLayer(), patch[i], null, 0, true);
	}
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:23,代码来源:PatchStack.java

示例2: alignSelectionTask

import ini.trakem2.display.Display; //导入方法依赖的package包/类
final static public Bureaucrat alignSelectionTask ( final Selection selection )
{
	final Worker worker = new Worker("Aligning selected images", false, true) {
		@Override
		public void run() {
			startedWorking();
			try {
				final int m = chooseAlignmentMode();
				if (-1 == m)
					return;
				alignSelection( selection, m );
				Display.repaint(selection.getLayer());
			} catch (final Throwable e) {
				IJError.print(e);
			} finally {
				finishedWorking();
			}
		}
		@Override
		public void cleanup() {
			if (!selection.isEmpty())
				selection.getLayer().getParent().undoOneStep();
		}
	};
	return Bureaucrat.createAndStart( worker, selection.getProject() );
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:27,代码来源:AlignTask.java

示例3: correctDistortionFromSelectionTask

import ini.trakem2.display.Display; //导入方法依赖的package包/类
final static public Bureaucrat correctDistortionFromSelectionTask ( final Selection selection )
{
	final Worker worker = new Worker("Distortion Correction", false, true) {
		@Override
		public void run() {
			startedWorking();
			try {
				correctDistortionFromSelection( selection );
				Display.repaint(selection.getLayer());
			} catch (final Throwable e) {
				IJError.print(e);
			} finally {
				finishedWorking();
			}
		}
		@Override
		public void cleanup() {
			if (!selection.isEmpty())
				selection.getLayer().getParent().undoOneStep();
		}
	};
	return Bureaucrat.createAndStart( worker, selection.getProject() );
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:24,代码来源:DistortionCorrectionTask.java

示例4: remove

import ini.trakem2.display.Display; //导入方法依赖的package包/类
/** If the given node is null, it will be searched for. */
public boolean remove(final boolean check, final ProjectThing thing, final DefaultMutableTreeNode node) {
	final Object obd = thing.getObject();
	if (obd.getClass() == Project.class) return ((Project)obd).remove(check); // shortcut to remove everything regardless.
	final boolean b = thing.remove(check) && removeNode(null != node ? node : findNode(thing, this));
	Display.repaint();
	return b;
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:9,代码来源:ProjectTree.java

示例5: remove

import ini.trakem2.display.Display; //导入方法依赖的package包/类
/** Remove this instance, cascading the remove action to the children and the objects.  Will also cleanup the nodes in the ProjectTree. */
public boolean remove(boolean check) {
	if (check && !Utils.check("Really delete " + this.toString() + (object instanceof Layer && ((Layer)object).getDisplayables().size() > 0 ? " and all its children?" : ""))) return false;
	// remove the children, which will propagate to their own objects
	if (null != al_children) {
		synchronized (al_children) {
			LayerThing[] ob = new LayerThing[al_children.size()];
			al_children.toArray(ob);
			for (int i=0; i<ob.length; i++) {
				if ( ! ob[i].remove(false)) {
					Utils.log("Could not delete " + ob[i]);
					return false;
				}
			}
			al_children.clear();
		}
	}
	// TODO the attributes are being ignored! (not even created either)

	// remove the object
	if (null != object && object instanceof DBObject) {
		if (!((DBObject)object).remove(false)) {
			Utils.log("Could not delete " + object);
			return false;
		}
		Display.repaint();
	}

	// remove the Thing itself
	if (null != parent && !parent.removeChild(this)) {
		Utils.log("Could not delete LayerThing with id=" + id);
		return false;
	}
	removeFromDatabase();
	return true;
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:37,代码来源:LayerThing.java

示例6: revert

import ini.trakem2.display.Display; //导入方法依赖的package包/类
public void revert(Patch p) {
	for (int i=0; i<patch.length; i++) {
		if (patch[i].getId() == p.getId()) {
			revert2(p);
			Display.repaint(p.getLayer(), p, 0);
			//p.getProject().getLoader().vacuum();
			break;
		}
	}
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:11,代码来源:PatchStack.java

示例7: saveImages

import ini.trakem2.display.Display; //导入方法依赖的package包/类
/** Store working copies and remake the awts and repaint. */
public void saveImages() {
	Utils.log2("PatchStack: calling saveImages");
	if (!this.changes) {
		Utils.log2("PatchStack.saveImages: nothing changed.");
		return;
	}
	Loader loader = patch[currentSlice-1].getProject().getLoader();
	Utils.showProgress(0);
	for (int i=0; i<patch.length; i++) {
		ImagePlus imp = loader.fetchImagePlus(patch[i]);
		Utils.log2("PatchStack.saveImages: patch imp " + i + " has the imp.changes=" + imp.changes + " and the called[i]=" + called[i]);
		if (imp.changes || called[i]) {
			patch[i].updateInDatabase("tiff_working"); // may be doing it twice, check TODO
			/*
			patch[i].createImage(); //flushes the old awt, and creates the new one, and stores it in the cache.
			*/
			// just flush away all dependent images, will be recreated when needed on repaint
			patch[i].getProject().getLoader().decache(imp);
			Display.repaint(patch[i].getLayer(), patch[i], 0);
			// reset
			imp.changes = false;
			called[i] = false;
		}
		Utils.showProgress((i+1.0) / patch.length);
	}
	this.changes = false;
	//patch[0].getProject().getLoader().vacuum();
	Utils.showProgress(1);
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:31,代码来源:PatchStack.java

示例8: correctDistortionFromSelection

import ini.trakem2.display.Display; //导入方法依赖的package包/类
final static public Bureaucrat correctDistortionFromSelection( final Selection selection )
{
	final List< Patch > patches = new ArrayList< Patch >();
	for ( final Displayable d : Display.getFront().getSelection().getSelected() )
		if ( d instanceof Patch ) patches.add( ( Patch )d );

	if ( patches.size() < 2 )
	{
		Utils.log("No images in the selection.");
		return null;
	}

	final Worker worker = new Worker( "Lens correction" )
	{
		@Override
		final public void run()
		{
			try
			{
				startedWorking();

				if ( !correctDistortionFromSelectionParam.setup( selection ) ) return;

				DistortionCorrectionTask.run( correctDistortionFromSelectionParam.clone(), patches, selection.getActive(), selection.getLayer(), null );

				Display.repaint();
			}
			catch ( final Exception e ) { IJError.print( e ); }
			finally { finishedWorking(); }
		}
	};

	return Bureaucrat.createAndStart( worker, selection.getProject() );
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:35,代码来源:DistortionCorrectionTask.java

示例9: invertLookupTable

import ini.trakem2.display.Display; //导入方法依赖的package包/类
public void invertLookupTable() {
	Loader loader = patch[currentSlice-1].getProject().getLoader();
	ImagePlus imp = loader.fetchImagePlus(patch[currentSlice-1]);
	imp.getProcessor().invert();
	Display.repaint(patch[currentSlice-1].getLayer(), patch[currentSlice-1], 0);
	patch[currentSlice-1].updateInDatabase("tiff_working"); // TODO if the database updates are too much, then one could put a "save" button somewhere that shows as "unsaved" (red?) when there are unsaved changes.
	imp.changes = false; // just saved
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:9,代码来源:PatchStack.java

示例10: decacheAll

import ini.trakem2.display.Display; //导入方法依赖的package包/类
/** Remove all awts and snaps from the loader's cache, and repaint (which will remake as many as needed) */
public void decacheAll() {
	final HashSet<ImagePlus> hs = new HashSet<ImagePlus>(); // record already flushed imps, since there can be shared imps among Patch instances (for example in stacks)
	final Loader loader = patch[currentSlice-1].getProject().getLoader();
	for (int i=0; i<patch.length; i++) {
		ImagePlus imp = loader.fetchImagePlus(patch[i]);
		if (hs.contains(imp)) continue;
		else if (null != imp) hs.add(imp);
		loader.decache(imp);
		loader.flushMipMaps(patch[i].getId());
		Display.repaint(patch[i].getLayer(), patch[i], 0);
	}
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:14,代码来源:PatchStack.java

示例11: alignPatchesTask

import ini.trakem2.display.Display; //导入方法依赖的package包/类
final static public Bureaucrat alignPatchesTask ( final List< Patch > patches , final Set< Patch > fixedPatches )
{
	if ( 0 == patches.size())
	{
		Utils.log("Can't align zero patches.");
		return null;
	}
	final Worker worker = new Worker("Aligning images", false, true) {
		@Override
		public void run() {
			startedWorking();
			try {
				final int m = chooseAlignmentMode();
				if (-1 == m)
					return;
				alignPatches( patches, fixedPatches, m );
				Display.repaint();
			} catch (final Throwable e) {
				IJError.print(e);
			} finally {
				finishedWorking();
			}
		}
		@Override
		public void cleanup() {
			patches.get(0).getLayer().getParent().undoOneStep();
		}
	};
	return Bureaucrat.createAndStart( worker, patches.get(0).getProject() );
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:31,代码来源:AlignTask.java

示例12: montageLayers

import ini.trakem2.display.Display; //导入方法依赖的package包/类
@SuppressWarnings( { "rawtypes", "unchecked" } )
final static public void montageLayers(
		final Align.ParamOptimize p,
		final List<Layer> layers,
		final boolean tilesAreInPlaceIn,
		final boolean largestGraphOnlyIn,
		final boolean hideDisconnectedTilesIn,
		final boolean deleteDisconnectedTilesIn,
		final boolean sloppyOverlapTest ) {
	int i = 0;
	for (final Layer layer : layers) {
		if (Thread.currentThread().isInterrupted()) return;
		final Collection<Displayable> patches = layer.getDisplayables(Patch.class, true);
		if (patches.isEmpty()) continue;
		for (final Displayable patch : patches) {
			if (patch.isLinked() && !patch.isOnlyLinkedTo(Patch.class)) {
				Utils.log("Cannot montage layer " + layer + "\nReason: at least one Patch is linked to non-image data: " + patch);
				continue;
			}
		}
		Utils.log("====\nMontaging layer " + layer);
		Utils.showProgress(((double)i)/layers.size());
		i++;
		alignPatches(p, new ArrayList<Patch>((Collection<Patch>)(Collection)patches), new ArrayList<Patch>(), tilesAreInPlaceIn, largestGraphOnlyIn, hideDisconnectedTilesIn, deleteDisconnectedTilesIn, sloppyOverlapTest );
		Display.repaint(layer);
	}
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:28,代码来源:AlignTask.java

示例13: draw

import ini.trakem2.display.Display; //导入方法依赖的package包/类
public void draw() {
	// repaint all Displays that show any layer of the parent LayerSet (this is overkill, but not so bad, almost never there'll be that many Displays)
	Display.repaint(patch[currentSlice-1].getLayer().getParent());
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:5,代码来源:PatchStack.java

示例14: repaintWindow

import ini.trakem2.display.Display; //导入方法依赖的package包/类
public void repaintWindow() {
	Display.repaint(patch[currentSlice-1].getLayer(), patch[currentSlice-1], 0);
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:4,代码来源:PatchStack.java

示例15: updateAndRepaintWindow

import ini.trakem2.display.Display; //导入方法依赖的package包/类
public void updateAndRepaintWindow() {
	Display.repaint(patch[currentSlice-1].getLayer(), patch[currentSlice-1], 0);
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:4,代码来源:PatchStack.java


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