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


Java ImageDescriptor.createFromImage方法代码示例

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


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

示例1: GraphicalPalette

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
public GraphicalPalette(){
	PaletteDrawer tools=new PaletteDrawer("节点列表");
	PanningSelectionToolEntry selectionTool=new PanningSelectionToolEntry();
	tools.add(selectionTool);
	this.setDefaultEntry(selectionTool);
	ImageDescriptor transitionDescriptor=ImageDescriptor.createFromImage(Activator.getImageFromPlugin(Constants.TRANSITION_NODE_ICON_SMALL));
	ConnectionCreationToolEntry connection=new ConnectionCreationToolEntry("Transition","Create a Transition",null,transitionDescriptor,transitionDescriptor);
	tools.add(connection);
	tools.add(this.createToolEntry(StartNode.class,"Start","Create a start node",70,40));
	tools.add(this.createToolEntry(EndNode.class,"End","Create a end node",70,40));
	tools.add(this.createToolEntry(TaskNode.class,"Task","Create a task node",80,40));
	tools.add(this.createToolEntry(ForkNode.class,"Fork","Create a fork node",80,40));
	tools.add(this.createToolEntry(JoinNode.class,"Join","Create a join node",80,40));
	tools.add(this.createToolEntry(ForeachNode.class,"Foreach","Create a foreach node",80,40));
	tools.add(this.createToolEntry(DecisionNode.class,"Decision","Create a decision node",80,40));
	tools.add(this.createToolEntry(SubprocessNode.class,"Subprocess","Create a subprocess node",100,40));
	tools.add(this.createToolEntry(EndCancelNode.class,"End Cancel","Create a end cancel node",100,40));
	tools.add(this.createToolEntry(EndErrorNode.class,"End Error","Create a end error node",100,40));
	tools.add(this.createToolEntry(StateNode.class,"State","Create a state node",80,40));
	tools.add(this.createToolEntry(CustomNode.class,"Custom","Create a custom node",80,40));
	this.add(tools);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:23,代码来源:GraphicalPalette.java

示例2: createToolEntry

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
private CreationToolEntry createToolEntry(final Class<?> nodeClass,final String name,String desc,final int width,final int height){
	SimpleFactory nodeFactory=new SimpleFactory(nodeClass){
		@Override
		public Object getNewObject() {
			AbstractNodeElement node=instanceNode(nodeClass,name,width,height);
			return node;
		}
	};
	String nodeName=instanceNode(nodeClass,name,width,height).nodeName();
	NodeImageConfig config=Activator.getPreference().getNodeImageConfigByName(nodeName);
	if(config==null){
		throw new RuntimeException("当前没有为名为"+nodeName+"的节点预定义配置信息!");
	}
	ImageDescriptor descriptor=ImageDescriptor.createFromImage(config.getSmallImage());
	return new CombinedTemplateCreationEntry(name,desc,nodeFactory,descriptor,descriptor);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:17,代码来源:GraphicalPalette.java

示例3: testIndirectImageDescriptorCaching

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
/**
 * Checks the indirect {@link ImageDescriptor image descriptor} caching.
 */
@Test
public void testIndirectImageDescriptorCaching() {
	final Image img1 = ImageRef.LIB_PATH.asImage().orNull();
	final Image img2 = ImageRef.LIB_PATH.asImage().orNull();
	final ImageDescriptor desc1 = ImageDescriptor.createFromImage(img1);
	final ImageDescriptor desc2 = ImageDescriptor.createFromImage(img2);
	assertTrue("Expected different reference of image descriptors.", desc1 != desc2);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:12,代码来源:GHOLD_170_ImageCaching_PluginUITest.java

示例4: getImageDescriptor

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
@Override
default ImageDescriptor getImageDescriptor(final Object object) {
	final Image image = getImage();
	return null == image ? null : ImageDescriptor.createFromImage(image);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:6,代码来源:Node.java

示例5: dbModelsViewDidShowMenu

import org.eclipse.jface.resource.ImageDescriptor; //导入方法依赖的package包/类
@Override
public void dbModelsViewDidShowMenu(IMenuManager menuManager) {
    if (dbModelsView.getTableViewer().getStructuredSelection().getFirstElement() == null) {
        return;
    }
    DBController selectedController = (DBController) dbModelsView.getTableViewer().getStructuredSelection().getFirstElement();
    if (selectedController.isConnected()) {
        Action disconnectAction = new Action(Images.DISCONNECT_DATABASE.getDescription(resourceBundle),
                ImageDescriptor.createFromImage(ImageUtils.getImage(Images.DISCONNECT_DATABASE))) {
            @Override
            public void run() {
                disconnectSelectedDatabase();
            }
        };
        menuManager.add(disconnectAction);
    } else {
        Action connectAction = new Action(Images.CONNECT_DATABASE.getDescription(resourceBundle),
                ImageDescriptor.createFromImage(ImageUtils.getImage(Images.CONNECT_DATABASE))) {
            @Override
            public void run() {
                connectToSelectedDatabase();
            }
        };
        menuManager.add(connectAction);
        Action editAction = new Action(Images.EDIT_DATABASE.getDescription(resourceBundle),
                ImageDescriptor.createFromImage(ImageUtils.getImage(Images.EDIT_DATABASE))) {
            @Override
            public void run() {
                openEditSelectedDatabaseDialog();
            }
        };
        menuManager.add(editAction);
    }
    Action updateProcessesAction = new Action(Images.UPDATE.getDescription(resourceBundle),
            ImageDescriptor.createFromImage(ImageUtils.getImage(Images.UPDATE))) {
        @Override
        public void run() {
            updateProcessesInSelectedDatabase();
        }
    };
    menuManager.add(updateProcessesAction);
}
 
开发者ID:technology16,项目名称:pgsqlblocks,代码行数:43,代码来源:ProcessesController.java


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