01: /*
02: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
03: *
04: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
05: *
06: * The contents of this file are subject to the terms of either the GNU
07: * General Public License Version 2 only ("GPL") or the Common
08: * Development and Distribution License("CDDL") (collectively, the
09: * "License"). You may not use this file except in compliance with the
10: * License. You can obtain a copy of the License at
11: * http://www.netbeans.org/cddl-gplv2.html
12: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13: * specific language governing permissions and limitations under the
14: * License. When distributing the software, include this License Header
15: * Notice in each file and include the License file at
16: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
17: * particular file as subject to the "Classpath" exception as provided
18: * by Sun in the GPL Version 2 section of the License file that
19: * accompanied this code. If applicable, add the following below the
20: * License Header, with the fields enclosed by brackets [] replaced by
21: * your own identifying information:
22: * "Portions Copyrighted [year] [name of copyright owner]"
23: *
24: * Contributor(s):
25: *
26: * The Original Software is NetBeans. The Initial Developer of the Original
27: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
28: * Microsystems, Inc. All Rights Reserved.
29: *
30: * If you wish your version of this file to be governed by only the CDDL
31: * or only the GPL Version 2, indicate your decision by adding
32: * "[Contributor] elects to include this software in this distribution
33: * under the [CDDL or GPL Version 2] license." If you do not indicate a
34: * single choice of license, a recipient has the option to distribute
35: * your version of this file under either the CDDL, the GPL Version 2 or
36: * to extend the choice of license to its licensees as provided above.
37: * However, if you add GPL Version 2 code and therefore, elected the GPL
38: * Version 2 license, then the option applies only if the new code is
39: * made subject to such option by the copyright holder.
40: */
41:
42: /*
43: * Created on Jun 6, 2003
44: *
45: *
46: */
47: /**
48: * This class is a common resource for icons. If you call GetIconFor... then you need to manage
49: * the destruction of the HICON. If you only want icons loaded once per type of object you need
50: * to get the details and load them yourself using the GetIconDetailsFor... The project tree uses
51: * the details calls cause it puts the icons into an image list and only needs one icon per, for
52: * example, "Class". The we report uses the other interface cause it requires a unique HICON per
53: * entry in its tree.
54: */package org.netbeans.modules.uml.ui.support.commonresources;
55:
56: import javax.swing.Icon;
57:
58: /**
59: * @author sumitabhk
60: *
61: *
62: */
63: public interface ICommonResourceManager {
64: // Returns an HICON (as a long) for the name. sKeyname may be an element type ie Class. The caller manages the HICON destruction.
65: // HRESULT GetIconForElementType([in]BSTR sKeyname,
66: // [out,retval]long* pIcon);
67:
68: public Icon getIconForElementType(String sKeyname);
69:
70: // Returns an HICON (as a long) for the IDispatch. The pDisp can be an IElement, IDiagram or IProxyDiagram. The caller manages the HICON destruction.
71: // HRESULT GetIconForDisp([in]IDispatch* pDisp,
72: // [out,retval]long* pIcon);
73: public Icon getIconForDisp(Object pDisp);
74:
75: // Returns an HICON (as a long) for the diagram kind (of type DiagramKind). The caller manages the HICON destruction.
76: // HRESULT GetIconForDiagramKind([in]long nDiagramKind,
77: // [out,retval]long* pIcon);
78: public Icon getIconForDiagramKind(int nDiagramKind);
79:
80: // Returns the information about a specific icon. Use to load the icon yourself - for instance if you need to put into an image list.
81: // HRESULT GetIconDetailsForElementType([in]BSTR sKeyname,
82: // [out]BSTR* sIconLibrary,
83: // [out,retval]long* nIconID);
84: public String getIconDetailsForElementType(String sKeyname);
85:
86: // Returns the information about a specific icon for the IDispatch. The pDisp can be an IElement, IDiagram or IProxyDiagram.. Use to load the icon yourself - for instance if you need to put into an image list.
87: // HRESULT GetIconDetailsForDisp([in]IDispatch* pDisp,
88: // [out]BSTR* sIconLibrary,
89: // [out,retval]long* nIconID);
90: public String getIconDetailsForDisp(Object pDisp);
91:
92: // Returns the information about a specific icon for the diagram kind (of type DiagramKind). Use to load the icon yourself - for instance if you need to put into an image list.
93: // HRESULT GetIconDetailsDiagramKind([in]long nDiagramKind,
94: // [out]BSTR* sIconLibrary,
95: // [out,retval]long* nIconID);
96: public String getIconDetailsDiagrmaKind(int nDiagramKind);
97:
98: }
|