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


Java Display.getFront方法代码示例

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


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

示例1: currentLayer

import ini.trakem2.display.Display; //导入方法依赖的package包/类
private Layer currentLayer( final Object... params )
{
	final Layer layer;
	if ( params != null && params[ 0 ] != null )
	{
		final Object param = params[ 0 ];
		if ( Layer.class.isInstance( param ) )
			layer = ( Layer ) param;
		else if ( LayerSet.class.isInstance( param ) )
			layer = ( ( LayerSet ) param ).getLayer( 0 );
		else if ( Displayable.class.isInstance( param ) )
			layer = ( ( Displayable ) param ).getLayer();
		else
			layer = null;
	}
	else
	{
		final Display front = Display.getFront();
		if ( front == null )
			layer = Project.getProjects().get( 0 ).getRootLayerSet().getLayer( 0 );
		else
			layer = front.getLayer();
	}
	return layer;
}
 
开发者ID:saalfeldlab,项目名称:z-spacing,代码行数:26,代码来源:LayerZPosition.java

示例2: setup

import ini.trakem2.display.Display; //导入方法依赖的package包/类
@Override
public boolean setup( final Object... params )
{
	if ( params != null && params[ 0 ] != null )
	{
		final Object param = params[ 0 ];
		if ( LayerSet.class.isInstance( param ) )
			layerset = ( LayerSet ) param;
		else if ( Displayable.class.isInstance( param ) )
			layerset = ( ( Displayable ) param ).getLayerSet();
		else
			return false;
	}
	else
	{
		final Display front = Display.getFront();
		if ( front == null )
			layerset = Project.getProjects().get( 0 ).getRootLayerSet();
		else
			layerset = front.getLayerSet();
	}
	return true;
}
 
开发者ID:saalfeldlab,项目名称:z-spacing,代码行数:24,代码来源:LayerZPosition.java

示例3: setup

import ini.trakem2.display.Display; //导入方法依赖的package包/类
@Override
public boolean setup( final Object... params )
{
    if ( params != null && params[ 0 ] != null )
	{
		final Object param = params[ 0 ];
		if ( LayerSet.class.isInstance( param ) )
			layerset = ( LayerSet ) param;
		else if ( Displayable.class.isInstance( param ) )
			layerset = ( ( Displayable ) param ).getLayerSet();
		else
			return false;
	}
	else
	{
		final Display front = Display.getFront();
		if ( front == null )
			layerset = Project.getProjects().get( 0 ).getRootLayerSet();
		else
			layerset = front.getLayerSet();
	}
	return true;
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:24,代码来源:MatchIntensities.java

示例4: getRoi

import ini.trakem2.display.Display; //导入方法依赖的package包/类
private static Rectangle getRoi( final LayerSet layerset )
{
	final Roi roi;
	final Display front = Display.getFront();
	if ( front == null )
		roi = null;
	else
		roi = front.getRoi();
	if ( roi == null )
		return new Rectangle( 0, 0, ( int ) layerset.getLayerWidth(), ( int ) layerset.getLayerHeight() );
	else
		return roi.getBounds();
}
 
开发者ID:saalfeldlab,项目名称:z-spacing,代码行数:14,代码来源:LayerZPosition.java

示例5: createCoordinate

import ini.trakem2.display.Display; //导入方法依赖的package包/类
private Coordinate<Displayable> createCoordinate(final Displayable d) {
	Rectangle r = d.getBoundingBox();
	Layer la = d instanceof ZDisplayable ? ((ZDisplayable) d)
			.getFirstLayer() : d.getLayer();
	if (null == la) {
		Display display = Display.getFront(d.getProject());
		if (null == display)
			la = d.getProject().getRootLayerSet().getLayer(0);
		else
			la = display.getLayer();
	}
	return new Coordinate<Displayable>(r.x + r.width / 2, r.y + r.height
			/ 2, la, d);
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:15,代码来源:Search.java

示例6: select

import ini.trakem2.display.Display; //导入方法依赖的package包/类
private void select(ZDisplayable d) {
	Display display = Display.getFront(d.getProject());
	if (null == display) {
		Utils.log("No displays open for project " + d.getProject());
	} else {
		display.select(d);
	}
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:9,代码来源:Merger.java

示例7: select2

import ini.trakem2.display.Display; //导入方法依赖的package包/类
private void select2(ZDisplayable d) {
	Display display = Display.getFront(d.getProject());
	if (null == display) {
		Utils.log("No displays open for project " + d.getProject());
	} else {
		Display.showCentered(d.getFirstLayer(), d, true, false); // also select
	}
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:9,代码来源:Merger.java

示例8: showCentered2D

import ini.trakem2.display.Display; //导入方法依赖的package包/类
/** Show centered, set visible and select. */
final public void showCentered2D(final boolean shift_down) {
	Rectangle b = null;
	final Display display = Display.getFront();
	for (final Line3D line3d : pipes) {
		final ZDisplayable p = (ZDisplayable)line3d;
		if (null == b) b = p.getBoundingBox();
		else b.add(p.getBoundingBox());
		p.setVisible(true);
		display.select(p, shift_down);
	}
	display.select((ZDisplayable)pipes.get(0), shift_down); // the root as active
	display.getCanvas().showCentered(b);
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:15,代码来源:Compare.java

示例9: doProcess

import ini.trakem2.display.Display; //导入方法依赖的package包/类
@Override
public void doProcess(final MouseEvent e) {
	if(!e.isControlDown() ||
			e.getID() != MouseEvent.MOUSE_PRESSED) {
		super.doProcess(e);
		return;
	}
	final Picker picker = universe.getPicker();
	final Content content = picker.getPickedContent(e.getX(),e.getY());
	if(content==null)
		return;
	final Point3d p = picker.getPickPointGeometry(content,e);
	if(p==null) {
		Utils.log("No point was found on content "+content);
		return;
	}
	final Display display = Display.getFront(ls.getProject());
	if(display==null) {
		// If there's no Display, just return...
		return;
	}
	if (display.getLayerSet() != ls) {
		Utils.log("The LayerSet instances do not match");
		return;
	}
	if(ls==null) {
		Utils.log("No LayerSet was found for the Display");
		return;
	}
	final Calibration cal = ls.getCalibration();
	if(cal==null) {
		Utils.log("No calibration information was found for the LayerSet");
		return;
	}
	final double scaledZ = p.z/cal.pixelWidth;
	final Layer l = ls.getNearestLayer(scaledZ);
	if(l==null) {
		Utils.log("No layer was found nearest to "+scaledZ);
		return;
	}
	final Coordinate<?> coordinate = new Coordinate<Object>(p.x/cal.pixelWidth,p.y/cal.pixelHeight,l,null);
	display.center(coordinate);
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:44,代码来源:ControlClickBehavior.java


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