本文整理汇总了Python中ij.WindowManager.getNonImageWindows方法的典型用法代码示例。如果您正苦于以下问题:Python WindowManager.getNonImageWindows方法的具体用法?Python WindowManager.getNonImageWindows怎么用?Python WindowManager.getNonImageWindows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.WindowManager
的用法示例。
在下文中一共展示了WindowManager.getNonImageWindows方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: arrange
# 需要导入模块: from ij import WindowManager [as 别名]
# 或者: from ij.WindowManager import getNonImageWindows [as 别名]
def arrange():
# Fiji JFrame Instance and Measurements
IJ_FRAME = IJ.getInstance()
IJ_WIDTH = IJ_FRAME.getWidth()
IJ_HEIGHT = IJ_FRAME.getHeight()
#
# Display Screen Measurements
SCREEN_DIMS = IJ_FRAME.getGraphicsConfiguration().getBounds()
SCREEN_WIDTH = int(SCREEN_DIMS.getWidth())
SCREEN_HEIGHT = int(SCREEN_DIMS.getHeight())
print SCREEN_WIDTH, SCREEN_HEIGHT
#
SPECS = {
# Format:
# WINDOW : [x, y, w, h]
#
ImageJ : [SCREEN_WIDTH - IJ_WIDTH, 0, None, None],
TextEditor : [SCREEN_WIDTH-640, SCREEN_HEIGHT-540, 640, 540],
RoiManager : [0, 0, None, None],
TextWindow : [0, SCREEN_HEIGHT-320, 480, 320],
Recorder : [0, SCREEN_HEIGHT-320-120, 480, 320],
}
# the window is Fiji JFrame itself
x,y,w,h = SPECS[ type(IJ_FRAME) ]
IJ_FRAME.setLocation(x,y)
#
niws = WM.getNonImageWindows()
print "%i non-image windows are open" % (len(niws))
for win in niws:
print type(win)
x, y, w, h = SPECS[ type(win) ]
if w == None: w = win.getWidth()
if h == None: h = win.getHeight()
win.setSize(w, h)
win.setLocation(x, y)