cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r905616 [4/6] - in /cayenne/main/trunk/framework: cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/event/ cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/project/ cayenne-jdk1.5-unpublished/src/main/java/org/apach...
Date Tue, 02 Feb 2010 13:08:18 GMT
Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableAttributeTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableAttributeTab.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableAttributeTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableAttributeTab.java Tue Feb  2 13:06:56 2010
@@ -32,6 +32,7 @@
 import javax.swing.event.ListSelectionListener;
 import javax.swing.table.TableColumn;
 
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Embeddable;
 import org.apache.cayenne.map.EmbeddableAttribute;
@@ -160,7 +161,7 @@
                 mediator.getCurrentEmbeddable(),
                 attrs,
                 mediator.getCurrentDataMap(),
-                mediator.getCurrentDataDomain());
+                (DataChannelDescriptor)mediator.getProject().getRootNode());
 
         mediator.fireEmbeddableAttributeDisplayEvent(ev);
     }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableTab.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableTab.java Tue Feb  2 13:06:56 2010
@@ -27,7 +27,7 @@
 import javax.swing.JTextField;
 import javax.swing.JToolBar;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Embeddable;
 import org.apache.cayenne.map.ObjAttribute;
@@ -90,8 +90,7 @@
 
     public void processExistingSelection(EventObject e) {
         EmbeddableDisplayEvent ede = new EmbeddableDisplayEvent(this, mediator
-                .getCurrentEmbeddable(), mediator.getCurrentDataMap(), mediator
-                .getCurrentDataDomain());
+                .getCurrentEmbeddable(), mediator.getCurrentDataMap(), (DataChannelDescriptor)mediator.getProject().getRootNode());
         mediator.fireEmbeddableDisplayEvent(ede);
     }
 
@@ -116,7 +115,7 @@
         else if (embeddable.getDataMap().getEmbeddable(newClassName) == null) {
             
             // if newClassName dupliucates in other DataMaps 
-            DataDomain domain = mediator.getCurrentDataDomain();
+            DataChannelDescriptor domain = (DataChannelDescriptor) mediator.getProject().getRootNode();
             if (domain != null) {
                 for (DataMap nextMap : domain.getDataMaps()) {
                     if (nextMap == embeddable.getDataMap()) {
@@ -141,7 +140,7 @@
 
             mediator.fireEmbeddableEvent(e, mediator.getCurrentDataMap());
 
-            Iterator it = mediator.getCurrentDataDomain().getDataMaps().iterator();
+            Iterator it =((DataChannelDescriptor) mediator.getProject().getRootNode()).getDataMaps().iterator();
             while (it.hasNext()) {
                 DataMap dataMap = (DataMap) it.next();
                 Iterator<ObjEntity> ent = dataMap.getObjEntities().iterator();

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjAttributeTableModel.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjAttributeTableModel.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjAttributeTableModel.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjAttributeTableModel.java Tue Feb  2 13:06:56 2010
@@ -28,6 +28,8 @@
 
 import javax.swing.DefaultCellEditor;
 import javax.swing.JComboBox;
+
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.dba.TypesMapping;
 import org.apache.cayenne.map.Attribute;
 import org.apache.cayenne.map.DbAttribute;
@@ -303,8 +305,7 @@
                 mediator.fireObjEntityEvent(new EntityEvent(this, ent, MapEvent.CHANGE));
 
                 EntityDisplayEvent ev = new EntityDisplayEvent(this, mediator
-                        .getCurrentObjEntity(), mediator.getCurrentDataMap(), mediator
-                        .getCurrentDataDomain());
+                        .getCurrentObjEntity(), mediator.getCurrentDataMap(), (DataChannelDescriptor)mediator.getProject().getRootNode());
 
                 mediator.fireObjEntityDisplayEvent(ev);
 
@@ -319,7 +320,7 @@
                         attributeNew,
                         mediator.getCurrentObjEntity(),
                         mediator.getCurrentDataMap(),
-                        mediator.getCurrentDataDomain());
+                        (DataChannelDescriptor)mediator.getProject().getRootNode());
 
                 mediator.fireObjAttributeDisplayEvent(eventAttr);
             }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java Tue Feb  2 13:06:56 2010
@@ -47,6 +47,7 @@
 import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.TableColumn;
 
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Embeddable;
 import org.apache.cayenne.map.ObjAttribute;
@@ -86,7 +87,7 @@
     protected ProjectController mediator;
     protected CayenneTable table;
     private TableColumnPreferences tablePreferences;
-    
+
     JButton resolve;
 
     public ObjEntityAttributeTab(ProjectController mediator) {
@@ -123,8 +124,10 @@
 
         table = new CayenneTable();
         table.setDefaultRenderer(String.class, new CellRenderer());
-        
-        tablePreferences = new TableColumnPreferences(ObjAttributeTableModel.class, "objEntity/attributeTable");
+
+        tablePreferences = new TableColumnPreferences(
+                ObjAttributeTableModel.class,
+                "objEntity/attributeTable");
 
         /**
          * Create and install a popup
@@ -192,7 +195,9 @@
         List<String> embeddableNames = new ArrayList<String>();
         List<String> typeNames = new ArrayList<String>();
 
-        Iterator it = mediator.getCurrentDataDomain().getDataMaps().iterator();
+        Iterator it = ((DataChannelDescriptor) mediator.getProject().getRootNode())
+                .getDataMaps()
+                .iterator();
         while (it.hasNext()) {
             DataMap dataMap = (DataMap) it.next();
             Iterator<Embeddable> embs = dataMap.getEmbeddables().iterator();
@@ -201,17 +206,18 @@
                 embeddableNames.add(emb.getClassName());
             }
         }
-        
+
         String[] registeredTypes = ModelerUtil.getRegisteredTypeNames();
-        for(int i=0; i< registeredTypes.length; i++){
+        for (int i = 0; i < registeredTypes.length; i++) {
             typeNames.add(registeredTypes[i]);
         }
         typeNames.addAll(embeddableNames);
-     
+
         TableColumn typeColumn = table.getColumnModel().getColumn(
                 ObjAttributeTableModel.OBJ_ATTRIBUTE_TYPE);
 
-        JComboBox javaTypesCombo = CayenneWidgetFactory.createComboBox(typeNames.toArray(), false);
+        JComboBox javaTypesCombo = CayenneWidgetFactory.createComboBox(typeNames
+                .toArray(), false);
         AutoCompletion.enable(javaTypesCombo, false, true);
         typeColumn.setCellEditor(CayenneWidgetFactory.createCellEditor(javaTypesCombo));
 
@@ -277,9 +283,12 @@
             resolve.setEnabled(false);
         }
 
-        AttributeDisplayEvent ev = new AttributeDisplayEvent(this, attrs, mediator
-                .getCurrentObjEntity(), mediator.getCurrentDataMap(), mediator
-                .getCurrentDataDomain());
+        AttributeDisplayEvent ev = new AttributeDisplayEvent(
+                this,
+                attrs,
+                mediator.getCurrentObjEntity(),
+                mediator.getCurrentDataMap(),
+                (DataChannelDescriptor) mediator.getProject().getRootNode());
 
         mediator.fireObjAttributeDisplayEvent(ev);
     }
@@ -330,18 +339,24 @@
     }
 
     protected void setUpTableStructure(ObjAttributeTableModel model) {
-       
+
         int inheritanceColumnWidth = 30;
-               
+
         Map<Integer, Integer> minSizes = new HashMap<Integer, Integer>();
         Map<Integer, Integer> maxSizes = new HashMap<Integer, Integer>();
-        
+
         minSizes.put(ObjAttributeTableModel.INHERITED, inheritanceColumnWidth);
         maxSizes.put(ObjAttributeTableModel.INHERITED, inheritanceColumnWidth);
-        
+
         initComboBoxes(model);
 
-        tablePreferences.bind(table, minSizes, maxSizes, null, ObjAttributeTableModel.OBJ_ATTRIBUTE, true);
+        tablePreferences.bind(
+                table,
+                minSizes,
+                maxSizes,
+                null,
+                ObjAttributeTableModel.OBJ_ATTRIBUTE,
+                true);
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipTab.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipTab.java Tue Feb  2 13:06:56 2010
@@ -47,6 +47,7 @@
 import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.TableColumn;
 
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DeleteRule;
 import org.apache.cayenne.map.ObjEntity;
@@ -265,8 +266,7 @@
         resolveMenu.setEnabled(resolve.isEnabled());
 
         RelationshipDisplayEvent ev = new RelationshipDisplayEvent(this, rels, mediator
-                .getCurrentObjEntity(), mediator.getCurrentDataMap(), mediator
-                .getCurrentDataDomain());
+                .getCurrentObjEntity(), mediator.getCurrentDataMap(), (DataChannelDescriptor)mediator.getProject().getRootNode());
 
         mediator.fireObjRelationshipDisplayEvent(ev);
     }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java Tue Feb  2 13:06:56 2010
@@ -38,7 +38,7 @@
 import javax.swing.JTextField;
 import javax.swing.JToolBar;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
@@ -295,7 +295,7 @@
                     // fire both EntityEvent and EntityDisplayEvent;
                     // the later is to update attribute and relationship display
 
-                    DataDomain domain = mediator.getCurrentDataDomain();
+                    DataChannelDescriptor domain = (DataChannelDescriptor)mediator.getProject().getRootNode();
                     DataMap map = mediator.getCurrentDataMap();
 
                     mediator.fireObjEntityEvent(new EntityEvent(this, entity));
@@ -314,7 +314,7 @@
                 // Jump to DbEntity of the current ObjEntity
                 DbEntity entity = mediator.getCurrentObjEntity().getDbEntity();
                 if (entity != null) {
-                    DataDomain dom = mediator.getCurrentDataDomain();
+                    DataChannelDescriptor dom = (DataChannelDescriptor)mediator.getProject().getRootNode();
                     mediator.fireDbEntityDisplayEvent(new EntityDisplayEvent(
                             this,
                             entity,
@@ -432,7 +432,7 @@
 
         // init DbEntities
         DataMap map = mediator.getCurrentDataMap();
-        Object[] dbEntities = map.getNamespace().getDbEntities().toArray();
+        Object[] dbEntities = map.getDbEntities().toArray();
         Arrays.sort(dbEntities, Comparators.getDataMapChildrenComparator());
 
         DefaultComboBoxModel dbModel = new DefaultComboBoxModel(dbEntities);
@@ -463,7 +463,7 @@
         };
 
         Object[] objEntities = CollectionUtils.select(
-                map.getNamespace().getObjEntities(),
+                map.getObjEntities(),
                 inheritanceFilter).toArray();
         Arrays.sort(objEntities, Comparators.getDataMapChildrenComparator());
         Object[] finalObjEntities = new Object[objEntities.length + 1];
@@ -629,8 +629,7 @@
     public void processExistingSelection(EventObject e) {
 
         EntityDisplayEvent ede = new EntityDisplayEvent(this, mediator
-                .getCurrentObjEntity(), mediator.getCurrentDataMap(), mediator
-                .getCurrentDataDomain());
+                .getCurrentObjEntity(), mediator.getCurrentDataMap(), (DataChannelDescriptor)mediator.getProject().getRootNode());
         mediator.fireObjEntityDisplayEvent(ede);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTab.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTab.java Tue Feb  2 13:06:56 2010
@@ -40,6 +40,7 @@
 import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.TableColumn;
 
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.event.ProcedureEvent;
 import org.apache.cayenne.configuration.event.ProcedureParameterEvent;
 import org.apache.cayenne.configuration.event.ProcedureParameterListener;
@@ -234,7 +235,7 @@
                 parameters,
                 eventController.getCurrentProcedure(),
                 eventController.getCurrentDataMap(),
-                eventController.getCurrentDataDomain());
+                (DataChannelDescriptor)eventController.getProject().getRootNode());
         eventController.fireProcedureParameterDisplayEvent(ppde);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureTab.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureTab.java Tue Feb  2 13:06:56 2010
@@ -29,6 +29,7 @@
 import javax.swing.JPanel;
 import javax.swing.JTextField;
 
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.event.ProcedureEvent;
 import org.apache.cayenne.map.Procedure;
 import org.apache.cayenne.modeler.ProjectController;
@@ -129,7 +130,7 @@
                 this,
                 eventController.getCurrentProcedure(),
                 eventController.getCurrentDataMap(),
-                eventController.getCurrentDataDomain());
+                (DataChannelDescriptor)eventController.getProject().getRootNode());
         eventController.fireProcedureDisplayEvent(pde);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/RawQueryPropertiesPanel.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/RawQueryPropertiesPanel.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/RawQueryPropertiesPanel.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/RawQueryPropertiesPanel.java Tue Feb  2 13:06:56 2010
@@ -30,7 +30,9 @@
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
 
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.util.CayenneWidgetFactory;
@@ -122,9 +124,8 @@
      */
     public void initFromModel(Query query) {
         super.initFromModel(query);
-
-        boolean fetchingDO = !query.getMetaData(
-                mediator.getCurrentDataDomain().getEntityResolver()).isFetchingDataRows();
+        EntityResolver entRes = new EntityResolver(((DataChannelDescriptor)mediator.getProject().getRootNode()).getDataMaps());
+        boolean fetchingDO = !query.getMetaData(entRes).isFetchingDataRows();
         dataObjects.setSelected(fetchingDO);
 
         // TODO: now we only allow ObjEntities from the current map,

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/AdapterEditor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/AdapterEditor.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/AdapterEditor.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/AdapterEditor.java Tue Feb  2 13:06:56 2010
@@ -23,15 +23,12 @@
 import java.awt.event.ComponentAdapter;
 import java.awt.event.ComponentEvent;
 
-import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.configuration.event.DataNodeEvent;
-import org.apache.cayenne.dba.AutoAdapter;
-import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.event.DataNodeDisplayEvent;
 import org.apache.cayenne.modeler.event.DataNodeDisplayListener;
 import org.apache.cayenne.modeler.util.CayenneController;
-import org.apache.cayenne.modeler.util.ModelerDbAdapter;
 import org.apache.cayenne.swing.BindingBuilder;
 import org.apache.cayenne.swing.ObjectBinding;
 
@@ -40,7 +37,7 @@
 public class AdapterEditor extends CayenneController {
 
     protected AdapterView view;
-    protected DataNode node;
+    protected DataNodeDescriptor node;
     protected ObjectBinding adapterNameBinding;
 
     public AdapterEditor(CayenneController parent) {
@@ -78,10 +75,10 @@
         });
     }
 
-    protected void refreshView(DataNode node) {
-        this.node = node;
+    protected void refreshView(DataNodeDescriptor dataNodeDescriptor) {
+        this.node = dataNodeDescriptor;
 
-        if (node == null) {
+        if (dataNodeDescriptor == null) {
             getView().setVisible(false);
             return;
         }
@@ -97,25 +94,8 @@
         if (node == null) {
             return null;
         }
-
-        DbAdapter adapter = node.getAdapter();
-
-        // TODO, Andrus, 11/3/2005 - to simplify this logic, it would be nice to
-        // consistently load CustomDbAdapter... this would require an ability to set a
-        // load delegate in OpenProjectAction
-        if (adapter == null) {
-            return null;
-        }
-        else if (adapter instanceof ModelerDbAdapter) {
-            return ((ModelerDbAdapter) adapter).getAdapterClassName();
-        }
-        // don't do "instanceof" here, as we maybe dealing with a custom subclass...
-        else if (adapter.getClass() == AutoAdapter.class) {
-            return null;
-        }
-        else {
-            return adapter.getClass().getName();
-        }
+        
+        return node.getAdapterType();
     }
 
     public void setAdapterName(String name) {
@@ -123,9 +103,9 @@
             return;
         }
 
-        ModelerDbAdapter adapter = new ModelerDbAdapter(name, node.getDataSource());
-        adapter.validate();
-        node.setAdapter(adapter);
+//        ModelerDbAdapter adapter = new ModelerDbAdapter(name, node.getDataSource());
+//        adapter.validate();
+        node.setAdapterType(name);
         
         DataNodeEvent e = new DataNodeEvent(AdapterEditor.this, node);
         ((ProjectController) getParent()).fireDataNodeEvent(e);

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/CustomDataSourceEditor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/CustomDataSourceEditor.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/CustomDataSourceEditor.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/CustomDataSourceEditor.java Tue Feb  2 13:06:56 2010
@@ -43,7 +43,7 @@
         fieldAdapters = new ObjectBinding[1];
         fieldAdapters[0] = builder.bindToTextField(
                 view.getLocationHint(),
-                "node.dataSourceLocation");
+                "node.parameters");
     }
 
     public Component getView() {

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/DBCPDataSourceEditor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/DBCPDataSourceEditor.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/DBCPDataSourceEditor.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/DBCPDataSourceEditor.java Tue Feb  2 13:06:56 2010
@@ -43,7 +43,7 @@
         fieldAdapters = new ObjectBinding[1];
         fieldAdapters[0] = builder.bindToTextField(
                 view.getPropertiesFile(),
-                "node.dataSourceLocation");
+                "node.parameters");
     }
 
     public Component getView() {

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/DataSourceEditor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/DataSourceEditor.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/DataSourceEditor.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/DataSourceEditor.java Tue Feb  2 13:06:56 2010
@@ -19,7 +19,7 @@
 
 package org.apache.cayenne.modeler.editor.datanode;
 
-import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.util.CayenneController;
 import org.apache.cayenne.swing.BindingBuilder;
@@ -32,7 +32,7 @@
 public abstract class DataSourceEditor extends CayenneController {
 
     protected ObjectBinding[] fieldAdapters;
-    protected DataNode node;
+    protected DataNodeDescriptor node;
     protected BindingDelegate nodeChangeProcessor;
 
     public DataSourceEditor(ProjectController controller,
@@ -44,11 +44,11 @@
 
    
 
-    public DataNode getNode() {
+    public DataNodeDescriptor getNode() {
         return node;
     }
 
-    public void setNode(DataNode node) {
+    public void setNode(DataNodeDescriptor node) {
         if (!Util.nullSafeEquals(this.node, node)) {
             this.node = node;
 

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/JDBCDataSourceEditor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/JDBCDataSourceEditor.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/JDBCDataSourceEditor.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/JDBCDataSourceEditor.java Tue Feb  2 13:06:56 2010
@@ -21,10 +21,10 @@
 
 import java.awt.Component;
 
+import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.modeler.CayenneModelerController;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.pref.DBConnectionInfo;
-import org.apache.cayenne.project.ProjectDataSource;
 import org.apache.cayenne.swing.BindingBuilder;
 import org.apache.cayenne.swing.BindingDelegate;
 import org.apache.cayenne.swing.ObjectBinding;
@@ -49,17 +49,17 @@
         
         fieldAdapters = new ObjectBinding[6];
         fieldAdapters[0] =
-          builder.bindToTextField(view.getUserName(), "node.dataSource.dataSourceInfo.userName");
+          builder.bindToTextField(view.getUserName(), "node.dataSourceDescriptor.userName");
         fieldAdapters[1] =
-          builder.bindToTextField(view.getPassword(), "node.dataSource.dataSourceInfo.password");
+          builder.bindToTextField(view.getPassword(), "node.dataSourceDescriptor.password");
         fieldAdapters[2] =
-          builder.bindToTextField(view.getUrl(), "node.dataSource.dataSourceInfo.dataSourceUrl");
+          builder.bindToTextField(view.getUrl(), "node.dataSourceDescriptor.dataSourceUrl");
         fieldAdapters[3] =
-          builder.bindToTextField(view.getDriver(), "node.dataSource.dataSourceInfo.jdbcDriver");
+          builder.bindToTextField(view.getDriver(), "node.dataSourceDescriptor.jdbcDriver");
         fieldAdapters[4] =
-          builder.bindToTextField(view.getMaxConnections(), "node.dataSource.dataSourceInfo.maxConnections");
+          builder.bindToTextField(view.getMaxConnections(), "node.dataSourceDescriptor.maxConnections");
         fieldAdapters[5] =
-          builder.bindToTextField(view.getMinConnections(), "node.dataSource.dataSourceInfo.minConnections");
+          builder.bindToTextField(view.getMinConnections(), "node.dataSourceDescriptor.minConnections");
         
 
         builder.bindToAction(view.getSyncWithLocal(),    "syncDataSourceAction()");
@@ -76,11 +76,11 @@
     public void syncDataSourceAction() {
         CayenneModelerController mainController = getApplication().getFrameController();
 
-        if (getNode() == null || getNode().getDataSource() == null) {
+        if (getNode() == null || getNode().getDataSourceDescriptor() == null) {
             return;
         }
 
-        ProjectDataSource projectDS = (ProjectDataSource) getNode().getDataSource();
+        DataSourceInfo projectDSI = getNode().getDataSourceDescriptor();
 
         ProjectController parent = (ProjectController) getParent();
         String key = parent.getDataNodePreferences().getLocalDataSource();
@@ -95,7 +95,7 @@
             .getObject(key);
 
         if (dataSource != null) {
-            if (dataSource.copyTo(projectDS.getDataSourceInfo())) {
+            if (dataSource.copyTo(projectDSI)) {
                 refreshView();
                 super.nodeChangeProcessor.modelUpdated(null, null, null);
                 mainController.updateStatus(null);

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/JNDIDataSourceEditor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/JNDIDataSourceEditor.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/JNDIDataSourceEditor.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/JNDIDataSourceEditor.java Tue Feb  2 13:06:56 2010
@@ -47,6 +47,6 @@
         fieldAdapters = new ObjectBinding[1];
         fieldAdapters[0] = builder.bindToTextField(
                 view.getJndiPath(),
-                "node.dataSourceLocation");
+                "node.parameters");
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/MainDataNodeEditor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/MainDataNodeEditor.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/MainDataNodeEditor.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/MainDataNodeEditor.java Tue Feb  2 13:06:56 2010
@@ -23,23 +23,25 @@
 import java.awt.event.ComponentAdapter;
 import java.awt.event.ComponentEvent;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
 import javax.swing.DefaultComboBoxModel;
 
-import org.apache.cayenne.access.DataDomain;
-import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy;
 import org.apache.cayenne.access.dbsync.ThrowOnPartialOrCreateSchemaStrategy;
 import org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy;
 import org.apache.cayenne.access.dbsync.ThrowOnPartialSchemaStrategy;
-import org.apache.cayenne.conf.Configuration;
 import org.apache.cayenne.conf.DBCPDataSourceFactory;
 import org.apache.cayenne.conf.DriverDataSourceFactory;
 import org.apache.cayenne.conf.JNDIDataSourceFactory;
 import org.apache.cayenne.configuration.event.DataNodeEvent;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
+import org.apache.cayenne.configuration.DataNodeDescriptor;
+import org.apache.cayenne.modeler.Application;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.dialog.pref.PreferenceDialog;
 import org.apache.cayenne.modeler.event.DataNodeDisplayEvent;
@@ -47,7 +49,6 @@
 import org.apache.cayenne.modeler.pref.DBConnectionInfo;
 import org.apache.cayenne.modeler.util.CayenneController;
 import org.apache.cayenne.modeler.util.ProjectUtil;
-import org.apache.cayenne.project.ApplicationProject;
 import org.apache.cayenne.swing.BindingBuilder;
 import org.apache.cayenne.swing.BindingDelegate;
 import org.apache.cayenne.swing.ObjectBinding;
@@ -75,7 +76,7 @@
 
     protected MainDataNodeView view;
     protected DataNodeEditor tabbedPaneController;
-    protected DataNode node;
+    protected DataNodeDescriptor node;
     protected Map datasourceEditors;
     protected List localDataSources;
 
@@ -121,23 +122,23 @@
     }
 
     public String getFactoryName() {
-        return (node != null) ? node.getDataSourceFactory() : null;
+        return (node != null) ? node.getDataSourceFactoryType() : null;
     }
 
     public void setFactoryName(String factoryName) {
         if (node != null) {
-            node.setDataSourceFactory(factoryName);
+            node.setDataSourceFactoryType(factoryName);
             showDataSourceSubview(factoryName);
         }
     }
 
     public String getSchemaUpdateStrategy() {
-        return (node != null) ? node.getSchemaUpdateStrategyName() : null;
+        return (node != null) ? node.getSchemaUpdateStrategyType() : null;
     }
 
     public void setSchemaUpdateStrategy(String schemaUpdateStrategy) {
         if (node != null) {
-            node.setSchemaUpdateStrategyName(schemaUpdateStrategy);
+            node.setSchemaUpdateStrategyType(schemaUpdateStrategy);
         }
     }
 
@@ -156,36 +157,28 @@
         }
 
         ProjectController parent = (ProjectController) getParent();
-        Configuration config = ((ApplicationProject) parent.getProject())
-                .getConfiguration();
+        DataChannelDescriptor dataChannelDescriptor = (DataChannelDescriptor)Application.getProject().getRootNode();
 
-        DataNode matchingNode = null;
+        Collection<DataNodeDescriptor> matchingNode = dataChannelDescriptor.getNodeDescriptors();
 
-        for (DataDomain domain : config.getDomains()) {
-            DataNode nextNode = domain.getNode(newName);
-
-            if (nextNode == node) {
-                continue;
-            }
-
-            if (nextNode != null) {
-                matchingNode = nextNode;
-                break;
-            }
-        }
-
-        if (matchingNode != null) {
-            // there is an entity with the same name
-            throw new ValidationException("There is another DataNode named '"
-                    + newName
-                    + "'. Use a different name.");
+        Iterator<DataNodeDescriptor> it = matchingNode.iterator();
+        while (it.hasNext()) {
+            DataNodeDescriptor node = it.next();
+            if (node.getName().equals(newName)) {
+                // there is an entity with the same name
+                throw new ValidationException("There is another DataNode named '"
+                        + newName
+                        + "'. Use a different name.");
+            } 
         }
+        
+        
 
         // passed validation, set value...
 
         // TODO: fixme....there is a slight chance that domain is different than the one
         // cached node belongs to
-        ProjectUtil.setDataNodeName(parent.getCurrentDataDomain(), node, newName);
+        ProjectUtil.setDataNodeName((DataChannelDescriptor)parent.getProject().getRootNode(), node, newName);
     }
 
     // ======== other stuff
@@ -276,7 +269,7 @@
     /**
      * Reinitializes widgets to display selected DataNode.
      */
-    protected void refreshView(DataNode node) {
+    protected void refreshView(DataNodeDescriptor node) {
         this.node = node;
 
         if (node == null) {

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/PasswordEncoderEditor.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/PasswordEncoderEditor.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/PasswordEncoderEditor.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/datanode/PasswordEncoderEditor.java Tue Feb  2 13:06:56 2010
@@ -24,21 +24,20 @@
 
 import javax.swing.JOptionPane;
 
-import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.configuration.event.DataNodeEvent;
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.event.DataNodeDisplayEvent;
 import org.apache.cayenne.modeler.event.DataNodeDisplayListener;
 import org.apache.cayenne.modeler.util.CayenneController;
-import org.apache.cayenne.project.ProjectDataSource;
 import org.apache.cayenne.swing.BindingBuilder;
 import org.apache.cayenne.swing.BindingDelegate;
 import org.apache.cayenne.swing.ObjectBinding;
 
 public class PasswordEncoderEditor extends CayenneController {
 
-    protected DataNode node;
+    protected DataNodeDescriptor node;
     protected ObjectBinding[] bindings;
     protected PasswordEncoderView view;
     protected BindingDelegate nodeChangeProcessor;
@@ -75,16 +74,16 @@
 
         bindings[0] = builder.bindToComboSelection(
                 view.getPasswordEncoder(),
-                "node.dataSource.dataSourceInfo.passwordEncoderClass");
+                "node.dataSourceDescriptor.passwordEncoderClass");
         bindings[1] = builder.bindToTextField(
                 view.getPasswordKey(),
-                "node.dataSource.dataSourceInfo.passwordEncoderKey");
+                "node.dataSourceDescriptor.passwordEncoderKey");
         bindings[2] = builder.bindToComboSelection(
                 view.getPasswordLocation(),
-                "node.dataSource.dataSourceInfo.passwordLocation");
+                "node.dataSourceDescriptor.passwordLocation");
         bindings[3] = builder.bindToTextField(
                 view.getPasswordSource(),
-                "node.dataSource.dataSourceInfo.passwordSource");
+                "node.dataSourceDescriptor.passwordSource");
 
         ((ProjectController) getParent())
                 .addDataNodeDisplayListener(new DataNodeDisplayListener() {
@@ -112,10 +111,10 @@
 
     }
 
-    protected void refreshView(DataNode node) {
-        this.node = node;
+    protected void refreshView(DataNodeDescriptor dataNodeDescriptor) {
+        this.node = dataNodeDescriptor;
 
-        if (node == null) {
+        if (dataNodeDescriptor == null || dataNodeDescriptor.getDataSourceDescriptor() == null) {
             getView().setVisible(false);
             return;
         }
@@ -126,11 +125,10 @@
     }
 
     public void validatePasswordEncoderAction() {
-        if (node == null || node.getDataSource() == null)
+        if (node == null || node.getDataSourceDescriptor() == null)
             return;
 
-        DataSourceInfo dsi = ((ProjectDataSource) node.getDataSource())
-                .getDataSourceInfo();
+        DataSourceInfo dsi = node.getDataSourceDescriptor();
 
         if (view.getPasswordEncoder().getSelectedItem().equals(
                 dsi.getPasswordEncoderClass()) == false)
@@ -159,11 +157,10 @@
     }
 
     public void passwordLocationChangedAction() {
-        if (node == null || node.getDataSource() == null)
+        if (node == null || node.getDataSourceDescriptor() == null)
             return;
 
-        DataSourceInfo dsi = ((ProjectDataSource) node.getDataSource())
-                .getDataSourceInfo();
+        DataSourceInfo dsi = node.getDataSourceDescriptor();
 
         String selectedItem = (String) view.getPasswordLocation().getSelectedItem();
 
@@ -193,11 +190,11 @@
         return view;
     }
 
-    public DataNode getNode() {
+    public DataNodeDescriptor getNode() {
         return node;
     }
 
-    public void setNode(DataNode node) {
+    public void setNode(DataNodeDescriptor node) {
         this.node = node;
     }
 

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java Tue Feb  2 13:06:56 2010
@@ -21,9 +21,7 @@
 
 import java.awt.BorderLayout;
 import java.util.EventObject;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import javax.swing.JComboBox;
 import javax.swing.JPanel;
@@ -32,10 +30,9 @@
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
-import javax.swing.table.JTableHeader;
 import javax.swing.table.TableColumn;
-import javax.swing.table.TableColumnModel;
 
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.dba.TypesMapping;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
@@ -180,7 +177,7 @@
                attrs,
                mediator.getCurrentDbEntity(),
                mediator.getCurrentDataMap(),
-               mediator.getCurrentDataDomain()));
+               (DataChannelDescriptor)mediator.getProject().getRootNode()));
     }
 
     public void dbAttributeChanged(AttributeEvent e) {

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipTab.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipTab.java Tue Feb  2 13:06:56 2010
@@ -41,6 +41,7 @@
 import javax.swing.event.TableModelListener;
 import javax.swing.table.TableColumn;
 
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbRelationship;
@@ -242,8 +243,7 @@
         resolveMenu.setEnabled(resolve.isEnabled());
 
         RelationshipDisplayEvent ev = new RelationshipDisplayEvent(this, rels, mediator
-                .getCurrentDbEntity(), mediator.getCurrentDataMap(), mediator
-                .getCurrentDataDomain());
+                .getCurrentDbEntity(), mediator.getCurrentDataMap(), (DataChannelDescriptor)mediator.getProject().getRootNode());
 
         mediator.fireDbRelationshipDisplayEvent(ev);
     }
@@ -363,7 +363,7 @@
      */
     private ComboBoxModel createComboModel(Entity entity) {
         DataMap map = entity.getDataMap();
-        Object[] objects = map.getNamespace().getDbEntities().toArray();
+        Object[] objects = map.getDbEntities().toArray();
         return new DefaultComboBoxModel(objects);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityTab.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityTab.java Tue Feb  2 13:06:56 2010
@@ -32,6 +32,7 @@
 import javax.swing.JTextField;
 import javax.swing.JToolBar;
 
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
@@ -187,8 +188,7 @@
 
     public void processExistingSelection(EventObject e) {
         EntityDisplayEvent ede = new EntityDisplayEvent(this, mediator
-                .getCurrentDbEntity(), mediator.getCurrentDataMap(), mediator
-                .getCurrentDataDomain());
+                .getCurrentDbEntity(), mediator.getCurrentDataMap(), (DataChannelDescriptor)mediator.getProject().getRootNode());
         mediator.fireDbEntityDisplayEvent(ede);
     }
 

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbRelationshipTableModel.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbRelationshipTableModel.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbRelationshipTableModel.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbRelationshipTableModel.java Tue Feb  2 13:06:56 2010
@@ -23,7 +23,8 @@
 
 import javax.swing.JOptionPane;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
+import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbRelationship;
 import org.apache.cayenne.map.ObjEntity;
@@ -187,18 +188,22 @@
 
     void updateDependentObjRelationships(DbRelationship relationship) {
 
-        DataDomain domain = mediator.getCurrentDataDomain();
+        DataChannelDescriptor domain = (DataChannelDescriptor) mediator
+                .getProject()
+                .getRootNode();
         if (domain != null) {
 
-            for (ObjEntity entity : domain.getEntityResolver().getObjEntities()) {
-                for (ObjRelationship objRelationship : entity.getRelationships()) {
-
-                    for (DbRelationship dbRelationship : objRelationship
-                            .getDbRelationships()) {
-                        if (dbRelationship == relationship) {
-                            objRelationship.recalculateToManyValue();
-                            objRelationship.recalculateReadOnlyValue();
-                            break;
+            for (DataMap map : domain.getDataMaps()) {
+                for (ObjEntity entity : map.getObjEntities()) {
+                    for (ObjRelationship objRelationship : entity.getRelationships()) {
+
+                        for (DbRelationship dbRelationship : objRelationship
+                                .getDbRelationships()) {
+                            if (dbRelationship == relationship) {
+                                objRelationship.recalculateToManyValue();
+                                objRelationship.recalculateReadOnlyValue();
+                                break;
+                            }
                         }
                     }
                 }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/AttributeDisplayEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/AttributeDisplayEvent.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/AttributeDisplayEvent.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/AttributeDisplayEvent.java Tue Feb  2 13:06:56 2010
@@ -19,7 +19,7 @@
  ****************************************************************/
 
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.Attribute;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Entity;
@@ -35,7 +35,7 @@
             Attribute attribute,
             Entity entity,
             DataMap dataMap,
-            DataDomain domain) {
+            DataChannelDescriptor domain) {
         
             super(src, entity, dataMap, domain);
             attributes = new Attribute[] { attribute };
@@ -46,7 +46,7 @@
         Attribute[] attributes,
         Entity entity,
         DataMap dataMap,
-        DataDomain domain) {
+        DataChannelDescriptor domain) {
 
         super(src, entity, dataMap, domain);
         this.attributes = attributes;

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataMapDisplayEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataMapDisplayEvent.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataMapDisplayEvent.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataMapDisplayEvent.java Tue Feb  2 13:06:56 2010
@@ -19,8 +19,8 @@
  ****************************************************************/
 
 
-import org.apache.cayenne.access.DataDomain;
-import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
+import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.map.DataMap;
 
 /**
@@ -33,17 +33,17 @@
 	/** True if different from current data map. */
 	protected boolean dataMapChanged = true;
 
-	public DataMapDisplayEvent(Object src, DataMap map, DataDomain domain) {
-		this(src, map, domain, null);
+	public DataMapDisplayEvent(Object src, DataMap map, DataChannelDescriptor dataChannelDescriptor) {
+		this(src, map, dataChannelDescriptor, null);
 	}
 
 	public DataMapDisplayEvent(
 		Object src,
 		DataMap map,
-		DataDomain domain,
-		DataNode node) {
+		DataChannelDescriptor dataChannelDescriptor,
+		DataNodeDescriptor node) {
 
-		super(src, domain, node);
+		super(src, dataChannelDescriptor, node);
 		this.dataMap = map;
 		setDataNodeChanged(false);
 	}

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataNodeDisplayEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataNodeDisplayEvent.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataNodeDisplayEvent.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataNodeDisplayEvent.java Tue Feb  2 13:06:56 2010
@@ -19,8 +19,8 @@
 
 package org.apache.cayenne.modeler.event;
 
-import org.apache.cayenne.access.DataDomain;
-import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
+import org.apache.cayenne.configuration.DataNodeDescriptor;
 
 /**
  * Represents a display event of a DataNode.
@@ -28,20 +28,20 @@
  */
 public class DataNodeDisplayEvent extends DomainDisplayEvent {
 
-	protected DataNode dataNode;
+	protected DataNodeDescriptor dataNode;
 	
 	/** True if data node is different from the current data node. */
 	protected boolean dataNodeChanged = true;
 
 	/** Current DataNode changed. */
-	public DataNodeDisplayEvent(Object src, DataDomain domain, DataNode node) {
-		super(src, domain);
+	public DataNodeDisplayEvent(Object src, DataChannelDescriptor dataChannelDescriptor, DataNodeDescriptor node) {
+		super(src, dataChannelDescriptor);
 		this.dataNode = node;
 		setDomainChanged(false);
 	}
 
 	/** Get data node (data source) associated with this data map. */
-	public DataNode getDataNode() {
+	public DataNodeDescriptor getDataNode() {
 		return dataNode;
 	}
 
@@ -57,7 +57,7 @@
 	 * Sets the dataNode.
 	 * @param dataNode The dataNode to set
 	 */
-	public void setDataNode(DataNode dataNode) {
+	public void setDataNode(DataNodeDescriptor dataNode) {
 		this.dataNode = dataNode;
 	}
 

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DomainDisplayEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DomainDisplayEvent.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DomainDisplayEvent.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DomainDisplayEvent.java Tue Feb  2 13:06:56 2010
@@ -18,23 +18,23 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.event;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 
 /**
  * Represents a display event of a DataDomain.
  * 
  */
 public class DomainDisplayEvent extends DisplayEvent {
-	protected DataDomain domain;
+	protected DataChannelDescriptor domain;
 	protected boolean domainChanged = true;
 
-	public DomainDisplayEvent(Object src, DataDomain domain) {
+	public DomainDisplayEvent(Object src, DataChannelDescriptor domain) {
 		super(src);
 		this.domain = domain;
 	}
 
 	/** Get domain for this data map. */
-	public DataDomain getDomain() {
+	public DataChannelDescriptor getDomain() {
 		return domain;
 	}
 	
@@ -42,7 +42,7 @@
 	 * Sets the domain.
 	 * @param domain The domain to set
 	 */
-	public void setDomain(DataDomain domain) {
+	public void setDomain(DataChannelDescriptor domain) {
 		this.domain = domain;
 	}
 	

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EmbeddableAttributeDisplayEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EmbeddableAttributeDisplayEvent.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EmbeddableAttributeDisplayEvent.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EmbeddableAttributeDisplayEvent.java Tue Feb  2 13:06:56 2010
@@ -18,7 +18,7 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.event;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Embeddable;
 import org.apache.cayenne.map.EmbeddableAttribute;
@@ -28,16 +28,16 @@
     protected EmbeddableAttribute[] embeddableAttributes;
 
     public EmbeddableAttributeDisplayEvent(Object src, Embeddable embeddable,
-            EmbeddableAttribute attr, DataMap dataMap, DataDomain domain) {
+            EmbeddableAttribute attrs, DataMap dataMap, DataChannelDescriptor dataChannelDescriptor) {
 
-        super(src, embeddable, dataMap, domain);
+        super(src, embeddable, dataMap, dataChannelDescriptor);
         embeddableAttributes = new EmbeddableAttribute[] {
-            attr
+            attrs
         };
     }
 
     public EmbeddableAttributeDisplayEvent(Object src, Embeddable embeddable,
-            EmbeddableAttribute[] attr, DataMap dataMap, DataDomain domain) {
+            EmbeddableAttribute[] attr, DataMap dataMap, DataChannelDescriptor domain) {
         super(src, embeddable, dataMap, domain);
         this.embeddableAttributes = attr;
     }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EmbeddableDisplayEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EmbeddableDisplayEvent.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EmbeddableDisplayEvent.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EmbeddableDisplayEvent.java Tue Feb  2 13:06:56 2010
@@ -18,7 +18,7 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.event;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Embeddable;
 
@@ -30,8 +30,8 @@
     protected boolean mainTabFocus;
 
     public EmbeddableDisplayEvent(Object src, Embeddable embeddable, DataMap dataMap,
-            DataDomain dataDomain) {
-        super(src, dataMap, dataDomain);
+            DataChannelDescriptor dataChannelDescriptor) {
+        super(src, dataMap, dataChannelDescriptor);
         this.embeddable = embeddable;
         setDataMapChanged(false);
     }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EntityDisplayEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EntityDisplayEvent.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EntityDisplayEvent.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EntityDisplayEvent.java Tue Feb  2 13:06:56 2010
@@ -19,8 +19,8 @@
 
 package org.apache.cayenne.modeler.event;
 
-import org.apache.cayenne.access.DataDomain;
-import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
+import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Entity;
 
@@ -46,15 +46,15 @@
         this(src, entity, null, null, null);
     }
 
-    public EntityDisplayEvent(Object src, Entity entity, DataMap map, DataDomain domain) {
+    public EntityDisplayEvent(Object src, Entity entity, DataMap map, DataChannelDescriptor dataChannelDescriptor) {
 
-        this(src, entity, map, null, domain);
+        this(src, entity, map, null, dataChannelDescriptor);
     }
 
-    public EntityDisplayEvent(Object src, Entity entity, DataMap map, DataNode node,
-            DataDomain domain) {
+    public EntityDisplayEvent(Object src, Entity entity, DataMap map, DataNodeDescriptor node,
+            DataChannelDescriptor dataChannelDescriptor) {
 
-        super(src, map, domain, node);
+        super(src, map, dataChannelDescriptor, node);
         this.entity = entity;
         setDataMapChanged(false);
     }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ProcedureDisplayEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ProcedureDisplayEvent.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ProcedureDisplayEvent.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ProcedureDisplayEvent.java Tue Feb  2 13:06:56 2010
@@ -19,7 +19,7 @@
 
 package org.apache.cayenne.modeler.event;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Procedure;
 
@@ -35,7 +35,7 @@
     /**
      * Creates a new ProcedureDisplayEvent
      */
-    public ProcedureDisplayEvent(Object src, Procedure procedure, DataMap map, DataDomain domain) {
+    public ProcedureDisplayEvent(Object src, Procedure procedure, DataMap map, DataChannelDescriptor domain) {
         super(src, map, domain);
         this.procedure = procedure;
     }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ProcedureParameterDisplayEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ProcedureParameterDisplayEvent.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ProcedureParameterDisplayEvent.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ProcedureParameterDisplayEvent.java Tue Feb  2 13:06:56 2010
@@ -19,7 +19,7 @@
 
 package org.apache.cayenne.modeler.event;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Procedure;
 import org.apache.cayenne.map.ProcedureParameter;
@@ -35,7 +35,7 @@
         ProcedureParameter procedureParameter,
         Procedure procedure,
         DataMap map,
-        DataDomain domain) {
+        DataChannelDescriptor domain) {
         	
         super(src, procedure, map, domain);
         this.procedureParameters = new ProcedureParameter[] { procedureParameter };
@@ -46,7 +46,7 @@
             ProcedureParameter[] procedureParameters,
             Procedure procedure,
             DataMap map,
-            DataDomain domain) {
+            DataChannelDescriptor domain) {
                 
             super(src, procedure, map, domain);
             this.procedureParameters = procedureParameters;

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/QueryDisplayEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/QueryDisplayEvent.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/QueryDisplayEvent.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/QueryDisplayEvent.java Tue Feb  2 13:06:56 2010
@@ -20,7 +20,7 @@
 
 package org.apache.cayenne.modeler.event;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.query.Query;
 
@@ -31,7 +31,7 @@
     protected Query query;
     protected boolean queryChanged = true;
 
-    public QueryDisplayEvent(Object src, Query query, DataMap map, DataDomain domain) {
+    public QueryDisplayEvent(Object src, Query query, DataMap map, DataChannelDescriptor domain) {
         super(src, map, domain);
         this.query = query;
     }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/RelationshipDisplayEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/RelationshipDisplayEvent.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/RelationshipDisplayEvent.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/RelationshipDisplayEvent.java Tue Feb  2 13:06:56 2010
@@ -19,7 +19,7 @@
 
 package org.apache.cayenne.modeler.event;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Entity;
 import org.apache.cayenne.map.Relationship;
@@ -33,7 +33,7 @@
             Relationship relationship,
             Entity entity,
             DataMap map,
-            DataDomain domain) {
+            DataChannelDescriptor domain) {
 
             super(src, entity, map, domain);
             this.relationships = new Relationship[] { relationship };
@@ -44,7 +44,7 @@
         Relationship[] relationships,
         Entity entity,
         DataMap map,
-        DataDomain domain) {
+        DataChannelDescriptor domain) {
 
         super(src, entity, map, domain);
         this.relationships = relationships;

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/BaseGraphBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/BaseGraphBuilder.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/BaseGraphBuilder.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/BaseGraphBuilder.java Tue Feb  2 13:06:56 2010
@@ -39,7 +39,7 @@
 import javax.swing.border.LineBorder;
 import javax.swing.event.UndoableEditEvent;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.event.DataMapEvent;
 import org.apache.cayenne.configuration.event.DataMapListener;
 import org.apache.cayenne.map.DataMap;
@@ -81,7 +81,7 @@
     /**
      * Domain
      */
-    protected transient DataDomain domain;
+    protected transient DataChannelDescriptor domain;
     
     /**
      * Created entity cells.
@@ -111,7 +111,7 @@
     
     boolean undoEventsDisabled;
     
-    public synchronized void buildGraph(ProjectController mediator, DataDomain domain, boolean doLayout) {
+    public synchronized void buildGraph(ProjectController mediator, DataChannelDescriptor domain, boolean doLayout) {
         if (graph != null) {
             //graph already built, exiting silently
             return;
@@ -283,7 +283,7 @@
      * Returns whether an entity is not connected to any other
      * TODO: not fine algorithm, it iterates through all entities and all rels 
      */
-    protected boolean isIsolated(DataDomain domain, Entity entity) {
+    protected boolean isIsolated(DataChannelDescriptor domain, Entity entity) {
         if (entity.getRelationships().size() == 0) {
             //searching for rels that have a target="entity"
             
@@ -480,10 +480,6 @@
         GraphConstants.setExtraLabelPositions(edge.getAttributes(), labelPositions);
     }
     
-    protected boolean isInCurrentDomain() {
-        return mediator.getCurrentDataDomain() == domain;
-    }
-    
     public JGraph getGraph() {
         return graph;
     }
@@ -506,11 +502,11 @@
         mediator.addDataMapListener(this);
     }
     
-    public void setDataDomain(DataDomain domain) {
+    public void setDataDomain(DataChannelDescriptor domain) {
         this.domain = domain;
     }
     
-    public DataDomain getDataDomain() {
+    public DataChannelDescriptor getDataDomain() {
         return domain;
     }
     

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/DataDomainGraphTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/DataDomainGraphTab.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/DataDomainGraphTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/DataDomainGraphTab.java Tue Feb  2 13:06:56 2010
@@ -31,12 +31,11 @@
 import javax.swing.JScrollPane;
 import javax.swing.JToolBar;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.Entity;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.modeler.Application;
 import org.apache.cayenne.modeler.ProjectController;
-import org.apache.cayenne.modeler.action.ModelerProjectConfiguration;
 import org.apache.cayenne.modeler.event.DomainDisplayEvent;
 import org.apache.cayenne.modeler.event.DomainDisplayListener;
 import org.apache.cayenne.modeler.event.EntityDisplayEvent;
@@ -74,19 +73,23 @@
     /**
      * Current domain
      */
-    DataDomain domain;
+    DataChannelDescriptor domain;
     
     /**
      * True to invoke rebuild next time component becomes visible
      */
     boolean needRebuild;
     
+    GraphRegistry graphRegistry;
+    
     public DataDomainGraphTab(ProjectController mediator) {
         this.mediator = mediator;
         initView();
     }
     
+    
     private void initView() {
+        graphRegistry = new GraphRegistry();
         needRebuild = true;
         mediator.addDomainDisplayListener(this);
         
@@ -179,9 +182,7 @@
             dialog.setVisible(true);
             
             if (pane.getValue().equals(JOptionPane.YES_OPTION)) {
-                ModelerProjectConfiguration conf = (ModelerProjectConfiguration)
-                    mediator.getProject().getConfiguration();
-                conf.getGraphRegistry().getGraphMap(domain).remove(getSelectedType());
+                graphRegistry.getGraphMap(domain).remove(getSelectedType());
                 itemStateChanged(null);
             }
         }
@@ -197,7 +198,10 @@
     }
     
     GraphRegistry getGraphRegistry() {
-        return ((ModelerProjectConfiguration) mediator.getProject().getConfiguration())
-            .getGraphRegistry();
+        
+        if(graphRegistry == null) {
+            this.graphRegistry = new GraphRegistry();
+        }
+        return graphRegistry;
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/DbEntityCellMetadata.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/DbEntityCellMetadata.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/DbEntityCellMetadata.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/DbEntityCellMetadata.java Tue Feb  2 13:06:56 2010
@@ -18,7 +18,10 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.graph;
 
+import java.util.Iterator;
+
 import org.apache.cayenne.map.Attribute;
+import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.Entity;
 
@@ -32,7 +35,14 @@
     
     @Override
     public Entity fetchEntity() {
-        return builder.getDataDomain().getEntityResolver().getDbEntity(entityName);
+        Iterator<DataMap> it = builder.getDataDomain().getDataMaps().iterator();
+        while(it.hasNext()){
+            DataMap dm = (DataMap)it.next();
+            if(dm.getDbEntity(entityName)!=null){
+                return dm.getDbEntity(entityName);
+            }
+        }
+        return null;
     }
 
     @Override

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/DbGraphBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/DbGraphBuilder.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/DbGraphBuilder.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/DbGraphBuilder.java Tue Feb  2 13:06:56 2010
@@ -38,20 +38,20 @@
 /**
  * Class for building ER-graph, based on DbEntity information
  */
-class DbGraphBuilder extends BaseGraphBuilder 
-    implements DbEntityListener, DbAttributeListener, DbRelationshipListener {
-    
+class DbGraphBuilder extends BaseGraphBuilder implements DbEntityListener,
+        DbAttributeListener, DbRelationshipListener {
+
     static final Color ENTITY_COLOR = new Color(197, 253, 252);
-    
+
     @Override
     protected Collection<? extends Entity> getEntities(DataMap map) {
         return map.getDbEntities();
     }
-    
+
     @Override
     protected void postProcessEntity(Entity entity, DefaultGraphCell cell) {
         super.postProcessEntity(entity, cell);
-        
+
         GraphConstants.setBackground(cell.getAttributes(), ENTITY_COLOR);
         GraphConstants.setOpaque(cell.getAttributes(), true);
     }
@@ -60,20 +60,22 @@
     protected EntityCellMetadata getCellMetadata(Entity e) {
         return new DbEntityCellMetadata(this, e.getName());
     }
-    
+
     @Override
     protected DefaultEdge createRelationshipCell(Relationship rel) {
         DefaultEdge edge = super.createRelationshipCell(rel);
         if (edge != null) {
-            GraphConstants.setDashPattern(edge.getAttributes(), new float[] { 10, 3 });
+            GraphConstants.setDashPattern(edge.getAttributes(), new float[] {
+                    10, 3
+            });
         }
         return edge;
     }
-        
+
     @Override
     public void setProjectController(ProjectController mediator) {
         super.setProjectController(mediator);
-        
+
         mediator.addDbEntityListener(this);
         mediator.addDbAttributeListener(this);
         mediator.addDbRelationshipListener(this);
@@ -81,65 +83,49 @@
 
     public void destroy() {
         super.destroy();
-        
+
         mediator.removeDbEntityListener(this);
         mediator.removeDbAttributeListener(this);
         mediator.removeDbRelationshipListener(this);
     }
 
     public void dbEntityAdded(EntityEvent e) {
-        if (isInCurrentDomain()) {
-            insertEntityCell(e.getEntity());
-        }
+        insertEntityCell(e.getEntity());
     }
 
     public void dbEntityChanged(EntityEvent e) {
-        if (isInCurrentDomain()) {
-            remapEntity(e);
-            
-            updateEntityCell(e.getEntity());
-        }
+        remapEntity(e);
+
+        updateEntityCell(e.getEntity());
     }
 
     public void dbEntityRemoved(EntityEvent e) {
-        if (isInCurrentDomain()) {
-            removeEntityCell(e.getEntity());
-        }
+        removeEntityCell(e.getEntity());
     }
 
     public void dbAttributeAdded(AttributeEvent e) {
-        if (isInCurrentDomain()) {
-            updateEntityCell(e.getEntity());
-        }
+        updateEntityCell(e.getEntity());
     }
 
     public void dbAttributeChanged(AttributeEvent e) {
-        if (isInCurrentDomain()) {
-            updateEntityCell(e.getEntity());
-        }
+        updateEntityCell(e.getEntity());
     }
 
     public void dbAttributeRemoved(AttributeEvent e) {
-        if (isInCurrentDomain()) {
-            updateEntityCell(e.getEntity());
-        }
+        updateEntityCell(e.getEntity());
     }
 
     public void dbRelationshipAdded(RelationshipEvent e) {
-        //nothing because relationship does not have target yet
+        // nothing because relationship does not have target yet
     }
 
     public void dbRelationshipChanged(RelationshipEvent e) {
-        if (isInCurrentDomain()) {
-            updateRelationshipCell(e.getRelationship());
-        }
+        updateRelationshipCell(e.getRelationship());
     }
 
     public void dbRelationshipRemoved(RelationshipEvent e) {
-        if (isInCurrentDomain()) {
-            remapRelationship(e);
-            removeRelationshipCell(e.getRelationship());
-        }
+        remapRelationship(e);
+        removeRelationshipCell(e.getRelationship());
     }
 
     public GraphType getType() {

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphBuilder.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphBuilder.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphBuilder.java Tue Feb  2 13:06:56 2010
@@ -22,7 +22,7 @@
 
 import javax.swing.event.UndoableEditListener;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.Entity;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.util.XMLSerializable;
@@ -38,7 +38,7 @@
     /**
      * Builds graph
      */
-    public void buildGraph(ProjectController mediator, DataDomain domain, boolean layout);
+    public void buildGraph(ProjectController mediator, DataChannelDescriptor domain, boolean layout);
     
     /**
      * Invoked at destroying of the builder
@@ -53,7 +53,7 @@
     /**
      * Returns domain.
      */
-    public DataDomain getDataDomain();
+    public DataChannelDescriptor getDataDomain();
         
     /**
      * Returns type of the graph

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphFile.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphFile.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphFile.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphFile.java Tue Feb  2 13:06:56 2010
@@ -20,8 +20,8 @@
 
 import java.io.PrintWriter;
 
-import org.apache.cayenne.project.Project;
 import org.apache.cayenne.project.ProjectFile;
+import org.apache.cayenne.project2.Project;
 import org.apache.cayenne.util.XMLEncoder;
 
 /**
@@ -33,7 +33,7 @@
     GraphMap graphMap;
     
     public GraphFile(Project project, GraphMap graphMap) {
-        super(project, null);
+        //super(project, null);
         this.graphMap = graphMap;
     }
     

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphMap.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphMap.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphMap.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphMap.java Tue Feb  2 13:06:56 2010
@@ -21,7 +21,7 @@
 import java.util.HashMap;
 
 import org.apache.cayenne.CayenneRuntimeException;
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.modeler.Application;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.util.XMLEncoder;
@@ -40,16 +40,16 @@
     /**
      * Domain
      */
-    DataDomain domain;
+    DataChannelDescriptor domain;
     
-    public GraphMap(DataDomain domain) {
+    public GraphMap(DataChannelDescriptor domain) {
         this.domain = domain;
     }
      
     /**
      * Returns domain
      */
-    public DataDomain getDomain() {
+    public DataChannelDescriptor getDomain() {
         return domain;
     }
     

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphRegistry.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphRegistry.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphRegistry.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/GraphRegistry.java Tue Feb  2 13:06:56 2010
@@ -21,7 +21,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.event.DomainEvent;
 import org.apache.cayenne.configuration.event.DomainListener;
 import org.apache.cayenne.modeler.ProjectController;
@@ -38,16 +38,16 @@
     /**
      * Main storage of graph builders
      */
-    Map<DataDomain, GraphMap> graphMaps;
+    Map<DataChannelDescriptor, GraphMap> graphMaps;
 
     public GraphRegistry() {
-        graphMaps = new HashMap<DataDomain, GraphMap>();
+        graphMaps = new HashMap<DataChannelDescriptor, GraphMap>();
     }
 
     /**
      * Builds graph with specified type, or returns existing one
      */
-    public JGraph loadGraph(ProjectController mediator, DataDomain domain, GraphType type) {
+    public JGraph loadGraph(ProjectController mediator, DataChannelDescriptor domain, GraphType type) {
         GraphMap graphMap = graphMaps.get(domain);
         if (graphMap == null) {
             graphMap = new GraphMap(domain);
@@ -70,7 +70,7 @@
     /**
      * Gets graph map for specified domain, creating it if needed
      */
-    public GraphMap getGraphMap(DataDomain domain) {
+    public GraphMap getGraphMap(DataChannelDescriptor domain) {
         GraphMap map = graphMaps.get(domain);
         if (map == null) {
             map = new GraphMap(domain);
@@ -79,23 +79,16 @@
         return map;
     }
 
-    public void domainAdded(DomainEvent e) {
-    }
-
     public void domainChanged(DomainEvent e) {
     }
 
-    public void domainRemoved(DomainEvent e) {
-        unregisterDomain(e.getDomain());
-    }
-    
-    void unregisterDomain(DataDomain domain) {
-        GraphMap map = graphMaps.get(domain);
+    void unregisterDomain(DataChannelDescriptor dataChannelDescriptor) {
+        GraphMap map = graphMaps.get(dataChannelDescriptor);
         if (map != null) {
             for (GraphBuilder builder : map.values()) {
                 builder.destroy();
             }
-            graphMaps.remove(domain);
+            graphMaps.remove(dataChannelDescriptor);
         }
     }
     
@@ -103,9 +96,7 @@
      * Removes all listeners (and itself) from ProjectController
      */
     public void unregister(ProjectController mediator) {
-        for (DataDomain domain : mediator.getProject().getConfiguration().getDomains()) {
-            unregisterDomain(domain);
-        }
+        unregisterDomain((DataChannelDescriptor)mediator.getProject().getRootNode());
         mediator.removeDomainListener(this);
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/ObjEntityCellMetadata.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/ObjEntityCellMetadata.java?rev=905616&r1=905615&r2=905616&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/ObjEntityCellMetadata.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/graph/ObjEntityCellMetadata.java Tue Feb  2 13:06:56 2010
@@ -18,7 +18,10 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.graph;
 
+import java.util.Iterator;
+
 import org.apache.cayenne.map.Attribute;
+import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.Entity;
 
 /**
@@ -31,7 +34,14 @@
     
     @Override
     public Entity fetchEntity() {
-        return builder.getDataDomain().getEntityResolver().getObjEntity(entityName);
+        Iterator<DataMap> it = builder.getDataDomain().getDataMaps().iterator();
+        while(it.hasNext()){
+            DataMap dm = (DataMap)it.next();
+            if(dm.getObjEntity(entityName)!=null){
+                return dm.getObjEntity(entityName);
+            }
+        }
+        return null;
     }
 
     @Override



Mime
View raw message