Datatips: field in the graphic handle structure 10/8710/5
Gustavo LIBOTTE [Tue, 21 Aug 2012 04:46:05 +0000 (01:46 -0300)]
Change-Id: I76644f249ebfcbccc42f058f9064fe1c80d47002

34 files changed:
scilab/modules/fileio/macros/%_listvarinfile.sci
scilab/modules/graphic_objects/includes/graphicObjectProperties.h
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObjectProperties.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/polyline/Polyline.java
scilab/modules/graphic_objects/src/scripts/propertiesMap.properties
scilab/modules/graphics/Makefile.am
scilab/modules/graphics/Makefile.in
scilab/modules/graphics/graphics.vcxproj
scilab/modules/graphics/graphics.vcxproj.filters
scilab/modules/graphics/macros/%h_load.sci
scilab/modules/graphics/macros/%h_p.sci
scilab/modules/graphics/macros/%h_save.sci
scilab/modules/graphics/src/c/getHandleProperty/GetHashTable.c
scilab/modules/graphics/src/c/getHandleProperty/SetHashTable.c
scilab/modules/graphics/src/c/getHandleProperty/getHandleProperty.h
scilab/modules/graphics/src/c/getHandleProperty/get_datatips_property.c [new file with mode: 0644]
scilab/modules/graphics/src/c/getHandleProperty/setHandleProperty.h
scilab/modules/graphics/src/c/getHandleProperty/set_datatips_property.c [new file with mode: 0644]
scilab/modules/gui/Makefile.am
scilab/modules/gui/Makefile.in
scilab/modules/gui/includes/CallDatatipCreateField.h [new file with mode: 0644]
scilab/modules/gui/sci_gateway/cpp/sci_datatipcreate.cpp
scilab/modules/gui/sci_gateway/cpp/sci_datatipremove.cpp
scilab/modules/gui/src/c/gui.vcxproj
scilab/modules/gui/src/c/gui.vcxproj.filters
scilab/modules/gui/src/cpp/CallDatatipCreateField.cpp [new file with mode: 0644]
scilab/modules/gui/src/cpp/CallDatatipCreateField.hxx [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/datatip/DatatipCreate.java
scilab/modules/gui/src/java/org/scilab/modules/gui/datatip/DatatipDelete.java
scilab/modules/gui/src/java/org/scilab/modules/gui/datatip/DatatipDrag.java
scilab/modules/gui/src/java/org/scilab/modules/gui/datatip/DatatipMove.java
scilab/modules/gui/src/jni/Datatip.giws.xml
scilab/modules/gui/src/jni/DatatipFunctions.cpp [changed mode: 0755->0644]
scilab/modules/gui/src/jni/DatatipFunctions.hxx [changed mode: 0755->0644]

index 87f9b47..d0b07bf 100644 (file)
@@ -623,6 +623,8 @@ function totalSize = getSingleHandleInfo(fd, totalSize)
                 totalSize = seekDouble(fd, totalSize); // bar_width
             end
 
+            totalSize = seekMatrix(fd, totalSize); // datatips
+
             [totalSize, state] = readString(fd, totalSize); // clip_state
             if state == "on" then
                 totalSize = seekDoubleCount(fd, 4, totalSize); //clip_box
index 298ff06..a099415 100644 (file)
 #define __GO_Y_SHIFT__                     "YShift"
 #define __GO_Z_SHIFT__                     "ZShift"
 #define __GO_BAR_WIDTH__                   "BarWidth"
+#define __GO_DATATIPS__                    "Datatips"
+#define __GO_DATATIPS_SIZE__               "DatatipsSize"
 
 #define __GO_SURFACE_MODE__                "SurfaceMode"
 #define __GO_COLOR_MODE__                  "ColorMode"
index 68de0d3..3a7b370 100644 (file)
@@ -263,6 +263,8 @@ public class GraphicObjectProperties {
     public static final String __GO_Y_SHIFT__ =                "YShift";
     public static final String __GO_Z_SHIFT__ =                "ZShift";
     public static final String __GO_BAR_WIDTH__ =              "BarWidth";
+    public static final String __GO_DATATIPS__ =               "Datatips";
+    public static final String __GO_DATATIPS_SIZE__ =          "DatatipsSize";
 
     public static final String __GO_SURFACE_MODE__ =           "SurfaceMode";
     public static final String __GO_COLOR_MODE__ =             "ColorMode";
index d279837..8cacc76 100644 (file)
@@ -29,7 +29,7 @@ public class Polyline extends ClippableContouredObject {
        /** Polyline properties names */
        private enum PolylineProperty { CLOSED, ARROWSIZEFACTOR, POLYLINESTYLE,
                INTERPCOLORVECTOR, INTERPCOLORVECTORSET, INTERPCOLORMODE,
-               XSHIFT, YSHIFT, ZSHIFT, BARWIDTH };
+               XSHIFT, YSHIFT, ZSHIFT, BARWIDTH, DATATIPS, DATATIPSSIZE };
 
        /** Specifies whether the polyline is closed */
        private boolean closed;
@@ -61,6 +61,9 @@ public class Polyline extends ClippableContouredObject {
        /** Bar width */
        private double barWidth;
 
+        /** Datatips property */
+       private Double[] datatips;
+
        /** Constructor */
        public Polyline() {
                super();
@@ -74,6 +77,7 @@ public class Polyline extends ClippableContouredObject {
                yShift = null;
                zShift = null;
                barWidth = 0.0;
+                datatips = new Double[0];
        }
 
     @Override
@@ -107,7 +111,11 @@ public class Polyline extends ClippableContouredObject {
                        return PolylineProperty.ZSHIFT;
                } else if (propertyName.equals(__GO_BAR_WIDTH__)) {
                        return PolylineProperty.BARWIDTH;
-               } else {
+               } else if (propertyName.equals(__GO_DATATIPS__)) {
+                        return PolylineProperty.DATATIPS;
+                } else if (propertyName.equals(__GO_DATATIPS_SIZE__)) {
+                        return PolylineProperty.DATATIPSSIZE;
+                } else {
                        return super.getPropertyFromName(propertyName);
                }
        }       
@@ -138,7 +146,11 @@ public class Polyline extends ClippableContouredObject {
                        return getZShift();
                } else if (property == PolylineProperty.BARWIDTH) {
                        return getBarWidth();
-               } else {
+               } else if (property == PolylineProperty.DATATIPS) {
+                        return getDatatips();
+                } else if (property == PolylineProperty.DATATIPSSIZE) {
+                        return getDatatipsSize();
+                } else {
                        return super.getProperty(property);     
                }
        }
@@ -170,7 +182,9 @@ public class Polyline extends ClippableContouredObject {
                        setZShift((double[]) value);
                } else if (property == PolylineProperty.BARWIDTH) {
                        setBarWidth((Double) value);
-               } else {
+               } else if (property == PolylineProperty.DATATIPS) {
+                        setDatatips((Double[]) value);
+                } else {
                        return super.setProperty(property, value);
                }
 
@@ -328,6 +342,28 @@ public class Polyline extends ClippableContouredObject {
                zShift = shift;
        }
 
+        /**
+        * @param datatips datatips coordinates
+        */
+       public void setDatatips(Double[] datatips) {
+               this.datatips = datatips;
+       }
+
+        /**
+        * @return the datatips coordinates
+        */
+       public Double[] getDatatips() {
+               return datatips;
+       }
+
+        /**
+        * Return the number of datatips
+        * @return the number of datatips
+        */
+        public int getDatatipsSize() {
+            return datatips.length / 2;
+        }
+
        /**
         * @return Type as String
         */
index 5a56487..6b52fab 100644 (file)
 @DECLARE@ __GO_Y_SHIFT__ @EQUAL@                "YShift" @END@
 @DECLARE@ __GO_Z_SHIFT__ @EQUAL@                "ZShift" @END@
 @DECLARE@ __GO_BAR_WIDTH__ @EQUAL@              "BarWidth" @END@
+@DECLARE@ __GO_DATATIPS__ @EQUAL@               "Datatips" @END@
+@DECLARE@ __GO_DATATIPS_SIZE__ @EQUAL@          "DatatipsSize" @END@
 
 @DECLARE@ __GO_SURFACE_MODE__ @EQUAL@           "SurfaceMode" @END@
 @DECLARE@ __GO_COLOR_MODE__ @EQUAL@             "ColorMode" @END@
index 66a62bf..08bb46a 100644 (file)
@@ -43,6 +43,7 @@ src/c/getHandleProperty/get_current_axes_property.c \
 src/c/getHandleProperty/get_bar_width_property.c \
 src/c/getHandleProperty/get_font_color_property.c \
 src/c/getHandleProperty/get_default_axes_property.c \
+src/c/getHandleProperty/get_datatips_property.c \
 src/c/getHandleProperty/get_y_shift_property.c \
 src/c/getHandleProperty/get_immediate_drawing_property.c \
 src/c/getHandleProperty/get_current_entity_property.c \
@@ -200,6 +201,7 @@ src/c/getHandleProperty/set_font_foreground_property.c \
 src/c/getHandleProperty/set_text_box_mode_property.c \
 src/c/getHandleProperty/set_bar_layout_property.c \
 src/c/getHandleProperty/set_bar_width_property.c \
+src/c/getHandleProperty/set_datatips_property.c \
 src/c/getHandleProperty/SetPropertyStatus.c \
 src/c/getHandleProperty/set_font_style_property.c \
 src/c/getHandleProperty/set_surface_mode_property.c \
index d65c09e..93dc36a 100644 (file)
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
-    case $$MAKEFLAGS in \
-      *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
-    esac; \
-    test $$am__dry = yes; \
-  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -129,12 +112,6 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)" \
        "$(DESTDIR)$(libscigraphics_la_etcdir)" \
        "$(DESTDIR)$(libscigraphics_la_rootdir)" \
@@ -160,6 +137,7 @@ am__objects_1 = libscigraphics_algo_la-GetCommandArg.lo \
        libscigraphics_algo_la-get_bar_width_property.lo \
        libscigraphics_algo_la-get_font_color_property.lo \
        libscigraphics_algo_la-get_default_axes_property.lo \
+       libscigraphics_algo_la-get_datatips_property.lo \
        libscigraphics_algo_la-get_y_shift_property.lo \
        libscigraphics_algo_la-get_immediate_drawing_property.lo \
        libscigraphics_algo_la-get_current_entity_property.lo \
@@ -317,6 +295,7 @@ am__objects_1 = libscigraphics_algo_la-GetCommandArg.lo \
        libscigraphics_algo_la-set_text_box_mode_property.lo \
        libscigraphics_algo_la-set_bar_layout_property.lo \
        libscigraphics_algo_la-set_bar_width_property.lo \
+       libscigraphics_algo_la-set_datatips_property.lo \
        libscigraphics_algo_la-SetPropertyStatus.lo \
        libscigraphics_algo_la-set_font_style_property.lo \
        libscigraphics_algo_la-set_surface_mode_property.lo \
@@ -527,11 +506,6 @@ SOURCES = $(libscigraphics_algo_la_SOURCES) \
 DIST_SOURCES = $(libscigraphics_algo_la_SOURCES) \
        $(libscigraphics_disable_la_SOURCES) \
        $(libscigraphics_la_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
 DATA = $(libscigraphics_la_etc_DATA) $(libscigraphics_la_root_DATA) \
        $(libscigraphics_la_sci_gateway_DATA) \
        $(nobase_libscigraphics_la_ged_DATA)
@@ -822,6 +796,7 @@ src/c/getHandleProperty/get_current_axes_property.c \
 src/c/getHandleProperty/get_bar_width_property.c \
 src/c/getHandleProperty/get_font_color_property.c \
 src/c/getHandleProperty/get_default_axes_property.c \
+src/c/getHandleProperty/get_datatips_property.c \
 src/c/getHandleProperty/get_y_shift_property.c \
 src/c/getHandleProperty/get_immediate_drawing_property.c \
 src/c/getHandleProperty/get_current_entity_property.c \
@@ -979,6 +954,7 @@ src/c/getHandleProperty/set_font_foreground_property.c \
 src/c/getHandleProperty/set_text_box_mode_property.c \
 src/c/getHandleProperty/set_bar_layout_property.c \
 src/c/getHandleProperty/set_bar_width_property.c \
+src/c/getHandleProperty/set_datatips_property.c \
 src/c/getHandleProperty/SetPropertyStatus.c \
 src/c/getHandleProperty/set_font_style_property.c \
 src/c/getHandleProperty/set_surface_mode_property.c \
@@ -1365,7 +1341,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
            echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
        esac;
-$(top_srcdir)/Makefile.incl.am:
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -1386,6 +1361,7 @@ clean-noinstLTLIBRARIES:
        done
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
+       test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
        @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
        list2=; for p in $$list; do \
          if test -f $$p; then \
@@ -1393,8 +1369,6 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
          else :; fi; \
        done; \
        test -z "$$list2" || { \
-         echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
          echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
          $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
        }
@@ -1416,11 +1390,11 @@ clean-pkglibLTLIBRARIES:
          echo "rm -f \"$${dir}/so_locations\""; \
          rm -f "$${dir}/so_locations"; \
        done
-libscigraphics-algo.la: $(libscigraphics_algo_la_OBJECTS) $(libscigraphics_algo_la_DEPENDENCIES) $(EXTRA_libscigraphics_algo_la_DEPENDENCIES) 
+libscigraphics-algo.la: $(libscigraphics_algo_la_OBJECTS) $(libscigraphics_algo_la_DEPENDENCIES) 
        $(LINK) $(am_libscigraphics_algo_la_rpath) $(libscigraphics_algo_la_OBJECTS) $(libscigraphics_algo_la_LIBADD) $(LIBS)
-libscigraphics-disable.la: $(libscigraphics_disable_la_OBJECTS) $(libscigraphics_disable_la_DEPENDENCIES) $(EXTRA_libscigraphics_disable_la_DEPENDENCIES) 
+libscigraphics-disable.la: $(libscigraphics_disable_la_OBJECTS) $(libscigraphics_disable_la_DEPENDENCIES) 
        $(LINK) -rpath $(pkglibdir) $(libscigraphics_disable_la_OBJECTS) $(libscigraphics_disable_la_LIBADD) $(LIBS)
-libscigraphics.la: $(libscigraphics_la_OBJECTS) $(libscigraphics_la_DEPENDENCIES) $(EXTRA_libscigraphics_la_DEPENDENCIES) 
+libscigraphics.la: $(libscigraphics_la_OBJECTS) $(libscigraphics_la_DEPENDENCIES) 
        $(LINK) $(am_libscigraphics_la_rpath) $(libscigraphics_la_OBJECTS) $(libscigraphics_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -1496,6 +1470,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-get_data_bounds_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-get_data_mapping_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-get_data_property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-get_datatips_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-get_default_axes_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-get_default_figure_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-get_event_handler_enable_property.Plo@am__quote@
@@ -1640,6 +1615,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-set_data_bounds_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-set_data_mapping_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-set_data_property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-set_datatips_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-set_default_values_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-set_event_handler_enable_property.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphics_algo_la-set_event_handler_property.Plo@am__quote@
@@ -1944,6 +1920,13 @@ libscigraphics_algo_la-get_default_axes_property.lo: src/c/getHandleProperty/get
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscigraphics_algo_la-get_default_axes_property.lo `test -f 'src/c/getHandleProperty/get_default_axes_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_default_axes_property.c
 
+libscigraphics_algo_la-get_datatips_property.lo: src/c/getHandleProperty/get_datatips_property.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscigraphics_algo_la-get_datatips_property.lo -MD -MP -MF $(DEPDIR)/libscigraphics_algo_la-get_datatips_property.Tpo -c -o libscigraphics_algo_la-get_datatips_property.lo `test -f 'src/c/getHandleProperty/get_datatips_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_datatips_property.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscigraphics_algo_la-get_datatips_property.Tpo $(DEPDIR)/libscigraphics_algo_la-get_datatips_property.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/getHandleProperty/get_datatips_property.c' object='libscigraphics_algo_la-get_datatips_property.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscigraphics_algo_la-get_datatips_property.lo `test -f 'src/c/getHandleProperty/get_datatips_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_datatips_property.c
+
 libscigraphics_algo_la-get_y_shift_property.lo: src/c/getHandleProperty/get_y_shift_property.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscigraphics_algo_la-get_y_shift_property.lo -MD -MP -MF $(DEPDIR)/libscigraphics_algo_la-get_y_shift_property.Tpo -c -o libscigraphics_algo_la-get_y_shift_property.lo `test -f 'src/c/getHandleProperty/get_y_shift_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/get_y_shift_property.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscigraphics_algo_la-get_y_shift_property.Tpo $(DEPDIR)/libscigraphics_algo_la-get_y_shift_property.Plo
@@ -3043,6 +3026,13 @@ libscigraphics_algo_la-set_bar_width_property.lo: src/c/getHandleProperty/set_ba
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscigraphics_algo_la-set_bar_width_property.lo `test -f 'src/c/getHandleProperty/set_bar_width_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_bar_width_property.c
 
+libscigraphics_algo_la-set_datatips_property.lo: src/c/getHandleProperty/set_datatips_property.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscigraphics_algo_la-set_datatips_property.lo -MD -MP -MF $(DEPDIR)/libscigraphics_algo_la-set_datatips_property.Tpo -c -o libscigraphics_algo_la-set_datatips_property.lo `test -f 'src/c/getHandleProperty/set_datatips_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_datatips_property.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscigraphics_algo_la-set_datatips_property.Tpo $(DEPDIR)/libscigraphics_algo_la-set_datatips_property.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/getHandleProperty/set_datatips_property.c' object='libscigraphics_algo_la-set_datatips_property.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscigraphics_algo_la-set_datatips_property.lo `test -f 'src/c/getHandleProperty/set_datatips_property.c' || echo '$(srcdir)/'`src/c/getHandleProperty/set_datatips_property.c
+
 libscigraphics_algo_la-SetPropertyStatus.lo: src/c/getHandleProperty/SetPropertyStatus.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscigraphics_algo_la-SetPropertyStatus.lo -MD -MP -MF $(DEPDIR)/libscigraphics_algo_la-SetPropertyStatus.Tpo -c -o libscigraphics_algo_la-SetPropertyStatus.lo `test -f 'src/c/getHandleProperty/SetPropertyStatus.c' || echo '$(srcdir)/'`src/c/getHandleProperty/SetPropertyStatus.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscigraphics_algo_la-SetPropertyStatus.Tpo $(DEPDIR)/libscigraphics_algo_la-SetPropertyStatus.Plo
@@ -4394,11 +4384,8 @@ clean-libtool:
        -rm -rf .libs _libs
 install-libscigraphics_la_etcDATA: $(libscigraphics_la_etc_DATA)
        @$(NORMAL_INSTALL)
+       test -z "$(libscigraphics_la_etcdir)" || $(MKDIR_P) "$(DESTDIR)$(libscigraphics_la_etcdir)"
        @list='$(libscigraphics_la_etc_DATA)'; test -n "$(libscigraphics_la_etcdir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(libscigraphics_la_etcdir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(libscigraphics_la_etcdir)" || exit 1; \
-       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -4412,14 +4399,13 @@ uninstall-libscigraphics_la_etcDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(libscigraphics_la_etc_DATA)'; test -n "$(libscigraphics_la_etcdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       dir='$(DESTDIR)$(libscigraphics_la_etcdir)'; $(am__uninstall_files_from_dir)
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(libscigraphics_la_etcdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(libscigraphics_la_etcdir)" && rm -f $$files
 install-libscigraphics_la_rootDATA: $(libscigraphics_la_root_DATA)
        @$(NORMAL_INSTALL)
+       test -z "$(libscigraphics_la_rootdir)" || $(MKDIR_P) "$(DESTDIR)$(libscigraphics_la_rootdir)"
        @list='$(libscigraphics_la_root_DATA)'; test -n "$(libscigraphics_la_rootdir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(libscigraphics_la_rootdir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(libscigraphics_la_rootdir)" || exit 1; \
-       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -4433,14 +4419,13 @@ uninstall-libscigraphics_la_rootDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(libscigraphics_la_root_DATA)'; test -n "$(libscigraphics_la_rootdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       dir='$(DESTDIR)$(libscigraphics_la_rootdir)'; $(am__uninstall_files_from_dir)
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(libscigraphics_la_rootdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(libscigraphics_la_rootdir)" && rm -f $$files
 install-libscigraphics_la_sci_gatewayDATA: $(libscigraphics_la_sci_gateway_DATA)
        @$(NORMAL_INSTALL)
+       test -z "$(libscigraphics_la_sci_gatewaydir)" || $(MKDIR_P) "$(DESTDIR)$(libscigraphics_la_sci_gatewaydir)"
        @list='$(libscigraphics_la_sci_gateway_DATA)'; test -n "$(libscigraphics_la_sci_gatewaydir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(libscigraphics_la_sci_gatewaydir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(libscigraphics_la_sci_gatewaydir)" || exit 1; \
-       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -4454,21 +4439,20 @@ uninstall-libscigraphics_la_sci_gatewayDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(libscigraphics_la_sci_gateway_DATA)'; test -n "$(libscigraphics_la_sci_gatewaydir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       dir='$(DESTDIR)$(libscigraphics_la_sci_gatewaydir)'; $(am__uninstall_files_from_dir)
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(libscigraphics_la_sci_gatewaydir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(libscigraphics_la_sci_gatewaydir)" && rm -f $$files
 install-nobase_libscigraphics_la_gedDATA: $(nobase_libscigraphics_la_ged_DATA)
        @$(NORMAL_INSTALL)
+       test -z "$(libscigraphics_la_geddir)" || $(MKDIR_P) "$(DESTDIR)$(libscigraphics_la_geddir)"
        @list='$(nobase_libscigraphics_la_ged_DATA)'; test -n "$(libscigraphics_la_geddir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(libscigraphics_la_geddir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(libscigraphics_la_geddir)" || exit 1; \
-       fi; \
        $(am__nobase_list) | while read dir files; do \
          xfiles=; for file in $$files; do \
            if test -f "$$file"; then xfiles="$$xfiles $$file"; \
            else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
          test -z "$$xfiles" || { \
            test "x$$dir" = x. || { \
-             echo " $(MKDIR_P) '$(DESTDIR)$(libscigraphics_la_geddir)/$$dir'"; \
+             echo "$(MKDIR_P) '$(DESTDIR)$(libscigraphics_la_geddir)/$$dir'"; \
              $(MKDIR_P) "$(DESTDIR)$(libscigraphics_la_geddir)/$$dir"; }; \
            echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(libscigraphics_la_geddir)/$$dir'"; \
            $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(libscigraphics_la_geddir)/$$dir" || exit $$?; }; \
@@ -4478,7 +4462,9 @@ uninstall-nobase_libscigraphics_la_gedDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(nobase_libscigraphics_la_ged_DATA)'; test -n "$(libscigraphics_la_geddir)" || list=; \
        $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
-       dir='$(DESTDIR)$(libscigraphics_la_geddir)'; $(am__uninstall_files_from_dir)
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(libscigraphics_la_geddir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(libscigraphics_la_geddir)" && rm -f $$files
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -4580,15 +4566,10 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       if test -z '$(STRIP)'; then \
-         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-             install; \
-       else \
-         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-       fi
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
 
 clean-generic:
index dcf5f46..67469ca 100644 (file)
@@ -227,6 +227,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="src\c\getHandleProperty\get_background_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_bar_layout_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_bar_width_property.c" />
+    <ClCompile Include="src\c\getHandleProperty\get_datatips_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_box_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_callback_property.c" />
     <ClCompile Include="src\c\getHandleProperty\get_callback_type_property.c" />
@@ -446,6 +447,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="src\c\getHandleProperty\set_background_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_bar_layout_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_bar_width_property.c" />
+    <ClCompile Include="src\c\getHandleProperty\set_datatips_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_box_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_callback_property.c" />
     <ClCompile Include="src\c\getHandleProperty\set_callback_type_property.c" />
@@ -680,4 +682,4 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index c1bf4c1..ec5c9cb 100644 (file)
     <ClCompile Include="src\c\getHandleProperty\get_bar_width_property.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\c\getHandleProperty\get_datatips_property.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
     <ClCompile Include="src\c\getHandleProperty\get_box_property.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="src\c\getHandleProperty\set_bar_width_property.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\c\getHandleProperty\set_datatips_property.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
     <ClCompile Include="src\c\getHandleProperty\set_box_property.c">
       <Filter>Source Files</Filter>
     </ClCompile>
       <Filter>Resource Files</Filter>
     </ResourceCompile>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
index b5a94fd..7895f92 100644 (file)
@@ -581,6 +581,8 @@ function [h,immediate_drawing] = load_graphichandle(fd)
       bar_width = mget( 1, 'dl', fd ) ; // bar_width
     end
 
+    datatips=matrix(mget(mget(1,'il',fd),"dl",fd),-1,3) // datatips
+
     clip_state     = ascii(mget(mget(1,characterFormat,fd),characterFormat,fd)) // clip_state
 
     if clip_state=='on' then
@@ -630,6 +632,8 @@ function [h,immediate_drawing] = load_graphichandle(fd)
       set(h,"bar_width",bar_width);
     end
 
+    set(h,"datatips",datatips),
+
     if clip_state =='' then clip_state='clipgrf',end
     if clip_state=='on' then set(h,"clip_box",clip_box),end
     set(h,"clip_state",clip_state);
index 6b69da2..fc69de1 100644 (file)
@@ -86,6 +86,7 @@ function %h_p(h)
                 "y_shift = "+bys
                 "z_shift = "+bzs
                 "bar_width = "+sci2exp(h.bar_width)
+                "datatips = matrix "+strcat(string(size(h.datatips)),'x')
                 "clip_state = "+sci2exp(h.clip_state)
                 "clip_box = "+sci2exp(h.clip_box)
                 "user_data = "+fmtuser_data(u)
index 8d6743f..4d91b3b 100644 (file)
@@ -290,6 +290,10 @@ function save_graphichandle(h,fd)
     mput(size(h.z_shift,'*'),'sl',fd); mput(h.z_shift,'dl',fd); // z_shift
     
     mput( h.bar_width, 'dl', fd ) ; // bar_width
+
+    mput(size(h.datatips,'*'),'il',fd); // datatips
+    mput(h.datatips,'dl',fd);
+
     mput(length(h.clip_state),characterFormat,fd); // clip_state
     mput(ascii(h.clip_state),characterFormat,fd);
     if h.clip_state=='on' then
index 1a73d1a..8495833 100644 (file)
@@ -46,7 +46,7 @@ typedef struct
  * don't forget to modify it each time the propertyTable
  * is modified.
  */
-#define NB_PROPERTIES 162
+#define NB_PROPERTIES 163
 
 /**
  * list of all property names and associated functions in scilab
@@ -98,6 +98,7 @@ static getHashTableCouple propertyTable[NB_PROPERTIES] =
     {"mark_background", get_mark_background_property},
     {"bar_layout", get_bar_layout_property},
     {"bar_width", get_bar_width_property},
+    {"datatips", get_datatips_property},
     {"x_shift", get_x_shift_property},
     {"y_shift", get_y_shift_property},
     {"z_shift", get_z_shift_property},
index 6cf44a7..b42d008 100644 (file)
@@ -52,7 +52,7 @@ typedef struct
 * don't forget to modify it each time the propertyTable
 * is modified.
 */
-#define NB_PROPERTIES 157
+#define NB_PROPERTIES 158
 
 /**
 * list of all property names and associated functions in scilab
@@ -101,6 +101,7 @@ static setHashTableCouple propertyTable[NB_PROPERTIES] =
     {"mark_background", set_mark_background_property},
     {"bar_layout", set_bar_layout_property},
     {"bar_width", set_bar_width_property},
+    {"datatips", set_datatips_property},
     {"x_shift", set_x_shift_property},
     {"y_shift", set_y_shift_property},
     {"z_shift", set_z_shift_property},
index 032c3fd..992c808 100644 (file)
@@ -88,6 +88,7 @@ int get_mark_foreground_property(void* _pvCtx, char* pobjUID);
 int get_mark_background_property(void* _pvCtx, char* pobjUID);
 int get_bar_layout_property(void* _pvCtx, char* pobjUID);
 int get_bar_width_property(void* _pvCtx, char* pobjUID);
+int get_datatips_property(void* _pvCtx, char* pobjUID);
 int get_x_shift_property(void* _pvCtx, char* pobjUID);
 int get_y_shift_property(void* _pvCtx, char* pobjUID);
 int get_z_shift_property(void* _pvCtx, char* pobjUID);
diff --git a/scilab/modules/graphics/src/c/getHandleProperty/get_datatips_property.c b/scilab/modules/graphics/src/c/getHandleProperty/get_datatips_property.c
new file mode 100644 (file)
index 0000000..7c05411
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Gustavo Barbosa Libotte
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+/*------------------------------------------------------------------------*/
+/* file: get_datatips_property.c                                          */
+/* desc: function to retrieve in Scilab the datatips field of a           */
+/*        handle                                                          */
+/*------------------------------------------------------------------------*/
+
+#include "getHandleProperty.h"
+#include "returnProperty.h"
+#include "Scierror.h"
+#include "localization.h"
+
+#include "getGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+
+/*--------------------------------------------------------------------------*/
+int get_datatips_property(void* _pvCtx, char* pobjUID)
+{
+    double *pdblDatatips = NULL;
+
+    int iDatatipsSize = 0;
+    int * piDatatipsSize = &iDatatipsSize;
+
+    getGraphicObjectProperty(pobjUID, __GO_DATATIPS_SIZE__, jni_int, (void **)&piDatatipsSize);
+    getGraphicObjectProperty(pobjUID, __GO_DATATIPS__, jni_double_vector, (void **)&pdblDatatips);
+    if ( pdblDatatips == NULL )
+    {
+        Scierror(999, _("'%s' does not exist for this handle.\n"), "datatips");
+        return -1;
+    }
+
+    return sciReturnMatrix(_pvCtx, pdblDatatips, iDatatipsSize, 2);
+}
+/*--------------------------------------------------------------------------*/
index a14d7f2..f0899cb 100644 (file)
@@ -86,6 +86,7 @@ int set_mark_size_property(void* _pvCtx, char* pobj, size_t stackPointer, int va
 int set_mark_foreground_property(void* _pvCtx, char* pobj, size_t stackPointer, int valueType, int nbRow, int nbCol);
 int set_mark_background_property(void* _pvCtx, char* pobj, size_t stackPointer, int valueType, int nbRow, int nbCol);
 int set_bar_width_property(void* _pvCtx, char* pobj, size_t stackPointer, int valueType, int nbRow, int nbCol);
+int set_datatips_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol );
 int set_bar_layout_property(void* _pvCtx, char* pobj, size_t stackPointer, int valueType, int nbRow, int nbCol);
 int set_x_shift_property(void* _pvCtx, char* pobj, size_t stackPointer, int valueType, int nbRow, int nbCol);
 int set_y_shift_property(void* _pvCtx, char* pobj, size_t stackPointer, int valueType, int nbRow, int nbCol);
diff --git a/scilab/modules/graphics/src/c/getHandleProperty/set_datatips_property.c b/scilab/modules/graphics/src/c/getHandleProperty/set_datatips_property.c
new file mode 100644 (file)
index 0000000..3d36ea4
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Gustavo Barbosa Libotte
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+/*------------------------------------------------------------------------*/
+/* file: set_datatips_property.c                                          */
+/* desc: function to modify in Scilab the datatips field of               */
+/*        a handle                                                        */
+/*------------------------------------------------------------------------*/
+
+#include "setHandleProperty.h"
+#include "SetProperty.h"
+#include "getPropertyAssignedValue.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "SetPropertyStatus.h"
+#include "MALLOC.h"
+
+#include "setGraphicObjectProperty.h"
+#include "graphicObjectProperties.h"
+
+#include "CallDatatipCreateField.h"
+
+/*------------------------------------------------------------------------*/
+int set_datatips_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol)
+{
+    BOOL status = FALSE;
+    double* currentDatatipsCoords;
+    double* newDatatipsCoords;
+    int i;
+
+    if ( !( valueType == sci_matrix ) )
+    {
+        Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "datatips");
+        return SET_PROPERTY_ERROR ;
+    }
+
+    if ( !( nbRow*nbCol % 2 == 0 ) )
+    {
+        Scierror(999, _("Wrong number of input arguments for '%s' property: X and Y expected.\n"), "datatips");
+        return SET_PROPERTY_ERROR ;
+    }
+
+    currentDatatipsCoords = getDoubleMatrixFromStack(stackPointer);
+
+    newDatatipsCoords = CallDatatipCreateField((char*)pobjUID, currentDatatipsCoords, nbRow * nbCol);
+
+    status = setGraphicObjectProperty(pobjUID, __GO_DATATIPS__, newDatatipsCoords, jni_double_vector, nbRow * nbCol);
+
+    FREE(newDatatipsCoords);
+
+    if (status == TRUE)
+    {
+        return SET_PROPERTY_SUCCEED;
+    }
+    else
+    {
+        Scierror(999, _("'%s' does not exist for this handle.\n"), "datatips");
+        return SET_PROPERTY_ERROR;
+    }
+}
+/*------------------------------------------------------------------------*/
index 6a91ae5..d3dc749 100755 (executable)
@@ -134,7 +134,8 @@ src/jni/ScilabDisplayTree.cpp \
 src/jni/EditorManager.cpp \
 src/jni/StartGED.cpp \
 src/jni/DatatipFunctions.cpp \
-src/jni/StartPlotBrowser.cpp
+src/jni/StartPlotBrowser.cpp \
+src/cpp/CallDatatipCreateField.cpp
 
 GIWS_WRAPPERS = \
 src/jni/CallScilabBridge.giws.xml \
index 64547ce..e4d985e 100644 (file)
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
-    case $$MAKEFLAGS in \
-      *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
-    esac; \
-    test $$am__dry = yes; \
-  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -134,12 +117,6 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
 am__installdirs = "$(DESTDIR)$(pkglibdir)" \
        "$(DESTDIR)$(libscigui_la_etcdir)" \
        "$(DESTDIR)$(libscigui_la_rootdir)" \
@@ -229,7 +206,8 @@ am__objects_2 = libscigui_algo_la-InitUIMenu.lo \
        libscigui_algo_la-EditorManager.lo \
        libscigui_algo_la-StartGED.lo \
        libscigui_algo_la-DatatipFunctions.lo \
-       libscigui_algo_la-StartPlotBrowser.lo
+       libscigui_algo_la-StartPlotBrowser.lo \
+       libscigui_algo_la-CallDatatipCreateField.lo
 am_libscigui_algo_la_OBJECTS = $(am__objects_1) $(am__objects_2)
 libscigui_algo_la_OBJECTS = $(am_libscigui_algo_la_OBJECTS)
 @GUI_TRUE@am_libscigui_algo_la_rpath =
@@ -296,11 +274,6 @@ SOURCES = $(libscigui_algo_la_SOURCES) $(libscigui_disable_la_SOURCES) \
        $(libscigui_la_SOURCES)
 DIST_SOURCES = $(libscigui_algo_la_SOURCES) \
        $(libscigui_disable_la_SOURCES) $(libscigui_la_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
 DATA = $(libscigui_la_etc_DATA) $(libscigui_la_root_DATA) \
        $(libscigui_la_sci_gateway_DATA) \
        $(nobase_libscigui_la_icons_DATA)
@@ -679,7 +652,8 @@ src/jni/ScilabDisplayTree.cpp \
 src/jni/EditorManager.cpp \
 src/jni/StartGED.cpp \
 src/jni/DatatipFunctions.cpp \
-src/jni/StartPlotBrowser.cpp
+src/jni/StartPlotBrowser.cpp \
+src/cpp/CallDatatipCreateField.cpp
 
 GIWS_WRAPPERS = \
 src/jni/CallScilabBridge.giws.xml \
@@ -1029,7 +1003,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
            echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
        esac;
-$(top_srcdir)/Makefile.incl.am:
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -1050,6 +1023,7 @@ clean-noinstLTLIBRARIES:
        done
 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
+       test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
        @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
        list2=; for p in $$list; do \
          if test -f $$p; then \
@@ -1057,8 +1031,6 @@ install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
          else :; fi; \
        done; \
        test -z "$$list2" || { \
-         echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
          echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
          $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
        }
@@ -1080,11 +1052,11 @@ clean-pkglibLTLIBRARIES:
          echo "rm -f \"$${dir}/so_locations\""; \
          rm -f "$${dir}/so_locations"; \
        done
-libscigui-algo.la: $(libscigui_algo_la_OBJECTS) $(libscigui_algo_la_DEPENDENCIES) $(EXTRA_libscigui_algo_la_DEPENDENCIES) 
+libscigui-algo.la: $(libscigui_algo_la_OBJECTS) $(libscigui_algo_la_DEPENDENCIES) 
        $(CXXLINK) $(am_libscigui_algo_la_rpath) $(libscigui_algo_la_OBJECTS) $(libscigui_algo_la_LIBADD) $(LIBS)
-libscigui-disable.la: $(libscigui_disable_la_OBJECTS) $(libscigui_disable_la_DEPENDENCIES) $(EXTRA_libscigui_disable_la_DEPENDENCIES) 
+libscigui-disable.la: $(libscigui_disable_la_OBJECTS) $(libscigui_disable_la_DEPENDENCIES) 
        $(LINK) -rpath $(pkglibdir) $(libscigui_disable_la_OBJECTS) $(libscigui_disable_la_LIBADD) $(LIBS)
-libscigui.la: $(libscigui_la_OBJECTS) $(libscigui_la_DEPENDENCIES) $(EXTRA_libscigui_la_DEPENDENCIES) 
+libscigui.la: $(libscigui_la_OBJECTS) $(libscigui_la_DEPENDENCIES) 
        $(CXXLINK) $(am_libscigui_la_rpath) $(libscigui_la_OBJECTS) $(libscigui_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
@@ -1095,6 +1067,7 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_algo_la-CallClipboard.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_algo_la-CallColorChooser.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_algo_la-CallDatatipCreateField.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_algo_la-CallFontChooser.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_algo_la-CallHelpBrowser.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_algo_la-CallJuigetfile.Plo@am__quote@
@@ -2036,6 +2009,13 @@ libscigui_algo_la-StartPlotBrowser.lo: src/jni/StartPlotBrowser.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscigui_algo_la-StartPlotBrowser.lo `test -f 'src/jni/StartPlotBrowser.cpp' || echo '$(srcdir)/'`src/jni/StartPlotBrowser.cpp
 
+libscigui_algo_la-CallDatatipCreateField.lo: src/cpp/CallDatatipCreateField.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscigui_algo_la-CallDatatipCreateField.lo -MD -MP -MF $(DEPDIR)/libscigui_algo_la-CallDatatipCreateField.Tpo -c -o libscigui_algo_la-CallDatatipCreateField.lo `test -f 'src/cpp/CallDatatipCreateField.cpp' || echo '$(srcdir)/'`src/cpp/CallDatatipCreateField.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscigui_algo_la-CallDatatipCreateField.Tpo $(DEPDIR)/libscigui_algo_la-CallDatatipCreateField.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/CallDatatipCreateField.cpp' object='libscigui_algo_la-CallDatatipCreateField.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscigui_algo_la-CallDatatipCreateField.lo `test -f 'src/cpp/CallDatatipCreateField.cpp' || echo '$(srcdir)/'`src/cpp/CallDatatipCreateField.cpp
+
 libscigui_la-sci_printsetupbox.lo: sci_gateway/cpp/sci_printsetupbox.cpp
 @am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscigui_la-sci_printsetupbox.lo -MD -MP -MF $(DEPDIR)/libscigui_la-sci_printsetupbox.Tpo -c -o libscigui_la-sci_printsetupbox.lo `test -f 'sci_gateway/cpp/sci_printsetupbox.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_printsetupbox.cpp
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscigui_la-sci_printsetupbox.Tpo $(DEPDIR)/libscigui_la-sci_printsetupbox.Plo
@@ -2183,11 +2163,8 @@ clean-libtool:
        -rm -rf .libs _libs
 install-libscigui_la_etcDATA: $(libscigui_la_etc_DATA)
        @$(NORMAL_INSTALL)
+       test -z "$(libscigui_la_etcdir)" || $(MKDIR_P) "$(DESTDIR)$(libscigui_la_etcdir)"
        @list='$(libscigui_la_etc_DATA)'; test -n "$(libscigui_la_etcdir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(libscigui_la_etcdir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(libscigui_la_etcdir)" || exit 1; \
-       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -2201,14 +2178,13 @@ uninstall-libscigui_la_etcDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(libscigui_la_etc_DATA)'; test -n "$(libscigui_la_etcdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       dir='$(DESTDIR)$(libscigui_la_etcdir)'; $(am__uninstall_files_from_dir)
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(libscigui_la_etcdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(libscigui_la_etcdir)" && rm -f $$files
 install-libscigui_la_rootDATA: $(libscigui_la_root_DATA)
        @$(NORMAL_INSTALL)
+       test -z "$(libscigui_la_rootdir)" || $(MKDIR_P) "$(DESTDIR)$(libscigui_la_rootdir)"
        @list='$(libscigui_la_root_DATA)'; test -n "$(libscigui_la_rootdir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(libscigui_la_rootdir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(libscigui_la_rootdir)" || exit 1; \
-       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -2222,14 +2198,13 @@ uninstall-libscigui_la_rootDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(libscigui_la_root_DATA)'; test -n "$(libscigui_la_rootdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       dir='$(DESTDIR)$(libscigui_la_rootdir)'; $(am__uninstall_files_from_dir)
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(libscigui_la_rootdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(libscigui_la_rootdir)" && rm -f $$files
 install-libscigui_la_sci_gatewayDATA: $(libscigui_la_sci_gateway_DATA)
        @$(NORMAL_INSTALL)
+       test -z "$(libscigui_la_sci_gatewaydir)" || $(MKDIR_P) "$(DESTDIR)$(libscigui_la_sci_gatewaydir)"
        @list='$(libscigui_la_sci_gateway_DATA)'; test -n "$(libscigui_la_sci_gatewaydir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(libscigui_la_sci_gatewaydir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(libscigui_la_sci_gatewaydir)" || exit 1; \
-       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -2243,21 +2218,20 @@ uninstall-libscigui_la_sci_gatewayDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(libscigui_la_sci_gateway_DATA)'; test -n "$(libscigui_la_sci_gatewaydir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       dir='$(DESTDIR)$(libscigui_la_sci_gatewaydir)'; $(am__uninstall_files_from_dir)
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(libscigui_la_sci_gatewaydir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(libscigui_la_sci_gatewaydir)" && rm -f $$files
 install-nobase_libscigui_la_iconsDATA: $(nobase_libscigui_la_icons_DATA)
        @$(NORMAL_INSTALL)
+       test -z "$(libscigui_la_iconsdir)" || $(MKDIR_P) "$(DESTDIR)$(libscigui_la_iconsdir)"
        @list='$(nobase_libscigui_la_icons_DATA)'; test -n "$(libscigui_la_iconsdir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(libscigui_la_iconsdir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(libscigui_la_iconsdir)" || exit 1; \
-       fi; \
        $(am__nobase_list) | while read dir files; do \
          xfiles=; for file in $$files; do \
            if test -f "$$file"; then xfiles="$$xfiles $$file"; \
            else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
          test -z "$$xfiles" || { \
            test "x$$dir" = x. || { \
-             echo " $(MKDIR_P) '$(DESTDIR)$(libscigui_la_iconsdir)/$$dir'"; \
+             echo "$(MKDIR_P) '$(DESTDIR)$(libscigui_la_iconsdir)/$$dir'"; \
              $(MKDIR_P) "$(DESTDIR)$(libscigui_la_iconsdir)/$$dir"; }; \
            echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(libscigui_la_iconsdir)/$$dir'"; \
            $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(libscigui_la_iconsdir)/$$dir" || exit $$?; }; \
@@ -2267,7 +2241,9 @@ uninstall-nobase_libscigui_la_iconsDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(nobase_libscigui_la_icons_DATA)'; test -n "$(libscigui_la_iconsdir)" || list=; \
        $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
-       dir='$(DESTDIR)$(libscigui_la_iconsdir)'; $(am__uninstall_files_from_dir)
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(libscigui_la_iconsdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(libscigui_la_iconsdir)" && rm -f $$files
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -2371,15 +2347,10 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       if test -z '$(STRIP)'; then \
-         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-             install; \
-       else \
-         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-       fi
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
 
 clean-generic:
diff --git a/scilab/modules/gui/includes/CallDatatipCreateField.h b/scilab/modules/gui/includes/CallDatatipCreateField.h
new file mode 100644 (file)
index 0000000..ab9d1d1
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef __CALLDATATIPCREATEFIELD_H__
+#define __CALLDATATIPCREATEFIELD_H__
+
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Gustavo Barbosa Libotte
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "dynlib_gui.h"
+
+GUI_IMPEXP double* CallDatatipCreateField(char const* polylineUid, double const* coordDoubleXY, int coordDoubleXYSize);
+#endif
index a68ff53..e2ea188 100755 (executable)
@@ -103,6 +103,8 @@ int sci_datatipcreate(char *fname, unsigned long fname_len)
         return FALSE;
     }
 
+    nbRow = 1;
+    nbCol = 1;
     CreateVar(Rhs + 1, GRAPHICAL_HANDLE_DATATYPE, &nbRow, &nbCol, &out_index);
     hstk(out_index)[0] = getHandle(datatip_handler);
     LhsVar(1) = Rhs + 1;
index fdab673..81d8eec 100644 (file)
@@ -47,6 +47,7 @@ int sci_datatipremove(char *fname, unsigned long fname_len)
     int* piAddr        = NULL;
     double* pdblReal = NULL;
     int indexPos = 0;
+    int *status = NULL;
 
     if (Rhs == 1)
     {
@@ -117,4 +118,21 @@ int sci_datatipremove(char *fname, unsigned long fname_len)
         return FALSE;
     }
 
+    if ((status = (int *)MALLOC(sizeof(int))) == NULL)
+    {
+        Scierror(999, _("%s: No more memory.\n"), fname, 0);
+        return FALSE;
+    }
+
+    nbRow = 1;
+    nbCol = 1;
+    CreateVarFromPtr(Rhs + 1, MATRIX_OF_BOOLEAN_DATATYPE, &nbRow, &nbCol, &status);
+
+    FREE(status);
+
+    LhsVar(1) = Rhs + 1;
+    PutLhsVar();
+
+    return TRUE;
+
 }
index 3a0a720..5b6fb1e 100755 (executable)
     <ClCompile Include="..\cpp\CallFontChooser.cpp" />
     <ClCompile Include="..\cpp\CallHelpBrowser.cpp" />
     <ClCompile Include="..\cpp\CallJuigetfile.cpp" />
+    <ClCompile Include="..\cpp\CallDatatipCreateField.cpp" />
     <ClCompile Include="..\cpp\CallJxclick.cpp" />
     <ClCompile Include="..\cpp\CallJxgetmouse.cpp" />
     <ClCompile Include="..\cpp\CallMessageBox.cpp" />
     <ClInclude Include="..\..\includes\CallJuigetfile.h" />
     <ClInclude Include="..\..\includes\CallJuigetfile.hxx" />
     <ClInclude Include="..\..\includes\CallJxclick.h" />
+    <ClInclude Include="..\..\includes\CallDatatipCreateField.h" />
     <ClInclude Include="..\..\includes\CallJxgetmouse.h" />
     <ClInclude Include="..\..\includes\CallMessageBox.h" />
     <ClInclude Include="..\..\includes\ContextMenu.h" />
     <ClInclude Include="..\cpp\CallHelpBrowser.hxx" />
     <ClInclude Include="..\cpp\CallJxclick.hxx" />
     <ClInclude Include="..\cpp\CallJxgetmouse.hxx" />
+    <ClInclude Include="..\cpp\CallDatatipCreateField.hxx" />
     <ClInclude Include="..\cpp\CallMainWindow.hxx" />
     <ClInclude Include="..\cpp\CallMessageBox.hxx" />
     <ClInclude Include="..\cpp\ContextMenu.hxx" />
index de4035a..d16dc15 100755 (executable)
@@ -47,6 +47,9 @@
     <ClCompile Include="..\cpp\CallJxclick.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\cpp\CallDatatipCreateField.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
     <ClCompile Include="..\cpp\CallJxgetmouse.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClInclude Include="..\cpp\CallJxgetmouse.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\cpp\CallDatatipCreateField.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
     <ClInclude Include="..\cpp\CallMainWindow.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\..\includes\CallJxclick.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\includes\CallDatatipCreateField.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\includes\CallJxgetmouse.h">
       <Filter>Header Files</Filter>
     </ClInclude>
diff --git a/scilab/modules/gui/src/cpp/CallDatatipCreateField.cpp b/scilab/modules/gui/src/cpp/CallDatatipCreateField.cpp
new file mode 100644 (file)
index 0000000..53f318f
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Gustavo Barbosa Libotte
+ * 
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at    
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "CallDatatipCreateField.hxx"
+
+using namespace org_scilab_modules_gui_datatip;
+
+double* CallDatatipCreateField(char const* polylineUid, double const* coordDoubleXY, int coordDoubleXYSize)
+{
+    DatatipCreate::createDatatipField(getScilabJavaVM(), polylineUid, coordDoubleXY, coordDoubleXYSize);
+}
diff --git a/scilab/modules/gui/src/cpp/CallDatatipCreateField.hxx b/scilab/modules/gui/src/cpp/CallDatatipCreateField.hxx
new file mode 100644 (file)
index 0000000..5d71c10
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef __CALLDATATIPCREATEFIELD_HXX__
+#define __CALLDATATIPCREATEFIELD_HXX__
+
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Gustavo Barbosa Libotte
+ * 
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at    
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "DatatipFunctions.hxx"
+extern "C" {
+#include "getScilabJavaVM.h"
+#include "CallDatatipCreateField.h"
+}
+
+#endif
index 443508c..cfb176b 100755 (executable)
@@ -42,8 +42,10 @@ public class DatatipCreate {
     public static Double[] datatipPosition = new Double[3];
     private static double[] pixelMouseCoordDouble = new double[2];
     public static double[] coordDoubleXY = new double[]{0.0, 0.0};
-    static EntityPicker ep = new EntityPicker();
+    public static Integer[] coordInteger = new Integer[]{0, 0};
     public static double[] graphicCoord = new double[3];
+    public static double[] datatipCoordinates = new double[2];
+    static EntityPicker ep = new EntityPicker();
     public static String newDatatip = null;
     public static String newMarker = null;
 
@@ -59,9 +61,11 @@ public class DatatipCreate {
     public static String createDatatip(String figureUid, Integer coordIntX, Integer coordIntY) {
 
         Integer[] pixelMouseCoordInt = { coordIntX , coordIntY };
+        String polylineUid = ep.pick (figureUid, coordIntX, coordIntY);
         String axesUid = datatipAxesHandler(figureUid, pixelMouseCoordInt);
         double[] pixelMouseCoordDouble = transformPixelCoordToDouble(pixelMouseCoordInt);
         graphicCoord = transformPixelCoordToGraphic(axesUid, pixelMouseCoordDouble);
+        insertPoint (polylineUid, graphicCoord[0], graphicCoord[1]);
         String newDatatip = datatipProperties (graphicCoord, axesUid);
         return newDatatip;
     }
@@ -98,29 +102,13 @@ public class DatatipCreate {
                     posMin = j;
                 }
             }
-
             String newDatatip = createDatatipProgramIndex(polylineUid, posMin+1);
             return newDatatip;
 
         } else {
 
             int middleLineFactor = 0;
-
-            double[] graphCoordDouble = new double[]{0.0, 0.0, 0.0};
-            graphCoordDouble[0] = coordDoubleXY[0];
-            graphCoordDouble[1] = coordDoubleXY[1];
-            graphCoordDouble[2] = 0.0;
-
-            double[] pixelCoordinates = new double[]{0.0, 0.0};
-            pixelCoordinates = CallRenderer.getPixelFrom2dViewCoordinates(axesUid, graphCoordDouble);
-
-            int xInt = (int) pixelCoordinates[0];
-            int yInt = (int) pixelCoordinates[1];
-
-            Integer[] coordInteger = new Integer[]{0, 0};
-            coordInteger[0] = (Integer) xInt;
-            coordInteger[1] = (Integer) yInt;
-
+            coordInteger = getDatatipPositionInteger (coordDoubleXY, axesUid);
             int yVerify = 0;
             Integer[] axesDimension = new Integer[]{0, 0};
             axesDimension = (Integer[])GraphicController.getController().getProperty(figureUid, GraphicObjectProperties.__GO_AXES_SIZE__);
@@ -155,18 +143,17 @@ public class DatatipCreate {
                 pixelMouseCoordInt[0] = newX;
                 pixelMouseCoordInt[1] = newY;
 
-                double[] pixelMouseCoordDouble = new double[]{0.0, 0.0};
                 pixelMouseCoordDouble = transformPixelCoordToDouble(pixelMouseCoordInt);
 
-                double[] graphicCoord = new double[]{0.0, 0.0, 0.0};
                 graphicCoord = transformPixelCoordToGraphic (axesUid, pixelMouseCoordDouble);
 
+                insertPoint (polylineUid, graphicCoord[0], graphicCoord[1]);
                 newDatatip = datatipProperties (graphicCoord, axesUid);
                 newMarker = MarkerCreate.markerProperties (graphicCoord, axesUid);
                 return newDatatip;
 
             } else {
-
+                insertPoint (polylineUid, coordDoubleXY[0], coordDoubleXY[1]);
                 newDatatip = datatipProperties (coordDoubleXY, axesUid);
                 newMarker = MarkerCreate.markerProperties (coordDoubleXY, axesUid);
                 return newDatatip;
@@ -177,6 +164,93 @@ public class DatatipCreate {
 
     }
 
+    public static double[] createDatatipField (String polylineUid, double[] coordDoubleXY) {
+
+        double[] fieldArray = new double[coordDoubleXY.length];
+
+        String compoundUid = (String) GraphicController.getController().getProperty(polylineUid, GraphicObjectProperties.__GO_PARENT__);
+        String axesUid = (String) GraphicController.getController().getProperty(compoundUid, GraphicObjectProperties.__GO_PARENT__);
+        String figureUid = (String) GraphicController.getController().getProperty(axesUid, GraphicObjectProperties.__GO_PARENT__);
+
+        String[] childrenUid = (String[]) GraphicController.getController().getProperty(axesUid, GraphicObjectProperties.__GO_CHILDREN__);
+        for (int i = 0 ; i < childrenUid.length ; i++) {
+            String objType = (String) GraphicController.getController().getProperty(childrenUid[i], GraphicObjectProperties.__GO_TYPE__);
+            if (objType == "Text") {
+                Double[] datatipPosition = (Double[]) GraphicController.getController().getProperty(childrenUid[i], GraphicObjectProperties.__GO_POSITION__);
+                double[] doublePosition = new double[datatipPosition.length];
+                for (int j = 0 ; j < datatipPosition.length ; j++) {
+                    doublePosition[j] = (double) datatipPosition[j];
+                }
+                coordInteger = getDatatipPositionInteger (doublePosition, axesUid);
+                String polylineUidEnd = ep.pick (figureUid, coordInteger[0], coordInteger[1]);
+                if (polylineUidEnd.equals(polylineUid)) {
+                    GraphicController.getController().removeRelationShipAndDelete(childrenUid[i]);
+                }
+            }
+        }
+
+        for (int i = 0 ; i < (coordDoubleXY.length / 2) ; i++) {
+            datatipCoordinates[0] = coordDoubleXY[2*i];
+            datatipCoordinates[1] = coordDoubleXY[2*i + 1];
+
+            int middleLineFactor = 0;
+            coordInteger = getDatatipPositionInteger (datatipCoordinates, axesUid);
+            int yVerify = 0;
+            Integer[] axesDimension = new Integer[]{0, 0};
+            axesDimension = (Integer[])GraphicController.getController().getProperty(figureUid, GraphicObjectProperties.__GO_AXES_SIZE__);
+
+            String polylineUidEnd = null;
+            for (yVerify = 0 ; yVerify < axesDimension[1] ; yVerify++) {
+                polylineUidEnd = ep.pick (figureUid, coordInteger[0], yVerify);
+                if (polylineUidEnd != null) {
+                    if (polylineUidEnd.equals(polylineUid)) {
+                        middleLineFactor++;
+                    }
+                }
+            }
+
+            if (middleLineFactor < 20) {
+
+                for (yVerify = 0 ; yVerify < axesDimension[1] ; yVerify++) {
+                    polylineUidEnd = ep.pick (figureUid, coordInteger[0], yVerify);
+                    if (polylineUidEnd != null) {
+                        if (polylineUidEnd.equals(polylineUid)) {
+                            break;
+                        }
+                    }
+                }
+
+                Integer newX = 0;
+                Integer newY = 0;
+                newX = coordInteger[0];
+                newY = yVerify + (middleLineFactor / 2);
+
+                Integer[] pixelMouseCoordInt = new Integer[]{0, 0};
+                pixelMouseCoordInt[0] = newX;
+                pixelMouseCoordInt[1] = newY;
+
+                pixelMouseCoordDouble = transformPixelCoordToDouble(pixelMouseCoordInt);
+
+                graphicCoord = transformPixelCoordToGraphic (axesUid, pixelMouseCoordDouble);
+
+                newDatatip = datatipProperties (graphicCoord, axesUid);
+                newMarker = MarkerCreate.markerProperties (graphicCoord, axesUid);
+                fieldArray[i] = graphicCoord[0];
+                fieldArray[i + (coordDoubleXY.length / 2)] = graphicCoord[1];
+
+            } else {
+                graphicCoord[0] = datatipCoordinates[0];
+                graphicCoord[1] = datatipCoordinates[1];
+                newDatatip = datatipProperties (graphicCoord, axesUid);
+                newMarker = MarkerCreate.markerProperties (graphicCoord, axesUid);
+                fieldArray[i] = datatipCoordinates[0];
+                fieldArray[i + (coordDoubleXY.length / 2)] = datatipCoordinates[1];
+            }
+        }
+
+        return fieldArray;
+    }
+
     /**
     * Given an integer index that belongs to the polyline create a datatip.
     *
@@ -198,12 +272,39 @@ public class DatatipCreate {
         }
         coordDoubleXY[0] = DataX[indexPoint - 1];
         coordDoubleXY[1] = DataY[indexPoint - 1];
+        insertPoint (polylineUid, coordDoubleXY[0], coordDoubleXY[1]);
         String newDatatip = datatipProperties (coordDoubleXY, axesUid);
         String newMarker = MarkerCreate.markerProperties (coordDoubleXY, axesUid);
         return newDatatip;
     }
 
     /**
+    * Get integer datatip position on a specific axes
+    *
+    * @param coordinates Datatip coordinates x, y in double precision
+    * @param axesUid Axes unique identifier
+    * @return integer datatip position
+    */
+    public static Integer[] getDatatipPositionInteger (double[] coordinates, String axesUid) {
+
+        double[] graphCoordDouble = new double[]{0.0, 0.0, 0.0};
+        graphCoordDouble[0] = coordinates[0];
+        graphCoordDouble[1] = coordinates[1];
+        graphCoordDouble[2] = 0.0;
+
+        double[] pixelCoordinates = new double[]{0.0, 0.0};
+        pixelCoordinates = CallRenderer.getPixelFrom2dViewCoordinates(axesUid, graphCoordDouble);
+
+        int xInt = (int) pixelCoordinates[0];
+        int yInt = (int) pixelCoordinates[1];
+
+        coordInteger[0] = (Integer) xInt;
+        coordInteger[1] = (Integer) yInt;
+
+        return coordInteger;
+    }
+
+    /**
     * Get the axes handler of the figure which mouse click belongs
     *
     * @param figureUid Figure unique identifier.
@@ -339,4 +440,31 @@ public class DatatipCreate {
             GraphicController.getController().setProperty(polylineUid, GraphicObjectProperties.__GO_TAG__, interpString);
         }
     }
+
+    /**
+    * Insert the coordinates of a created datatip in the datatips field in the polyline
+    *
+    * @param polylineUid Polyline handler string.
+    * @param coordX Coordinate x of the datatip.
+    * @param coordY Coordinate y of the datatip.
+    */
+    private static void insertPoint (String polylineUid, double coordX, double coordY) {
+
+        Double[] currentDatatips = (Double[]) GraphicController.getController().getProperty(polylineUid, GraphicObjectProperties.__GO_DATATIPS__);
+        Integer numDatatips = (Integer) GraphicController.getController().getProperty(polylineUid, GraphicObjectProperties.__GO_DATATIPS_SIZE__);
+        int allocArray = (2*numDatatips) + 2;
+        Double[] newDatatips = new Double[allocArray];
+        int j = 0;
+        for (int i = 0 ; i < newDatatips.length ; i++) {
+            if (i == numDatatips) {
+                newDatatips[i] = coordX;
+            } else if (i == (newDatatips.length - 1)) {
+                newDatatips[i] = coordY;
+            } else {
+                newDatatips[i] = currentDatatips[j];
+                j++;
+            }
+        }
+        GraphicController.getController().setProperty(polylineUid, GraphicObjectProperties.__GO_DATATIPS__, newDatatips);
+    }
 }
index 8a2a177..b2c6ed5 100644 (file)
@@ -17,7 +17,9 @@ import org.scilab.modules.graphic_objects.graphicObject.GraphicObject.Type;
 import org.scilab.modules.graphic_objects.graphicObject.GraphicObject;
 import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
 
-import java.util.ArrayList;
+import org.scilab.modules.renderer.CallRenderer;
+
+import org.scilab.modules.gui.editor.EntityPicker;
 
 /**
  * Delete a datatip
@@ -25,23 +27,43 @@ import java.util.ArrayList;
  */
 public class DatatipDelete {
 
+    static EntityPicker ep = new EntityPicker();
+
     /**
-    * Delete a specific datatip;
+    * Delete a specific datatip using the right mouse click;
     *
     * @param markerUid Datatip marker unique identifier.
     */
     public static void deleteDatatip (String markerUid) {
 
-        String parentUid = (String) GraphicController.getController().getProperty(markerUid, GraphicObjectProperties.__GO_PARENT__);
-        String[] childrenUid = (String[]) GraphicController.getController().getProperty(parentUid, GraphicObjectProperties.__GO_CHILDREN__);
+        String axesUid = (String) GraphicController.getController().getProperty(markerUid, GraphicObjectProperties.__GO_PARENT__);
+        String figureUid = (String) GraphicController.getController().getProperty(axesUid, GraphicObjectProperties.__GO_PARENT__);
+
+        Double[] datatipPosition = (Double[]) GraphicController.getController().getProperty(markerUid, GraphicObjectProperties.__GO_POSITION__);
+
+        double[] graphCoordDouble = new double[]{0.0, 0.0, 0.0};
+        graphCoordDouble[0] = datatipPosition[0];
+        graphCoordDouble[1] = datatipPosition[1];
+        graphCoordDouble[2] = datatipPosition[2];
+
+        String polylineUid = getPolylineOfDatatip (graphCoordDouble, markerUid);
+
+        String[] childrenUid = (String[]) GraphicController.getController().getProperty(axesUid, GraphicObjectProperties.__GO_CHILDREN__);
         for (int i = 0 ; i < childrenUid.length ; i++) {
             if (markerUid == childrenUid[i]) {
                 GraphicController.getController().removeRelationShipAndDelete(childrenUid[i]);
                 GraphicController.getController().removeRelationShipAndDelete(childrenUid[i + 1]);
+                removePoint (polylineUid, graphCoordDouble[0], graphCoordDouble[1]);
             }
         }
     }
 
+    /**
+    * Delete a specific datatip using the command "datatipRemove(polyline_handle,ind)";
+    *
+    * @param polylineUid Polyline unique identifier.
+    * @param indexRemove Index of the datatip to be removed.
+    */
     public static void datatipRemoveProgramIndex (String polylineUid, int indexRemove) {
 
         int numDatatips = 0;
@@ -59,31 +81,121 @@ public class DatatipDelete {
             int indexDel = (2 * indexRemove) - 1;
             String datatipUid = childrenUid[indexDel];
             String markerUid = childrenUid[indexDel - 1];
+            Double[] datatipPosition = (Double[]) GraphicController.getController().getProperty(markerUid, GraphicObjectProperties.__GO_POSITION__);
+            removePoint (polylineUid, datatipPosition[0], datatipPosition[1]);
             GraphicController.getController().removeRelationShipAndDelete(datatipUid);
             GraphicController.getController().removeRelationShipAndDelete(markerUid);
+            
         }
+
     }
 
+    /**
+    * Delete a specific datatip using the command "datatipRemove(datatip_handle)";
+    *
+    * @param datatipUid Datatip unique identifier.
+    * @param figureUid Figure unique identifier.
+    */
     public static void datatipRemoveProgramHandler (String datatipUid, String figureUid) {
 
         int posDelete = -1;
+        String axesUid = null;
         String[] childrenUid = (String[]) GraphicController.getController().getProperty(figureUid, GraphicObjectProperties.__GO_CHILDREN__);
-        String axesUid = childrenUid[0];
-        childrenUid = (String[]) GraphicController.getController().getProperty(axesUid, GraphicObjectProperties.__GO_CHILDREN__);
-        String objType = (String) GraphicController.getController().getProperty(datatipUid, GraphicObjectProperties.__GO_TYPE__);
-        if (objType == "Text") {
-            for (int i = 0 ; i < childrenUid.length ; i++) {
-                if (datatipUid == childrenUid[i]) {
-                    posDelete = i;
+        for (int i = 0 ; i < childrenUid.length ; i++) {
+            String objType = (String) GraphicController.getController().getProperty(childrenUid[i], GraphicObjectProperties.__GO_TYPE__);
+            if (objType == "Axes") {
+                axesUid = childrenUid[i];
+            }
+        }
+        if (axesUid != null){
+            childrenUid = (String[]) GraphicController.getController().getProperty(axesUid, GraphicObjectProperties.__GO_CHILDREN__);
+            String objType = (String) GraphicController.getController().getProperty(datatipUid, GraphicObjectProperties.__GO_TYPE__);
+            if (objType == "Text") {
+                for (int i = 0 ; i < childrenUid.length ; i++) {
+                    if (datatipUid.equals(childrenUid[i])) {
+                        posDelete = i;
+                    }
+                }
+            }
+            if (posDelete >= 0) {
+                Double[] datatipPosition = (Double[]) GraphicController.getController().getProperty(datatipUid, GraphicObjectProperties.__GO_POSITION__);
+                double[] graphCoordDouble = new double[]{0.0, 0.0, 0.0};
+                graphCoordDouble[0] = datatipPosition[0];
+                graphCoordDouble[1] = datatipPosition[1];
+                graphCoordDouble[2] = datatipPosition[2];
+                String polylineUid = getPolylineOfDatatip (graphCoordDouble, datatipUid);
+                removePoint (polylineUid, datatipPosition[0], datatipPosition[1]);
+                GraphicController.getController().removeRelationShipAndDelete(childrenUid[posDelete]);
+                if (posDelete % 2 == 0) {
+                    GraphicController.getController().removeRelationShipAndDelete(childrenUid[posDelete + 1]);
+                } else {
+                    GraphicController.getController().removeRelationShipAndDelete(childrenUid[posDelete - 1]);
                 }
             }
         }
-        if (posDelete >= 0) {
-            GraphicController.getController().removeRelationShipAndDelete(childrenUid[posDelete]);
-            if (posDelete % 2 == 0) {
-                GraphicController.getController().removeRelationShipAndDelete(childrenUid[posDelete + 1]);
+    }
+
+    /**
+    * Get the polyline which the datatip belongs
+    *
+    * @param graphCoordDouble double array with graphic position x and y of the datatip.
+    * @param datatipUid Datatip unique identifier.
+    * @return Polyline unique identifier string.
+    */
+    private static String getPolylineOfDatatip (double[] graphCoordDouble, String datatipUid) {
+
+        String axesUid = (String) GraphicController.getController().getProperty(datatipUid, GraphicObjectProperties.__GO_PARENT__);
+        String figureUid = (String) GraphicController.getController().getProperty(axesUid, GraphicObjectProperties.__GO_PARENT__);
+
+        double[] pixelCoordinates = new double[]{0.0, 0.0};
+        pixelCoordinates = CallRenderer.getPixelFrom2dViewCoordinates(axesUid, graphCoordDouble);
+
+        int xInt = (int) pixelCoordinates[0];
+        int yInt = (int) pixelCoordinates[1];
+
+        Integer[] coordInteger = new Integer[]{0, 0};
+        coordInteger[0] = (Integer) xInt;
+        coordInteger[1] = (Integer) yInt;
+
+        String polylineUid = ep.pick (figureUid, coordInteger[0], coordInteger[1]);
+
+        return polylineUid;
+    }
+
+    /**
+    * Remove the point of the deleted datatip from the datatips field;
+    *
+    * @param polylineUid Polyline unique identifier.
+    * @param coordX Coordinate x to be removed.
+    * @param coordY Coordinate y to be removed.
+    */
+    private static void removePoint (String polylineUid, double coordX, double coordY) {
+
+        Double[] currentDatatips = (Double[]) GraphicController.getController().getProperty(polylineUid, GraphicObjectProperties.__GO_DATATIPS__);
+        Integer numDatatips = (Integer) GraphicController.getController().getProperty(polylineUid, GraphicObjectProperties.__GO_DATATIPS_SIZE__);
+        int xSkip = -1;
+        int ySkip = -1;
+        if (numDatatips > 0) {
+            int allocArray = (2*numDatatips) - 2;
+            Double[] newDatatips = new Double[allocArray];
+            if (allocArray == 0) {
+                GraphicController.getController().setProperty(polylineUid, GraphicObjectProperties.__GO_DATATIPS__, newDatatips);
             } else {
-                GraphicController.getController().removeRelationShipAndDelete(childrenUid[posDelete - 1]);
+                for (int i = 0 ; i < currentDatatips.length ; i++) {
+                    if (currentDatatips[i] == coordX & currentDatatips[i+numDatatips] == coordY) {
+                        xSkip = i;
+                        ySkip = i+numDatatips;
+                        break;
+                    }
+                }
+                int j = 0;
+                for (int i = 0 ; i < currentDatatips.length ; i++) {
+                    if (i != xSkip & i != ySkip) {
+                        newDatatips[j] = currentDatatips[i];
+                        j++;
+                    }
+                }
+                GraphicController.getController().setProperty(polylineUid, GraphicObjectProperties.__GO_DATATIPS__, newDatatips);
             }
         }
     }
index 04e9400..35dfca0 100644 (file)
@@ -59,7 +59,6 @@ public class DatatipDrag {
         String[] axesChildrenUid = (String[]) GraphicController.getController().getProperty(axesUid, GraphicObjectProperties.__GO_CHILDREN__);
         coordInteger = DatatipMove.getCoordInteger (markerUid, axesUid);
         polylineUidInit = ep.pick(figureUid, coordInteger[0], coordInteger[1]);
-
         Boolean isLineModeOn = (Boolean) GraphicController.getController().getProperty(polylineUidInit, GraphicObjectProperties.__GO_LINE_MODE__);
         Integer[] axesDimension = (Integer[])GraphicController.getController().getProperty(figureUid, GraphicObjectProperties.__GO_AXES_SIZE__);
         for (int yVerify = 0 ; yVerify < axesDimension[1] ; yVerify++) {
@@ -72,7 +71,7 @@ public class DatatipDrag {
                     Integer[] pixelMouseCoordInt = { newX , newY };
                     double[] pixelMouseCoordDouble = DatatipCreate.transformPixelCoordToDouble(pixelMouseCoordInt);
                     double[] graphicCoord = DatatipCreate.transformPixelCoordToGraphic (axesUid, pixelMouseCoordDouble);
-                    setNewPosition (graphicCoord, markerUid, axesUid);
+                    setNewPosition (graphicCoord, markerUid, axesUid, polylineUidInit);
                 } else {
                     Integer[] pixelMouseCoordInt = { newX , newY };
                     double[] pixelMouseCoordDouble = DatatipCreate.transformPixelCoordToDouble(pixelMouseCoordInt);
@@ -83,7 +82,7 @@ public class DatatipDrag {
                         if (graphicCoord[0] > polylineDataX[i - 1] & graphicCoord[0] < polylineDataX[i + 1]) {
                             newCoord[0] = polylineDataX[i];
                             newCoord[1] = polylineDataY[i];
-                            setNewPosition (newCoord, markerUid, axesUid);
+                            setNewPosition (newCoord, markerUid, axesUid, polylineUidInit);
                         }
                     }
                 }
@@ -128,17 +127,17 @@ public class DatatipDrag {
     * @param indexToMove Integer referring to the selected datatip.
     * @return New position of the datatip to be saved
     */
-    private static void setNewPosition (double[] graphicCoord, String markerUid, String axesUid) {
+    private static void setNewPosition (double[] graphicCoord, String markerUid, String axesUid, String polylineUid) {
 
         String[] axesChildrenUid = (String[]) GraphicController.getController().getProperty(axesUid, GraphicObjectProperties.__GO_CHILDREN__);
-
         for (int i = 0 ; i < axesChildrenUid.length ; i++) {
             if (axesChildrenUid[i] == markerUid) {
                 datatipUid = axesChildrenUid[i + 1];
                 break;
             }
         }
-
+        Double[] datatipPosition = (Double[]) GraphicController.getController().getProperty(markerUid, GraphicObjectProperties.__GO_POSITION__);
+        DatatipMove.updateDatatipsField (polylineUid, datatipPosition[0], datatipPosition[1], graphicCoord[0], graphicCoord[1]);
         datatipPosition = DatatipCreate.setDatatipPosition(graphicCoord);
         GraphicController.getController().setProperty(datatipUid, GraphicObjectProperties.__GO_POSITION__, datatipPosition);
         GraphicController.getController().setProperty(markerUid, GraphicObjectProperties.__GO_POSITION__, datatipPosition);
index 3b3d1fd..4d31fb8 100644 (file)
@@ -69,6 +69,7 @@ public class DatatipMove {
             }
         }
         setNewPosition (datatipUid, markerUid, newX, newY);
+        updateDatatipsField (polylineUid, coordsToMove[0], coordsToMove[1], newX, newY);
     }
 
     /**
@@ -99,8 +100,16 @@ public class DatatipMove {
             }
         }
         setNewPosition (datatipUid, markerUid, newX, newY);
+        updateDatatipsField (polylineUid, coordsToMove[0], coordsToMove[1], newX, newY);
     }
 
+    /**
+    * Get the pixel integer coordinates of a datatip
+    *
+    * @param markerUid Datatip's marker unique identifier
+    * @param axesUid Axes unique identifier which the datatip belongs
+    * @return Array with x, y coordinates
+    */
     public static Integer[] getCoordInteger (String markerUid, String axesUid) {
 
         Double[] markerPosition = (Double[]) GraphicController.getController().getProperty(markerUid, GraphicObjectProperties.__GO_POSITION__);
@@ -115,6 +124,14 @@ public class DatatipMove {
         return coordInteger;
     }
 
+    /**
+    * Set the new position of a datatip and its label after moved
+    *
+    * @param datatipUid Datatip unique identifier.
+    * @param markerUid Datatip's marker unique identifier.
+    * @param newX New position x of the datatip
+    * @param newX New position y of the datatip
+    */
     private static void setNewPosition (String datatipUid, String markerUid, double newX, double newY) {
 
         double[] newPosition = { newX , newY , 0.0 };
@@ -127,4 +144,27 @@ public class DatatipMove {
         GraphicController.getController().setProperty(markerUid, GraphicObjectProperties.__GO_POSITION__, datatipPosition);
     }
 
+    /**
+    * Update the datatips field in the polyline handler after move
+    *
+    * @param polylineUid Polyline unique identifier.
+    * @param oldX Current position x of the datatip
+    * @param oldY Current position y of the datatip
+    * @param newX New position x of the datatip
+    * @param newX New position y of the datatip
+    */
+    public static void updateDatatipsField (String polylineUid, double oldX, double oldY, double newX, double newY) {
+
+        Double[] currentDatatips = (Double[]) GraphicController.getController().getProperty(polylineUid, GraphicObjectProperties.__GO_DATATIPS__);
+        Integer numDatatips = (Integer) GraphicController.getController().getProperty(polylineUid, GraphicObjectProperties.__GO_DATATIPS_SIZE__);
+        for (int i = 0 ; i < currentDatatips.length ; i++) {
+            if (currentDatatips[i] == oldX & currentDatatips[i+numDatatips] == oldY) {
+                currentDatatips[i] = newX;
+                currentDatatips[i+numDatatips] = newY;
+                break;
+            }
+        }
+        GraphicController.getController().setProperty(polylineUid, GraphicObjectProperties.__GO_DATATIPS__, currentDatatips);
+    }
+
 }
index 1a7d2a0..43c84e7 100755 (executable)
@@ -4,6 +4,10 @@
             <parameter name="polylineUid" type="String"/>
             <parameter name="coordDoubleXY" type="double[]"/>
         </method>
+        <method name="createDatatipField" returnType="double[]" modifier="static">
+            <parameter name="polylineUid" type="String"/>
+            <parameter name="coordDoubleXY" type="double[]"/>
+        </method>
         <method name="createDatatipProgramIndex" returnType="String" modifier="static">
             <parameter name="polylineUid" type="String"/>
             <parameter name="indexPoint" type="int"/>
old mode 100755 (executable)
new mode 100644 (file)
index c8cb915..d857cf4
@@ -1,7 +1,7 @@
 #include "DatatipFunctions.hxx"
 
 /* Generated by GIWS (version 2.0.0) with command:
-giws -f Datatip.giws.xml -p 
+giws -f Datatip.giws.xml -p -r 
 */
 /*
 
@@ -125,6 +125,7 @@ curEnv->DeleteLocalRef(localInstance);
 
                 /* Methods ID set to NULL */
 jstringcreateDatatipProgramCoordjstringjava_lang_StringjdoubleArray_doubledoubleID=NULL;
+jdoubleArray_createDatatipFieldjstringjava_lang_StringjdoubleArray_doubledoubleID=NULL;
 jstringcreateDatatipProgramIndexjstringjava_lang_StringjintintID=NULL;
 voiddatatipSetInterpjstringjava_lang_StringjbooleanbooleanID=NULL;
 
@@ -156,6 +157,7 @@ exit(EXIT_FAILURE);
         }
         /* Methods ID set to NULL */
         jstringcreateDatatipProgramCoordjstringjava_lang_StringjdoubleArray_doubledoubleID=NULL;
+jdoubleArray_createDatatipFieldjstringjava_lang_StringjdoubleArray_doubledoubleID=NULL;
 jstringcreateDatatipProgramIndexjstringjava_lang_StringjintintID=NULL;
 voiddatatipSetInterpjstringjava_lang_StringjbooleanbooleanID=NULL;
 
@@ -230,6 +232,63 @@ return myStringBuffer;
 
 }
 
+double* DatatipCreate::createDatatipField (JavaVM * jvm_, char const* polylineUid, double const* coordDoubleXY, int coordDoubleXYSize){
+
+JNIEnv * curEnv = NULL;
+jvm_->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
+jclass cls = curEnv->FindClass( className().c_str() );
+
+jmethodID jdoubleArray_createDatatipFieldjstringjava_lang_StringjdoubleArray_doubledoubleID = curEnv->GetStaticMethodID(cls, "createDatatipField", "(Ljava/lang/String;[D)[D" ) ;
+if (jdoubleArray_createDatatipFieldjstringjava_lang_StringjdoubleArray_doubledoubleID == NULL) {
+std::cerr << "Could not access to the method " << "createDatatipField" << std::endl;
+curEnv->ExceptionDescribe();
+
+exit(EXIT_FAILURE);
+}
+
+jstring polylineUid_ = curEnv->NewStringUTF( polylineUid );
+if (polylineUid != NULL && polylineUid_ == NULL)
+{
+std::cerr << "Could not convert C string to Java UTF string, memory full." << std::endl;
+exit(EXIT_FAILURE);
+}
+
+
+jdoubleArray coordDoubleXY_ = curEnv->NewDoubleArray( coordDoubleXYSize ) ;
+
+curEnv->SetDoubleArrayRegion( coordDoubleXY_, 0, coordDoubleXYSize, (jdouble*)(coordDoubleXY) ) ;
+
+
+                        jdoubleArray res =  static_cast<jdoubleArray>( curEnv->CallStaticObjectMethod(cls, jdoubleArray_createDatatipFieldjstringjava_lang_StringjdoubleArray_doubledoubleID ,polylineUid_, coordDoubleXY_));
+                        if (res == NULL) { return NULL; }
+                        if (curEnv->ExceptionCheck()) {
+curEnv->ExceptionDescribe() ;
+}
+int lenRow;
+ lenRow = curEnv->GetArrayLength(res);
+jboolean isCopy = JNI_FALSE;
+
+/* GetPrimitiveArrayCritical is faster than getXXXArrayElements */
+jdouble *resultsArray = static_cast<jdouble *>(curEnv->GetPrimitiveArrayCritical(res, &isCopy));
+double* myArray= new double[ lenRow];
+
+for (jsize i = 0; i <  lenRow; i++){
+myArray[i]=resultsArray[i];
+}
+curEnv->ReleasePrimitiveArrayCritical(res, resultsArray, JNI_ABORT);
+
+                        curEnv->DeleteLocalRef(res);
+curEnv->DeleteLocalRef(polylineUid_);
+curEnv->DeleteLocalRef(coordDoubleXY_);
+curEnv->DeleteLocalRef(cls);
+if (curEnv->ExceptionCheck()) {
+curEnv->ExceptionDescribe() ;
+}
+
+return myArray;
+
+}
+
 char* DatatipCreate::createDatatipProgramIndex (JavaVM * jvm_, char const* polylineUid, int indexPoint){
 
 JNIEnv * curEnv = NULL;
old mode 100755 (executable)
new mode 100644 (file)
index 8804951..31b77ef
@@ -1,5 +1,5 @@
 /* Generated by GIWS (version 2.0.0) with command:
-giws -f Datatip.giws.xml -p 
+giws -f Datatip.giws.xml -p -r 
 */
 /*
 
@@ -82,6 +82,7 @@ JavaVM * jvm;
 
 protected:
 jmethodID jstringcreateDatatipProgramCoordjstringjava_lang_StringjdoubleArray_doubledoubleID; // cache method id
+jmethodID jdoubleArray_createDatatipFieldjstringjava_lang_StringjdoubleArray_doubledoubleID; // cache method id
 jmethodID jstringcreateDatatipProgramIndexjstringjava_lang_StringjintintID; // cache method id
 jmethodID voiddatatipSetInterpjstringjava_lang_StringjbooleanbooleanID; // cache method id
 
@@ -145,6 +146,8 @@ void endSynchronize();
 // Methods
 static char* createDatatipProgramCoord(JavaVM * jvm_, char const* polylineUid, double const* coordDoubleXY, int coordDoubleXYSize);
 
+static double* createDatatipField(JavaVM * jvm_, char const* polylineUid, double const* coordDoubleXY, int coordDoubleXYSize);
+
 static char* createDatatipProgramIndex(JavaVM * jvm_, char const* polylineUid, int indexPoint);
 
 static void datatipSetInterp(JavaVM * jvm_, char const* polylineUid, bool interpMode);