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