Source Code Cross Referenced for SpaceServerHelper.java in  » Web-Server » Jigsaw » org » w3c » jigadmin » editors » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Server » Jigsaw » org.w3c.jigadmin.editors 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // SpaceServerHelper.java
002:        // $Id: SpaceServerHelper.java,v 1.22 2000/08/16 21:37:31 ylafon Exp $
003:        // (c) COPYRIGHT MIT and INRIA, 1998.
004:        // Please first read the full copyright statement in file COPYRIGHT.html
005:
006:        package org.w3c.jigadmin.editors;
007:
008:        import javax.swing.JDesktopPane;
009:        import javax.swing.JScrollPane;
010:        import javax.swing.BorderFactory;
011:        import javax.swing.JInternalFrame;
012:        import javax.swing.JTabbedPane;
013:        import javax.swing.JLayeredPane;
014:        import javax.swing.JOptionPane;
015:        import javax.swing.border.BevelBorder;
016:
017:        import java.awt.Component;
018:        import java.awt.GridLayout;
019:        import java.awt.Container;
020:
021:        import java.util.Properties;
022:        import java.util.Hashtable;
023:        import java.util.Vector;
024:        import java.util.Enumeration;
025:
026:        import org.w3c.jigadmin.RemoteResourceWrapper;
027:        import org.w3c.jigadmin.PropertyManager;
028:        import org.w3c.jigadmin.gui.Message;
029:        import org.w3c.jigadmin.widgets.DraggableList;
030:        import org.w3c.jigadmin.events.ResourceActionListener;
031:        import org.w3c.jigadmin.events.ResourceActionEvent;
032:
033:        import org.w3c.jigsaw.admin.RemoteAccessException;
034:
035:        import org.w3c.tools.sorter.Sorter;
036:
037:        /**
038:         * Server Helper for resources space.
039:         * @version $Revision: 1.22 $
040:         * @author  Benoît Mahé (bmahe@w3.org)
041:         */
042:        public class SpaceServerHelper extends JDesktopPane implements 
043:                ServerHelperInterface, ResourceActionListener {
044:
045:            protected String name = null;
046:            protected String tooltip = null;
047:            protected RemoteResourceWrapper root = null;
048:            protected ResourceTreeBrowser tree = null;
049:            protected JTabbedPane tabbedPane = null;
050:            protected JScrollPane treeview = null;
051:            protected JInternalFrame iframe = null;
052:
053:            /**
054:             * Initialize this editor.
055:             * @param name the editor name
056:             * @param rrw the RemoteResourceWrapper wrapping the editor node.
057:             * @param p the editor properties
058:             */
059:            public void initialize(String name, RemoteResourceWrapper rrw,
060:                    Properties p) {
061:                this .name = name;
062:                this .root = rrw;
063:                this .tooltip = (String) p.get(TOOLTIP_P);
064:                build();
065:            }
066:
067:            /**
068:             * Get a draggable JList of ResourceCell
069:             * @param cells a Vector of ResourceCell
070:             * @return A DraggableList instance
071:             */
072:            protected DraggableList getResourceList(Vector cells) {
073:                DraggableList list = new DraggableList(cells);
074:                list.setCellRenderer(new ResourceCellRenderer());
075:                return list;
076:            }
077:
078:            /**
079:             * Get the Internal Frame containing frame & resource lists
080:             * @return A JInternalFrame instance
081:             */
082:            protected JInternalFrame getInternalFrame() {
083:                PropertyManager pm = PropertyManager.getPropertyManager();
084:                JInternalFrame frame = new JInternalFrame(
085:                        "Available Resources", true, //resizable
086:                        false, //closable
087:                        true, //maximizable
088:                        true);//iconifiable
089:                tabbedPane = new JTabbedPane();
090:                //Resource list
091:                Hashtable resources = pm.getResources();
092:                Enumeration e = (Sorter.sortStringEnumeration(resources.keys()))
093:                        .elements();
094:                Vector cells = new Vector(10);
095:                while (e.hasMoreElements()) {
096:                    String name = (String) e.nextElement();
097:                    ResourceCell cell = new ResourceCell(name,
098:                            (String) resources.get(name));
099:                    cells.addElement(cell);
100:                }
101:                DraggableList list = getResourceList(cells);
102:                JScrollPane scroll = new JScrollPane(list);
103:                tabbedPane.addTab("Resources", null, scroll,
104:                        "Resources available");
105:                //frames
106:                resources = pm.getFrames();
107:                e = (Sorter.sortStringEnumeration(resources.keys())).elements();
108:                cells = new Vector(10);
109:                while (e.hasMoreElements()) {
110:                    String name = (String) e.nextElement();
111:                    ResourceCell cell = new ResourceCell(name,
112:                            (String) resources.get(name));
113:                    cells.addElement(cell);
114:                }
115:                list = getResourceList(cells);
116:                scroll = new JScrollPane(list);
117:                tabbedPane.addTab("Frames", null, scroll,
118:                        "Frames and Filters available");
119:                frame.getContentPane().add(tabbedPane);
120:                frame.setSize(350, 410);
121:                return frame;
122:            }
123:
124:            /**
125:             * A resource action occured.
126:             * @param e the ResourceActionEvent
127:             */
128:            public void resourceActionPerformed(ResourceActionEvent e) {
129:                tree.resourceActionPerformed(e);
130:            }
131:
132:            /**
133:             * Return a new ResourceTreeBrowser.
134:             * @return a ResourceTreeBrowser instance
135:             */
136:            protected ResourceTreeBrowser getTreeBrowser() {
137:                return ResourceTreeBrowser.getResourceTreeBrowser(root, "Root");
138:            }
139:
140:            /**
141:             * Build the interface
142:             */
143:            protected void build() {
144:                setOpaque(false);
145:                tree = getTreeBrowser();
146:                treeview = new JScrollPane(tree);
147:                add(treeview, JLayeredPane.FRAME_CONTENT_LAYER);
148:                treeview.setLocation(10, 10);
149:                treeview.setBorder(BorderFactory
150:                        .createBevelBorder(BevelBorder.LOWERED));
151:                iframe = getInternalFrame();
152:                add(iframe, JLayeredPane.PALETTE_LAYER);
153:            }
154:
155:            /**
156:             * Update the layout in the JDesktopPane
157:             * @param width The JDesktopPane width
158:             * @param height  The JDesktopPane height
159:             */
160:            protected void updateLayout(int width, int height) {
161:                int treewidth = 5 * width / 12;
162:                treeview.setLocation(10, 10);
163:                treeview.setSize(treewidth, height - 20);
164:                int x = iframe.getLocation().x;
165:                int minx = 20 + treewidth;
166:                if (x < minx)
167:                    iframe.setLocation(minx, 10);
168:            }
169:
170:            /**
171:             * Moves and resizes this component. The new location of the top-left
172:             * corner is specified by x and y, and the new size is specified by 
173:             * width and height.
174:             * @param x The new x-coordinate of this component.
175:             * @param y The new y-coordinate of this component.
176:             * @param width The new width of this component.
177:             * @param height The new height of this component.
178:             */
179:            public void setBounds(int x, int y, int width, int height) {
180:                updateLayout(width, height);
181:                super .setBounds(x, y, width, height);
182:            }
183:
184:            /**
185:             * Get the helper name.
186:             * @return a String instance
187:             */
188:            public String getName() {
189:                return name;
190:            }
191:
192:            /**
193:             * Get the helper tooltip
194:             * @return a String
195:             */
196:            public String getToolTip() {
197:                return tooltip;
198:            }
199:
200:            /**
201:             * Get the Component.
202:             * @return a Component instance
203:             */
204:            public Component getComponent() {
205:                return this ;
206:            }
207:
208:            /**
209:             * Constructor.
210:             */
211:            public SpaceServerHelper() {
212:                //new instance
213:            }
214:
215:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.