Introduce bearing node type.
authorMathieu Baudier <mbaudier@argeo.org>
Sat, 12 Dec 2020 09:13:51 +0000 (10:13 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Sat, 12 Dec 2020 09:13:51 +0000 (10:13 +0100)
org.argeo.entity.api/src/org/argeo/entity/EntityNames.java
org.argeo.entity.api/src/org/argeo/entity/EntityType.java
org.argeo.entity.api/src/org/argeo/entity/entity.cnd
org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteUiUtils.java

index 8e2f1b8ec7576c6f8319bdd8efd54ea21bf4f501..07504318aec9f17be245e2a206d3630f8476c6e4 100644 (file)
@@ -18,8 +18,8 @@ public interface EntityNames {
        final String ADM = "adm";
 
        final String ENTITY_TYPE = "entity:type";
-       //final String ENTITY_UID = "entity:uid";
-       //final String ENTITY_NAME = "entity:name";
+       // final String ENTITY_UID = "entity:uid";
+       // final String ENTITY_NAME = "entity:name";
 
        // GENERIC CONCEPTS
        /** The language which is relevant. */
@@ -50,4 +50,8 @@ public interface EntityNames {
        // SVG
        final String SVG_WIDTH = "svg:width";
        final String SVG_HEIGHT = "svg:height";
+       final String SVG_LENGTH = "svg:length";
+       final String SVG_UNIT = "svg:unit";
+       final String SVG_DUR = "svg:dur";
+       final String SVG_DIRECTION = "svg:direction";
 }
index f208a99bfe9dc7e9655080e90e9ccda534b0461d..ecd6330fed6252be79b537ac1e6573535050eccd 100644 (file)
@@ -11,7 +11,7 @@ public enum EntityType implements JcrName {
        // graphics
        box,
        // geography
-       geopoint,
+       geopoint, bearing,
        // ldap
        person, user;
 
index 0b3127b305115cf16c82412b1f1b23df15825bdb..b30657d06c536c12fab0102d85cee7b5518d1702 100644 (file)
@@ -94,3 +94,6 @@ mixin
 - geo:lat (DOUBLE)
 - geo:alt (DOUBLE)
 
+[entity:bearing]
+mixin
+- svg:direction (DOUBLE)
index c98e6d64c800c677fb7ceaabd38b083ef9fd06fb..085dd4f099eace84f6556bc1ff37cea191e13e32 100644 (file)
@@ -244,8 +244,12 @@ public class SuiteUiUtils {
                Label img = new Label(parent, SWT.NONE);
                CmsUiUtils.markup(img);
                img.setText(CmsUiUtils.img(fileNode, width.toString(), height.toString()));
-               if (parent.getLayout() instanceof GridLayout)
-                       img.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
+               if (parent.getLayout() instanceof GridLayout) {
+                       GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false);
+                       gd.widthHint = width.intValue();
+                       gd.heightHint = height.intValue();
+                       img.setLayoutData(gd);
+               }
                img.addMouseListener(new MouseListener() {
 
                        @Override
@@ -268,7 +272,7 @@ public class SuiteUiUtils {
                                                scroll.setLayout(CmsUiUtils.noSpaceGridLayout());
                                                scroll.setExpandHorizontal(true);
                                                scroll.setExpandVertical(true);
-                                               //scroll.setAlwaysShowScrollBars(true);
+                                               // scroll.setAlwaysShowScrollBars(true);
 
                                                Composite c = new Composite(scroll, SWT.NONE);
                                                scroll.setContent(c);