Source Code Cross Referenced for ViewAttributesPlugIn.java in  » GIS » openjump » com » vividsolutions » jump » workbench » ui » plugin » 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 » GIS » openjump » com.vividsolutions.jump.workbench.ui.plugin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI for
003:         * visualizing and manipulating spatial features with geometry and attributes.
004:         * 
005:         * Copyright (C) 2003 Vivid Solutions
006:         * 
007:         * This program is free software; you can redistribute it and/or modify it
008:         * under the terms of the GNU General Public License as published by the Free
009:         * Software Foundation; either version 2 of the License, or (at your option)
010:         * any later version.
011:         * 
012:         * This program is distributed in the hope that it will be useful, but WITHOUT
013:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
014:         * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
015:         * more details.
016:         * 
017:         * You should have received a copy of the GNU General Public License along with
018:         * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
019:         * Place - Suite 330, Boston, MA 02111-1307, USA.
020:         * 
021:         * For more information, contact:
022:         * 
023:         * Vivid Solutions Suite #1A 2328 Government Street Victoria BC V8T 5G5 Canada
024:         * 
025:         * (250)385-6040 www.vividsolutions.com
026:         */
027:        package com.vividsolutions.jump.workbench.ui.plugin;
028:
029:        import com.vividsolutions.jts.util.Assert;
030:        import com.vividsolutions.jump.I18N;
031:        import com.vividsolutions.jump.workbench.WorkbenchContext;
032:        import com.vividsolutions.jump.workbench.model.*;
033:        import com.vividsolutions.jump.workbench.plugin.AbstractPlugIn;
034:        import com.vividsolutions.jump.workbench.plugin.EnableCheckFactory;
035:        import com.vividsolutions.jump.workbench.plugin.MultiEnableCheck;
036:        import com.vividsolutions.jump.workbench.plugin.PlugInContext;
037:        import com.vividsolutions.jump.workbench.ui.*;
038:        import com.vividsolutions.jump.workbench.ui.images.IconLoader;
039:        import java.awt.BorderLayout;
040:        import javax.swing.ImageIcon;
041:        import javax.swing.JInternalFrame;
042:        import javax.swing.event.InternalFrameAdapter;
043:        import javax.swing.event.InternalFrameEvent;
044:
045:        public class ViewAttributesPlugIn extends AbstractPlugIn {
046:            public ViewAttributesPlugIn() {
047:            }
048:
049:            public String getName() {
050:                return I18N
051:                        .get("ui.plugin.ViewAttributesPlugIn.view-edit-attributes");
052:            }
053:
054:            public boolean execute(final PlugInContext context)
055:                    throws Exception {
056:                reportNothingToUndoYet(context);
057:                //Don't add GeometryInfoFrame because the HTML will probably be too
058:                // much for the editor pane (too many features). [Jon Aquino]
059:                final ViewAttributesFrame frame = new ViewAttributesFrame(
060:                        context.getSelectedLayer(0), context);
061:                context.getWorkbenchFrame().addInternalFrame(frame);
062:                return true;
063:            }
064:
065:            public MultiEnableCheck createEnableCheck(
066:                    final WorkbenchContext workbenchContext) {
067:                EnableCheckFactory checkFactory = new EnableCheckFactory(
068:                        workbenchContext);
069:                return new MultiEnableCheck()
070:                        .add(checkFactory.createTaskWindowMustBeActiveCheck())
071:                        .add(
072:                                checkFactory
073:                                        .createExactlyNLayersMustBeSelectedCheck(1));
074:            }
075:
076:            public ImageIcon getIcon() {
077:                return IconLoader.icon("Row.gif");
078:            }
079:
080:            public static class ViewAttributesFrame extends JInternalFrame
081:                    implements  LayerManagerProxy, SelectionManagerProxy,
082:                    LayerNamePanelProxy, TaskFrameProxy, LayerViewPanelProxy {
083:                private LayerManager layerManager;
084:                private OneLayerAttributeTab attributeTab;
085:
086:                public ViewAttributesFrame(Layer layer, PlugInContext context) {
087:                    this .layerManager = context.getLayerManager();
088:                    addInternalFrameListener(new InternalFrameAdapter() {
089:                        public void internalFrameClosed(InternalFrameEvent e) {
090:                            //Assume that there are no other views on the model [Jon
091:                            // Aquino]
092:                            attributeTab.getModel().dispose();
093:                        }
094:                    });
095:                    setResizable(true);
096:                    setClosable(true);
097:                    setMaximizable(true);
098:                    setIconifiable(true);
099:                    getContentPane().setLayout(new BorderLayout());
100:                    attributeTab = new OneLayerAttributeTab(context
101:                            .getWorkbenchContext(), ((TaskFrameProxy) context
102:                            .getActiveInternalFrame()).getTaskFrame(), this )
103:                            .setLayer(layer);
104:                    addInternalFrameListener(new InternalFrameAdapter() {
105:                        public void internalFrameOpened(InternalFrameEvent e) {
106:                            attributeTab.getToolBar().updateEnabledState();
107:                        }
108:                    });
109:                    getContentPane().add(attributeTab, BorderLayout.CENTER);
110:                    setSize(500, 300);
111:                    updateTitle(attributeTab.getLayer());
112:                    context.getLayerManager().addLayerListener(
113:                            new LayerListener() {
114:                                public void layerChanged(LayerEvent e) {
115:                                    if (attributeTab.getLayer() != null) {
116:                                        updateTitle(attributeTab.getLayer());
117:                                    }
118:                                }
119:
120:                                public void categoryChanged(CategoryEvent e) {
121:                                }
122:
123:                                public void featuresChanged(FeatureEvent e) {
124:                                }
125:                            });
126:                    Assert
127:                            .isTrue(
128:                                    !(this  instanceof  CloneableInternalFrame),
129:                                    I18N
130:                                            .get("ui.plugin.ViewAttributesPlugIn.there-can-be-no-other-views-on-the-InfoModels"));
131:                }
132:
133:                public LayerViewPanel getLayerViewPanel() {
134:                    return getTaskFrame().getLayerViewPanel();
135:                }
136:
137:                public LayerManager getLayerManager() {
138:                    return layerManager;
139:                }
140:
141:                private void updateTitle(Layer layer) {
142:                    String editView;
143:                    if (layer.isEditable()) {
144:                        editView = I18N
145:                                .get("ui.plugin.ViewAttributesPlugIn.edit");
146:                    } else {
147:                        editView = I18N
148:                                .get("ui.plugin.ViewAttributesPlugIn.view");
149:                    }
150:
151:                    setTitle(" "
152:                            + I18N
153:                                    .get("ui.plugin.ViewAttributesPlugIn.attributes")
154:                            + ": " + layer.getName());
155:                }
156:
157:                public TaskFrame getTaskFrame() {
158:                    return attributeTab.getTaskFrame();
159:                }
160:
161:                public SelectionManager getSelectionManager() {
162:                    return attributeTab.getPanel().getSelectionManager();
163:                }
164:
165:                public LayerNamePanel getLayerNamePanel() {
166:                    return attributeTab;
167:                }
168:            }
169:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.