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


Java Context.inject方法代码示例

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


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

示例1: SCIFIOCellCache

import org.scijava.Context; //导入方法依赖的package包/类
/**
 * Creates a new SCIFIOCellCache and makes it available to the current
 * CacheService
 */
public SCIFIOCellCache(final Context context,
	final SCIFIOArrayLoader<A> loader)
{
	this.loader = loader;
	context.inject(this);
	cacheService.addCache(cacheId);
	refManagerService.manage(this);
}
 
开发者ID:scifio,项目名称:scifio,代码行数:13,代码来源:SCIFIOCellCache.java

示例2: TileCache

import org.scijava.Context; //导入方法依赖的package包/类
public TileCache(final Context ctx, final int yy, final int hh) {
	ctx.inject(this);
	options.interleaved = true;
	options.littleEndian = false;
	this.yy = yy;
	this.hh = hh;
	codec = codecService.getCodec(JPEGCodec.class);
}
 
开发者ID:scifio,项目名称:scifio,代码行数:9,代码来源:JPEGTileDecoder.java

示例3: OMEHandler

import org.scijava.Context; //导入方法依赖的package包/类
public OMEHandler(final Vector<String> xmlFragments,
	final String currentFragment, final Context context)
{
	super(new StderrLogService());
	this.xmlFragments = xmlFragments;
	this.currentFragment = currentFragment;
	context.inject(this);
}
 
开发者ID:scifio,项目名称:scifio-ome-xml,代码行数:9,代码来源:OMEXMLFormat.java

示例4: Worker

import org.scijava.Context; //导入方法依赖的package包/类
Worker(Context context, Map<String, ScriptEngine> scriptEngines, Map<String, ScriptLanguage> scriptLanguages) {
context.inject(this);
this.scriptEngines = scriptEngines;
this.scriptLanguages = scriptLanguages;
   }
 
开发者ID:scijava,项目名称:scijava-jupyter-kernel,代码行数:6,代码来源:Worker.java

示例5: ScijavaKernelConfigurationFile

import org.scijava.Context; //导入方法依赖的package包/类
public ScijavaKernelConfigurationFile(Context context, String logLevel, Path connectionFile) {
    context.inject(this);
    this.configFile = connectionFile.toFile();
    this.logLevel = logLevel;
}
 
开发者ID:scijava,项目名称:scijava-jupyter-kernel,代码行数:6,代码来源:ScijavaKernelConfigurationFile.java

示例6: setContext

import org.scijava.Context; //导入方法依赖的package包/类
public void setContext(Context context) {
    context.inject(this);
}
 
开发者ID:hadim,项目名称:imagej-plugin-javafx,代码行数:4,代码来源:RootLayoutController.java

示例7: SwingOverlayManager

import org.scijava.Context; //导入方法依赖的package包/类
/**
 * Creates a JList to list the overlays. 
 */
public SwingOverlayManager(final Context context) {
	this.context = context;
	context.inject(this);

	jlist = new JList<>(new OverlayListModel(overlayService.getOverlayInfo()));
	//jlist.setCellRenderer(new OverlayRenderer());

	final JScrollPane listScroller = new JScrollPane(jlist);
	listScroller.setPreferredSize(new Dimension(250, 80));
	listScroller.setAlignmentX(LEFT_ALIGNMENT);
	final JPanel listPanel = new JPanel();
	listPanel.setLayout(new BoxLayout(listPanel, BoxLayout.Y_AXIS));
	listPanel.add(listScroller);
	listPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

	final JPanel buttonPane = new JPanel();
	buttonPane.setLayout(new GridLayout(9,1,5,0));
	// NO LONGER SUPPORTING
	//buttonPane.add(getAddButton());
	//buttonPane.add(getUpdateButton());
	buttonPane.add(getDeleteButton());
	buttonPane.add(getRenameButton());
	buttonPane.add(getMeasureButton());
	buttonPane.add(getDeselectButton());
	buttonPane.add(getPropertiesButton());
	buttonPane.add(getFlattenButton());
	buttonPane.add(getFillButton());
	buttonPane.add(getDrawButton());
	buttonPane.add(getMoreButton());

	final JPanel boolPane = new JPanel();
	boolPane.setLayout(new BoxLayout(boolPane, BoxLayout.Y_AXIS));
	showAllCheckBox = new JCheckBox("Show All",false);
	editModeCheckBox = new JCheckBox("Edit Mode",false);
	boolPane.add(showAllCheckBox);
	boolPane.add(editModeCheckBox);
	showAllCheckBox.addItemListener(this);
	editModeCheckBox.addItemListener(this);
	
	final JPanel controlPanel = new JPanel();
	controlPanel.setLayout(new BorderLayout());
	controlPanel.add(buttonPane,BorderLayout.CENTER);
	controlPanel.add(boolPane,BorderLayout.SOUTH);

	final Container cp = this.getContentPane();
	cp.add(listPanel, BorderLayout.CENTER);
	cp.add(controlPanel, BorderLayout.EAST);

	setTitle("Overlay Manager");
	setupListSelectionListener();
	setupCloseListener();
	setupKeyListener();
	restoreLocation();
	
	pack();
	
	eventService.subscribe(this);

	populateOverlayList();
}
 
开发者ID:imagej,项目名称:imagej-ui-swing,代码行数:64,代码来源:SwingOverlayManager.java

示例8: PreviewPane

import org.scijava.Context; //导入方法依赖的package包/类
/** Constructs a preview pane for the given file chooser. */
public PreviewPane(final Context context, final JFileChooser jc) {
	super();

	context.inject(this);

	// create view
	setBorder(new EmptyBorder(0, 10, 0, 10));
	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
	iconLabel = new JLabel();
	iconLabel.setMinimumSize(new java.awt.Dimension(128, -1));
	iconLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
	add(iconLabel);
	add(Box.createVerticalStrut(7));
	formatLabel = new JLabel();
	formatLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
	add(formatLabel);
	add(Box.createVerticalStrut(5));
	resLabel = new JLabel();
	resLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
	add(resLabel);
	zctLabel = new JLabel();
	zctLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
	add(zctLabel);
	typeLabel = new JLabel();
	typeLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
	add(typeLabel);

	// smaller font for most labels
	Font font = formatLabel.getFont();
	font = font.deriveFont(font.getSize2D() - 3);
	formatLabel.setFont(font);
	resLabel.setFont(font);
	zctLabel.setFont(font);
	typeLabel.setFont(font);

	// populate model
	icon = null;
	iconText = formatText = resText = npText = typeText = "";
	iconTip = formatTip = resTip = zctTip = typeTip = null;

	if (jc != null) {
		jc.setAccessory(this);
		jc.addPropertyChangeListener(this);

		refresher = new Runnable() {

			@Override
			public void run() {
				iconLabel.setIcon(icon);
				iconLabel.setText(iconText);
				iconLabel.setToolTipText(iconTip);
				formatLabel.setText(formatText);
				formatLabel.setToolTipText(formatTip);
				resLabel.setText(resText);
				resLabel.setToolTipText(resTip);
				zctLabel.setText(npText);
				zctLabel.setToolTipText(zctTip);
				typeLabel.setText(typeText);
				typeLabel.setToolTipText(typeTip);
			}
		};

		// start separate loader thread
		loaderAlive = true;
		loader = new Thread(this, "Preview");
		loader.start();
	}
}
 
开发者ID:scifio,项目名称:scifio,代码行数:70,代码来源:PreviewPane.java

示例9: Runner

import org.scijava.Context; //导入方法依赖的package包/类
/** Default constructor-based dependency injection */
public Runner(final Context context) {
	context.inject(this);
	setSilent(false);
}
 
开发者ID:tferr,项目名称:Scripts,代码行数:6,代码来源:Runner.java

示例10: initialize

import org.scijava.Context; //导入方法依赖的package包/类
/**
 * Initialize resource by injection. Should not be called directly.
 * 
 * @param ctx
 */
@Inject
public void initialize(final Context ctx) {
	ctx.inject(this);
	updateModuleCache();
}
 
开发者ID:imagej,项目名称:imagej-server,代码行数:11,代码来源:ModulesResource.java

示例11: ScriptGenerator

import org.scijava.Context; //导入方法依赖的package包/类
public ScriptGenerator(final Context context) {
	context.inject(this);
}
 
开发者ID:imagej,项目名称:imagej-omero,代码行数:4,代码来源:ScriptGenerator.java

示例12: ScijavaEvaluator

import org.scijava.Context; //导入方法依赖的package包/类
public ScijavaEvaluator(Context context, String shellId, String sessionId) {
    context.inject(this);

    this.shellId = shellId;
    this.sessionId = sessionId;

    this.scriptEngines = new HashMap<>();
    this.scriptLanguages = new HashMap<>();

    this.completers = new HashMap<>();

    this.languageName = DEFAULT_LANGUAGE;
}
 
开发者ID:scijava,项目名称:scijava-jupyter-kernel,代码行数:14,代码来源:ScijavaEvaluator.java


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