cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [5/5] cayenne git commit: Global Modeler update and bug fixing. Major changes: - CAY-2300 New icons and design improvements - alert istead of silent fail for edit relationship without target - closes #206 CAY-2287 - closes #209 inheritance icon allow
Date Wed, 10 May 2017 14:17:42 GMT
Global Modeler update and bug fixing.
Major changes:
 - CAY-2300 New icons and design improvements
 - alert istead of silent fail for edit relationship without target
 - closes #206 CAY-2287
 - closes #209 inheritance icon allows to go to super Entity
 - removed unused code


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/09b0fdb0
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/09b0fdb0
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/09b0fdb0

Branch: refs/heads/master
Commit: 09b0fdb0097448c8a04049984ff37cdd2d6e6989
Parents: 652004e
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Wed May 10 17:17:22 2017 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Wed May 10 17:17:23 2017 +0300

----------------------------------------------------------------------
 docs/doc/src/main/resources/RELEASE-NOTES.txt   |   1 +
 .../modeler/generic/GenericButtonUI.java        |  59 +++++
 .../generic/GenericPlatformInitializer.java     |  23 +-
 .../apache/cayenne/modeler/osx/OSXPanelUI.java  |  84 +++++++
 .../modeler/osx/OSXPlatformInitializer.java     |  32 ++-
 .../modeler/osx/OSXToolBarSeparatorUI.java      |  64 +++++
 .../modeler/win/WinPlatformInitializer.java     |  22 ++
 .../org/apache/cayenne/modeler/Application.java |  16 +-
 .../cayenne/modeler/CayenneModelerFrame.java    | 240 ++++++++++++-------
 .../java/org/apache/cayenne/modeler/Main.java   |   8 +-
 .../cayenne/modeler/ModelerConstants.java       |   4 +-
 .../cayenne/modeler/ProjectTreeModel.java       |  29 +--
 .../apache/cayenne/modeler/ProjectTreeView.java | 160 +++++++------
 .../cayenne/modeler/action/AboutAction.java     |   1 -
 .../modeler/action/BaseViewEntityAction.java    |  83 +++++++
 .../ChangeObjEntityListenerClassAction.java     | 128 ----------
 .../cayenne/modeler/action/CopyAction.java      |   2 +-
 .../modeler/action/CreateAttributeAction.java   |   2 +-
 .../action/CreateCallbackMethodAction.java      |   2 +-
 .../modeler/action/CreateDataMapAction.java     |   2 +-
 .../modeler/action/CreateDbEntityAction.java    |   2 +-
 .../modeler/action/CreateEmbeddableAction.java  |   2 +-
 .../modeler/action/CreateNodeAction.java        |   2 +-
 .../modeler/action/CreateObjEntityAction.java   |   2 +-
 .../modeler/action/CreateProcedureAction.java   |   2 +-
 .../action/CreateProcedureParameterAction.java  |   2 +-
 .../modeler/action/CreateQueryAction.java       |   2 +-
 .../action/CreateRelationshipAction.java        |   2 +-
 .../cayenne/modeler/action/CutAction.java       |   2 +-
 .../action/DbEntityCounterpartAction.java       |   2 +-
 .../modeler/action/DbEntitySyncAction.java      |   2 +-
 .../modeler/action/DefaultActionManager.java    |   6 +-
 .../cayenne/modeler/action/FilterAction.java    |  11 +-
 .../modeler/action/GenerateCodeAction.java      |   2 +-
 .../modeler/action/ImportEOModelAction.java     |   4 -
 .../modeler/action/LinkDataMapsAction.java      |   2 +-
 .../cayenne/modeler/action/MigrateAction.java   |   8 +
 .../modeler/action/NavigateBackwardAction.java  |   3 +-
 .../modeler/action/NavigateForwardAction.java   |   3 +-
 .../modeler/action/NewProjectAction.java        |   2 +-
 .../action/ObjEntityCounterpartAction.java      |  51 +---
 .../modeler/action/ObjEntitySyncAction.java     |   2 +-
 .../action/ObjEntityToSuperEntityAction.java    |  42 ++++
 .../modeler/action/OpenProjectAction.java       |   2 +-
 .../cayenne/modeler/action/PasteAction.java     |   2 +-
 .../cayenne/modeler/action/ProjectOpener.java   |  22 +-
 .../cayenne/modeler/action/RedoAction.java      |   2 +-
 .../cayenne/modeler/action/RemoveAction.java    |   2 +-
 .../action/RemoveCallbackMethodAction.java      |   2 +-
 .../action/RemoveEntityListenerAction.java      | 101 --------
 .../RemoveEntityListenerForDataMapAction.java   |  98 --------
 .../cayenne/modeler/action/SaveAction.java      |   2 +-
 .../cayenne/modeler/action/UndoAction.java      |   2 +-
 .../modeler/dialog/ConfirmRemoveDialog.java     |  21 +-
 .../cayenne/modeler/dialog/LogConsole.java      |  62 ++---
 .../cayenne/modeler/dialog/LogConsoleView.java  | 114 +++++----
 .../dialog/ResolveDbRelationshipDialog.java     |  29 ++-
 .../modeler/dialog/UnsavedChangesDialog.java    |  51 +---
 .../dialog/datadomain/FilterController.java     |  16 +-
 .../modeler/dialog/datadomain/FilterDialog.java |  41 +---
 .../objentity/ObjAttributeInfoDialogView.java   |   5 +-
 .../dialog/pref/ClasspathPreferencesView.java   |   5 +-
 .../dialog/pref/PreferenceDialogView.java       |  51 ++--
 .../modeler/dialog/pref/TemplateCreator.java    |  12 +-
 .../dialog/pref/TemplatePreferences.java        |   6 +-
 .../dialog/pref/TemplatePreferencesView.java    |   5 +-
 .../modeler/dialog/welcome/WelcomeScreen.java   |   2 +
 .../editor/AbstractCallbackMethodsTab.java      | 144 +++++------
 .../editor/CallbackDescriptorTableModel.java    |  21 +-
 .../cayenne/modeler/editor/EditorView.java      |  93 +++----
 .../modeler/editor/EmbeddableAttributeTab.java  |   7 +-
 .../cayenne/modeler/editor/EmbeddableTab.java   |   3 +
 .../modeler/editor/ObjEntityAttributePanel.java |  29 ++-
 .../ObjEntityAttributeRelationshipTab.java      |  26 +-
 .../editor/ObjEntityRelationshipPanel.java      |  17 +-
 .../cayenne/modeler/editor/ObjEntityTab.java    |  24 +-
 .../modeler/editor/ProcedureParameterTab.java   |  85 +++----
 .../editor/ProcedureParameterTableModel.java    | 117 ++++-----
 .../modeler/editor/SelectQueryMainTab.java      |   3 +
 .../modeler/editor/SelectQueryOrderingTab.java  |  39 +--
 .../modeler/editor/SelectQueryPrefetchTab.java  |  26 +-
 .../editor/dbentity/DbEntityAttributePanel.java |   7 +-
 .../DbEntityAttributeRelationshipTab.java       |  36 +--
 .../dbentity/DbEntityRelationshipPanel.java     |   6 +-
 .../modeler/editor/dbentity/DbEntityTab.java    |  37 +--
 .../event/ListenerClassSelectionEvent.java      |  53 ----
 .../event/ListenerClassSelectionListener.java   |  36 ---
 .../cayenne/modeler/graph/BaseGraphBuilder.java |  20 +-
 .../modeler/graph/DataDomainGraphTab.java       |  11 +-
 .../modeler/pref/TableColumnPreferences.java    |  18 +-
 .../cayenne/modeler/util/BevelArrowIcon.java    | 166 -------------
 .../modeler/util/BoardTableCellRenderer.java    |   3 +
 .../cayenne/modeler/util/CayenneAction.java     |  25 +-
 .../cayenne/modeler/util/CayenneTable.java      |   7 +
 .../cayenne/modeler/util/CellRenderers.java     | 118 ++++-----
 .../util/DbAttributePathComboBoxRenderer.java   |   3 +-
 .../modeler/util/DefaultWidgetFactory.java      |   3 +-
 .../modeler/util/JUndoableCayenneTextPane.java  |   3 +-
 .../cayenne/modeler/util/ModelerUtil.java       |  86 +++----
 .../modeler/util/MultiColumnBrowser.java        |   2 +-
 .../util/PathChooserComboBoxCellEditor.java     |   4 +-
 .../modeler/util/SortButtonRenderer.java        |  44 +++-
 .../modeler/util/TableHeaderListener.java       |  22 +-
 .../modeler/util/combo/EditorTextField.java     |  23 +-
 .../modeler/util/combo/SuggestionList.java      |   8 +-
 .../cayenne/pref/CayennePreferenceEditor.java   |  70 ++----
 .../cayenne/swing/components/MainToolBar.java   |  50 ++++
 .../cayenne/swing/components/TopBorder.java     |  83 +++++++
 .../components/image/FilteredIconFactory.java   | 114 +++++++++
 .../components/textpane/JCayenneTextPane.java   |   7 +-
 .../modeler/cayennemodeler-strings.properties   |   2 +-
 .../org/apache/cayenne/modeler/images/error.gif | Bin 328 -> 0 bytes
 .../cayenne/modeler/images/icon-alphab_sort.gif | Bin 331 -> 0 bytes
 .../modeler/images/icon-arrow-closed.png        | Bin 0 -> 232 bytes
 .../cayenne/modeler/images/icon-arrow-open.png  | Bin 0 -> 205 bytes
 .../cayenne/modeler/images/icon-attribute.gif   | Bin 1171 -> 0 bytes
 .../cayenne/modeler/images/icon-attribute.png   | Bin 0 -> 293 bytes
 .../cayenne/modeler/images/icon-backward.png    | Bin 0 -> 218 bytes
 .../modeler/images/icon-backward_nav.gif        | Bin 532 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-copy.gif | Bin 607 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-copy.png | Bin 0 -> 181 bytes
 .../modeler/images/icon-create-listener.gif     | Bin 274 -> 0 bytes
 .../modeler/images/icon-create-method.gif       | Bin 278 -> 0 bytes
 .../modeler/images/icon-create-method.png       | Bin 0 -> 479 bytes
 .../apache/cayenne/modeler/images/icon-cut.gif  | Bin 212 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-cut.png  | Bin 0 -> 391 bytes
 .../cayenne/modeler/images/icon-datamap.gif     | Bin 755 -> 0 bytes
 .../cayenne/modeler/images/icon-datamap.png     | Bin 0 -> 411 bytes
 .../cayenne/modeler/images/icon-dbentity.gif    | Bin 1171 -> 0 bytes
 .../cayenne/modeler/images/icon-dbentity.png    | Bin 0 -> 142 bytes
 .../apache/cayenne/modeler/images/icon-dom.gif  | Bin 1171 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-dom.png  | Bin 0 -> 421 bytes
 .../apache/cayenne/modeler/images/icon-down.png | Bin 0 -> 248 bytes
 .../apache/cayenne/modeler/images/icon-edit.png | Bin 0 -> 340 bytes
 .../cayenne/modeler/images/icon-embeddable.gif  | Bin 581 -> 0 bytes
 .../cayenne/modeler/images/icon-embeddable.png  | Bin 0 -> 440 bytes
 .../cayenne/modeler/images/icon-eomodel.gif     | Bin 1171 -> 0 bytes
 .../cayenne/modeler/images/icon-error.gif       | Bin 331 -> 0 bytes
 .../cayenne/modeler/images/icon-error.png       | Bin 0 -> 418 bytes
 .../cayenne/modeler/images/icon-filter.png      | Bin 329 -> 296 bytes
 .../cayenne/modeler/images/icon-forward.png     | Bin 0 -> 230 bytes
 .../cayenne/modeler/images/icon-forward_nav.gif | Bin 532 -> 0 bytes
 .../cayenne/modeler/images/icon-gen_java.gif    | Bin 755 -> 0 bytes
 .../cayenne/modeler/images/icon-gen_java.png    | Bin 0 -> 349 bytes
 .../apache/cayenne/modeler/images/icon-info.gif | Bin 755 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-info.png | Bin 0 -> 702 bytes
 .../cayenne/modeler/images/icon-inheritance.png | Bin 0 -> 473 bytes
 .../cayenne/modeler/images/icon-move_down.gif   | Bin 532 -> 0 bytes
 .../cayenne/modeler/images/icon-move_down.png   | Bin 0 -> 304 bytes
 .../cayenne/modeler/images/icon-move_up.gif     | Bin 532 -> 0 bytes
 .../cayenne/modeler/images/icon-move_up.png     | Bin 0 -> 558 bytes
 .../apache/cayenne/modeler/images/icon-new.gif  | Bin 1171 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-new.png  | Bin 0 -> 154 bytes
 .../modeler/images/icon-new_embeddable.gif      | Bin 396 -> 0 bytes
 .../modeler/images/icon-new_embeddable.png      | Bin 0 -> 521 bytes
 .../modeler/images/icon-new_objentity.gif       | Bin 755 -> 0 bytes
 .../modeler/images/icon-new_objentity.png       | Bin 0 -> 563 bytes
 .../cayenne/modeler/images/icon-new_query.png   | Bin 0 -> 466 bytes
 .../apache/cayenne/modeler/images/icon-node.gif | Bin 331 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-node.png | Bin 0 -> 350 bytes
 .../cayenne/modeler/images/icon-objentity.gif   | Bin 755 -> 0 bytes
 .../cayenne/modeler/images/icon-objentity.png   | Bin 0 -> 481 bytes
 .../apache/cayenne/modeler/images/icon-open.gif | Bin 1171 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-open.png | Bin 0 -> 317 bytes
 .../cayenne/modeler/images/icon-override.gif    | Bin 72 -> 0 bytes
 .../cayenne/modeler/images/icon-paste.gif       | Bin 605 -> 0 bytes
 .../cayenne/modeler/images/icon-paste.png       | Bin 0 -> 244 bytes
 .../apache/cayenne/modeler/images/icon-plus.gif | Bin 532 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-plus.png | Bin 0 -> 129 bytes
 .../cayenne/modeler/images/icon-query.gif       | Bin 331 -> 0 bytes
 .../cayenne/modeler/images/icon-query.png       | Bin 0 -> 380 bytes
 .../apache/cayenne/modeler/images/icon-redo.gif | Bin 356 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-redo.png | Bin 0 -> 525 bytes
 .../cayenne/modeler/images/icon-refresh.png     | Bin 465 -> 506 bytes
 .../modeler/images/icon-relationship.gif        | Bin 1171 -> 0 bytes
 .../modeler/images/icon-relationship.png        | Bin 0 -> 347 bytes
 .../modeler/images/icon-remove-listener.gif     | Bin 286 -> 0 bytes
 .../modeler/images/icon-remove-method.gif       | Bin 289 -> 0 bytes
 .../cayenne/modeler/images/icon-remove.png      | Bin 0 -> 246 bytes
 .../modeler/images/icon-save-as-image.png       | Bin 462 -> 217 bytes
 .../apache/cayenne/modeler/images/icon-save.gif | Bin 331 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-save.png | Bin 0 -> 216 bytes
 .../cayenne/modeler/images/icon-sort-asc.png    | Bin 0 -> 189 bytes
 .../cayenne/modeler/images/icon-sort-desc.png   | Bin 0 -> 220 bytes
 .../modeler/images/icon-stored-procedure.gif    | Bin 1171 -> 0 bytes
 .../modeler/images/icon-stored-procedure.png    | Bin 0 -> 389 bytes
 .../apache/cayenne/modeler/images/icon-sync.gif | Bin 331 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-sync.png | Bin 0 -> 280 bytes
 .../cayenne/modeler/images/icon-trash.gif       | Bin 331 -> 0 bytes
 .../cayenne/modeler/images/icon-trash.png       | Bin 0 -> 164 bytes
 .../modeler/images/icon-tree-collapse.png       | Bin 295 -> 252 bytes
 .../apache/cayenne/modeler/images/icon-undo.gif | Bin 355 -> 0 bytes
 .../apache/cayenne/modeler/images/icon-undo.png | Bin 0 -> 511 bytes
 .../apache/cayenne/modeler/images/icon-up.png   | Bin 0 -> 234 bytes
 .../cayenne/modeler/images/icon-zoom-in.png     | Bin 700 -> 409 bytes
 .../cayenne/modeler/images/icon-zoom-out.png    | Bin 697 -> 403 bytes
 .../apache/cayenne/modeler/images/popupmenu.gif | Bin 285 -> 0 bytes
 .../cayenne/modeler/images/scroll_right.gif     | Bin 267 -> 0 bytes
 198 files changed, 1735 insertions(+), 1741 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/docs/doc/src/main/resources/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/RELEASE-NOTES.txt b/docs/doc/src/main/resources/RELEASE-NOTES.txt
index 2f6541d..bea5721 100644
--- a/docs/doc/src/main/resources/RELEASE-NOTES.txt
+++ b/docs/doc/src/main/resources/RELEASE-NOTES.txt
@@ -37,6 +37,7 @@ CAY-2278 Extract cayenne-postcommit module from cayenne-lifecycle
 CAY-2280 Switch from commons-logging to slf4j
 CAY-2295 "Sync ObjEntity with DbEntity" and "View related DbEntity" buttons aren't disabled, if DbEntity doesn't have ObjEntity
 CAY-2296 cayenne-crypto: Get java type for DbAttribute bound to ObjAttributes with the same type
+CAY-2300 Modeler: New icons and design improvements
 
 Bug Fixes:
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler-generic-ext/src/main/java/org/apache/cayenne/modeler/generic/GenericButtonUI.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler-generic-ext/src/main/java/org/apache/cayenne/modeler/generic/GenericButtonUI.java b/modeler/cayenne-modeler-generic-ext/src/main/java/org/apache/cayenne/modeler/generic/GenericButtonUI.java
new file mode 100644
index 0000000..306378d
--- /dev/null
+++ b/modeler/cayenne-modeler-generic-ext/src/main/java/org/apache/cayenne/modeler/generic/GenericButtonUI.java
@@ -0,0 +1,59 @@
+/*****************************************************************
+ *   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.generic;
+
+import javax.swing.AbstractButton;
+import javax.swing.JComponent;
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.LineBorder;
+import javax.swing.plaf.ComponentUI;
+
+import org.apache.cayenne.modeler.util.CayenneAction;
+
+/**
+ * @since 4.0
+ */
+public class GenericButtonUI extends com.jgoodies.looks.plastic.PlasticButtonUI {
+    private static final GenericButtonUI INSTANCE = new GenericButtonUI();
+
+    public GenericButtonUI() {
+    }
+
+    public static ComponentUI createUI(JComponent b) {
+        return INSTANCE;
+    }
+
+    @Override
+    public void installDefaults(AbstractButton b) {
+        super.installDefaults(b);
+        b.putClientProperty("Plastic.is3D", Boolean.FALSE);
+        if(b instanceof CayenneAction.CayenneToolbarButton) {
+            b.setBorder(
+                    new CompoundBorder(
+                            new EmptyBorder(1, 1, 1, 1),
+                            new CompoundBorder(
+                                    LineBorder.createGrayLineBorder(),
+                                    new EmptyBorder(4, 4, 4, 4))
+                    )
+            );
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler-generic-ext/src/main/java/org/apache/cayenne/modeler/generic/GenericPlatformInitializer.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler-generic-ext/src/main/java/org/apache/cayenne/modeler/generic/GenericPlatformInitializer.java b/modeler/cayenne-modeler-generic-ext/src/main/java/org/apache/cayenne/modeler/generic/GenericPlatformInitializer.java
index 5a5c426..3dfc4af 100644
--- a/modeler/cayenne-modeler-generic-ext/src/main/java/org/apache/cayenne/modeler/generic/GenericPlatformInitializer.java
+++ b/modeler/cayenne-modeler-generic-ext/src/main/java/org/apache/cayenne/modeler/generic/GenericPlatformInitializer.java
@@ -18,10 +18,13 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.generic;
 
+import java.awt.Color;
+import javax.swing.BorderFactory;
 import javax.swing.JFrame;
 import javax.swing.UIManager;
 
 import org.apache.cayenne.modeler.init.platform.PlatformInitializer;
+import org.apache.cayenne.modeler.util.ModelerUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -53,12 +56,28 @@ public class GenericPlatformInitializer implements PlatformInitializer {
 
         try {
             UIManager.setLookAndFeel(DEFAULT_LAF_NAME);
-        }
-        catch (Exception e) {
+            // override some default styles and colors
+            overrideUIDefaults();
+        } catch (Exception e) {
             logger.warn("Error installing L&F: " + DEFAULT_LAF_NAME, e);
         }
     }
 
+    private void overrideUIDefaults() {
+        UIManager.put("ButtonUI",                  GenericButtonUI.class.getName());
+        UIManager.put("HiResGrayFilterEnabled",    Boolean.TRUE);
+        UIManager.put("Tree.expandedIcon",         ModelerUtil.buildIcon("icon-arrow-open.png"));
+        UIManager.put("Tree.collapsedIcon",        ModelerUtil.buildIcon("icon-arrow-closed.png"));
+        UIManager.put("Tree.paintLines",           Boolean.FALSE);
+        UIManager.put("Tree.selectionBorderColor", UIManager.get("Tree.selectionBackground"));
+        UIManager.put("ScrollPane.border",         BorderFactory.createEmptyBorder());
+        UIManager.put("Table.scrollPaneBorder",    BorderFactory.createEmptyBorder());
+        UIManager.put("SplitPane.border",          BorderFactory.createEmptyBorder());
+        UIManager.put("ToolBar.border",            BorderFactory.createEmptyBorder(1, 1, 1, 1));
+        // this one is custom for MainToolBar
+        UIManager.put("MainToolBar.border",        BorderFactory.createLineBorder(Color.GRAY));
+    }
+
     protected PlasticTheme findTheme() {
 
         for (Object object : PlasticLookAndFeel.getInstalledThemes()) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXPanelUI.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXPanelUI.java b/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXPanelUI.java
new file mode 100644
index 0000000..fa45832
--- /dev/null
+++ b/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXPanelUI.java
@@ -0,0 +1,84 @@
+/*****************************************************************
+ *   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.osx;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicPanelUI;
+
+import org.apache.cayenne.modeler.CayenneModelerFrame;
+
+/**
+ * @since 4.0
+ */
+public class OSXPanelUI extends BasicPanelUI {
+
+    private static final Color BACKGROUND = new Color(0xEEEEEE);
+
+    private static final OSXPanelUI INSTANCE;
+
+    static {
+        BasicPanelUI delegate;
+        try {
+            @SuppressWarnings("unchecked")
+            Class<? extends  BasicPanelUI> delegateClass = (Class<? extends  BasicPanelUI>)
+                    Class.forName("com.apple.laf.AquaPanelUI");
+            delegate = delegateClass.newInstance();
+        } catch (Exception ex) {
+            delegate = new BasicPanelUI();
+        }
+
+        INSTANCE = new OSXPanelUI(delegate);
+    }
+
+    private BasicPanelUI delegate;
+
+    private OSXPanelUI(BasicPanelUI delegate) {
+        this.delegate = delegate;
+    }
+
+    public static ComponentUI createUI(JComponent c) {
+        return INSTANCE;
+    }
+
+    @Override
+    protected void installDefaults(final JPanel p) {
+        super.installDefaults(p);
+        if(p instanceof CayenneModelerFrame.SearchPanel) {
+            SwingUtilities.invokeLater(new Runnable() {
+                @Override
+                public void run() {
+                    ((CayenneModelerFrame.SearchPanel)p).hideSearchLabel();
+                }
+            });
+        } else {
+            p.setBackground(BACKGROUND);
+        }
+    }
+
+    @Override
+    public void update(Graphics g, JComponent c) {
+        delegate.update(g, c);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXPlatformInitializer.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXPlatformInitializer.java b/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXPlatformInitializer.java
index 21142f5..fa47935 100644
--- a/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXPlatformInitializer.java
+++ b/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXPlatformInitializer.java
@@ -18,16 +18,20 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.osx;
 
+import java.awt.Color;
 import java.awt.Component;
 import java.util.HashSet;
 import java.util.Set;
 
 import javax.swing.Action;
+import javax.swing.BorderFactory;
 import javax.swing.JFrame;
 import javax.swing.JMenu;
 import javax.swing.JMenuBar;
 import javax.swing.JMenuItem;
 import javax.swing.JPopupMenu;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
 
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.modeler.action.AboutAction;
@@ -43,7 +47,6 @@ import com.apple.eawt.PreferencesHandler;
 import com.apple.eawt.QuitHandler;
 import com.apple.eawt.QuitResponse;
 
-@SuppressWarnings("deprecation")
 public class OSXPlatformInitializer implements PlatformInitializer {
 
     @Inject
@@ -51,10 +54,10 @@ public class OSXPlatformInitializer implements PlatformInitializer {
 
     public void initLookAndFeel() {
 
-        // leave alone the look and feel. Presumably it is Aqua, since this
-        // launcher can only be executed on Mac
+        // override some default styles and colors, assuming that Aqua theme will be used
+        overrideUIDefaults();
 
-        // configure special Mac menu handlers though...
+        // configure special Mac menu handlers
         Application app = Application.getApplication();
         app.setAboutHandler(new AboutHandler() {
             @Override
@@ -80,7 +83,28 @@ public class OSXPlatformInitializer implements PlatformInitializer {
         });
     }
 
+    private void overrideUIDefaults() {
+        Color lightGrey = new Color(0xEEEEEE);
+        Color darkGrey  = new Color(225, 225, 225);
+        Border darkBorder = BorderFactory.createLineBorder(darkGrey);
+
+        UIManager.put("ToolBarSeparatorUI",          OSXToolBarSeparatorUI.class.getName());
+        UIManager.put("PanelUI",                     OSXPanelUI.class.getName());
+        // next two is custom made for Cayenne's MainToolBar
+        UIManager.put("MainToolBar.background",      UIManager.get("ToolBar.background"));
+        UIManager.put("MainToolBar.border",          BorderFactory.createEmptyBorder(0, 7, 0, 7));
+        UIManager.put("ToolBar.background",          lightGrey);
+        UIManager.put("ToolBar.border",              darkBorder);
+        UIManager.put("ScrollPane.border",           darkBorder);
+        UIManager.put("Table.scrollPaneBorder",      darkBorder);
+        UIManager.put("SplitPane.border",            BorderFactory.createEmptyBorder());
+        UIManager.put("SplitPane.background",        darkGrey);
+        UIManager.put("Tree.rendererFillBackground", Boolean.TRUE);
+    }
+
     public void setupMenus(JFrame frame) {
+        // set additional look and feel for the window
+        frame.getRootPane().putClientProperty("apple.awt.brushMetalLook", Boolean.TRUE);
 
         Set<Action> removeActions = new HashSet<>();
         removeActions.add(actionManager.getAction(ExitAction.class));

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXToolBarSeparatorUI.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXToolBarSeparatorUI.java b/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXToolBarSeparatorUI.java
new file mode 100644
index 0000000..d20f68d
--- /dev/null
+++ b/modeler/cayenne-modeler-mac-ext/src/main/java/org/apache/cayenne/modeler/osx/OSXToolBarSeparatorUI.java
@@ -0,0 +1,64 @@
+/*****************************************************************
+ *   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.osx;
+
+import java.awt.Dimension;
+import java.awt.Graphics;
+import javax.swing.JComponent;
+import javax.swing.JToolBar;
+import javax.swing.SwingConstants;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicToolBarSeparatorUI;
+
+/**
+ * This class provides correct size as in AquaToolBarSeparatorUI, but doesn't render anything.
+ *
+ * @since 4.0
+ */
+public class OSXToolBarSeparatorUI extends BasicToolBarSeparatorUI {
+
+    private OSXToolBarSeparatorUI() {
+    }
+
+    public static ComponentUI createUI(JComponent c) {
+        return new OSXToolBarSeparatorUI();
+    }
+
+    public void paint( Graphics g, JComponent c ) {
+        // do nothing as we don't need it to be visible
+    }
+
+    public Dimension getMinimumSize(JComponent var1) {
+        JToolBar.Separator var2 = (JToolBar.Separator)var1;
+        return var2.getOrientation() == SwingConstants.HORIZONTAL
+                ? new Dimension(1, 11) : new Dimension(11, 1);
+    }
+
+    public Dimension getPreferredSize(JComponent var1) {
+        JToolBar.Separator var2 = (JToolBar.Separator)var1;
+        return var2.getOrientation() == SwingConstants.HORIZONTAL
+                ? new Dimension(1, 11) : new Dimension(11, 1);
+    }
+
+    public Dimension getMaximumSize(JComponent var1) {
+        JToolBar.Separator var2 = (JToolBar.Separator)var1;
+        return var2.getOrientation() == SwingConstants.HORIZONTAL
+                ? new Dimension(2147483647, 11) : new Dimension(11, 2147483647);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler-win-ext/src/main/java/org/apache/cayenne/modeler/win/WinPlatformInitializer.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler-win-ext/src/main/java/org/apache/cayenne/modeler/win/WinPlatformInitializer.java b/modeler/cayenne-modeler-win-ext/src/main/java/org/apache/cayenne/modeler/win/WinPlatformInitializer.java
index aebaa9c..5603733 100644
--- a/modeler/cayenne-modeler-win-ext/src/main/java/org/apache/cayenne/modeler/win/WinPlatformInitializer.java
+++ b/modeler/cayenne-modeler-win-ext/src/main/java/org/apache/cayenne/modeler/win/WinPlatformInitializer.java
@@ -20,11 +20,14 @@ package org.apache.cayenne.modeler.win;
 
 import com.jgoodies.looks.windows.WindowsLookAndFeel;
 import org.apache.cayenne.modeler.init.platform.PlatformInitializer;
+import org.apache.cayenne.modeler.util.ModelerUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.swing.JFrame;
 import javax.swing.UIManager;
+import javax.swing.BorderFactory;
+import java.awt.Color;
 
 public class WinPlatformInitializer implements PlatformInitializer {
 
@@ -36,8 +39,27 @@ public class WinPlatformInitializer implements PlatformInitializer {
     public void initLookAndFeel() {
         try {
             UIManager.setLookAndFeel(WindowsLookAndFeel.class.getName());
+            // override some default styles and colors
+            overrideUIDefaults();
         } catch (Exception e) {
             logger.warn("Error installing L&F: " + WindowsLookAndFeel.class.getName(), e);
         }
     }
+
+    private void overrideUIDefaults() {
+        Color darkGrey = new Color(225, 225, 225);
+
+        UIManager.put("Tree.expandedIcon",      ModelerUtil.buildIcon("icon-arrow-open.png"));
+        UIManager.put("Tree.collapsedIcon",     ModelerUtil.buildIcon("icon-arrow-closed.png"));
+        UIManager.put("Tree.paintLines",        Boolean.FALSE);
+        UIManager.put("Tree.drawDashedFocusIndicator",  Boolean.FALSE);
+        UIManager.put("Tree.selectionBorderColor",      UIManager.get("Tree.selectionBackground"));
+        UIManager.put("ScrollPane.border",      BorderFactory.createEmptyBorder());
+        UIManager.put("Table.scrollPaneBorder", BorderFactory.createEmptyBorder());
+        UIManager.put("SplitPane.border",       BorderFactory.createEmptyBorder());
+        UIManager.put("SplitPane.background",   darkGrey);
+        UIManager.put("Separator.background",   darkGrey);
+        UIManager.put("Separator.foreground",   darkGrey);
+        UIManager.put("Separator.opaque",       Boolean.TRUE);
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java
index 44ebd6d..10dd3aa 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java
@@ -238,7 +238,7 @@ public class Application {
                 "");
 
         Collection details = new ArrayList<>();
-        String[] keys = null;
+        String[] keys;
         ArrayList<String> values = new ArrayList<>();
 
         try {
@@ -246,14 +246,10 @@ public class Application {
             for (String cpKey : keys) {
             	values.add(classLoaderPreference.get(cpKey, ""));
             }
-        }
-        catch (BackingStoreException e) {
-            // do nothing
+        } catch (BackingStoreException ignored) {
         }
 
-        for (int i = 0; i < values.size(); i++) {
-            details.add(values.get(i));
-        }
+        details.addAll(values);
 
         if (details.size() > 0) {
 
@@ -274,13 +270,11 @@ public class Application {
         // set as EventDispatch thread default class loader
         if (SwingUtilities.isEventDispatchThread()) {
             Thread.currentThread().setContextClassLoader(classLoader.getClassLoader());
-        }
-        else {
+        } else {
             SwingUtilities.invokeLater(new Runnable() {
 
                 public void run() {
-                    Thread.currentThread().setContextClassLoader(
-                            classLoader.getClassLoader());
+                    Thread.currentThread().setContextClassLoader(classLoader.getClassLoader());
                 }
             });
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java
index 58fb829..daefadc 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java
@@ -23,18 +23,23 @@ import java.awt.AWTEvent;
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Component;
+import java.awt.Dimension;
 import java.awt.FlowLayout;
 import java.awt.Font;
 import java.awt.Toolkit;
 import java.awt.event.AWTEventListener;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
 import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
 import java.util.List;
 import java.util.Vector;
 
 import javax.swing.Action;
+import javax.swing.BorderFactory;
 import javax.swing.Box;
 import javax.swing.BoxLayout;
+import javax.swing.JButton;
 import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JFrame;
 import javax.swing.JLabel;
@@ -104,6 +109,8 @@ import org.apache.cayenne.modeler.event.RecentFileListListener;
 import org.apache.cayenne.modeler.pref.ComponentGeometry;
 import org.apache.cayenne.modeler.util.ModelerUtil;
 import org.apache.cayenne.modeler.util.RecentFileMenu;
+import org.apache.cayenne.swing.components.MainToolBar;
+import org.apache.cayenne.swing.components.TopBorder;
 import org.slf4j.LoggerFactory;
 
 /**
@@ -150,7 +157,7 @@ public class CayenneModelerFrame extends JFrame implements DataNodeDisplayListen
         super(ModelerConstants.TITLE);
         this.actionManager = actionManager;
 
-        recentFileListeners = new Vector<RecentFileListListener>();
+        recentFileListeners = new Vector<>();
 
         setIconImage(ModelerUtil.buildIcon("CayenneModeler.jpg").getImage());
         initMenus();
@@ -233,19 +240,14 @@ public class CayenneModelerFrame extends JFrame implements DataNodeDisplayListen
         toolMenu.add(getAction(GenerateDBAction.class).buildMenu());
         toolMenu.add(getAction(MigrateAction.class).buildMenu());
 
-        /**
-         * Menu for opening Log console
-         */
+        // Menu for opening Log console
         toolMenu.addSeparator();
 
         logMenu = getAction(ShowLogConsoleAction.class).buildCheckBoxMenu();
 
         if (!LogConsole.getInstance().getConsoleProperty(LogConsole.DOCKED_PROPERTY)
-                && LogConsole.getInstance().getConsoleProperty(
-                        LogConsole.SHOW_CONSOLE_PROPERTY)) {
-            LogConsole.getInstance().setConsoleProperty(
-                    LogConsole.SHOW_CONSOLE_PROPERTY,
-                    false);
+                && LogConsole.getInstance().getConsoleProperty(LogConsole.SHOW_CONSOLE_PROPERTY)) {
+            LogConsole.getInstance().setConsoleProperty(LogConsole.SHOW_CONSOLE_PROPERTY, false);
         }
 
         updateLogConsoleMenu();
@@ -272,8 +274,7 @@ public class CayenneModelerFrame extends JFrame implements DataNodeDisplayListen
      * Selects/deselects menu item, depending on status of log console
      */
     public void updateLogConsoleMenu() {
-        logMenu.setSelected(LogConsole.getInstance().getConsoleProperty(
-                LogConsole.SHOW_CONSOLE_PROPERTY));
+        logMenu.setSelected(LogConsole.getInstance().getConsoleProperty(LogConsole.SHOW_CONSOLE_PROPERTY));
     }
 
     protected void initStatusBar() {
@@ -281,30 +282,28 @@ public class CayenneModelerFrame extends JFrame implements DataNodeDisplayListen
         status.setFont(status.getFont().deriveFont(Font.PLAIN, 10));
 
         splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
+        splitPane.setBorder(TopBorder.create());
         splitPane.getInsets().left = 5;
         splitPane.getInsets().right = 5;
-
         splitPane.setResizeWeight(0.7);
 
-        /**
-         * Moving this to try-catch block per CAY-940. Exception will be stack-traced
-         */
+        //  Moving this to try-catch block per CAY-940. Exception will be stack-traced
         try {
-            ComponentGeometry geometry = new ComponentGeometry(
-                    this.getClass(),
-                    "splitPane/divider");
-            geometry
-                    .bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, 400);
-        }
-        catch (Exception ex) {
+            ComponentGeometry geometry = new ComponentGeometry(this.getClass(), "splitPane/divider");
+            geometry.bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, 400);
+        } catch (Exception ex) {
             LoggerFactory.getLogger(getClass()).error("Cannot bind divider property", ex);
         }
 
         JPanel statusBar = new JPanel(new FlowLayout(FlowLayout.LEFT, 3, 1));
+        statusBar.setBorder(TopBorder.create());
         // add placeholder
         statusBar.add(Box.createVerticalStrut(16));
         statusBar.add(status);
 
+        if(getContentPane() instanceof JPanel) {
+            ((JPanel) getContentPane()).setBorder(BorderFactory.createEmptyBorder());
+        }
         getContentPane().add(splitPane, BorderLayout.CENTER);
         getContentPane().add(statusBar, BorderLayout.SOUTH);
     }
@@ -347,96 +346,98 @@ public class CayenneModelerFrame extends JFrame implements DataNodeDisplayListen
 
     /** Initializes main toolbar. */
     protected void initToolbar() {
-        JToolBar toolBar = new JToolBar();
 
-        toolBar.add(getAction(NewProjectAction.class).buildButton());
-        toolBar.add(getAction(OpenProjectAction.class).buildButton());
-        toolBar.add(getAction(SaveAction.class).buildButton());
+        final JToolBar toolBar = new MainToolBar();
 
-        toolBar.addSeparator();
-        toolBar.add(getAction(RemoveAction.class).buildButton());
+        Dimension smallBtnDim = new Dimension(30, 30);
+        JButton backButton = getAction(NavigateBackwardAction.class).buildButton(1);
+        backButton.setMinimumSize(smallBtnDim);
+        backButton.setPreferredSize(smallBtnDim);
+        toolBar.add(backButton);
 
-        toolBar.addSeparator();
+        JButton forwardButton = getAction(NavigateForwardAction.class).buildButton(3);
+        forwardButton.setMinimumSize(smallBtnDim);
+        forwardButton.setPreferredSize(smallBtnDim);
+        toolBar.add(forwardButton);
 
-        toolBar.add(getAction(CutAction.class).buildButton());
-        toolBar.add(getAction(CopyAction.class).buildButton());
-        toolBar.add(getAction(PasteAction.class).buildButton());
+        toolBar.addSeparator(new Dimension(30, 0));
 
-        toolBar.addSeparator();
-
-        toolBar.add(getAction(UndoAction.class).buildButton());
-        toolBar.add(getAction(RedoAction.class).buildButton());
+        toolBar.add(getAction(NewProjectAction.class).buildButton(1));
+        toolBar.add(getAction(OpenProjectAction.class).buildButton(2));
+        toolBar.add(getAction(SaveAction.class).buildButton(3));
 
         toolBar.addSeparator();
 
-        toolBar.add(getAction(CreateNodeAction.class).buildButton());
-        toolBar.add(getAction(CreateDataMapAction.class).buildButton());
+        JButton removeButton = getAction(RemoveAction.class).buildButton();
+        toolBar.add(removeButton);
 
         toolBar.addSeparator();
 
-        toolBar.add(getAction(CreateDbEntityAction.class).buildButton());
-        toolBar.add(getAction(CreateProcedureAction.class).buildButton());
+        toolBar.add(getAction(CutAction.class).buildButton(1));
+        toolBar.add(getAction(CopyAction.class).buildButton(2));
+        toolBar.add(getAction(PasteAction.class).buildButton(3));
 
         toolBar.addSeparator();
 
-        toolBar.add(getAction(CreateObjEntityAction.class).buildButton());
-        toolBar.add(getAction(CreateEmbeddableAction.class).buildButton());
-        toolBar.add(getAction(CreateQueryAction.class).buildButton());
+        toolBar.add(getAction(UndoAction.class).buildButton(1));
+        toolBar.add(getAction(RedoAction.class).buildButton(3));
 
         toolBar.addSeparator();
 
-        toolBar.add(getAction(NavigateBackwardAction.class).buildButton());
-        toolBar.add(getAction(NavigateForwardAction.class).buildButton());
+        toolBar.add(getAction(CreateNodeAction.class).buildButton(1));
+        toolBar.add(getAction(CreateDataMapAction.class).buildButton(3));
 
-        JPanel east = new JPanel(new BorderLayout()); // is used to place search feature
-        // components the most right on a
-        // toolbar
-        final JTextField findField = new JTextField(10);
-        findField.addKeyListener(new KeyListener() {
+        toolBar.addSeparator();
 
-            public void keyPressed(KeyEvent e) {
-                if (e.getKeyCode() != KeyEvent.VK_ENTER) {
-                    findField.setBackground(Color.white);
-                }
-            }
+        toolBar.add(getAction(CreateDbEntityAction.class).buildButton(1));
+        toolBar.add(getAction(CreateProcedureAction.class).buildButton(3));
 
-            public void keyReleased(KeyEvent e) {
-            }
+        toolBar.addSeparator();
 
-            public void keyTyped(KeyEvent e) {
-            }
+        toolBar.add(getAction(CreateObjEntityAction.class).buildButton(1));
+        toolBar.add(getAction(CreateEmbeddableAction.class).buildButton(2));
+        toolBar.add(getAction(CreateQueryAction.class).buildButton(3));
 
-        });
-        findField.setAction(getAction(FindAction.class));
-        JLabel findLabel = new JLabel("Search:");
-        findLabel.setLabelFor(findField);
-        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
+        // is used to place search feature components the most right on a toolbar
+        toolBar.add(new SearchPanel());
 
-            public void eventDispatched(AWTEvent event) {
+        getContentPane().add(toolBar, BorderLayout.NORTH);
 
-                if (event instanceof KeyEvent) {
+        // Hide some buttons when frame is too small
+        final int defaultBtnWidth = removeButton.getUI().getPreferredSize(backButton).width;
+        addComponentListener(new ComponentAdapter() {
+            private final int[] empty = {};
+            private final int[] all = {6, 7, 8, 9, 10, 11, 12, 13, 14};
+            private final int[] remove = {6, 7};
+            private final int[] removeAndCopy = {6, 7, 8, 9, 10, 11};
+            private final int[] undo = {12, 13, 14};
+            private final int[] undoAndCopy = {8, 9, 10, 11, 12, 13, 14};
+
+            @Override
+            public void componentResized(ComponentEvent e) {
+                int[] hidden, shown;
+                if(getSize().width < (13 * defaultBtnWidth + 300)) {
+                    hidden = all;
+                    shown = empty;
+                } else if(getSize().width < (16 * defaultBtnWidth + 300)) {
+                    hidden = removeAndCopy;
+                    shown = undo;
+                } else if(getSize().width < (18 * defaultBtnWidth + 300)) {
+                    hidden = remove;
+                    shown = undoAndCopy;
+                } else {
+                    hidden = empty;
+                    shown = all;
+                }
 
-                    if (((KeyEvent) event).getModifiers() == Toolkit
-                            .getDefaultToolkit()
-                            .getMenuShortcutKeyMask()
-                            && ((KeyEvent) event).getKeyCode() == KeyEvent.VK_F) {
-                        findField.requestFocus();
-                    }
+                for(int i : hidden) {
+                    toolBar.getComponentAtIndex(i).setVisible(false);
+                }
+                for(int i : shown) {
+                    toolBar.getComponentAtIndex(i).setVisible(true);
                 }
             }
-
-        },
-                AWTEvent.KEY_EVENT_MASK);
-
-        JPanel box = new JPanel(); // is used to place label and text field one after
-        // another
-        box.setLayout(new BoxLayout(box, BoxLayout.X_AXIS));
-        box.add(findLabel);
-        box.add(findField);
-        east.add(box, BorderLayout.EAST);
-        toolBar.add(east);
-
-        getContentPane().add(toolBar, BorderLayout.NORTH);
+        });
     }
 
     public void currentDataNodeChanged(DataNodeDisplayEvent e) {
@@ -463,9 +464,7 @@ public class CayenneModelerFrame extends JFrame implements DataNodeDisplayListen
         actionManager.procedureSelected();
     }
 
-    public void currentObjectsChanged(
-            MultipleObjectsDisplayEvent e,
-            Application application) {
+    public void currentObjectsChanged(MultipleObjectsDisplayEvent e, Application application) {
         actionManager.multipleObjectsSelected(e.getNodes(), application);
     }
 
@@ -505,8 +504,7 @@ public class CayenneModelerFrame extends JFrame implements DataNodeDisplayListen
 
         if (view != null) {
             splitPane.setTopComponent(view);
-        }
-        else {
+        } else {
             splitPane.setTopComponent(welcomeScreen);
         }
 
@@ -529,4 +527,66 @@ public class CayenneModelerFrame extends JFrame implements DataNodeDisplayListen
             recentFileListener.recentFileListChanged();
         }
     }
+
+    public class SearchPanel extends JPanel {
+
+        private JLabel searchLabel = new JLabel("Search: ");
+        private JPanel box = new JPanel();
+        private JTextField findField;
+
+        SearchPanel() {
+            super(new BorderLayout());
+            initView();
+        }
+
+        void initView() {
+            findField = new JTextField(10);
+            findField.putClientProperty("JTextField.variant", "search");
+            findField.setMaximumSize(new Dimension(100, 22));
+            findField.setPreferredSize(new Dimension(100, 22));
+            findField.addKeyListener(new KeyListener() {
+                public void keyPressed(KeyEvent e) {
+                    if (e.getKeyCode() != KeyEvent.VK_ENTER) {
+                        findField.setBackground(Color.white);
+                    }
+                }
+
+                public void keyReleased(KeyEvent e) {
+                }
+
+                public void keyTyped(KeyEvent e) {
+                }
+            });
+            findField.setAction(getAction(FindAction.class));
+
+            Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
+                public void eventDispatched(AWTEvent event) {
+                    if (event instanceof KeyEvent) {
+                        if (((KeyEvent) event).getModifiers() == Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()
+                                && ((KeyEvent) event).getKeyCode() == KeyEvent.VK_F) {
+                            findField.requestFocus();
+                        }
+                    }
+                }
+            }, AWTEvent.KEY_EVENT_MASK);
+
+            searchLabel.setLabelFor(findField);
+            // is used to place label and text field one after another
+            box.setLayout(new BoxLayout(box, BoxLayout.X_AXIS));
+            box.add(searchLabel);
+            box.add(findField);
+
+            add(box, BorderLayout.EAST);
+        }
+
+        public void hideSearchLabel() {
+            searchLabel.setVisible(false);
+            findField.setMaximumSize(null);
+            findField.setPreferredSize(new Dimension(100, 40));
+            findField.setToolTipText("Search");
+            box.setOpaque(false);
+            box.setBackground(null);
+        }
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Main.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Main.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Main.java
index a431cc9..ff5f225 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Main.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Main.java
@@ -69,15 +69,17 @@ public class Main {
 
         // TODO: use module auto-loading...
         final Injector injector = DIBootstrap.createInjector(appendModules(new ArrayList<Module>()));
+
+        // init look and feel before using any Swing classes...
+        injector.getInstance(PlatformInitializer.class).initLookAndFeel();
+
+        // logger should go after Look And Feel or Logger Console will be without style
         logger.info("Starting CayenneModeler.");
         logger.info("JRE v."
                 + System.getProperty("java.version")
                 + " at "
                 + System.getProperty("java.home"));
 
-        // init look and feel before starting any Swing classes...
-        injector.getInstance(PlatformInitializer.class).initLookAndFeel();
-
         SwingUtilities.invokeLater(new Runnable() {
 
             public void run() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerConstants.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerConstants.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerConstants.java
index 477d48a..cb6c488 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerConstants.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ModelerConstants.java
@@ -25,7 +25,7 @@ package org.apache.cayenne.modeler;
 public interface ModelerConstants {
 
     /** Defines path to the images. */
-    public static final String RESOURCE_PATH = "org/apache/cayenne/modeler/images/";
+    String RESOURCE_PATH = "org/apache/cayenne/modeler/images/";
 
-    public static final String TITLE = "CayenneModeler";
+    String TITLE = "CayenneModeler";
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeModel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeModel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeModel.java
index 08e4de3..c09b6c4 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeModel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeModel.java
@@ -33,8 +33,8 @@ import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.Embeddable;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.map.Procedure;
+import org.apache.cayenne.map.QueryDescriptor;
 import org.apache.cayenne.project.Project;
-import org.apache.cayenne.query.Query;
 
 /**
  * ProjectTreeModel is a model of Cayenne project tree.
@@ -112,8 +112,7 @@ public class ProjectTreeModel extends DefaultTreeModel {
 			try {
 				// insert
 				insertNodeInto(treeNode, parent, ins);
-			} catch (NullPointerException e) {
-
+			} catch (NullPointerException ignored) {
 			}
 		}
 	}
@@ -164,11 +163,9 @@ public class ProjectTreeModel extends DefaultTreeModel {
 	}
 
 	public int getChildCount(Object parent) {
-		int realCount = super.getChildCount(parent), filterCount = 0;
-
-		for (int i = 0; i < realCount; i++) {
-			DefaultMutableTreeNode dmtn = (DefaultMutableTreeNode) super.getChild(parent, i);
-			if (filter.pass(dmtn)) {
+		int filterCount = 0;
+		for (int i = 0, realCount = super.getChildCount(parent); i < realCount; i++) {
+			if (filter.pass((DefaultMutableTreeNode) super.getChild(parent, i))) {
 				filterCount++;
 			}
 		}
@@ -178,7 +175,7 @@ public class ProjectTreeModel extends DefaultTreeModel {
 	public Object getChild(Object parent, int index) {
 		int cnt = -1;
 		for (int i = 0; i < super.getChildCount(parent); i++) {
-			Object child = super.getChild(parent, i);
+			DefaultMutableTreeNode child = (DefaultMutableTreeNode) super.getChild(parent, i);
 			if (filter.pass(child)) {
 				cnt++;
 			}
@@ -198,20 +195,16 @@ public class ProjectTreeModel extends DefaultTreeModel {
 			pass = false;
 		}
 
-		public boolean pass(Object obj) {
-			Object root = ((DefaultMutableTreeNode) obj).getUserObject();
-			Object firstLeaf = ((DefaultMutableTreeNode) obj).getFirstLeaf().getUserObject();
+		public boolean pass(DefaultMutableTreeNode obj) {
+			Object root = obj.getUserObject();
+			Object firstLeaf = obj.getFirstLeaf().getUserObject();
 
 			return ((pass) || (root instanceof DataMap) || (root instanceof DataNodeDescriptor)
 					|| (firstLeaf instanceof DbEntity && filterMap.get("dbEntity"))
 					|| (firstLeaf instanceof ObjEntity && filterMap.get("objEntity"))
 					|| (firstLeaf instanceof Embeddable && filterMap.get("embeddable"))
-					|| (firstLeaf instanceof Query && filterMap.get("query")) || (firstLeaf instanceof Procedure && filterMap
-					.get("procedure")));
-		}
-
-		public boolean isFiltered() {
-			return pass;
+					|| (firstLeaf instanceof QueryDescriptor && filterMap.get("query"))
+					|| (firstLeaf instanceof Procedure && filterMap.get("procedure")));
 		}
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeView.java
index 6897b9f..ead0183 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ProjectTreeView.java
@@ -80,6 +80,7 @@ import org.apache.cayenne.project.Project;
 import org.apache.cayenne.map.QueryDescriptor;
 import org.apache.cayenne.reflect.PropertyUtils;
 import org.apache.cayenne.resource.Resource;
+import org.apache.cayenne.swing.components.TopBorder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -87,6 +88,8 @@ import javax.swing.Action;
 import javax.swing.JMenuItem;
 import javax.swing.JPopupMenu;
 import javax.swing.JTree;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
 import javax.swing.event.TreeExpansionEvent;
 import javax.swing.event.TreeSelectionEvent;
 import javax.swing.event.TreeSelectionListener;
@@ -96,6 +99,8 @@ import javax.swing.tree.ExpandVetoException;
 import javax.swing.tree.MutableTreeNode;
 import javax.swing.tree.TreePath;
 import javax.swing.tree.TreeSelectionModel;
+import java.awt.Color;
+import java.awt.Graphics;
 import java.awt.Rectangle;
 import java.awt.dnd.DnDConstants;
 import java.awt.event.MouseAdapter;
@@ -116,6 +121,8 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
 
     private static final Logger logObj = LoggerFactory.getLogger(ProjectTreeView.class);
 
+    private static final Color SELECTION_COLOR = UIManager.getColor("Tree.selectionBackground");
+
     protected ProjectController mediator;
     protected TreeSelectionListener treeSelectionListener;
     protected TreeWillExpandListener treeWillExpandListener;
@@ -134,6 +141,8 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
 
     private void initView() {
         setCellRenderer(CellRenderers.treeRenderer());
+        setOpaque(false);
+        setBorder(TopBorder.create());
     }
 
     private void initController() {
@@ -162,12 +171,10 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
                             projectParentPath = createProjectPath(parentPath);
                         }
 
-                        mediator
-                                .fireMultipleObjectsDisplayEvent(new MultipleObjectsDisplayEvent(
+                        mediator.fireMultipleObjectsDisplayEvent(new MultipleObjectsDisplayEvent(
                                         this,
                                         projectPaths, projectParentPath));
-                    }
-                    else if (paths.length == 1) {
+                    } else if (paths.length == 1) {
                         processSelection(paths[0]);
                     }
                 }
@@ -206,7 +213,7 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
         addTreeSelectionListener(treeSelectionListener);
         addTreeWillExpandListener(treeWillExpandListener);
 
-        addMouseListener(new PopupHandler());
+        addMouseListener(new MouseClickHandler());
 
         mediator.addDomainListener(this);
         mediator.addDomainDisplayListener(this);
@@ -273,7 +280,6 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
 
         // Project - return the name of top file
         if (value instanceof Project) {
-
             Resource resource = ((Project) value).getConfigurationResource();
             return (resource != null) ? resource.getURL().getPath() : "";
         }
@@ -281,20 +287,12 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
         // read name property
         try {
             if (value instanceof Embeddable) {
-                return (value != null) ? String.valueOf(PropertyUtils.getProperty(
-                        value,
-                        "className")) : "";
+                return String.valueOf(PropertyUtils.getProperty(value, "className"));
             }
 
-            return (value != null) ? String.valueOf(PropertyUtils.getProperty(
-                    value,
-                    "name")) : "";
-
-        }
-        catch (Exception e) {
-            String objectClass = (value == null) ? "(unknown)" : value
-                    .getClass()
-                    .getName();
+            return (value != null) ? String.valueOf(PropertyUtils.getProperty(value, "name")) : "";
+        } catch (Exception e) {
+            String objectClass = (value == null) ? "(unknown)" : value.getClass().getName();
             logObj.warn("Exception reading property 'name', class " + objectClass, e);
             return "";
         }
@@ -405,7 +403,7 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
 
         DefaultMutableTreeNode node = getProjectModel().getNodeForObjectPath(
                 new Object[] {
-                        (DataChannelDescriptor) mediator.getProject().getRootNode(),
+                        mediator.getProject().getRootNode(),
                         e.getProcedure().getDataMap()
                 });
 
@@ -514,57 +512,49 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
         if (node != null) {
 
             if (e.isNameChange()) {
-                positionNode((DefaultMutableTreeNode) node.getParent(), node, Comparators
-                        .getDataDomainChildrenComparator());
+                positionNode((DefaultMutableTreeNode) node.getParent(), node,
+                        Comparators.getDataDomainChildrenComparator());
                 showNode(node);
-            }
-            else {
+            } else {
 
                 getProjectModel().nodeChanged(node);
 
-                DataChannelDescriptor domain = (DataChannelDescriptor) mediator
-                        .getProject()
-                        .getRootNode();
+                DataChannelDescriptor domain = (DataChannelDescriptor) mediator.getProject().getRootNode();
 
                 // check for DataMap additions/removals...
-                Object[] mapsName = e.getDataNode().getDataMapNames().toArray();
+                String[] mapsName = e.getDataNode().getDataMapNames().toArray(new String[0]);
                 int mapCount = mapsName.length;
 
                 // DataMap was linked
                 if (mapCount > node.getChildCount()) {
 
-                    for (int i = 0; i < mapCount; i++) {
+                    for (String aMapsName : mapsName) {
                         boolean found = false;
                         for (int j = 0; j < node.getChildCount(); j++) {
-                            DefaultMutableTreeNode child = (DefaultMutableTreeNode) node
-                                    .getChildAt(j);
-                            if (domain.getDataMap(mapsName[i].toString()) == child
-                                    .getUserObject()) {
+                            DefaultMutableTreeNode child = (DefaultMutableTreeNode) node.getChildAt(j);
+                            if (domain.getDataMap(aMapsName) == child.getUserObject()) {
                                 found = true;
                                 break;
                             }
                         }
 
                         if (!found) {
-                            DefaultMutableTreeNode newMapNode = new DefaultMutableTreeNode(
-                                    domain.getDataMap(mapsName[i].toString()),
-                                    false);
-                            positionNode(node, newMapNode, Comparators
-                                    .getNamedObjectComparator());
+                            DefaultMutableTreeNode newMapNode =
+                                    new DefaultMutableTreeNode(domain.getDataMap(aMapsName), false);
+                            positionNode(node, newMapNode, Comparators.getNamedObjectComparator());
                             break;
                         }
                     }
-                }
-                // DataMap was unlinked
-                else if (mapCount < node.getChildCount()) {
+                } else if (mapCount < node.getChildCount()) {
+                    // DataMap was unlinked
                     int j = 0;
                     while (j < node.getChildCount()) {
                         boolean found = false;
                         DefaultMutableTreeNode child;
                         child = (DefaultMutableTreeNode) node.getChildAt(j);
                         Object obj = child.getUserObject();
-                        for (int i = 0; i < mapCount; i++) {
-                            if (domain.getDataMap(mapsName[i].toString()) == obj) {
+                        for (Object aMapsName : mapsName) {
+                            if (domain.getDataMap(aMapsName.toString()) == obj) {
                                 found = true;
                                 j++;
                             }
@@ -864,8 +854,7 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
             return;
         }
 
-        DefaultMutableTreeNode currentNode = (DefaultMutableTreeNode) path
-                .getLastPathComponent();
+        DefaultMutableTreeNode currentNode = (DefaultMutableTreeNode) path.getLastPathComponent();
 
         Object[] data = getUserObjects(currentNode);
         if (data.length == 0) {
@@ -883,67 +872,58 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
             mediator.fireDomainDisplayEvent(new DomainDisplayEvent(
                     this,
                     (DataChannelDescriptor) obj));
-        }
-        else if (obj instanceof DataMap) {
+        } else if (obj instanceof DataMap) {
             if (data.length == 2) {
                 mediator.fireDataMapDisplayEvent(new DataMapDisplayEvent(
                         this,
                         (DataMap) obj,
                         (DataChannelDescriptor) mediator.getProject().getRootNode(),
                         (DataNodeDescriptor) data[data.length - 2]));
-            }
-            else if (data.length == 1) {
+            } else if (data.length == 1) {
                 mediator.fireDataMapDisplayEvent(new DataMapDisplayEvent(
                         this,
                         (DataMap) obj,
                         (DataChannelDescriptor) mediator.getProject().getRootNode()));
             }
-        }
-        else if (obj instanceof DataNodeDescriptor) {
+        } else if (obj instanceof DataNodeDescriptor) {
             if (data.length == 1) {
                 mediator.fireDataNodeDisplayEvent(new DataNodeDisplayEvent(
                         this,
                         (DataChannelDescriptor) mediator.getProject().getRootNode(),
                         (DataNodeDescriptor) obj));
             }
-        }
-        else if (obj instanceof Entity) {
+        } else if (obj instanceof Entity) {
             EntityDisplayEvent e = new EntityDisplayEvent(this, (Entity) obj);
             e.setUnselectAttributes(true);
             if (data.length == 3) {
                 e.setDataMap((DataMap) data[data.length - 2]);
                 e.setDomain((DataChannelDescriptor) mediator.getProject().getRootNode());
                 e.setDataNode((DataNodeDescriptor) data[data.length - 3]);
-            }
-            else if (data.length == 2) {
+            } else if (data.length == 2) {
                 e.setDataMap((DataMap) data[data.length - 2]);
                 e.setDomain((DataChannelDescriptor) mediator.getProject().getRootNode());
             }
 
             if (obj instanceof ObjEntity) {
                 mediator.fireObjEntityDisplayEvent(e);
-            }
-            else if (obj instanceof DbEntity) {
+            } else if (obj instanceof DbEntity) {
                 mediator.fireDbEntityDisplayEvent(e);
             }
-        }
-        else if (obj instanceof Embeddable) {
+        } else if (obj instanceof Embeddable) {
             EmbeddableDisplayEvent e = new EmbeddableDisplayEvent(
                     this,
                     (Embeddable) obj,
                     (DataMap) data[data.length - 2],
                     (DataChannelDescriptor) mediator.getProject().getRootNode());
             mediator.fireEmbeddableDisplayEvent(e);
-        }
-        else if (obj instanceof Procedure) {
+        } else if (obj instanceof Procedure) {
             ProcedureDisplayEvent e = new ProcedureDisplayEvent(
                     this,
                     (Procedure) obj,
                     (DataMap) data[data.length - 2],
                     (DataChannelDescriptor) mediator.getProject().getRootNode());
             mediator.fireProcedureDisplayEvent(e);
-        }
-        else if (obj instanceof QueryDescriptor) {
+        } else if (obj instanceof QueryDescriptor) {
             QueryDisplayEvent e = new QueryDisplayEvent(
                     this,
                     (QueryDescriptor) obj,
@@ -960,7 +940,7 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
      * root. That is the array of actual objects rather than wrappers.
      */
     private Object[] getUserObjects(DefaultMutableTreeNode node) {
-        List list = new ArrayList();
+        List<Object> list = new ArrayList<>();
         while (!node.isRoot()) {
             list.add(0, node.getUserObject());
             node = (DefaultMutableTreeNode) node.getParent();
@@ -989,8 +969,7 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
         removeTreeSelectionListener(treeSelectionListener);
         try {
             getProjectModel().positionNode(parent, treeNode, comparator);
-        }
-        finally {
+        } finally {
             addTreeSelectionListener(treeSelectionListener);
         }
     }
@@ -1031,7 +1010,7 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
     /**
      * Creates and returns an menu item associated with the key.
      * 
-     * @param key action key
+     * @param actionType action type
      */
     private JMenuItem buildMenu(Class<? extends Action> actionType) {
         CayenneAction action = (CayenneAction) mediator
@@ -1042,28 +1021,39 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
     }
 
     /**
-     * Class to handle right-click and show popup for selected tree row
+     * Class to handle:
+     *  - right-click and show popup for selected tree row
+     *  - left click row selection based on full row length (instead of default selection based on label size)
      */
-    class PopupHandler extends MouseAdapter {
+    class MouseClickHandler extends MouseAdapter {
+
+        void selectRowForEvent(MouseEvent e) {
+            int closestRow = getClosestRowForLocation(e.getX(), e.getY());
+            Rectangle closestRowBounds = getRowBounds(closestRow);
+            if(e.getY() >= closestRowBounds.getY()
+                    && e.getY() < closestRowBounds.getY() + closestRowBounds.getHeight()
+                    && !isRowSelected(closestRow)) {
+                setSelectionRow(closestRow);
+            }
+        }
 
         @Override
         public void mousePressed(MouseEvent e) {
+            if (SwingUtilities.isLeftMouseButton(e)) {
+                selectRowForEvent(e);
+            }
+
             mouseReleased(e);
         }
 
         @Override
         public void mouseReleased(MouseEvent e) {
             if (e.isPopupTrigger()) {
-                if (popup == null)
+                // Selecting specified row
+                selectRowForEvent(e);
+                if (popup == null) {
                     popup = createJPopupMenu();
-
-                /**
-                 * Selecting specified row
-                 */
-                int row = getRowForLocation(e.getX(), e.getY());
-                if (row != -1 && !isRowSelected(row))
-                    setSelectionRow(row);
-
+                }
                 popup.show(ProjectTreeView.this, e.getX(), e.getY());
             }
         }
@@ -1135,4 +1125,20 @@ public class ProjectTreeView extends JTree implements DomainDisplayListener,
         return tds;
     }
 
+    @Override
+    public void paintComponent(Graphics g) {
+        g.setColor(Color.white);
+        g.fillRect(0, 0, getWidth(), getHeight());
+        if (getSelectionCount() > 0) {
+            g.setColor(SELECTION_COLOR);
+            int[] rows = getSelectionRows();
+            if(rows != null) {
+                for (int i : rows) {
+                    Rectangle r = getRowBounds(i);
+                    g.fillRect(0, r.y, getWidth(), r.height);
+                }
+            }
+        }
+        super.paintComponent(g);
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/AboutAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/AboutAction.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/AboutAction.java
index 8641c90..f3f7dd8 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/AboutAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/AboutAction.java
@@ -35,7 +35,6 @@ public class AboutAction extends CayenneAction {
 
     /**
      * Constructor for AboutMenuAction.
-     * @param name
      */
     public AboutAction(Application application) {
         super(getActionName(), application);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/BaseViewEntityAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/BaseViewEntityAction.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/BaseViewEntityAction.java
new file mode 100644
index 0000000..be4f26b
--- /dev/null
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/BaseViewEntityAction.java
@@ -0,0 +1,83 @@
+/*****************************************************************
+ *   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.action;
+
+import org.apache.cayenne.configuration.DataChannelDescriptor;
+import org.apache.cayenne.map.DbEntity;
+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.event.EntityDisplayEvent;
+import org.apache.cayenne.modeler.util.CayenneAction;
+
+import javax.swing.tree.TreePath;
+import java.awt.event.ActionEvent;
+
+/**
+ * @since 4.0
+ */
+public abstract class BaseViewEntityAction extends CayenneAction{
+
+    protected ObjEntity objEntity;
+
+    abstract protected Entity getEntity();
+
+    public BaseViewEntityAction(String name, Application application) {
+        super(name, application);
+    }
+
+    /**
+     * @see org.apache.cayenne.modeler.util.CayenneAction#performAction(ActionEvent)
+     */
+    @Override
+    public void performAction(ActionEvent e) {
+        viewEntity();
+    }
+
+    protected void viewEntity() {
+        ProjectController mediator = getProjectController();
+
+        objEntity = mediator.getCurrentObjEntity();
+
+        if (objEntity == null) {
+            return;
+        }
+
+        Entity entity = getEntity();
+
+        if(entity != null) {
+            TreePath path = DbEntityCounterpartAction.buildTreePath(entity);
+            DbEntityCounterpartAction.editor().getProjectTreeView().getSelectionModel().setSelectionPath(path);
+
+            EntityDisplayEvent event = new EntityDisplayEvent(
+                    DbEntityCounterpartAction.editor().getProjectTreeView(),
+                    entity,
+                    entity.getDataMap(),
+                    (DataChannelDescriptor) getProjectController().getProject().getRootNode());
+
+            if (entity instanceof DbEntity) {
+                mediator.fireDbEntityDisplayEvent(event);
+            } else if (entity instanceof ObjEntity){
+                mediator.fireObjEntityDisplayEvent(event);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ChangeObjEntityListenerClassAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ChangeObjEntityListenerClassAction.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ChangeObjEntityListenerClassAction.java
deleted file mode 100644
index c06c017..0000000
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ChangeObjEntityListenerClassAction.java
+++ /dev/null
@@ -1,128 +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.action;
-
-import java.awt.event.ActionEvent;
-
-import javax.swing.JOptionPane;
-
-import org.apache.cayenne.map.event.MapEvent;
-import org.apache.cayenne.modeler.Application;
-import org.apache.cayenne.modeler.event.EntityListenerEvent;
-import org.apache.cayenne.modeler.util.CayenneAction;
-
-
-/**
- * Action class for renaming entity listener class for ObjEntity
- *
- * @version 1.0 Oct 30, 2007
- * @deprecated
- */
-public class ChangeObjEntityListenerClassAction extends CayenneAction {
-    /**
-     * unique action name
-     */
-    private static final String ACTION_NAME = "Change objentity entity listener class";
-
-
-    /**
-     * Constructor.
-     *
-     * @param application Application instance
-     */
-    public ChangeObjEntityListenerClassAction(Application application) {
-        super(getActionName(), application);
-    }
-
-    /**
-     * Constructor for extending classes
-     *
-     * @param name unique action name
-     * @param application Application instance
-     */
-    protected ChangeObjEntityListenerClassAction(String name, Application application) {
-        super(name, application);
-    }
-
-    /**
-     * @return unique action name
-     */
-    public static String getActionName() {
-        return ACTION_NAME;
-    }
-
-    /**
-     * @return icon file name for button
-     */
-    public String getIconName() {
-        return "icon-change-listener.gif";
-    }
-
-    /**
-     * checks whether the new name of listener class already exists
-     *
-     * @param className entered class name
-     * @return true or false
-     */
-    protected boolean isListenerClassAlreadyExists(String className) {
-        return getProjectController().getCurrentObjEntity().getEntityListener(className) != null;
-    }
-
-    /**
-     * change entity listener class
-     * @param prevListenerClass previous class name
-     * @param newListenerClass new class name
-     */
-    protected void renameEntityListener(String prevListenerClass, String newListenerClass) {
-        getProjectController().getCurrentObjEntity().getEntityListener(prevListenerClass).setClassName(newListenerClass);
-    }
-
-    /**
-     * base entity listener class renaming logic
-     * @param e event
-     */
-    public void performAction(ActionEvent e) {
-        String currentListenerClass =  getProjectController().getCurrentListenerClass();
-        String newListenerClass = JOptionPane.showInputDialog(
-                "Please enter listener class:",
-                currentListenerClass);
-        if (newListenerClass != null && newListenerClass.trim().length() > 0) {
-            if (isListenerClassAlreadyExists(newListenerClass)) {
-                JOptionPane.showMessageDialog(
-                        null,
-                        "Listener class already exists.",
-                        "Error creating entity listener",
-                        JOptionPane.ERROR_MESSAGE
-                );
-            }
-            else {
-                renameEntityListener(currentListenerClass, newListenerClass);
-                getProjectController().fireEntityListenerEvent(
-                        new EntityListenerEvent(
-                                e.getSource(),
-                                currentListenerClass,
-                                newListenerClass,
-                                MapEvent.ADD
-                        )
-                );
-            }
-        }
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CopyAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CopyAction.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CopyAction.java
index f5c8301..b813ed8 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CopyAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CopyAction.java
@@ -72,7 +72,7 @@ public class CopyAction extends CayenneAction {
 
     @Override
     public String getIconName() {
-        return "icon-copy.gif";
+        return "icon-copy.png";
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateAttributeAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateAttributeAction.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateAttributeAction.java
index 5b1841d..9e24417 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateAttributeAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateAttributeAction.java
@@ -101,7 +101,7 @@ public class CreateAttributeAction extends CayenneAction {
 
     @Override
     public String getIconName() {
-        return "icon-attribute.gif";
+        return "icon-attribute.png";
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateCallbackMethodAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateCallbackMethodAction.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateCallbackMethodAction.java
index a3b5507..dc4c286 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateCallbackMethodAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateCallbackMethodAction.java
@@ -75,7 +75,7 @@ public class CreateCallbackMethodAction extends CayenneAction {
      * @return icon file name for button
      */
     public String getIconName() {
-        return "icon-create-method.gif";
+        return "icon-create-method.png";
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateDataMapAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateDataMapAction.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateDataMapAction.java
index 66dbae7..1a88d1e 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateDataMapAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateDataMapAction.java
@@ -45,7 +45,7 @@ public class CreateDataMapAction extends CayenneAction {
     }
 
     public String getIconName() {
-        return "icon-datamap.gif";
+        return "icon-datamap.png";
     }
 
     /** Calls addDataMap() or creates new data map if no data node selected. */

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateDbEntityAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateDbEntityAction.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateDbEntityAction.java
index 1117bf1..037148b 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateDbEntityAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateDbEntityAction.java
@@ -60,7 +60,7 @@ public class CreateDbEntityAction extends CayenneAction {
     }
 
     public String getIconName() {
-        return "icon-dbentity.gif";
+        return "icon-dbentity.png";
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateEmbeddableAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateEmbeddableAction.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateEmbeddableAction.java
index f58b021..0718672 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateEmbeddableAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateEmbeddableAction.java
@@ -46,7 +46,7 @@ public class CreateEmbeddableAction extends CayenneAction {
 
     @Override
     public String getIconName() {
-        return "icon-new_embeddable.gif";
+        return "icon-new_embeddable.png";
     }
 
     @Override


Mime
View raw message