cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [3/3] cayenne git commit: CAY-2475 Modeler: move inheritance icon to name column in objAttr table and objRel table cleanup
Date Wed, 19 Sep 2018 07:18:37 GMT
CAY-2475 Modeler: move inheritance icon to name column in objAttr table and objRel table
  cleanup


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

Branch: refs/heads/master
Commit: b88ecaf5b7c5a8bc9dc7ce641d184295dc807bb2
Parents: 200691d
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Wed Sep 19 10:17:42 2018 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Wed Sep 19 10:17:42 2018 +0300

----------------------------------------------------------------------
 .../cayenne/modeler/editor/ObjEntityAttributePanel.java      | 8 ++++----
 .../cayenne/modeler/editor/ObjEntityRelationshipPanel.java   | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/b88ecaf5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
index 6d300ae..efccc2b 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
@@ -95,6 +95,8 @@ import java.util.Map;
 public class ObjEntityAttributePanel extends JPanel implements ObjEntityDisplayListener,
         ObjEntityListener, ObjAttributeListener, ProjectOnSaveListener {
 
+    private static final ImageIcon INHERITANCE_ICON = ModelerUtil.buildIcon("icon-inheritance.png");
+
     private ProjectController mediator;
     private CayenneTable table;
     private TableColumnPreferences tablePreferences;
@@ -460,8 +462,7 @@ public class ObjEntityAttributePanel extends JPanel implements ObjEntityDisplayL
                 Font newFont = font.deriveFont(Font.ITALIC);
                 setFont(newFont);
                 if(column == ObjAttributeTableModel.OBJ_ATTRIBUTE) {
-                    ImageIcon icon = ModelerUtil.buildIcon("icon-inheritance.png");
-                    setIcon(icon);
+                    setIcon(INHERITANCE_ICON);
                 }
             }
 
@@ -473,8 +474,7 @@ public class ObjEntityAttributePanel extends JPanel implements ObjEntityDisplayL
 
         public void mouseClicked(MouseEvent event, int x) {
             Point point = event.getPoint();
-            ImageIcon icon = ModelerUtil.buildIcon("icon-inheritance.png");
-            if(point.x - x <= icon.getIconWidth()) {
+            if(point.x - x <= INHERITANCE_ICON.getIconWidth()) {
                 ActionManager actionManager = Application.getInstance().getActionManager();
                 actionManager.getAction(ObjEntityToSuperEntityAction.class).performAction(null);
             }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/b88ecaf5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipPanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipPanel.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipPanel.java
index bd65ec0..95d0448 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipPanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipPanel.java
@@ -86,6 +86,8 @@ public class ObjEntityRelationshipPanel extends JPanel implements ObjEntityDispl
 
     private static Logger logObj = LoggerFactory.getLogger(ObjEntityRelationshipPanel.class);
 
+    private static final ImageIcon INHERITANCE_ICON = ModelerUtil.buildIcon("icon-inheritance.png");
+
     private static final Object[] DELETE_RULES = new Object[]{
             DeleteRule.deleteRuleName(DeleteRule.NO_ACTION),
             DeleteRule.deleteRuleName(DeleteRule.NULLIFY),
@@ -444,8 +446,7 @@ public class ObjEntityRelationshipPanel extends JPanel implements ObjEntityDispl
                     && relationship.getSourceEntity() != model.getEntity()) {
                 setForeground(isSelected ? new Color(0xCECECE) : Color.GRAY);
                 if(column == ObjRelationshipTableModel.REL_NAME) {
-                    ImageIcon icon = ModelerUtil.buildIcon("icon-inheritance.png");
-                    setIcon(icon);
+                    setIcon(INHERITANCE_ICON);
                 }
             } else {
                 setForeground(isSelected && !hasFocus
@@ -461,8 +462,7 @@ public class ObjEntityRelationshipPanel extends JPanel implements ObjEntityDispl
 
         public void mouseClicked(MouseEvent event, int x) {
             Point point = event.getPoint();
-            ImageIcon icon = ModelerUtil.buildIcon("icon-inheritance.png");
-            if(point.x - x <= icon.getIconWidth()) {
+            if(point.x - x <= INHERITANCE_ICON.getIconWidth()) {
                 ActionManager actionManager = Application.getInstance().getActionManager();
                 actionManager.getAction(ObjEntityToSuperEntityAction.class).performAction(null);
             }


Mime
View raw message