cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [08/14] cayenne git commit: CAY-2337 Code refactoring, bugs fixing
Date Wed, 28 Mar 2018 11:22:14 GMT
http://git-wip-us.apache.org/repos/asf/cayenne/blob/51289d1c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportModel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportModel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportModel.java
deleted file mode 100644
index 749ffb0..0000000
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportModel.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.modeler.editor;
-
-import org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering;
-import org.apache.cayenne.modeler.dialog.db.load.DbImportTreeNode;
-
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.TreeNode;
-
-/**
- * @since 4.1
- */
-public class DbImportModel extends DefaultTreeModel {
-
-    private DbImportTree dbSchemaTree;
-    private boolean canBeCleaned;
-
-    DbImportModel(TreeNode root) {
-        super(root);
-    }
-
-    private void clearReverseEngineering(ReverseEngineering reverseEngineering) {
-        reverseEngineering.getSchemas().clear();
-        reverseEngineering.getCatalogs().clear();
-        reverseEngineering.getIncludeTables().clear();
-        reverseEngineering.getExcludeTables().clear();
-        reverseEngineering.getIncludeColumns().clear();
-        reverseEngineering.getExcludeColumns().clear();
-        reverseEngineering.getIncludeProcedures().clear();
-        reverseEngineering.getExcludeProcedures().clear();
-    }
-
-    private void preprocessTree() {
-        DbImportTreeNode rootNode = (DbImportTreeNode) getRoot();
-        if (rootNode.getChildCount() == 0) {
-            ReverseEngineering reverseEngineering = ((ReverseEngineering) rootNode.getUserObject());
-            if (canBeCleaned) {
-                clearReverseEngineering(reverseEngineering);
-            }
-            rootNode.add(new DbImportTreeNode(("Configuration is empty.")));
-        }
-    }
-
-    public void reload(TreeNode node) {
-        preprocessTree();
-        super.reload(node);
-        dbSchemaTree.repaint();
-    }
-
-    public void setDbSchemaTree(DbImportTree dbSchemaTree) {
-        this.dbSchemaTree = dbSchemaTree;
-    }
-
-    public void setCanBeCleaned(boolean canBeCleaned) {
-        this.canBeCleaned = canBeCleaned;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/51289d1c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportNodeHandler.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportNodeHandler.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportNodeHandler.java
deleted file mode 100644
index 3b33ad7..0000000
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportNodeHandler.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.modeler.editor;
-
-import org.apache.cayenne.dbsync.reverse.dbimport.Catalog;
-import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeProcedure;
-import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeTable;
-import org.apache.cayenne.dbsync.reverse.dbimport.IncludeProcedure;
-import org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable;
-import org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering;
-import org.apache.cayenne.dbsync.reverse.dbimport.Schema;
-import org.apache.cayenne.modeler.dialog.db.load.DbImportTreeNode;
-
-import javax.swing.tree.TreePath;
-import java.awt.Color;
-
-/**
- * @since 4.1
- */
-class DbImportNodeHandler {
-
-    private static final Color ACCEPT_COLOR = new Color(60,179,113);
-    private static final Color EXCLUDE_COLOR = new Color(178, 0, 0);
-    static final Color NON_INCLUDE_COLOR = Color.LIGHT_GRAY;
-    static final Color LABEL_COLOR = Color.BLACK;
-    private static final int EXCLUDE_TABLE_RATE = -10000;
-
-    private boolean existFirstLevelIncludeTable;
-    private boolean existCatalogsOrSchemas;
-    private boolean hasEntitiesInEmptyContainer;
-    private DbImportTreeNode dbSchemaNode;
-    private DbImportTree reverseEngineeringTree;
-
-    private boolean namesIsEqual(DbImportTreeNode reverseEngineeringNode) {
-        if (isContainer(reverseEngineeringNode)) {
-            return dbSchemaNode.getSimpleNodeName().equals(reverseEngineeringNode.getSimpleNodeName());
-        } else {
-            return (dbSchemaNode.getSimpleNodeName().toLowerCase().matches(reverseEngineeringNode.getSimpleNodeName().toLowerCase()));
-        }
-    }
-
-    boolean isContainer(DbImportTreeNode node) {
-        return (node.getUserObject().getClass() == Schema.class) || (node.getUserObject().getClass() == Catalog.class);
-    }
-
-    private boolean isEmptyContainer(DbImportTreeNode rootNode) {
-        return ((getChildIncludeTableCount(rootNode) == 0) && (!existFirstLevelIncludeTable));
-    }
-
-    boolean isParentIncluded() {
-        return ((dbSchemaNode.getParent() != null) && (((DbImportTreeNode) dbSchemaNode.getParent()).isColorized()));
-    }
-
-    // Compare node with current rendered node
-    public boolean nodesIsEqual(DbImportTreeNode reverseEngineeringNode) {
-        TreePath[] paths = reverseEngineeringTree.getSelectionPaths();
-        for (TreePath path : paths != null ? paths : new TreePath[0]) {
-            DbImportTreeNode node = (DbImportTreeNode) path.getLastPathComponent();
-            if ((nodesClassesComparation(node.getUserObject().getClass(), dbSchemaNode.getUserObject().getClass()))
-                    && namesIsEqual(node)
-                    && (dbSchemaNode.getLevel() >= node.getLevel())
-                    && (dbSchemaNode.parentsIsEqual(node))) {
-                return true;
-            }
-        }
-        if ((nodesClassesComparation(reverseEngineeringNode.getUserObject().getClass(), dbSchemaNode.getUserObject().getClass()))
-                && namesIsEqual(reverseEngineeringNode)
-                && (dbSchemaNode.getLevel() >= reverseEngineeringNode.getLevel())
-                && (dbSchemaNode.parentsIsEqual(reverseEngineeringNode))) {
-            return true;
-        }
-        return false;
-    }
-
-    public boolean checkTreesLevels(DbImportTree dbTree) {
-        if (dbTree.getRootNode().getChildCount() == 0) {
-            return false;
-        }
-        DbImportTreeNode dbNode = (DbImportTreeNode) dbTree.getRootNode().getChildAt(0);
-        int childCount = reverseEngineeringTree.getRootNode().getChildCount();
-        for (int i = 0; i < childCount; i++) {
-            if (((DbImportTreeNode) reverseEngineeringTree.getRootNode().getChildAt(i)).
-                    getUserObject().getClass() == Catalog.class) {
-                if (dbNode.getUserObject().getClass() == Catalog.class) {
-                    return true;
-                } else {
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    // Compare reverseEngineeringNode with node.getParent()
-    private boolean compareWithParent(DbImportTreeNode reverseEngineeringNode) {
-        if ((reverseEngineeringNode == null) || (dbSchemaNode.getParent() == null)) {
-            return false;
-        }
-        if ((((DbImportTreeNode)dbSchemaNode.getParent()).getUserObject().getClass() == reverseEngineeringNode.getUserObject().getClass())
-                && (((DbImportTreeNode)dbSchemaNode.getParent()).getSimpleNodeName().equals(reverseEngineeringNode.getSimpleNodeName()))
-                && (((DbImportTreeNode)dbSchemaNode.getParent()).getLevel() >= reverseEngineeringNode.getLevel())
-                && (((DbImportTreeNode)dbSchemaNode.getParent())).parentsIsEqual(reverseEngineeringNode)) {
-            return true;
-        }
-        return false;
-    }
-
-    // Get child IncludeTable's count in node, if exists
-    private int getChildIncludeTableCount(DbImportTreeNode parentNode) {
-        if (parentNode.isIncludeTable()) {
-            return 1;
-        }
-        int childCount = parentNode.getChildCount();
-        int result = 0;
-        for (int i = 0; i < childCount; i++) {
-            DbImportTreeNode tmpNode = (DbImportTreeNode) parentNode.getChildAt(i);
-            if (tmpNode.isIncludeTable()) {
-                result++;
-            }
-        }
-        return result;
-    }
-
-    // Find Exclude-node in configuration
-    private boolean foundExclude(DbImportTreeNode rootNode) {
-        int childCount = rootNode.getChildCount();
-        for (int i = 0; i < childCount; i++) {
-            DbImportTreeNode tmpNode = (DbImportTreeNode) rootNode.getChildAt(i);
-            if (tmpNode.getChildCount() > 0) {
-                if (tmpNode.isExcludeTable() || tmpNode.isExcludeProcedure()) {
-                    return true;
-                }
-            }
-            if (dbSchemaNode.getParent() != null) {
-                if (nodesIsEqual(tmpNode)) {
-                    if (tmpNode.isExcludeTable() || tmpNode.isExcludeProcedure()) {
-                        return true;
-                    }
-                }
-            }
-        }
-
-        return false;
-    }
-
-    /*
-    *  Recursively bypasses DbImportTree,
-    *  Increment result if rendered node exists in configuration tree,
-    *  Subtract EXCLUDE_TABLE_RATE from result, if found Exclude-node for rendered node,
-    *  Return 0, if rendered node not found.
-    */
-    int bypassTree(DbImportTreeNode rootNode) {
-        int bypassResult = 0;
-        int childCount = rootNode.getChildCount();
-        boolean hasProcedures = false;
-
-        // Case for empty reverse engineering, which has a include/exclude tables/procedures
-        if ((childCount == 0) && (nodesIsEqual(rootNode))) {
-            bypassResult++;
-        }
-
-        if (nodesIsEqual(rootNode)) {
-            bypassResult++;
-        }
-
-        ReverseEngineering reverseEngineering = reverseEngineeringTree.getReverseEngineering();
-        if ((reverseEngineering.getCatalogs().isEmpty()) && (reverseEngineering.getSchemas().isEmpty())
-                && (reverseEngineering.getIncludeTables().isEmpty())
-                && (!dbSchemaNode.isIncludeProcedure())) {
-            bypassResult++;
-        }
-
-        if (nodesIsEqual(rootNode) && isEmptyContainer(rootNode)) {
-            hasEntitiesInEmptyContainer = true;
-            if (foundExclude(rootNode)) {
-                return EXCLUDE_TABLE_RATE;
-            }
-            return 1;
-        }
-
-        if (compareWithParent(rootNode) && (!rootNode.isReverseEngineering()) &&
-                isEmptyContainer(rootNode) && (dbSchemaNode.isIncludeTable())) {
-            hasEntitiesInEmptyContainer = true;
-            if (foundExclude(rootNode)) {
-                return EXCLUDE_TABLE_RATE;
-            }
-            return 1;
-        }
-
-        if (hasEntitiesInEmptyContainer) {
-            for (int i = 0; i < childCount; i++) {
-                DbImportTreeNode tmpNode = (DbImportTreeNode) rootNode.getChildAt(i);
-                if (dbSchemaNode.isIncludeProcedure() && (nodesIsEqual(tmpNode))) {
-                    int tmpNodeChildCount = tmpNode.getChildCount();
-                    if (tmpNodeChildCount > 0) {
-                        bypassResult += bypassTree((DbImportTreeNode) rootNode.getChildAt(i));
-                    }
-                    bypassResult++;
-                    hasProcedures = true;
-                }
-            }
-            if ((!rootNode.isExcludeTable()) && (!nodesIsEqual(rootNode))
-                    && (!dbSchemaNode.isIncludeProcedure())) {
-                bypassResult++;
-            } else {
-                if ((!hasProcedures) && (!dbSchemaNode.isIncludeProcedure())) {
-                    bypassResult += EXCLUDE_TABLE_RATE;
-                }
-            }
-        }
-
-        for (int i = 0; i < childCount; i++) {
-            DbImportTreeNode tmpNode = (DbImportTreeNode) rootNode.getChildAt(i);
-            if (tmpNode.getChildCount() > 0) {
-                bypassResult += bypassTree(tmpNode);
-                if (tmpNode.isExcludeTable() || tmpNode.isExcludeProcedure()) {
-                    bypassResult += EXCLUDE_TABLE_RATE;
-                }
-            } else if (compareWithParent(tmpNode) && !(existFirstLevelIncludeTable)) {
-                if (!dbSchemaNode.isIncludeProcedure()) {
-                    bypassResult++;
-                }
-            }
-            if (dbSchemaNode.getParent() != null) {
-                if (nodesIsEqual(tmpNode)) {
-                    if (tmpNode.isExcludeTable() || tmpNode.isExcludeProcedure()) {
-                        bypassResult += EXCLUDE_TABLE_RATE;
-                    }
-                    bypassResult++;
-                }
-            }
-        }
-        return bypassResult;
-    }
-
-    Color getColorByNodeType(DbImportTreeNode node) {
-        if ((reverseEngineeringTree.getSelectionPaths() != null) &&(reverseEngineeringTree.getSelectionPaths().length > 1)) {
-            for (TreePath path : reverseEngineeringTree.getSelectionPaths()) {
-                DbImportTreeNode pathNode = (DbImportTreeNode) path.getLastPathComponent();
-                if (pathNode.getSimpleNodeName().equals(dbSchemaNode.getSimpleNodeName())) {
-                    if (pathNode.isExcludeTable() || pathNode.isExcludeProcedure()) {
-                        return EXCLUDE_COLOR;
-                    } else {
-                        return ACCEPT_COLOR;
-                    }
-                }
-            }
-        }
-        if (node.isExcludeTable() || node.isExcludeProcedure()) {
-            return EXCLUDE_COLOR;
-        } else {
-            return ACCEPT_COLOR;
-        }
-    }
-
-    void findFirstLevelIncludeTable() {
-        DbImportTreeNode root = reverseEngineeringTree.getRootNode();
-        int childCount = root.getChildCount();
-        existFirstLevelIncludeTable = false;
-        existCatalogsOrSchemas = false;
-        for (int i = 0; i < childCount; i++) {
-            DbImportTreeNode tmpNode = (DbImportTreeNode) root.getChildAt(i);
-            if (tmpNode.isIncludeTable()) {
-                existFirstLevelIncludeTable = true;
-            }
-            if (isContainer(tmpNode)) {
-                existCatalogsOrSchemas = true;
-            }
-        }
-    }
-
-    // Check, is DatabaseTree started with IncludeTable or IncludeProcedure
-    boolean isFirstNodeIsPrimitive(DbImportTree tree) {
-        final int firstChildIndex = 0;
-        DbImportTreeNode root = tree.getRootNode();
-        if (root.getChildCount() == 0) {
-            return false;
-        }
-        DbImportTreeNode firstElement = (DbImportTreeNode) root.getChildAt(firstChildIndex);
-        if (firstElement.isIncludeTable() || firstElement.isIncludeProcedure()) {
-            return true;
-        }
-        return false;
-    }
-
-    public boolean nodesClassesComparation(Class firstClass, Class secondClass) {
-        if (firstClass.equals(secondClass)) {
-            return true;
-        }
-        if ((firstClass.equals(IncludeTable.class)) && (secondClass.equals(ExcludeTable.class))) {
-            return true;
-        }
-        if ((firstClass.equals(ExcludeTable.class)) && (secondClass.equals(IncludeTable.class))) {
-            return true;
-        }
-        if ((firstClass.equals(IncludeProcedure.class)) && (secondClass.equals(ExcludeProcedure.class))) {
-            return true;
-        }
-        if ((firstClass.equals(ExcludeProcedure.class)) && (secondClass.equals(IncludeProcedure.class))) {
-            return true;
-        }
-        return false;
-    }
-
-    public boolean isExistCatalogsOrSchemas() {
-        return existCatalogsOrSchemas;
-    }
-
-    public boolean getHasEntitiesInEmptyContainer() {
-        return hasEntitiesInEmptyContainer;
-    }
-
-    public void setHasEntitiesInEmptyContainer(boolean newFlag) {
-        hasEntitiesInEmptyContainer = newFlag;
-    }
-
-    public void setDbSchemaNode(DbImportTreeNode dbSchemaNode) {
-        this.dbSchemaNode = dbSchemaNode;
-    }
-
-    public void setReverseEngineeringTree(DbImportTree reverseEngineeringTree) {
-        this.reverseEngineeringTree = reverseEngineeringTree;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/51289d1c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportTree.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportTree.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportTree.java
deleted file mode 100644
index 6862c82..0000000
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportTree.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.modeler.editor;
-
-import org.apache.cayenne.dbsync.reverse.dbimport.Catalog;
-import org.apache.cayenne.dbsync.reverse.dbimport.FilterContainer;
-import org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable;
-import org.apache.cayenne.dbsync.reverse.dbimport.PatternParam;
-import org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering;
-import org.apache.cayenne.dbsync.reverse.dbimport.Schema;
-import org.apache.cayenne.modeler.dialog.db.load.DbImportTreeNode;
-import org.apache.cayenne.modeler.dialog.db.load.TransferableNode;
-
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
-import java.util.ArrayList;
-import java.util.Collection;
-
-/**
- * @since 4.1
- */
-public class DbImportTree extends JTree {
-
-    private boolean isTransferable;
-    private ReverseEngineering reverseEngineering;
-
-    public DbImportTree(TreeNode node) {
-        super(node);
-    }
-
-    public void translateReverseEngineeringToTree(ReverseEngineering reverseEngineering, boolean isTransferable) {
-        this.isTransferable = isTransferable;
-        this.reverseEngineering = reverseEngineering;
-        DbImportModel model = (DbImportModel) this.getModel();
-        DbImportTreeNode root = (DbImportTreeNode) model.getRoot();
-        root.removeAllChildren();
-        root.setUserObject(reverseEngineering);
-        printCatalogs(reverseEngineering.getCatalogs(), root);
-        printSchemas(reverseEngineering.getSchemas(), root);
-        printIncludeTables(reverseEngineering.getIncludeTables(), root);
-        printParams(reverseEngineering.getExcludeTables(), root);
-        printParams(reverseEngineering.getIncludeColumns(), root);
-        printParams(reverseEngineering.getExcludeColumns(), root);
-        printParams(reverseEngineering.getIncludeProcedures(), root);
-        printParams(reverseEngineering.getExcludeProcedures(), root);
-        model.reload();
-    }
-
-    public DbImportTreeNode findNodeByParentsChain(DbImportTreeNode rootNode, DbImportTreeNode movedNode, int depth) {
-        String parentName = ((DbImportTreeNode) movedNode.getParent()).getSimpleNodeName();
-        if ((rootNode.parentsIsEqual(((DbImportTreeNode) movedNode.getParent())))
-                && (rootNode.getSimpleNodeName().equals(parentName))
-                && ((rootNode.isCatalog()) || (rootNode.isSchema()))) {
-            return rootNode;
-        }
-        for (int i = 0; i < rootNode.getChildCount(); i++) {
-            DbImportTreeNode childNode = (DbImportTreeNode) rootNode.getChildAt(i);
-            DbImportTreeNode node = findNodeByParentsChain(childNode, movedNode, depth++);
-            if (node != null) {
-                return node;
-            }
-        }
-        return null;
-    }
-
-    public DbImportTreeNode findNode(DbImportTreeNode rootNode, DbImportTreeNode movedNode, int depth) {
-        String parentName = movedNode.getSimpleNodeName();
-        if ((rootNode.parentsIsEqual(movedNode))
-                && (rootNode.getSimpleNodeName().equals(parentName))) {
-            return rootNode;
-        }
-        for (int i = 0; i < rootNode.getChildCount(); i++) {
-            DbImportTreeNode childNode = (DbImportTreeNode) rootNode.getChildAt(i);
-            DbImportTreeNode node = findNode(childNode, movedNode, depth++);
-            if (node != null) {
-                return node;
-            }
-        }
-        return null;
-    }
-
-    // Create list of expanded elements
-    private ArrayList<DbImportTreeNode> createTreeExpandList(DbImportTreeNode rootNode, ArrayList<DbImportTreeNode> resultList) {
-        for (int i = 0; i < rootNode.getChildCount(); i++) {
-            DbImportTreeNode childNode = (DbImportTreeNode) rootNode.getChildAt(i);
-            TreePath childPath = new TreePath(childNode.getPath());
-            if (isExpanded(childPath)) {
-                resultList.add(childNode);
-            }
-            if (childNode.getChildCount() > 0) {
-                createTreeExpandList(childNode, resultList);
-            }
-        }
-        return resultList;
-    }
-
-    public ArrayList<DbImportTreeNode> getTreeExpandList() {
-        ArrayList<DbImportTreeNode> resultList = new ArrayList<>();
-        return createTreeExpandList(getRootNode(), resultList);
-    }
-
-    private void expandBeginningWithNode(DbImportTreeNode rootNode, ArrayList<DbImportTreeNode> list) {
-        for (int i = 0; i < rootNode.getChildCount(); i++) {
-            DbImportTreeNode childNode = (DbImportTreeNode) rootNode.getChildAt(i);
-            list.forEach((element) -> {
-                if (element.equals(childNode)) {
-                    this.expandPath(new TreePath(childNode.getPath()));
-                }
-            });
-            if (childNode.getChildCount() > 0) {
-                expandBeginningWithNode(childNode, list);
-            }
-        }
-    }
-
-    public void expandTree(ArrayList<DbImportTreeNode> expandIndexesList) {
-        expandBeginningWithNode(getRootNode(), expandIndexesList);
-    }
-
-    private <T extends PatternParam> void printParams(Collection<T> collection, DbImportTreeNode parent) {
-        for (T element : collection) {
-            DbImportTreeNode node = !isTransferable ? new DbImportTreeNode(element) : new TransferableNode(element);
-            if (!node.getSimpleNodeName().equals("")) {
-                parent.add(node);
-            }
-        }
-    }
-
-    private void printIncludeTables(Collection<IncludeTable> collection, DbImportTreeNode parent) {
-        for (IncludeTable includeTable : collection) {
-            DbImportTreeNode node = !isTransferable ? new DbImportTreeNode(includeTable) : new TransferableNode(includeTable);
-            if (!node.getSimpleNodeName().equals("")) {
-                printParams(includeTable.getIncludeColumns(), node);
-                printParams(includeTable.getExcludeColumns(), node);
-                parent.add(node);
-            }
-        }
-    }
-
-    private void printChildren(FilterContainer container, DbImportTreeNode parent) {
-        printIncludeTables(container.getIncludeTables(), parent);
-        printParams(container.getExcludeTables(), parent);
-        printParams(container.getIncludeColumns(), parent);
-        printParams(container.getExcludeColumns(), parent);
-        printParams(container.getIncludeProcedures(), parent);
-        printParams(container.getExcludeProcedures(), parent);
-    }
-
-    private void printSchemas(Collection<Schema> schemas, DbImportTreeNode parent) {
-        for (Schema schema : schemas) {
-            DbImportTreeNode node = !isTransferable ? new DbImportTreeNode(schema) : new TransferableNode(schema);
-            if (!node.getSimpleNodeName().equals("")) {
-                printChildren(schema, node);
-                parent.add(node);
-            }
-        }
-    }
-
-    private void printCatalogs(Collection<Catalog> catalogs, DbImportTreeNode parent) {
-        for (Catalog catalog : catalogs) {
-            DbImportTreeNode node = !isTransferable ? new DbImportTreeNode(catalog) : new TransferableNode(catalog);
-            if (!node.getSimpleNodeName().equals("")) {
-                printSchemas(catalog.getSchemas(), node);
-                printChildren(catalog, node);
-                parent.add(node);
-            }
-        }
-    }
-
-    public DbImportTreeNode getSelectedNode() {
-        return (DbImportTreeNode) this.getSelectionPath().getLastPathComponent();
-    }
-
-    public DbImportTreeNode getRootNode() {
-        return (DbImportTreeNode) this.getModel().getRoot();
-    }
-
-    public ReverseEngineering getReverseEngineering() {
-        return reverseEngineering;
-    }
-
-    public void setReverseEngineering(ReverseEngineering reverseEngineering) {
-        this.reverseEngineering = reverseEngineering;
-    }
-
-    public boolean isTransferable() {
-        return isTransferable;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/51289d1c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportTreeCellEditor.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportTreeCellEditor.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportTreeCellEditor.java
deleted file mode 100644
index 6c96e31..0000000
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportTreeCellEditor.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.modeler.editor;
-
-import org.apache.cayenne.modeler.ProjectController;
-import org.apache.cayenne.modeler.action.DeleteNodeAction;
-import org.apache.cayenne.modeler.action.EditNodeAction;
-import org.apache.cayenne.modeler.dialog.db.load.DbImportTreeNode;
-import org.apache.cayenne.util.Util;
-
-import javax.swing.JTree;
-import javax.swing.event.CellEditorListener;
-import javax.swing.event.ChangeEvent;
-import javax.swing.tree.DefaultTreeCellEditor;
-import javax.swing.tree.DefaultTreeCellRenderer;
-import javax.swing.tree.TreePath;
-import java.awt.Component;
-import java.util.EventObject;
-import java.util.regex.Pattern;
-
-/**
- * @since 4.1
- */
-public class DbImportTreeCellEditor extends DefaultTreeCellEditor {
-
-    private ProjectController projectController;
-
-    public DbImportTreeCellEditor(JTree tree, DefaultTreeCellRenderer renderer) {
-        super(tree, renderer);
-        this.addCellEditorListener(new CellEditorListener() {
-            @Override
-            public void editingStopped(ChangeEvent e) {
-                DbImportTreeCellEditor.this.cancelCellEditing();
-            }
-
-            @Override
-            public void editingCanceled(ChangeEvent e) {
-                editingStopped(e);
-            }
-        });
-
-    }
-
-    @Override
-    public Object getCellEditorValue() {
-        if (tree.getSelectionPath() == null) {
-            return "";
-        }
-        DbImportTreeNode node = (DbImportTreeNode) tree.getSelectionPath().getLastPathComponent();
-        return node.getUserObject();
-    }
-
-    @Override
-    public Component getTreeCellEditorComponent(JTree tree, Object value,
-                                                boolean isSelected, boolean expanded, boolean leaf, int row) {
-        if (value instanceof DbImportTreeNode) {
-            value = ((DbImportTreeNode) value).getSimpleNodeName();
-        }
-        return super.getTreeCellEditorComponent(tree, value, isSelected, expanded,
-                leaf, row);
-    }
-
-    @Override
-    public boolean isCellEditable(EventObject e) {
-        if (tree.getSelectionPath() != null) {
-            // Disable label nodes editing
-            if (((DbImportTreeNode) tree.getSelectionPath().getLastPathComponent()).getUserObject().getClass() == String.class) {
-                return false;
-            }
-            if (tree.getSelectionPath().getLastPathComponent() == tree.getModel().getRoot()) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    private boolean isValidReverseEngineering() {
-        try {
-            Pattern.compile(super.getCellEditorValue().toString());
-        } catch (Exception exception) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public void cancelCellEditing() {
-        if (tree.getSelectionPath() == null) {
-            return;
-        }
-        if (!Util.isEmptyString(super.getCellEditorValue().toString()) && !insertableNodeExist() && (isValidReverseEngineering())) {
-            EditNodeAction action = projectController.getApplication().getActionManager().getAction(EditNodeAction.class);
-            action.setActionName(super.getCellEditorValue().toString());
-            action.actionPerformed(null);
-        } else {
-            DbImportTreeNode selectedNode = (DbImportTreeNode) tree.getSelectionPath().getLastPathComponent();
-            if (Util.isEmptyString(selectedNode.getSimpleNodeName()) || (insertableNodeExist())) {
-                DeleteNodeAction action = projectController.getApplication().getActionManager().getAction(DeleteNodeAction.class);
-                TreePath parentPath = tree.getSelectionPath().getParentPath();
-                action.actionPerformed(null);
-                tree.setSelectionPath(parentPath);
-            } else {
-                tree.startEditingAtPath(tree.getSelectionPath());
-            }
-        }
-        DbImportTreeNode selectedNode = (DbImportTreeNode) tree.getSelectionPath().getLastPathComponent();
-        ((DbImportModel) tree.getModel()).reload(selectedNode);
-    }
-
-    private boolean equalNodes(int i, DbImportTreeNode parent, DbImportTreeNode selectedElement) {
-        return super.getCellEditorValue().toString().equals(((DbImportTreeNode) parent.getChildAt(i)).getSimpleNodeName()) &&
-                selectedElement.getUserObject().getClass().equals(((DbImportTreeNode) parent.getChildAt(i)).getUserObject().getClass());
-    }
-
-    private boolean insertableNodeExist() {
-        DbImportTreeNode selectedElement;
-        if (tree.getSelectionPath() == null) {
-            selectedElement = (DbImportTreeNode) tree.getModel().getRoot();
-        } else {
-            selectedElement = (DbImportTreeNode) tree.getSelectionPath().getLastPathComponent();
-        }
-        int childCount = selectedElement.getParent().getChildCount();
-        for (int i = 0; i < childCount; i++) {
-            if (equalNodes(i, (DbImportTreeNode) selectedElement.getParent(), selectedElement)) {
-                if (selectedElement.getParent().getChildAt(i) != selectedElement) {
-                    return true;
-                }
-            }
-
-        }
-        return false;
-    }
-
-    public void setProjectController(ProjectController projectController) {
-        this.projectController = projectController;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/51289d1c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportTreeCellRenderer.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportTreeCellRenderer.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportTreeCellRenderer.java
deleted file mode 100644
index 82a1cd5..0000000
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportTreeCellRenderer.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.modeler.editor;
-
-import org.apache.cayenne.dbsync.reverse.dbimport.Catalog;
-import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeColumn;
-import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeProcedure;
-import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeTable;
-import org.apache.cayenne.dbsync.reverse.dbimport.IncludeColumn;
-import org.apache.cayenne.dbsync.reverse.dbimport.IncludeProcedure;
-import org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable;
-import org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering;
-import org.apache.cayenne.dbsync.reverse.dbimport.Schema;
-import org.apache.cayenne.modeler.dialog.db.load.DbImportTreeNode;
-import org.apache.cayenne.modeler.util.ModelerUtil;
-
-import javax.swing.ImageIcon;
-import javax.swing.JTree;
-import javax.swing.tree.DefaultTreeCellRenderer;
-import java.awt.Component;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @since 4.1
- */
-public class DbImportTreeCellRenderer extends DefaultTreeCellRenderer {
-
-    protected DbImportTreeNode node;
-    private Map<Class, String> icons;
-    private Map<Class, String> transferableTreeIcons;
-
-    public DbImportTreeCellRenderer() {
-        super();
-        initIcons();
-        initTrasferableTreeIcons();
-    }
-
-    private void initTrasferableTreeIcons() {
-        transferableTreeIcons = new HashMap<>();
-        transferableTreeIcons.put(Catalog.class, "icon-dbi-catalog.png");
-        transferableTreeIcons.put(Schema.class, "icon-dbi-schema.png");
-        transferableTreeIcons.put(IncludeTable.class, "icon-dbentity.png");
-        transferableTreeIcons.put(IncludeProcedure.class, "icon-stored-procedure.png");
-    }
-
-    private void initIcons() {
-        icons = new HashMap<>();
-        icons.put(Catalog.class, "icon-dbi-catalog.png");
-        icons.put(Schema.class, "icon-dbi-schema.png");
-        icons.put(IncludeTable.class, "icon-dbi-includeTable.png");
-        icons.put(ExcludeTable.class, "icon-dbi-excludeTable.png");
-        icons.put(IncludeColumn.class, "icon-dbi-includeColumn.png");
-        icons.put(ExcludeColumn.class, "icon-dbi-excludeColumn.png");
-        icons.put(IncludeProcedure.class, "icon-dbi-includeProcedure.png");
-        icons.put(ExcludeProcedure.class, "icon-dbi-excludeProcedure.png");
-    }
-
-    private ImageIcon getIconByNodeType(Class nodeClass, boolean isTransferable) {
-        String iconName = !isTransferable ? icons.get(nodeClass) : transferableTreeIcons.get(nodeClass);
-        if (iconName == null) {
-            return null;
-        }
-        return ModelerUtil.buildIcon(iconName);
-    }
-
-    @Override
-    public Component getTreeCellRendererComponent(JTree tree, Object value,
-                                                  boolean sel,
-                                                  boolean expanded,
-                                                  boolean leaf, int row,
-                                                  boolean hasFocus) {
-
-        super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
-        node = (DbImportTreeNode) value;
-        setIcon(getIconByNodeType(node.getUserObject().getClass(), ((DbImportTree) tree).isTransferable()));
-        return this;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/51289d1c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportView.java
deleted file mode 100644
index 453ce00..0000000
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DbImportView.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.modeler.editor;
-
-import com.jgoodies.forms.builder.DefaultFormBuilder;
-import com.jgoodies.forms.layout.FormLayout;
-import org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering;
-import org.apache.cayenne.map.DataMap;
-import org.apache.cayenne.modeler.ProjectController;
-import org.apache.cayenne.modeler.action.LoadDbSchemaAction;
-import org.apache.cayenne.modeler.action.ReverseEngineeringAction;
-import org.apache.cayenne.modeler.dialog.db.load.DbImportTreeNode;
-import org.apache.cayenne.modeler.dialog.db.load.TransferableNode;
-import org.apache.cayenne.modeler.util.CayenneAction;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JProgressBar;
-import java.awt.BorderLayout;
-
-/**
- * @since 4.1
- */
-public class DbImportView extends JPanel {
-
-    private static final String MAIN_LAYOUT = "fill:160dlu, 5dlu, fill:50dlu, 5dlu, fill:160dlu";
-    private static final String HEADER_LAYOUT = "fill:70dlu, 15dlu, fill:75dlu";
-    private static final String BUTTON_PANEL_LAYOUT = "fill:50dlu";
-    private static final String PROGRESS_PANEL_LAYOUT = "fill:160dlu, 60dlu, fill:160dlu";
-    private static final int ALL_LINE_SPAN = 5;
-
-    private TreeToolbarPanel treeToolbar;
-    private ReverseEngineeringTreePanel treePanel;
-    private ReverseEngineeringConfigPanel configPanel;
-    private DraggableTreePanel draggableTreePanel;
-    private JProgressBar loadDbSchemaProgress;
-    private JProgressBar reverseEngineeringProgress;
-    private CayenneAction.CayenneToolbarButton loadDbSchemaButton;
-
-    private ProjectController projectController;
-
-    DbImportView(ProjectController projectController) {
-        this.projectController = projectController;
-        initFormElements();
-        initListeners();
-        buildForm();
-        draggableTreePanel.getSourceTree().repaint();
-    }
-
-    private void initListeners() {
-        projectController.addDataMapDisplayListener(e -> {
-            DataMap map = e.getDataMap();
-            treePanel.getReverseEngineeringTree().stopEditing();
-            if (map != null) {
-                treeToolbar.unlockButtons();
-                ReverseEngineering reverseEngineering = DbImportView.this.projectController.getApplication().
-                        getMetaData().get(map, ReverseEngineering.class);
-                if (reverseEngineering == null) {
-                    reverseEngineering = new ReverseEngineering();
-                    DbImportView.this.projectController.getApplication().getMetaData().add(map, reverseEngineering);
-                }
-                configPanel.fillCheckboxes(reverseEngineering);
-                configPanel.initializeTextFields(reverseEngineering);
-                treePanel.updateTree();
-                DbImportTreeNode root = draggableTreePanel.getSourceTree().getRootNode();
-                root.removeAllChildren();
-                draggableTreePanel.updateTree(projectController.getCurrentDataMap());
-                draggableTreePanel.getMoveButton().setEnabled(false);
-                draggableTreePanel.getMoveInvertButton().setEnabled(false);
-            }
-        });
-    }
-
-    private void buildForm() {
-        FormLayout buttonPanelLayout = new FormLayout(BUTTON_PANEL_LAYOUT);
-        DefaultFormBuilder buttonBuilder = new DefaultFormBuilder(buttonPanelLayout);
-        buttonBuilder.append(draggableTreePanel.getMoveButton());
-        buttonBuilder.append(draggableTreePanel.getMoveInvertButton());
-
-        FormLayout layout = new FormLayout(MAIN_LAYOUT);
-        DefaultFormBuilder builder = new DefaultFormBuilder(layout);
-        builder.setDefaultDialogBorder();
-        builder.appendSeparator("Database Import Configuration");
-        builder.append(treeToolbar, ALL_LINE_SPAN);
-
-        FormLayout headerLayout = new FormLayout(HEADER_LAYOUT);
-
-        DefaultFormBuilder reverseEngineeringHeaderBuilder = new DefaultFormBuilder(headerLayout);
-        reverseEngineeringHeaderBuilder.append("Import Configuration");
-        ReverseEngineeringAction reverseEngineeringAction = projectController.getApplication().getActionManager().
-                getAction(ReverseEngineeringAction.class);
-        reverseEngineeringAction.setView(this);
-        CayenneAction.CayenneToolbarButton reverseEngineeringButton = (CayenneAction.CayenneToolbarButton)
-                reverseEngineeringAction.buildButton(0);
-        reverseEngineeringButton.setShowingText(true);
-        reverseEngineeringButton.setText("Run Import");
-        reverseEngineeringHeaderBuilder.append(reverseEngineeringButton);
-        builder.append(reverseEngineeringHeaderBuilder.getPanel());
-
-        DefaultFormBuilder databaseHeaderBuilder = new DefaultFormBuilder(headerLayout);
-        databaseHeaderBuilder.append("Database Schema");
-        LoadDbSchemaAction loadDbSchemaAction = projectController.getApplication().getActionManager().
-                getAction(LoadDbSchemaAction.class);
-        loadDbSchemaAction.setDraggableTreePanel(draggableTreePanel);
-        loadDbSchemaButton = (CayenneAction.CayenneToolbarButton) loadDbSchemaAction.buildButton(0);
-        loadDbSchemaButton.setShowingText(true);
-        loadDbSchemaButton.setText("Refresh DB Schema");
-        databaseHeaderBuilder.append(loadDbSchemaButton);
-
-        builder.append("");
-        builder.append(databaseHeaderBuilder.getPanel());
-        builder.append(treePanel);
-        builder.append(buttonBuilder.getPanel());
-        builder.append(draggableTreePanel);
-
-        loadDbSchemaProgress = new JProgressBar();
-        reverseEngineeringProgress = new JProgressBar();
-        loadDbSchemaProgress.setIndeterminate(true);
-        loadDbSchemaProgress.setVisible(false);
-        reverseEngineeringProgress.setIndeterminate(true);
-        reverseEngineeringProgress.setVisible(false);
-        FormLayout progressLayout = new FormLayout(PROGRESS_PANEL_LAYOUT, "fill:10dlu");
-        DefaultFormBuilder progressBarBuilder = new DefaultFormBuilder(progressLayout);
-        progressBarBuilder.append(reverseEngineeringProgress);
-        progressBarBuilder.append(loadDbSchemaProgress);
-        builder.append(progressBarBuilder.getPanel(), ALL_LINE_SPAN);
-
-        builder.append(configPanel, ALL_LINE_SPAN);
-        this.setLayout(new BorderLayout());
-        add(builder.getPanel(), BorderLayout.CENTER);
-    }
-
-    private void initFormElements() {
-        DbImportTreeNode root = new DbImportTreeNode(new ReverseEngineering());
-        DbImportTreeNode draggableTreeRoot = new DbImportTreeNode(new ReverseEngineering());
-        DbImportTree reverseEngineeringTree = new DbImportTree(root);
-        DbImportTree draggableTree = new DbImportTree(new TransferableNode(draggableTreeRoot));
-        DbImportModel model = new DbImportModel(root);
-        model.setCanBeCleaned(true);
-        DbImportModel draggableTreeModel = new DbImportModel(draggableTreeRoot);
-        draggableTreeModel.setCanBeCleaned(false);
-
-        draggableTree.setRootVisible(false);
-        draggableTree.setShowsRootHandles(true);
-        draggableTree.setModel(draggableTreeModel);
-        reverseEngineeringTree.setRootVisible(false);
-        reverseEngineeringTree.setModel(model);
-        reverseEngineeringTree.setShowsRootHandles(true);
-
-        draggableTreePanel = new DraggableTreePanel(projectController, draggableTree, reverseEngineeringTree);
-        treeToolbar = new TreeToolbarPanel(projectController, reverseEngineeringTree, draggableTreePanel);
-        treePanel = new ReverseEngineeringTreePanel(projectController, reverseEngineeringTree, draggableTree);
-        treePanel.setTreeToolbar(treeToolbar);
-
-        model.setDbSchemaTree(draggableTree);
-        draggableTreeModel.setDbSchemaTree(draggableTree);
-        ((ColorTreeRenderer) draggableTreePanel.getSourceTree().getCellRenderer()).
-                setReverseEngineeringTree(reverseEngineeringTree);
-
-        configPanel = new ReverseEngineeringConfigPanel(projectController);
-    }
-
-    public boolean isSkipRelationshipsLoading() {
-        return configPanel.getSkipRelationshipsLoading().isSelected();
-    }
-
-    public boolean isSkipPrimaryKeyLoading() {
-        return configPanel.getSkipPrimaryKeyLoading().isSelected();
-    }
-
-    public boolean isForceDataMapCatalog() {
-        return configPanel.getForceDataMapCatalog().isSelected();
-    }
-
-    public boolean isForceDataMapSchema() {
-        return configPanel.getForceDataMapSchema().isSelected();
-    }
-
-    public boolean isUsePrimitives() {
-        return configPanel.getUsePrimitives().isSelected();
-    }
-
-    public boolean isUseJava7Typed() {
-        return configPanel.getUseJava7Types().isSelected();
-    }
-
-    public String getMeaningfulPk() {
-        return "".equals(configPanel.getMeaningfulPk().getComponent().getText())
-                ? null : configPanel.getMeaningfulPk().getComponent().getText();
-    }
-
-    public String getNamingStrategy() {
-        return (String) configPanel.getStrategyCombo().getSelectedItem();
-    }
-
-    public String getStripFromTableNames() {
-        return configPanel.getStripFromTableNames().getComponent().getText();
-    }
-
-    public JProgressBar getLoadDbSchemaProgress() {
-        return loadDbSchemaProgress;
-    }
-
-    public void lockToolbarButtons() {
-        treeToolbar.changeToolbarButtonsState(false);
-    }
-
-    public void unlockToolbarButtons() {
-        treeToolbar.unlockButtons();
-    }
-
-    public JProgressBar getReverseEngineeringProgress() {
-        return reverseEngineeringProgress;
-    }
-
-    public JButton getLoadDbSchemaButton() {
-        return loadDbSchemaButton;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/51289d1c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DraggableTreePanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DraggableTreePanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DraggableTreePanel.java
deleted file mode 100644
index 5418f0f..0000000
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DraggableTreePanel.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.modeler.editor;
-
-import org.apache.cayenne.dbsync.reverse.dbimport.Catalog;
-import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeColumn;
-import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeProcedure;
-import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeTable;
-import org.apache.cayenne.dbsync.reverse.dbimport.IncludeColumn;
-import org.apache.cayenne.dbsync.reverse.dbimport.IncludeProcedure;
-import org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable;
-import org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering;
-import org.apache.cayenne.dbsync.reverse.dbimport.Schema;
-import org.apache.cayenne.map.DataMap;
-import org.apache.cayenne.modeler.ProjectController;
-import org.apache.cayenne.modeler.action.AddCatalogAction;
-import org.apache.cayenne.modeler.action.AddExcludeColumnAction;
-import org.apache.cayenne.modeler.action.AddExcludeProcedureAction;
-import org.apache.cayenne.modeler.action.AddExcludeTableAction;
-import org.apache.cayenne.modeler.action.AddIncludeColumnAction;
-import org.apache.cayenne.modeler.action.AddIncludeProcedureAction;
-import org.apache.cayenne.modeler.action.AddIncludeTableAction;
-import org.apache.cayenne.modeler.action.AddSchemaAction;
-import org.apache.cayenne.modeler.action.MoveImportNodeAction;
-import org.apache.cayenne.modeler.action.MoveInvertNodeAction;
-import org.apache.cayenne.modeler.action.TreeManipulationAction;
-import org.apache.cayenne.modeler.dialog.db.load.DbImportTreeNode;
-import org.apache.cayenne.modeler.dialog.db.load.TransferableNode;
-import org.apache.cayenne.modeler.util.CayenneAction;
-
-import javax.swing.DropMode;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JScrollPane;
-import javax.swing.JTree;
-import javax.swing.TransferHandler;
-import javax.swing.tree.DefaultTreeCellRenderer;
-import javax.swing.tree.TreePath;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @since 4.1
- */
-public class DraggableTreePanel extends JScrollPane {
-
-    private static final int ROOT_LEVEL = 14;
-    private static final int FIRST_LEVEL = 11;
-    private static final int SECOND_LEVEL = 8;
-    private static final int THIRD_LEVEL = 5;
-    private static final int FOURTH_LEVEL = 2;
-    private static final int FIFTH_LEVEL = 3;
-    private static final String MOVE_BUTTON_LABEL = "Include";
-    private static final String MOVE_INV_BUTTON_LABEL = "Exclude";
-
-    private DbImportTree sourceTree;
-    private DbImportTree targetTree;
-    private CayenneAction.CayenneToolbarButton moveButton;
-    private CayenneAction.CayenneToolbarButton moveInvertButton;
-    private Map<DataMap, ReverseEngineering> databaseStructures;
-
-    private ProjectController projectController;
-    private Map<Class, Integer> levels;
-    private Map<Class, List<Class>> insertableLevels;
-    private Map<Class, Class> actions;
-
-    public DraggableTreePanel(ProjectController projectController, DbImportTree sourceTree, DbImportTree targetTree) {
-        super(sourceTree);
-        this.targetTree = targetTree;
-        this.sourceTree = sourceTree;
-        this.projectController = projectController;
-        this.databaseStructures = new HashMap<>();
-        initLevels();
-        initElement();
-        initActions();
-        initListeners();
-    }
-
-    private void initActions() {
-        actions = new HashMap<>();
-        actions.put(Catalog.class, AddCatalogAction.class);
-        actions.put(Schema.class, AddSchemaAction.class);
-        actions.put(IncludeTable.class, AddIncludeTableAction.class);
-        actions.put(ExcludeTable.class, AddExcludeTableAction.class);
-        actions.put(IncludeColumn.class, AddIncludeColumnAction.class);
-        actions.put(ExcludeColumn.class, AddExcludeColumnAction.class);
-        actions.put(IncludeProcedure.class, AddIncludeProcedureAction.class);
-        actions.put(ExcludeProcedure.class, AddExcludeProcedureAction.class);
-    }
-
-    public void updateTree(DataMap dataMap) {
-        DbImportModel model = (DbImportModel) sourceTree.getModel();
-        model.reload();
-        if (databaseStructures.get(dataMap) != null) {
-            sourceTree.setReverseEngineering(databaseStructures.get(dataMap));
-            sourceTree.translateReverseEngineeringToTree(databaseStructures.get(dataMap), true);
-            sourceTree.setEnabled(true);
-        } else {
-            sourceTree.setEnabled(false);
-        }
-    }
-
-    private void initListeners() {
-        sourceTree.addKeyListener(new KeyListener() {
-            @Override
-            public void keyTyped(KeyEvent e) {}
-
-            @Override
-            public void keyPressed(KeyEvent e) {
-                if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
-                    sourceTree.setSelectionRow(-1);
-                    moveButton.setEnabled(false);
-                    moveInvertButton.setEnabled(false);
-                }
-            }
-
-            @Override
-            public void keyReleased(KeyEvent e) {}
-        });
-        targetTree.addKeyListener(new KeyListener() {
-            @Override
-            public void keyTyped(KeyEvent e) {}
-
-            @Override
-            public void keyPressed(KeyEvent e) {
-                if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
-                    targetTree.setSelectionRow(-1);
-                }
-            }
-
-            @Override
-            public void keyReleased(KeyEvent e) {}
-        });
-        targetTree.addTreeSelectionListener(e -> {
-            DbImportModel model = (DbImportModel) sourceTree.getModel();
-            DbImportTreeNode root = (DbImportTreeNode) model.getRoot();
-            sourceTree.repaint();
-            if (root.getChildCount() > 0) {
-                model.nodesChanged(root, new int[]{root.getChildCount() - 1});
-            }
-            if (canBeMoved()) {
-                moveButton.setEnabled(true);
-                if (canBeInverted()) {
-                    moveInvertButton.setEnabled(true);
-                } else {
-                    moveInvertButton.setEnabled(false);
-                }
-            } else {
-                moveButton.setEnabled(false);
-                moveInvertButton.setEnabled(false);
-            }
-        });
-        targetTree.setDragEnabled(true);
-        targetTree.setTransferHandler(new TransferHandler() {
-
-            @Override
-            public int getSourceActions(JComponent c) {
-                return COPY_OR_MOVE;
-            }
-
-            @Override
-            public boolean canImport(TransferSupport support) {
-                if (!support.isDrop()) {
-                    return false;
-                }
-                return true;
-            }
-
-            @Override
-            public boolean importData(TransferSupport support) {
-                if (!canImport(support)) {
-                    return false;
-                }
-                if (!canBeMoved()) {
-                    return false;
-                }
-                Transferable transferable = support.getTransferable();
-                DbImportTreeNode[] transferData = null;
-                try {
-                    for (DataFlavor dataFlavor : transferable.getTransferDataFlavors()) {
-                        transferData = (DbImportTreeNode[]) transferable.getTransferData(dataFlavor);
-                    }
-                } catch (IOException | UnsupportedFlavorException e) {
-                    return false;
-                }
-                if (transferData != null) {
-                    MoveImportNodeAction action = projectController.getApplication().
-                            getActionManager().getAction(MoveImportNodeAction.class);
-                    action.setSourceTree(sourceTree);
-                    action.setTargetTree(targetTree);
-                    action.setPanel(DraggableTreePanel.this);
-                    action.performAction(null);
-                    return true;
-                }
-                return false;
-            }
-        });
-    }
-
-    private boolean canBeInverted() {
-        if (sourceTree.getSelectionPath() != null) {
-            DbImportTreeNode selectedElement = sourceTree.getSelectedNode();
-            if (selectedElement == null) {
-                return false;
-            }
-            if (levels.get(selectedElement.getUserObject().getClass()) < SECOND_LEVEL) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private void initElement() {
-        sourceTree.setDragEnabled(true);
-        sourceTree.setCellRenderer(new ColorTreeRenderer());
-        sourceTree.setDropMode(DropMode.INSERT);
-        sourceTree.setTransferHandler(new TransferHandler() {
-
-            @Override
-            public int getSourceActions(JComponent c) {
-                return COPY;
-            }
-
-            @Override
-            public Transferable createTransferable(JComponent c) {
-                JTree tree = (JTree) c;
-                TreePath[] paths = tree.getSelectionPaths();
-                DbImportTreeNode[] nodes = new DbImportTreeNode[paths.length];
-                for (int i = 0; i < paths.length; i++) {
-                    nodes[i] = (DbImportTreeNode) paths[i].getLastPathComponent();
-                }
-                return new Transferable() {
-                    @Override
-                    public DataFlavor[] getTransferDataFlavors() {
-                        return TransferableNode.flavors;
-                    }
-
-                    @Override
-                    public boolean isDataFlavorSupported(DataFlavor flavor) {
-                        return true;
-                    }
-
-                    @Override
-                    public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
-                        return nodes;
-                    }
-                };
-            }
-        });
-        sourceTree.addTreeSelectionListener(e -> {
-            if (sourceTree.getLastSelectedPathComponent() != null) {
-                if (canBeMoved()) {
-                    moveButton.setEnabled(true);
-                    if (canBeInverted()) {
-                        moveInvertButton.setEnabled(true);
-                    } else {
-                        moveInvertButton.setEnabled(false);
-                    }
-                } else {
-                    moveInvertButton.setEnabled(false);
-                    moveButton.setEnabled(false);
-                }
-            }
-        });
-
-        sourceTree.addMouseListener(new MouseAdapter() {
-            @Override
-            public void mouseClicked(MouseEvent e) {
-                if (sourceTree.getRowForLocation(e.getX(),e.getY()) == -1) {
-                    sourceTree.setSelectionRow(-1);
-                    moveInvertButton.setEnabled(false);
-                    moveButton.setEnabled(false);
-                }
-            }
-        });
-
-        MoveImportNodeAction action = projectController.getApplication().
-                getActionManager().getAction(MoveImportNodeAction.class);
-        action.setPanel(this);
-        action.setSourceTree(sourceTree);
-        action.setTargetTree(targetTree);
-        moveButton = (CayenneAction.CayenneToolbarButton) action.buildButton();
-        moveButton.setShowingText(true);
-        moveButton.setText(MOVE_BUTTON_LABEL);
-        MoveInvertNodeAction actionInv = projectController.getApplication().
-                getActionManager().getAction(MoveInvertNodeAction.class);
-        actionInv.setPanel(this);
-        actionInv.setSourceTree(sourceTree);
-        actionInv.setTargetTree(targetTree);
-        moveInvertButton = (CayenneAction.CayenneToolbarButton) actionInv.buildButton();
-        moveInvertButton.setShowingText(true);
-        moveInvertButton.setText(MOVE_INV_BUTTON_LABEL);
-
-
-        DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) sourceTree.getCellRenderer();
-        renderer.setLeafIcon(null);
-        renderer.setClosedIcon(null);
-        renderer.setOpenIcon(null);
-    }
-
-    private void initLevels() {
-        levels = new HashMap<>();
-        levels.put(ReverseEngineering.class, ROOT_LEVEL);
-        levels.put(Catalog.class, FIRST_LEVEL);
-        levels.put(Schema.class, SECOND_LEVEL);
-        levels.put(IncludeTable.class, THIRD_LEVEL);
-        levels.put(IncludeColumn.class, FOURTH_LEVEL);
-        levels.put(ExcludeColumn.class, FOURTH_LEVEL);
-        levels.put(ExcludeTable.class, FIFTH_LEVEL);
-        levels.put(IncludeProcedure.class, FIFTH_LEVEL);
-        levels.put(ExcludeProcedure.class, FIFTH_LEVEL);
-
-        insertableLevels = new HashMap<>();
-        List<Class> rootLevelClasses = new ArrayList<>();
-        rootLevelClasses.add(Catalog.class);
-        rootLevelClasses.add(Schema.class);
-        rootLevelClasses.add(IncludeTable.class);
-        rootLevelClasses.add(ExcludeTable.class);
-        rootLevelClasses.add(IncludeColumn.class);
-        rootLevelClasses.add(ExcludeColumn.class);
-        rootLevelClasses.add(IncludeProcedure.class);
-        rootLevelClasses.add(ExcludeProcedure.class);
-
-        List<Class> catalogLevelClasses = new ArrayList<>();
-        catalogLevelClasses.add(Schema.class);
-        catalogLevelClasses.add(IncludeTable.class);
-        catalogLevelClasses.add(ExcludeTable.class);
-        catalogLevelClasses.add(IncludeColumn.class);
-        catalogLevelClasses.add(ExcludeColumn.class);
-        catalogLevelClasses.add(IncludeProcedure.class);
-        catalogLevelClasses.add(ExcludeProcedure.class);
-
-        List<Class> schemaLevelClasses = new ArrayList<>();
-        schemaLevelClasses.add(IncludeTable.class);
-        schemaLevelClasses.add(ExcludeTable.class);
-        schemaLevelClasses.add(IncludeColumn.class);
-        schemaLevelClasses.add(ExcludeColumn.class);
-        schemaLevelClasses.add(IncludeProcedure.class);
-        schemaLevelClasses.add(ExcludeProcedure.class);
-
-        List<Class> includeTableLevelClasses = new ArrayList<>();
-        includeTableLevelClasses.add(IncludeColumn.class);
-        includeTableLevelClasses.add(ExcludeColumn.class);
-
-        insertableLevels.put(ReverseEngineering.class, rootLevelClasses);
-        insertableLevels.put(Catalog.class, catalogLevelClasses);
-        insertableLevels.put(Schema.class, schemaLevelClasses);
-        insertableLevels.put(IncludeTable.class, includeTableLevelClasses);
-    }
-
-    private boolean canBeMoved() {
-        if (sourceTree.getSelectionPath() != null) {
-            DbImportTreeNode selectedElement = sourceTree.getSelectedNode();
-            if (selectedElement == null) {
-                return false;
-            }
-            Class draggableElementClass = selectedElement.getUserObject().getClass();
-            Class reverseEngineeringElementClass;
-            if (targetTree.getSelectionPath() != null) {
-                selectedElement = targetTree.getSelectedNode();
-                DbImportTreeNode parent = (DbImportTreeNode) selectedElement.getParent();
-                if (parent != null) {
-                    reverseEngineeringElementClass = parent.getUserObject().getClass();
-                } else {
-                    reverseEngineeringElementClass = selectedElement.getUserObject().getClass();
-                }
-            } else {
-                reverseEngineeringElementClass = ReverseEngineering.class;
-            }
-            List<Class> containsList = insertableLevels.get(reverseEngineeringElementClass);
-            return containsList.contains(draggableElementClass);
-        }
-        return false;
-    }
-
-    public JButton getMoveButton() {
-        return moveButton;
-    }
-
-    public JButton getMoveInvertButton() {
-        return moveInvertButton;
-    }
-
-    public TreeManipulationAction getActionByNodeType(Class nodeType) {
-        Class actionClass = actions.get(nodeType);
-        if (actionClass != null) {
-            TreeManipulationAction action = (TreeManipulationAction) projectController.getApplication().
-                    getActionManager().getAction(actionClass);
-            return action;
-        }
-        return null;
-    }
-
-    public void bindReverseEngineeringToDatamap(DataMap dataMap, ReverseEngineering reverseEngineering) {
-        databaseStructures.put(dataMap, reverseEngineering);
-    }
-
-    public DbImportTree getSourceTree() {
-        return sourceTree;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/51289d1c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ReverseEngineeringConfigPanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ReverseEngineeringConfigPanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ReverseEngineeringConfigPanel.java
deleted file mode 100644
index 65c9282..0000000
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ReverseEngineeringConfigPanel.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.modeler.editor;
-
-import com.jgoodies.forms.builder.DefaultFormBuilder;
-import com.jgoodies.forms.layout.FormLayout;
-import org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering;
-import org.apache.cayenne.map.DataMap;
-import org.apache.cayenne.modeler.ProjectController;
-import org.apache.cayenne.modeler.util.NameGeneratorPreferences;
-import org.apache.cayenne.modeler.util.TextAdapter;
-
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Vector;
-
-/**
- * @since 4.1
- */
-public class ReverseEngineeringConfigPanel extends JPanel {
-
-    private static final String DATA_FIELDS_LAYOUT = "right:pref, 3dlu, fill:235dlu";
-
-    private JComboBox<String> strategyCombo;
-    private TextAdapter meaningfulPk;
-    private TextAdapter stripFromTableNames;
-    private JCheckBox skipRelationshipsLoading;
-    private JCheckBox skipPrimaryKeyLoading;
-    private JCheckBox forceDataMapCatalog;
-    private JCheckBox forceDataMapSchema;
-    private JCheckBox usePrimitives;
-    private JCheckBox useJava7Types;
-
-    private ProjectController projectController;
-
-    ReverseEngineeringConfigPanel(ProjectController projectController) {
-        this.projectController = projectController;
-        initFormElements();
-        initListeners();
-        buildView();
-    }
-
-    private void buildView() {
-        FormLayout panelLayout = new FormLayout(DATA_FIELDS_LAYOUT);
-        DefaultFormBuilder panelBuilder = new DefaultFormBuilder(panelLayout);
-        panelBuilder.setDefaultDialogBorder();
-
-        panelBuilder.append("Tables with Meaningful PK Pattern:", meaningfulPk.getComponent());
-        panelBuilder.append("Strip from table names:", stripFromTableNames.getComponent());
-        panelBuilder.append("Skip relationships loading:", skipRelationshipsLoading);
-        panelBuilder.append("Skip primary key loading:", skipPrimaryKeyLoading);
-        panelBuilder.append("Force datamap catalog:", forceDataMapCatalog);
-        panelBuilder.append("Force datamap schema:", forceDataMapSchema);
-        panelBuilder.append("Use Java primitive types:", usePrimitives);
-        panelBuilder.append("Use java.util.Date type:", useJava7Types);
-        panelBuilder.append(strategyCombo);
-
-        add(panelBuilder.getPanel());
-    }
-
-    void fillCheckboxes(ReverseEngineering reverseEngineering) {
-        skipRelationshipsLoading.setSelected(reverseEngineering.getSkipRelationshipsLoading());
-        skipPrimaryKeyLoading.setSelected(reverseEngineering.getSkipPrimaryKeyLoading());
-        forceDataMapCatalog.setSelected(reverseEngineering.isForceDataMapCatalog());
-        forceDataMapSchema.setSelected(reverseEngineering.isForceDataMapSchema());
-        usePrimitives.setSelected(reverseEngineering.isUsePrimitives());
-        useJava7Types.setSelected(reverseEngineering.isUseJava7Types());
-    }
-
-    void initializeTextFields(ReverseEngineering reverseEngineering) {
-        meaningfulPk.setText(reverseEngineering.getMeaningfulPkTables());
-        stripFromTableNames.setText(reverseEngineering.getStripFromTableNames());
-    }
-
-    private ReverseEngineering getReverseEngineeringBySelectedMap() {
-        DataMap dataMap = projectController.getCurrentDataMap();
-        return projectController.getApplication().getMetaData().get(dataMap, ReverseEngineering.class);
-    }
-
-    private void initStrategy() {
-        Vector<String> arr = NameGeneratorPreferences
-                .getInstance()
-                .getLastUsedStrategies();
-        strategyCombo.setModel(new DefaultComboBoxModel<>(arr));
-    }
-
-    private void initFormElements() {
-        strategyCombo = new JComboBox<>();
-        strategyCombo.addActionListener(e -> {
-            getReverseEngineeringBySelectedMap().setNamingStrategy(
-                    (String) ReverseEngineeringConfigPanel.this.getStrategyCombo().getSelectedItem()
-            );
-            projectController.setDirty(true);
-        });
-        strategyCombo.setVisible(false);
-
-        JTextField meaningfulPkField = new JTextField();
-        meaningfulPkField.setToolTipText("<html>Regular expression to filter tables with meaningful primary keys.<br>" +
-                "Multiple expressions divided by comma can be used.<br>" +
-                "Example: <b>^table1|^table2|^prefix.*|table_name</b></html>");
-        meaningfulPk = new TextAdapter(meaningfulPkField) {
-            protected void updateModel(String text) {
-                getReverseEngineeringBySelectedMap().setMeaningfulPkTables(text);
-                projectController.setDirty(true);
-            }
-        };
-
-        JTextField stripFromTableNamesField = new JTextField();
-        stripFromTableNamesField.setToolTipText("<html>Regex that matches the part of the table name that needs to be stripped off " +
-                "when generating ObjEntity name</html>");
-        stripFromTableNames = new TextAdapter(stripFromTableNamesField) {
-            protected void updateModel(String text) {
-                getReverseEngineeringBySelectedMap().setStripFromTableNames(text);
-                projectController.setDirty(true);
-            }
-        };
-
-        skipRelationshipsLoading = new JCheckBox();
-        skipRelationshipsLoading.setToolTipText("<html>Whether to load relationships.</html>");
-        skipPrimaryKeyLoading = new JCheckBox();
-        skipPrimaryKeyLoading.setToolTipText("<html>Whether to load primary keys.</html>");
-        forceDataMapCatalog = new JCheckBox();
-        forceDataMapCatalog.setToolTipText("<html>Automatically tagging each DbEntity with the actual DB catalog/schema" +
-                "(default behavior) may sometimes be undesirable.<br>  If this is the case then setting <b>forceDataMapCatalog</b> " +
-                "to <b>true</b> will set DbEntity catalog to one in the DataMap.</html>");
-        forceDataMapSchema = new JCheckBox();
-        forceDataMapSchema.setToolTipText("<html>Automatically tagging each DbEntity with the actual DB catalog/schema " +
-                "(default behavior) may sometimes be undesirable.<br> If this is the case then setting <b>forceDataMapSchema</b> " +
-                "to <b>true</b> will set DbEntity schema to one in the DataMap.</html>");
-        useJava7Types = new JCheckBox();
-        useJava7Types.setToolTipText("<html>Use <b>java.util.Date</b> for all columns with <i>DATE/TIME/TIMESTAMP</i> types.<br>" +
-                "By default <b>java.time.*</b> types will be used.</html>");
-        usePrimitives = new JCheckBox();
-        usePrimitives.setToolTipText("<html>Use primitive types (e.g. int) or Object types (e.g. java.lang.Integer)</html>");
-        initStrategy();
-    }
-
-    private void initListeners() {
-        skipRelationshipsLoading.addActionListener(e -> {
-            getReverseEngineeringBySelectedMap().setSkipRelationshipsLoading(skipRelationshipsLoading.isSelected());
-            projectController.setDirty(true);
-        });
-        skipPrimaryKeyLoading.addActionListener(e -> {
-            getReverseEngineeringBySelectedMap().setSkipPrimaryKeyLoading(skipPrimaryKeyLoading.isSelected());
-            projectController.setDirty(true);
-        });
-        forceDataMapCatalog.addActionListener(e -> {
-            getReverseEngineeringBySelectedMap().setForceDataMapCatalog(forceDataMapCatalog.isSelected());
-            projectController.setDirty(true);
-        });
-        forceDataMapSchema.addActionListener(e -> {
-            getReverseEngineeringBySelectedMap().setForceDataMapSchema(forceDataMapSchema.isSelected());
-            projectController.setDirty(true);
-        });
-        usePrimitives.addActionListener(e -> {
-            getReverseEngineeringBySelectedMap().setUsePrimitives(usePrimitives.isSelected());
-            projectController.setDirty(true);
-        });
-        useJava7Types.addActionListener(e -> {
-            getReverseEngineeringBySelectedMap().setUseJava7Types(useJava7Types.isSelected());
-            projectController.setDirty(true);
-        });
-    }
-
-    JComboBox<String> getStrategyCombo() {
-        return strategyCombo;
-    }
-
-    TextAdapter getMeaningfulPk() {
-        return meaningfulPk;
-    }
-
-    TextAdapter getStripFromTableNames() {
-        return stripFromTableNames;
-    }
-
-    JCheckBox getSkipRelationshipsLoading() {
-        return skipRelationshipsLoading;
-    }
-
-    JCheckBox getSkipPrimaryKeyLoading() {
-        return skipPrimaryKeyLoading;
-    }
-
-    JCheckBox getForceDataMapCatalog() {
-        return forceDataMapCatalog;
-    }
-
-    JCheckBox getForceDataMapSchema() {
-        return forceDataMapSchema;
-    }
-
-    JCheckBox getUsePrimitives() {
-        return usePrimitives;
-    }
-
-    JCheckBox getUseJava7Types() {
-        return useJava7Types;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/51289d1c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ReverseEngineeringTreePanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ReverseEngineeringTreePanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ReverseEngineeringTreePanel.java
deleted file mode 100644
index 8c50c1e..0000000
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ReverseEngineeringTreePanel.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.modeler.editor;
-
-import org.apache.cayenne.dbsync.reverse.dbimport.Catalog;
-import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeColumn;
-import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeProcedure;
-import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeTable;
-import org.apache.cayenne.dbsync.reverse.dbimport.IncludeColumn;
-import org.apache.cayenne.dbsync.reverse.dbimport.IncludeProcedure;
-import org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable;
-import org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering;
-import org.apache.cayenne.dbsync.reverse.dbimport.Schema;
-import org.apache.cayenne.map.DataMap;
-import org.apache.cayenne.modeler.ProjectController;
-import org.apache.cayenne.modeler.dialog.db.load.CatalogPopUpMenu;
-import org.apache.cayenne.modeler.dialog.db.load.DbImportTreeNode;
-import org.apache.cayenne.modeler.dialog.db.load.DefaultPopUpMenu;
-import org.apache.cayenne.modeler.dialog.db.load.IncludeTablePopUpMenu;
-import org.apache.cayenne.modeler.dialog.db.load.RootPopUpMenu;
-import org.apache.cayenne.modeler.dialog.db.load.SchemaPopUpMenu;
-
-import javax.swing.JScrollPane;
-import javax.swing.JTree;
-import javax.swing.SwingUtilities;
-import javax.swing.tree.DefaultTreeCellRenderer;
-import javax.swing.tree.TreePath;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @since 4.1
- */
-class ReverseEngineeringTreePanel extends JScrollPane {
-
-    private DbImportTree reverseEngineeringTree;
-    private DbImportTree dbSchemaTree;
-
-    private ProjectController projectController;
-    private TreeToolbarPanel treeToolbar;
-    private Map<Class, DefaultPopUpMenu> popups;
-
-    ReverseEngineeringTreePanel(ProjectController projectController, DbImportTree reverseEngineeringTree,
-                                DbImportTree dbSchemaTree) {
-        super(reverseEngineeringTree);
-        this.projectController = projectController;
-        this.reverseEngineeringTree = reverseEngineeringTree;
-        this.dbSchemaTree = dbSchemaTree;
-        reverseEngineeringTree.setEditable(true);
-        reverseEngineeringTree.setCellRenderer(new DbImportTreeCellRenderer());
-        DbImportTreeCellEditor editor = new DbImportTreeCellEditor(reverseEngineeringTree,
-                (DefaultTreeCellRenderer) reverseEngineeringTree.getCellRenderer());
-        editor.setProjectController(projectController);
-        reverseEngineeringTree.setCellEditor(editor);
-        initListeners();
-        initPopupMenus();
-        changeIcons();
-    }
-
-    void updateTree() {
-        reverseEngineeringTree.translateReverseEngineeringToTree(getReverseEngineeringBySelectedMap(), false);
-    }
-
-    private void initPopupMenus() {
-        popups = new HashMap<>();
-        popups.put(Catalog.class, new CatalogPopUpMenu());
-        popups.put(Schema.class, new SchemaPopUpMenu());
-        popups.put(ReverseEngineering.class, new RootPopUpMenu());
-        popups.put(String.class, new RootPopUpMenu());
-        popups.put(IncludeTable.class, new IncludeTablePopUpMenu());
-        popups.put(ExcludeTable.class, new DefaultPopUpMenu());
-        popups.put(IncludeColumn.class, new DefaultPopUpMenu());
-        popups.put(ExcludeColumn.class, new DefaultPopUpMenu());
-        popups.put(IncludeProcedure.class, new DefaultPopUpMenu());
-        popups.put(ExcludeProcedure.class, new DefaultPopUpMenu());
-    }
-
-    private void initListeners() {
-        reverseEngineeringTree.addTreeSelectionListener(e -> treeToolbar.lockButtons());
-        reverseEngineeringTree.addMouseListener(new MouseAdapter() {
-            @Override
-            public void mouseClicked(MouseEvent e) {
-                if (reverseEngineeringTree.getRowForLocation(e.getX(), e.getY()) == -1) {
-                    reverseEngineeringTree.setSelectionRow(-1);
-                }
-
-                if (SwingUtilities.isRightMouseButton(e)) {
-                    if (reverseEngineeringTree.isEditing()) {
-                        return;
-                    }
-                    int row = reverseEngineeringTree.getClosestRowForLocation(e.getX(), e.getY());
-                    reverseEngineeringTree.setSelectionRow(row);
-                    DefaultPopUpMenu popupMenu;
-                    DbImportTreeNode selectedElement;
-                    if (reverseEngineeringTree.getSelectionPath() != null) {
-                        selectedElement = reverseEngineeringTree.getSelectedNode();
-                        popupMenu = popups.get(selectedElement.getUserObject().getClass());
-                    } else {
-                        selectedElement = reverseEngineeringTree.getRootNode();
-                        popupMenu = popups.get(ReverseEngineering.class);
-                    }
-                    if (popupMenu != null) {
-                        popupMenu.setProjectController(projectController);
-                        popupMenu.setSelectedElement(selectedElement);
-                        popupMenu.setParentElement((DbImportTreeNode) selectedElement.getParent());
-                        popupMenu.setTree(reverseEngineeringTree);
-                        popupMenu.show(e.getComponent(), e.getX(), e.getY());
-                    }
-                } else if (reverseEngineeringTree.getSelectionPath() != null) {
-                    DbImportTreeNode findedNode = dbSchemaTree.findNode(
-                            dbSchemaTree.getRootNode(), reverseEngineeringTree.getSelectedNode(), 0
-                    );
-                    if (findedNode != null) {
-                        dbSchemaTree.expandPath(new TreePath(((DbImportTreeNode) findedNode.getParent()).getPath()));
-                        scrollToNode(dbSchemaTree, findedNode);
-                    }
-                }
-            }
-        });
-    }
-
-    private void scrollToNode(JTree tree, DbImportTreeNode node) {
-        TreePath path = new TreePath(node.getPath());
-        tree.scrollPathToVisible(path);
-        DraggableTreePanel parentPanel = ((DraggableTreePanel) dbSchemaTree.getParent().getParent());
-        parentPanel.getHorizontalScrollBar().setValue(0);
-    }
-
-    private ReverseEngineering getReverseEngineeringBySelectedMap() {
-        DataMap dataMap = projectController.getCurrentDataMap();
-        return projectController.getApplication().getMetaData().get(dataMap, ReverseEngineering.class);
-    }
-
-    private void changeIcons() {
-        // Deleting standard tree icons
-        DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) reverseEngineeringTree.getCellRenderer();
-        renderer.setLeafIcon(null);
-        renderer.setClosedIcon(null);
-        renderer.setOpenIcon(null);
-    }
-
-    public DbImportTree getReverseEngineeringTree() {
-        return reverseEngineeringTree;
-    }
-
-    void setTreeToolbar(TreeToolbarPanel treeToolbar) {
-        this.treeToolbar = treeToolbar;
-    }
-}


Mime
View raw message