cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgen...@apache.org
Subject [08/50] cayenne-modeler git commit: Updated ObjectEntityAdapter to valid Property Adapter semantics.
Date Thu, 05 Jan 2017 22:09:16 GMT
Updated ObjectEntityAdapter to valid Property Adapter semantics.


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

Branch: refs/heads/master
Commit: 4b0560299e82ad4e4aa21a237c815309947d81b7
Parents: 74f74a4
Author: mrg <blacknext@gmail.com>
Authored: Mon Sep 26 08:44:16 2016 -0400
Committer: mrg <blacknext@gmail.com>
Committed: Mon Sep 26 08:44:16 2016 -0400

----------------------------------------------------------------------
 .../cayenne/modeler/adapters/DataMapAdapter.java      |  4 ++--
 .../cayenne/modeler/adapters/ObjectEntityAdapter.java | 14 ++++++--------
 .../modeler/layout/ObjectEntityClassTabLayout.java    |  9 ++-------
 .../cayenne/modeler/project/ObjectEntityTreeItem.java |  2 +-
 4 files changed, 11 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/4b056029/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java b/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
index 02910f8..13534f2 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
@@ -99,7 +99,7 @@ public class DataMapAdapter extends CayennePropertyAdapter // implements
Adapter
 
         // Add change listeners for all ObjectEntityAdapter name changes and automatically
re-sort.
         for (final ObjectEntityAdapter objectEntityAdapter : objectEntityAdapters)
-            objectEntityAdapter.getNameProperty().addListener((observable, oldValue, newValue)
-> sortObjectEntities());
+            objectEntityAdapter.nameProperty().addListener((observable, oldValue, newValue)
-> sortObjectEntities());
 
         // Create DatabaseEntityAdapters for all database entities.
         for (final DbEntity dbEntity : dataMap.getDbEntities())
@@ -178,7 +178,7 @@ public class DataMapAdapter extends CayennePropertyAdapter // implements
Adapter
     {
         objectEntityAdapters.sort((entity1, entity2) ->
             {
-                return ObjectUtils.compare(entity1.getNameProperty().get(), entity2.getNameProperty().get());
+                return ObjectUtils.compare(entity1.nameProperty().get(), entity2.nameProperty().get());
             });
     }
 }

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/4b056029/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java b/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
index 15e50f2..218b739 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
@@ -87,15 +87,13 @@ public class ObjectEntityAdapter extends CayennePropertyAdapter // implements
Ad
             objectAttributeAdapters.add(new ObjectAttributeAdapter(objAttribute));
     }
 
-    public StringProperty getNameProperty()
-    {
-        return nameProperty;
-    }
+    public StringProperty nameProperty() { return nameProperty; }
+    public String getName() { return nameProperty.get(); }
+    public void setName(final String value) { nameProperty.set(value); }
 
-    public BooleanProperty getAbstractClassProperty()
-    {
-        return abstractClassProperty;
-    }
+    public BooleanProperty abstractClassProperty() { return abstractClassProperty; }
+    public Boolean getAbstractClass() { return abstractClassProperty.get(); }
+    public void setAbstractClass(final Boolean value) { abstractClassProperty.set(value);
}
 
     public ObservableList<ObjectAttributeAdapter> getAttributes()
     {

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/4b056029/src/main/java/org/apache/cayenne/modeler/layout/ObjectEntityClassTabLayout.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/layout/ObjectEntityClassTabLayout.java
b/src/main/java/org/apache/cayenne/modeler/layout/ObjectEntityClassTabLayout.java
index 3158636..cdef659 100644
--- a/src/main/java/org/apache/cayenne/modeler/layout/ObjectEntityClassTabLayout.java
+++ b/src/main/java/org/apache/cayenne/modeler/layout/ObjectEntityClassTabLayout.java
@@ -56,11 +56,6 @@ public class ObjectEntityClassTabLayout
     @Override
     public void initialize()
     {
-//        getScene().getWindow().getScene();
-//        getStage().getScene().getWindow().get
-//        System.out.println("mrg: " + getStage().getScene().getRoot());
-//        System.out.println("oectv");
-
         super.initialize();
 
         dbEntitySyncButton.setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.REFRESH, "16px"));
@@ -78,7 +73,7 @@ public class ObjectEntityClassTabLayout
     {
         LOGGER.debug("begin editing " + this);
 
-        abstractClassCheckbox.selectedProperty().bindBidirectional(objectEntityAdapter.getAbstractClassProperty());
+        abstractClassCheckbox.selectedProperty().bindBidirectional(objectEntityAdapter.abstractClassProperty());
     }
 
 
@@ -87,6 +82,6 @@ public class ObjectEntityClassTabLayout
     {
         LOGGER.debug("end editing " + this);
 
-        abstractClassCheckbox.selectedProperty().unbindBidirectional(objectEntityAdapter.getAbstractClassProperty());
+        abstractClassCheckbox.selectedProperty().unbindBidirectional(objectEntityAdapter.abstractClassProperty());
     }
 }

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/4b056029/src/main/java/org/apache/cayenne/modeler/project/ObjectEntityTreeItem.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/project/ObjectEntityTreeItem.java b/src/main/java/org/apache/cayenne/modeler/project/ObjectEntityTreeItem.java
index 7cd5559..851631e 100644
--- a/src/main/java/org/apache/cayenne/modeler/project/ObjectEntityTreeItem.java
+++ b/src/main/java/org/apache/cayenne/modeler/project/ObjectEntityTreeItem.java
@@ -33,7 +33,7 @@ public class ObjectEntityTreeItem extends TreeItem<String> implements
CayenneTre
     {
         this.objectEntityAdapter = objectEntityAdapter;
 
-        valueProperty().bindBidirectional(objectEntityAdapter.getNameProperty());
+        valueProperty().bindBidirectional(objectEntityAdapter.nameProperty());
         setGraphic(GlyphsDude.createIcon(FontAwesomeIcon.FILE_TEXT, TREE_ICON_SIZE));
         parent.getChildren().add(this);
         setExpanded(true);


Mime
View raw message