當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。