本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
}
示例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
}
}
示例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);
}
示例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);
}