Java UserInterface类代码示例(javauserinterface类的具体用法)

本文整理汇总了Java中org.scijava.ui.UserInterface的典型用法代码示例。如果您正苦于以下问题:Java UserInterface类的具体用法?Java UserInterface怎么用?Java UserInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Java UserInterface类代码示例(javauserinterface类的具体用法)

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

示例1: testCompositeImageCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
@Test
public void testCompositeImageCancelsPlugin() throws Exception {
	// SETUP
	final String expectedMessage = CommonMessages.HAS_CHANNEL_DIMENSIONS +
		". Please split the channels.";
	final UserInterface mockUI = CommonWrapperTests.mockUIService(IMAGE_J);
	final ImagePlus imagePlus = IJ.createHyperStack("test", 3, 3, 3, 3, 1, 8);

	// EXECUTE
	final CommandModule module = IMAGE_J.command().run(
		AnalyseSkeletonWrapper.class, true, "inputImage", imagePlus).get();

	// VERIFY
	assertTrue("A composite image should have cancelled the plugin", module
		.isCanceled());
	assertEquals("Cancel reason is incorrect", expectedMessage, module
		.getCancelReason());
	verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
		any());
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:21,代码来源:AnalyseSkeletonWrapperTest.java

示例2: testTimeDimensionCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
@Test
public void testTimeDimensionCancelsPlugin() throws Exception {
	// SETUP
	final String expectedMessage = CommonMessages.HAS_TIME_DIMENSIONS +
		". Please split the hyperstack.";
	final UserInterface mockUI = CommonWrapperTests.mockUIService(IMAGE_J);
	final ImagePlus imagePlus = IJ.createHyperStack("test", 3, 3, 1, 3, 3, 8);

	// EXECUTE
	final CommandModule module = IMAGE_J.command().run(
		AnalyseSkeletonWrapper.class, true, "inputImage", imagePlus).get();

	// VERIFY
	assertTrue("An image with time dimension should have cancelled the plugin",
		module.isCanceled());
	assertEquals("Cancel reason is incorrect", expectedMessage, module
		.getCancelReason());
	verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
		any());
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:21,代码来源:AnalyseSkeletonWrapperTest.java

示例3: testNoSkeletonsCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
@Test
public void testNoSkeletonsCancelsPlugin() throws Exception {
	// SETUP
	final ImagePlus imagePlus = IJ.createImage("test", 3, 3, 3, 8);
	final UserInterface mockUI = CommonWrapperTests.mockUIService(IMAGE_J);

	// EXECUTE
	final CommandModule module = IMAGE_J.command().run(
		AnalyseSkeletonWrapper.class, true, "inputImage", imagePlus,
		"pruneCycleMethod", "None").get();

	// VERIFY
	assertTrue("Plugin should have cancelled", module.isCanceled());
	assertEquals("Cancel reason is incorrect", NO_SKELETONS, module
		.getCancelReason());
	verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
		any());
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:19,代码来源:AnalyseSkeletonWrapperTest.java

示例4: testNoImageWhenNoSkeletonisation

import org.scijava.ui.UserInterface; //导入依赖的package包/类
/**
 * Test that no skeleton image pops open, when the input is already a skeleton
 * (or skeletonisation didn't change it)
 */
@Test
public void testNoImageWhenNoSkeletonisation() throws Exception {
	// SETUP
	final UserInterface mockUI = mock(UserInterface.class);
	IMAGE_J.ui().setDefaultUI(mockUI);
	final ImagePlus pixel = NewImage.createByteImage("Test", 3, 3, 1,
		FILL_BLACK);
	pixel.getStack().getProcessor(1).set(1, 1, (byte) 0xFF);

	// EXECUTE
	final CommandModule module = IMAGE_J.command().run(
		AnalyseSkeletonWrapper.class, true, "inputImage", pixel,
		"pruneCycleMethod", "None").get();

	// VERIFY
	assertFalse(
		"Sanity check failed: plugin cancelled before image could have been shown",
		module.isCanceled());
	verify(mockUI, after(250).never()).show(any(ImagePlus.class));
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:25,代码来源:AnalyseSkeletonWrapperTest.java

示例5: testSkeletonImageWhenSkeletonised

import org.scijava.ui.UserInterface; //导入依赖的package包/类
/**
 * Test that the skeleton is displayed, when the input image gets skeletonised
 */
@Test
public void testSkeletonImageWhenSkeletonised() throws Exception {
	final UserInterface mockUI = mock(UserInterface.class);
	IMAGE_J.ui().setDefaultUI(mockUI);
	final ImagePlus square = NewImage.createByteImage("Test", 4, 4, 1,
		FILL_BLACK);
	square.getStack().getProcessor(1).set(1, 1, (byte) 0xFF);
	square.getStack().getProcessor(1).set(1, 2, (byte) 0xFF);
	square.getStack().getProcessor(1).set(2, 1, (byte) 0xFF);
	square.getStack().getProcessor(1).set(2, 2, (byte) 0xFF);

	// EXECUTE
	CommandModule module = IMAGE_J.command().run(AnalyseSkeletonWrapper.class,
		true, "inputImage", square, "pruneCycleMethod", "None").get();

	// VERIFY
	assertFalse(
		"Sanity check failed: plugin cancelled before image could have been shown",
		module.isCanceled());
	verify(mockUI, timeout(1000)).show(any(ImagePlus.class));
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:25,代码来源:AnalyseSkeletonWrapperTest.java

示例6: testBadFormatIntensityImageCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
@Test
public void testBadFormatIntensityImageCancelsPlugin() throws Exception {
	// SETUP
	final ImagePlus imagePlus = IJ.createImage("test", 3, 3, 3, 8);
	final UserInterface mockUI = mock(UserInterface.class);
	final File exceptionFile = mock(File.class);
	when(exceptionFile.getAbsolutePath()).thenReturn("file.foo");
	when(mockUI.chooseFile(any(File.class), anyString())).thenReturn(
		exceptionFile);
	IMAGE_J.ui().setDefaultUI(mockUI);

	// EXECUTE
	final CommandModule module = IMAGE_J.command().run(
		AnalyseSkeletonWrapper.class, true, "inputImage", imagePlus,
		"pruneCycleMethod", "Lowest intensity voxel").get();

	// VERIFY
	assertTrue("Plugin should have cancelled", module.isCanceled());
	assertEquals("Cancel reason is incorrect", "Image format is not recognized",
		module.getCancelReason());
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:22,代码来源:AnalyseSkeletonWrapperTest.java

示例7: testCompositeImageCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
@Test
public void testCompositeImageCancelsPlugin() throws Exception {
	// SETUP
	final String expectedMessage = CommonMessages.HAS_CHANNEL_DIMENSIONS +
		". Please split the channels.";
	final UserInterface mockUI = CommonWrapperTests.mockUIService(IMAGE_J);
	final ImagePlus imagePlus = IJ.createHyperStack("test", 3, 3, 3, 3, 1, 8);

	// EXECUTE
	final CommandModule module = IMAGE_J.command().run(ThicknessWrapper.class,
		true, "inputImage", imagePlus).get();

	// VERIFY
	assertTrue("A composite image should have cancelled the plugin", module
		.isCanceled());
	assertEquals("Cancel reason is incorrect", expectedMessage, module
		.getCancelReason());
	verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
		any());
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:21,代码来源:ThicknessWrapperTest.java

示例8: testTimeDimensionCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
@Test
public void testTimeDimensionCancelsPlugin() throws Exception {
	// SETUP
	final String expectedMessage = CommonMessages.HAS_TIME_DIMENSIONS +
		". Please split the hyperstack.";
	final UserInterface mockUI = CommonWrapperTests.mockUIService(IMAGE_J);
	final ImagePlus imagePlus = IJ.createHyperStack("test", 3, 3, 1, 3, 3, 8);

	// EXECUTE
	final CommandModule module = IMAGE_J.command().run(ThicknessWrapper.class,
		true, "inputImage", imagePlus).get();

	// VERIFY
	assertTrue("An image with time dimension should have cancelled the plugin",
		module.isCanceled());
	assertEquals("Cancel reason is incorrect", expectedMessage, module
		.getCancelReason());
	verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
		any());
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:21,代码来源:ThicknessWrapperTest.java

示例9: testNullROIManagerCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
@Test
public void testNullROIManagerCancelsPlugin() throws Exception {
	// SETUP
	final UserInterface mockUI = CommonWrapperTests.mockUIService(IMAGE_J);
	final ImagePlus imagePlus = NewImage.createByteImage("", 5, 5, 5, 1);

	// EXECUTE
	final CommandModule module = IMAGE_J.command().run(ThicknessWrapper.class,
		true, "inputImage", imagePlus, "cropToRois", true).get();

	// VERIFY
	assertTrue("No ROI Manager should have cancelled the plugin", module
		.isCanceled());
	assertEquals("Cancel reason is incorrect",
		"Can't crop without valid ROIs in the ROIManager", module
			.getCancelReason());
	verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
		any());
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:20,代码来源:ThicknessWrapperTest.java

示例10: testNullImageCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
public static <C extends Command> void testNullImageCancelsPlugin(
	final ImageJ imageJ, final Class<C> commandClass) throws Exception
{
	// SETUP
	final UserInterface mockUI = mockUIService(imageJ);

	// EXECUTE
	final CommandModule module = imageJ.command().run(commandClass, true,
		"inputImage", null).get();

	// VERIFY
	assertTrue("Null image should have canceled the plugin", module
		.isCanceled());
	assertEquals("Cancel reason is incorrect", CommonMessages.NO_IMAGE_OPEN,
		module.getCancelReason());
	verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
		any());
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:19,代码来源:CommonWrapperTests.java

示例11: test2DImageCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
public static <C extends Command> void test2DImageCancelsPlugin(
	final ImageJ imageJ, final Class<C> commandClass) throws Exception
{
	// SETUP
	final UserInterface mockUI = mockUIService(imageJ);
	// Create an image with only two spatial dimensions
	final DefaultLinearAxis xAxis = new DefaultLinearAxis(Axes.X);
	final DefaultLinearAxis yAxis = new DefaultLinearAxis(Axes.Y);
	final DefaultLinearAxis cAxis = new DefaultLinearAxis(Axes.CHANNEL);
	final Img<DoubleType> img = ArrayImgs.doubles(10, 10, 3);
	final ImgPlus<DoubleType> imgPlus = new ImgPlus<>(img, "Test image", xAxis,
		yAxis, cAxis);

	// EXECUTE
	final CommandModule module = imageJ.command().run(commandClass, true,
		"inputImage", imgPlus).get();

	// VERIFY
	assertTrue("2D image should have cancelled the plugin", module
		.isCanceled());
	assertEquals("Cancel reason is incorrect", CommonMessages.NOT_3D_IMAGE,
		module.getCancelReason());
	verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
		any());
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:26,代码来源:CommonWrapperTests.java

示例12: test2DImagePlusCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
public static <C extends Command> void test2DImagePlusCancelsPlugin(
	final ImageJ imageJ, final Class<C> commandClass) throws Exception
{
	// SETUP
	final UserInterface mockUI = mockUIService(imageJ);
	final ImagePlus image = mock(ImagePlus.class);
	when(image.getNSlices()).thenReturn(1);

	// EXECUTE
	final CommandModule module = imageJ.command().run(commandClass, true,
		"inputImage", image).get();

	// VERIFY
	assertTrue("2D image should have cancelled the plugin", module
		.isCanceled());
	assertEquals("Cancel reason is incorrect", CommonMessages.NOT_3D_IMAGE,
		module.getCancelReason());
	verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
		any());
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:21,代码来源:CommonWrapperTests.java

示例13: testNullROIManagerCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
@Test
public void testNullROIManagerCancelsPlugin() throws Exception {
	// SETUP
	final UserInterface mockUI = CommonWrapperTests.mockUIService(IMAGE_J);
	final ImagePlus imagePlus = NewImage.createImage("", 5, 5, 5, 8, 1);

	// EXECUTE
	final CommandModule module = IMAGE_J.command().run(
		FitEllipsoidWrapper.class, true, "inputImage", imagePlus).get();

	// VERIFY
	assertTrue("No ROI Manager should have cancelled the plugin", module
		.isCanceled());
	assertTrue("Cancel reason is incorrect", module.getCancelReason()
		.startsWith("Please populate ROI Manager with at least " +
			QUADRIC_TERMS));
	verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
		any());
   } 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:20,代码来源:FitEllipsoidWrapperTest.java

示例14: testCompositeImageCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
@Test
public void testCompositeImageCancelsPlugin() throws Exception {
	// SETUP
	final String expectedMessage = CommonMessages.HAS_CHANNEL_DIMENSIONS +
		". Please split the channels.";
	final UserInterface mockUI = CommonWrapperTests.mockUIService(IMAGE_J);
	final ImagePlus imagePlus = IJ.createHyperStack("test", 3, 3, 3, 3, 1, 8);

	// EXECUTE
	final CommandModule module = IMAGE_J.command().run(SkeletoniseWrapper.class,
		true, "inputImage", imagePlus).get();

	// VERIFY
	assertTrue("A composite image should have cancelled the plugin", module
		.isCanceled());
	assertEquals("Cancel reason is incorrect", expectedMessage, module
		.getCancelReason());
	verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
		any());
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:21,代码来源:SkeletoniseWrapperTest.java

示例15: testTimeDimensionCancelsPlugin

import org.scijava.ui.UserInterface; //导入依赖的package包/类
@Test
public void testTimeDimensionCancelsPlugin() throws Exception {
	// SETUP
	final String expectedMessage = CommonMessages.HAS_TIME_DIMENSIONS +
		". Please split the hyperstack.";
	final UserInterface mockUI = CommonWrapperTests.mockUIService(IMAGE_J);
	final ImagePlus imagePlus = IJ.createHyperStack("test", 3, 3, 1, 3, 3, 8);

	// EXECUTE
	final CommandModule module = IMAGE_J.command().run(SkeletoniseWrapper.class,
		true, "inputImage", imagePlus).get();

	// VERIFY
	assertTrue("An image with time dimension should have cancelled the plugin",
		module.isCanceled());
	assertEquals("Cancel reason is incorrect", expectedMessage, module
		.getCancelReason());
	verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
		any());
} 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:21,代码来源:SkeletoniseWrapperTest.java

本文标签属性:

示例:示例的拼音

代码:代码生成器

java:java游戏

UserInterface:userinterface是什么意思

上一篇:当下全球面临的安全挑战主要有哪些方面?(网络安全方面有哪些挑战)(网络安全方面有哪些挑战网络安全方面有哪些挑战)
下一篇:Python win32pipe.ConnectNamedPipe方法代码示例(pythonwin32pipe.connectnamedpipe方法的典型用法代码示例)

为您推荐