#This file is also generated, but can not be listed to prevent GCJ call.
#src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObjectProperties.java
-GRAPHIC_OBJECTS_JNI_SOURCES = src/jni/CallGraphicController.cpp
+GRAPHIC_OBJECTS_JNI_SOURCES = src/jni/CallGraphicController.cpp \
+ src/jni/GraphicObjectBuilder.cpp
GRAPHIC_OBJECTS_C_SOURCES = src/jni/DataLoader_wrap.c \
src/jni/ScilabNativeView_wrap.c
$(top_builddir)/modules/output_stream/libscioutput_stream.la
am__objects_2 = libscigraphic_objects_la-DataLoader_wrap.lo \
libscigraphic_objects_la-ScilabNativeView_wrap.lo
-am__objects_3 = libscigraphic_objects_la-CallGraphicController.lo
+am__objects_3 = libscigraphic_objects_la-CallGraphicController.lo \
+ libscigraphic_objects_la-GraphicObjectBuilder.lo
am__objects_4 = libscigraphic_objects_la-gw_graphic_objects.lo
am__objects_5 = libscigraphic_objects_la-sci_graphicfunction.lo
am__objects_6 = libscigraphic_objects_la-createGraphicObject.lo \
$(am__append_4)
#This file is also generated, but can not be listed to prevent GCJ call.
#src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObjectProperties.java
-GRAPHIC_OBJECTS_JNI_SOURCES = src/jni/CallGraphicController.cpp
+GRAPHIC_OBJECTS_JNI_SOURCES = src/jni/CallGraphicController.cpp \
+ src/jni/GraphicObjectBuilder.cpp
+
GRAPHIC_OBJECTS_C_SOURCES = src/jni/DataLoader_wrap.c \
src/jni/ScilabNativeView_wrap.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphic_objects_la-Fac3DDecomposer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphic_objects_la-FigureList.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphic_objects_la-FigureModel.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphic_objects_la-GraphicObjectBuilder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphic_objects_la-HandleManagement.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphic_objects_la-MatPlotDecomposer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigraphic_objects_la-NgonData.Plo@am__quote@
@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) $(libscigraphic_objects_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscigraphic_objects_la-CallGraphicController.lo `test -f 'src/jni/CallGraphicController.cpp' || echo '$(srcdir)/'`src/jni/CallGraphicController.cpp
+libscigraphic_objects_la-GraphicObjectBuilder.lo: src/jni/GraphicObjectBuilder.cpp
+@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphic_objects_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscigraphic_objects_la-GraphicObjectBuilder.lo -MD -MP -MF $(DEPDIR)/libscigraphic_objects_la-GraphicObjectBuilder.Tpo -c -o libscigraphic_objects_la-GraphicObjectBuilder.lo `test -f 'src/jni/GraphicObjectBuilder.cpp' || echo '$(srcdir)/'`src/jni/GraphicObjectBuilder.cpp
+@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libscigraphic_objects_la-GraphicObjectBuilder.Tpo $(DEPDIR)/libscigraphic_objects_la-GraphicObjectBuilder.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='src/jni/GraphicObjectBuilder.cpp' object='libscigraphic_objects_la-GraphicObjectBuilder.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) $(libscigraphic_objects_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscigraphic_objects_la-GraphicObjectBuilder.lo `test -f 'src/jni/GraphicObjectBuilder.cpp' || echo '$(srcdir)/'`src/jni/GraphicObjectBuilder.cpp
+
libscigraphic_objects_la-sci_graphicfunction.lo: sci_gateway/cpp/sci_graphicfunction.cpp
@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphic_objects_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscigraphic_objects_la-sci_graphicfunction.lo -MD -MP -MF $(DEPDIR)/libscigraphic_objects_la-sci_graphicfunction.Tpo -c -o libscigraphic_objects_la-sci_graphicfunction.lo `test -f 'sci_gateway/cpp/sci_graphicfunction.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_graphicfunction.cpp
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libscigraphic_objects_la-sci_graphicfunction.Tpo $(DEPDIR)/libscigraphic_objects_la-sci_graphicfunction.Plo
*/
GRAPHIC_OBJECTS_IMPEXP void buildFigureMenuBar(char const* _sFigureId);
+GRAPHIC_OBJECTS_IMPEXP char * constructRectangles(char * pparentsubwinUID, double x, double y, double height, double width, int foreground, int background, int isfilled, int isline);
+
#endif /* !__CREATEGRAPHICOBJECT_H__ */
<ClCompile Include="..\cpp\dataModel.cpp" />
<ClCompile Include="..\cpp\DecompositionUtils.cpp" />
<ClCompile Include="..\cpp\deleteGraphicObject.cpp" />
+ <ClCompile Include="..\jni\GraphicObjectBuilder.cpp" />
<ClCompile Include="..\jni\ScilabNativeView_wrap.c" />
<ClCompile Include="DllmainGraphic_objects.c" />
<ClCompile Include="..\cpp\Fac3DDecomposer.cpp" />
<ClInclude Include="..\..\includes\PolylineDecomposer.hxx" />
<ClInclude Include="..\..\includes\TriangleMeshData.hxx" />
<ClInclude Include="..\..\includes\TriangleMeshFecDataDecomposer.hxx" />
+ <ClInclude Include="..\jni\GraphicObjectBuilder.hxx" />
</ItemGroup>
<ItemGroup>
<None Include="..\jni\ScilabNativeView.i" />
<ClCompile Include="..\cpp\MatPlotDecomposer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\jni\GraphicObjectBuilder.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\jni\CallGraphicController.hxx">
<ClInclude Include="..\..\includes\MatPlotDecomposer.hxx">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\jni\GraphicObjectBuilder.hxx">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="core_import.def">
}
#include "CallGraphicController.hxx"
-
+#include "GraphicObjectBuilder.hxx"
#include "DataController.hxx"
using namespace org_scilab_modules_graphic_objects;
{
CallGraphicController::buildFigureMenuBar(getScilabJavaVM(), _sFigureId);
}
+
+char * constructRectangles(char * pparentsubwinUID, double x, double y, double height, double width, int foreground, int background, int isfilled, int isline)
+{
+ try
+ {
+ return GraphicObjectBuilder::constructRectangles(getScilabJavaVM(), pparentsubwinUID, x, y, height, width, foreground, background, isfilled, isline);
+ }
+ catch (std::exception & e)
+ {
+ printf("exception: %s\n", e.what());
+ return NULL;
+ }
+}
--- /dev/null
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2010 - DIGITEO - Bruno JOFRET
+ *
+ * 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
+ *
+ */
+
+package org.scilab.modules.graphic_objects;
+
+import org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties;
+
+/**
+ * This is a static class to access all controller capabilities
+ * from C/C++ code through JNI
+ * See SCI/modules/graphic_objects/src/jni/graphic_objects.giws.xml for other details.
+ **/
+public final class GraphicObjectBuilder {
+
+ public static String constructRectangles(String pparentsubwinUID, double x, double y, double height, double width, int foreground, int background, int isfilled, int isline) {
+ double[] clipRegion;
+ int visible = 0;
+ int clipRegionSet = 0;
+ int clipState = 0;
+ int iMarkMode = 0;
+
+ if (height < 0 || width < 0)
+ {
+ return null;
+ }
+
+ String pobjUID = CallGraphicController.askGraphicObject(GraphicObjectProperties.__GO_RECTANGLE__);
+
+ /*
+ * Sets the rectangle's parent in order to initialize the former's Contoured properties
+ * with the latter's values (cloneGraphicContext call below)
+ */
+ //setGraphicObjectProperty(pobjUID, __GO_PARENT__, pparentsubwinUID, jni_string, 1);
+
+ CallGraphicController.setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_UPPER_LEFT_POINT__, new double[]{x, y, 0});
+ CallGraphicController.setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_HEIGHT__, height);
+ CallGraphicController.setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_WIDTH__, width);
+
+ visible = CallGraphicController.getGraphicObjectPropertyAsBoolean(pparentsubwinUID, GraphicObjectProperties.__GO_VISIBLE__);
+ CallGraphicController.setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_VISIBLE__, visible == 1);
+
+ /* Clip state and region */
+ /* To be checked for consistency */
+
+ clipRegion = CallGraphicController.getGraphicObjectPropertyAsDoubleVector(pparentsubwinUID, GraphicObjectProperties.__GO_CLIP_BOX__);
+ CallGraphicController.setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_CLIP_BOX__, clipRegion);
+
+ clipRegionSet = CallGraphicController.getGraphicObjectPropertyAsBoolean(pparentsubwinUID, GraphicObjectProperties.__GO_CLIP_BOX_SET__);
+ CallGraphicController.setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_CLIP_BOX_SET__, clipRegionSet == 1);
+
+ clipState = CallGraphicController.getGraphicObjectPropertyAsInteger(pparentsubwinUID, GraphicObjectProperties.__GO_CLIP_STATE__);
+ CallGraphicController.setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_CLIP_STATE__, clipState);
+
+ iMarkMode = CallGraphicController.getGraphicObjectPropertyAsBoolean(pparentsubwinUID, GraphicObjectProperties.__GO_MARK_MODE__);
+ CallGraphicController.setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_MARK_MODE__, iMarkMode == 1);
+
+ /*
+ * Initializes the contour properties (background, foreground, etc)
+ * to the default values (those of the parent Axes).
+ */
+ cloneGraphicContext(pparentsubwinUID, pobjUID);
+
+ /* Contour settings */
+ CallGraphicController.setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_LINE_MODE__, isline == 1);
+ CallGraphicController.setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_FILL_MODE__, isfilled == 1);
+
+ if (foreground != -1)
+ {
+ CallGraphicController.setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_LINE_COLOR__, foreground);
+ }
+
+ if (background != -1)
+ {
+ CallGraphicController.setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_BACKGROUND__, background);
+ }
+
+ /* Parent reset to the null object */
+ //setGraphicObjectProperty(pobjUID, GraphicObjectProperties.__GO_PARENT__, "", jni_string, 1);
+
+ /*
+ * Sets the Axes as the rectangle's parent and adds the rectangle to
+ * its parent's list of children.
+ */
+ //setGraphicObjectRelationship(pparentsubwinUID, pobjUID);
+
+ return pobjUID;
+ }
+
+ public static int cloneGraphicContext(String sourceIdentifier, String destIdentifier) {
+ int lineMode = 0;
+ int foreground = 0;
+ int lineStyle = 0;
+ int background = 0;
+ int markForeground = 0;
+ int markBackground = 0;
+ int markStyle = 0;
+ int markSize = 0;
+ int markSizeUnit = 0;
+ double lineThickness = 0.;
+
+ /*
+ * All these properties are passed by value thus do not care to release them
+ * and do not call releaseGraphicObjectProperty on purpose.
+ */
+
+ lineMode = CallGraphicController.getGraphicObjectPropertyAsBoolean(sourceIdentifier, GraphicObjectProperties.__GO_LINE_MODE__);
+ foreground = CallGraphicController.getGraphicObjectPropertyAsInteger(sourceIdentifier, GraphicObjectProperties.__GO_LINE_COLOR__);
+ lineThickness = CallGraphicController.getGraphicObjectPropertyAsDouble(sourceIdentifier, GraphicObjectProperties.__GO_LINE_THICKNESS__);
+ lineStyle = CallGraphicController.getGraphicObjectPropertyAsInteger(sourceIdentifier, GraphicObjectProperties.__GO_LINE_STYLE__);
+
+ background = CallGraphicController.getGraphicObjectPropertyAsInteger(sourceIdentifier, GraphicObjectProperties.__GO_BACKGROUND__);
+
+ markForeground = CallGraphicController.getGraphicObjectPropertyAsInteger(sourceIdentifier, GraphicObjectProperties.__GO_MARK_FOREGROUND__);
+
+ markBackground = CallGraphicController.getGraphicObjectPropertyAsInteger(sourceIdentifier, GraphicObjectProperties.__GO_MARK_BACKGROUND__);
+
+ markStyle = CallGraphicController.getGraphicObjectPropertyAsInteger(sourceIdentifier, GraphicObjectProperties.__GO_MARK_STYLE__);
+
+ markSize = CallGraphicController.getGraphicObjectPropertyAsInteger(sourceIdentifier, GraphicObjectProperties.__GO_MARK_SIZE__);
+
+ markSizeUnit = CallGraphicController.getGraphicObjectPropertyAsInteger(sourceIdentifier, GraphicObjectProperties.__GO_MARK_SIZE_UNIT__);
+
+ CallGraphicController.setGraphicObjectProperty(destIdentifier, GraphicObjectProperties.__GO_LINE_MODE__, lineMode == 1);
+ CallGraphicController.setGraphicObjectProperty(destIdentifier, GraphicObjectProperties.__GO_LINE_COLOR__, foreground);
+ CallGraphicController.setGraphicObjectProperty(destIdentifier, GraphicObjectProperties.__GO_LINE_THICKNESS__, lineThickness);
+ CallGraphicController.setGraphicObjectProperty(destIdentifier, GraphicObjectProperties.__GO_LINE_STYLE__, lineStyle);
+
+ CallGraphicController.setGraphicObjectProperty(destIdentifier, GraphicObjectProperties.__GO_BACKGROUND__, background);
+
+ CallGraphicController.setGraphicObjectProperty(destIdentifier, GraphicObjectProperties.__GO_MARK_FOREGROUND__, markForeground);
+ CallGraphicController.setGraphicObjectProperty(destIdentifier, GraphicObjectProperties.__GO_MARK_BACKGROUND__, markBackground);
+ CallGraphicController.setGraphicObjectProperty(destIdentifier, GraphicObjectProperties.__GO_MARK_STYLE__, markStyle);
+ CallGraphicController.setGraphicObjectProperty(destIdentifier, GraphicObjectProperties.__GO_MARK_SIZE__, markSize);
+ CallGraphicController.setGraphicObjectProperty(destIdentifier, GraphicObjectProperties.__GO_MARK_SIZE_UNIT__, markSizeUnit);
+
+ return 0;
+ }
+}
--- /dev/null
+#include "GraphicObjectBuilder.hxx"
+/* Generated by GIWS (version 2.0.1) with command:
+giws --disable-return-size-array --output-dir src/jni/ --throws-exception-on-error --description-file src/jni/graphic_objects.giws.xml
+*/
+/*
+
+This is generated code.
+
+This software is a computer program whose purpose is to hide the complexity
+of accessing Java objects/methods from C++ code.
+
+This software is governed by the CeCILL-B license under French law and
+abiding by the rules of distribution of free software. You can use,
+modify and/ or redistribute the software under the terms of the CeCILL-B
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info".
+
+As a counterpart to the access to the source code and rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty and the software's author, the holder of the
+economic rights, and the successive licensors have only limited
+liability.
+
+In this respect, the user's attention is drawn to the risks associated
+with loading, using, modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean that it is complicated to manipulate, and that also
+therefore means that it is reserved for developers and experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or
+data to be ensured and, more generally, to use and operate it in the
+same conditions as regards security.
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL-B license and that you accept its terms.
+*/
+
+namespace org_scilab_modules_graphic_objects {
+
+ // Static declarations (if any)
+
+// Returns the current env
+
+JNIEnv * GraphicObjectBuilder::getCurrentEnv() {
+JNIEnv * curEnv = NULL;
+jint res=this->jvm->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
+if (res != JNI_OK) {
+throw GiwsException::JniException(getCurrentEnv());
+}
+return curEnv;
+}
+// Destructor
+
+GraphicObjectBuilder::~GraphicObjectBuilder() {
+JNIEnv * curEnv = NULL;
+this->jvm->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
+
+curEnv->DeleteGlobalRef(this->instance);
+curEnv->DeleteGlobalRef(this->instanceClass);
+}
+// Constructors
+GraphicObjectBuilder::GraphicObjectBuilder(JavaVM * jvm_) {
+jmethodID constructObject = NULL ;
+jobject localInstance ;
+jclass localClass ;
+
+const std::string construct="<init>";
+const std::string param="()V";
+jvm=jvm_;
+
+JNIEnv * curEnv = getCurrentEnv();
+
+localClass = curEnv->FindClass( this->className().c_str() ) ;
+if (localClass == NULL) {
+ throw GiwsException::JniClassNotFoundException(curEnv, this->className());
+}
+
+this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass));
+
+/* localClass is not needed anymore */
+curEnv->DeleteLocalRef(localClass);
+
+if (this->instanceClass == NULL) {
+throw GiwsException::JniObjectCreationException(curEnv, this->className());
+}
+
+
+constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ;
+if(constructObject == NULL){
+throw GiwsException::JniObjectCreationException(curEnv, this->className());
+}
+
+localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ;
+if(localInstance == NULL){
+throw GiwsException::JniObjectCreationException(curEnv, this->className());
+}
+
+this->instance = curEnv->NewGlobalRef(localInstance) ;
+if(this->instance == NULL){
+throw GiwsException::JniObjectCreationException(curEnv, this->className());
+}
+/* localInstance not needed anymore */
+curEnv->DeleteLocalRef(localInstance);
+
+ /* Methods ID set to NULL */
+jstringconstructRectanglesjstringjava_lang_StringjdoubledoublejdoubledoublejdoubledoublejdoubledoublejintintjintintjintintjintintID=NULL;
+
+
+}
+
+GraphicObjectBuilder::GraphicObjectBuilder(JavaVM * jvm_, jobject JObj) {
+ jvm=jvm_;
+
+ JNIEnv * curEnv = getCurrentEnv();
+
+jclass localClass = curEnv->GetObjectClass(JObj);
+ this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass));
+ curEnv->DeleteLocalRef(localClass);
+
+ if (this->instanceClass == NULL) {
+throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ }
+
+ this->instance = curEnv->NewGlobalRef(JObj) ;
+ if(this->instance == NULL){
+throw GiwsException::JniObjectCreationException(curEnv, this->className());
+ }
+ /* Methods ID set to NULL */
+ jstringconstructRectanglesjstringjava_lang_StringjdoubledoublejdoubledoublejdoubledoublejdoubledoublejintintjintintjintintjintintID=NULL;
+
+
+}
+
+// Generic methods
+
+void GraphicObjectBuilder::synchronize() {
+if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
+throw GiwsException::JniMonitorException(getCurrentEnv(), "GraphicObjectBuilder");
+}
+}
+
+void GraphicObjectBuilder::endSynchronize() {
+if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
+throw GiwsException::JniMonitorException(getCurrentEnv(), "GraphicObjectBuilder");
+}
+}
+// Method(s)
+
+char* GraphicObjectBuilder::constructRectangles (JavaVM * jvm_, char const* pparentsubwinUID, double x, double y, double height, double width, int foreground, int background, int isfilled, int isline){
+
+JNIEnv * curEnv = NULL;
+jvm_->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
+jclass cls = curEnv->FindClass( className().c_str() );
+
+jmethodID jstringconstructRectanglesjstringjava_lang_StringjdoubledoublejdoubledoublejdoubledoublejdoubledoublejintintjintintjintintjintintID = curEnv->GetStaticMethodID(cls, "constructRectangles", "(Ljava/lang/String;DDDDIIII)Ljava/lang/String;" ) ;
+if (jstringconstructRectanglesjstringjava_lang_StringjdoubledoublejdoubledoublejdoubledoublejdoubledoublejintintjintintjintintjintintID == NULL) {
+throw GiwsException::JniMethodNotFoundException(curEnv, "constructRectangles");
+}
+
+jstring pparentsubwinUID_ = curEnv->NewStringUTF( pparentsubwinUID );
+if (pparentsubwinUID != NULL && pparentsubwinUID_ == NULL)
+{
+throw GiwsException::JniBadAllocException(curEnv);
+}
+
+
+ jstring res = static_cast<jstring>( curEnv->CallStaticObjectMethod(cls, jstringconstructRectanglesjstringjava_lang_StringjdoubledoublejdoubledoublejdoubledoublejdoubledoublejintintjintintjintintjintintID ,pparentsubwinUID_, x, y, height, width, foreground, background, isfilled, isline));
+ if (curEnv->ExceptionCheck()) {
+throw GiwsException::JniCallMethodException(curEnv);
+}if (res != NULL) {
+
+const char *tempString = curEnv->GetStringUTFChars(res, 0);
+char * myStringBuffer = new char[strlen(tempString) + 1];
+strcpy(myStringBuffer, tempString);
+curEnv->ReleaseStringUTFChars(res, tempString);
+curEnv->DeleteLocalRef(res);
+curEnv->DeleteLocalRef(pparentsubwinUID_);
+curEnv->DeleteLocalRef(cls);
+if (curEnv->ExceptionCheck()) {
+delete[] myStringBuffer;
+ throw GiwsException::JniCallMethodException(curEnv);
+}
+return myStringBuffer;
+ } else {
+curEnv->DeleteLocalRef(res);
+return NULL;
+}
+}
+
+}
--- /dev/null
+/* Generated by GIWS (version 2.0.1) with command:
+giws --disable-return-size-array --output-dir src/jni/ --throws-exception-on-error --description-file src/jni/graphic_objects.giws.xml
+*/
+/*
+
+This is generated code.
+
+This software is a computer program whose purpose is to hide the complexity
+of accessing Java objects/methods from C++ code.
+
+This software is governed by the CeCILL-B license under French law and
+abiding by the rules of distribution of free software. You can use,
+modify and/ or redistribute the software under the terms of the CeCILL-B
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info".
+
+As a counterpart to the access to the source code and rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty and the software's author, the holder of the
+economic rights, and the successive licensors have only limited
+liability.
+
+In this respect, the user's attention is drawn to the risks associated
+with loading, using, modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean that it is complicated to manipulate, and that also
+therefore means that it is reserved for developers and experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or
+data to be ensured and, more generally, to use and operate it in the
+same conditions as regards security.
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL-B license and that you accept its terms.
+*/
+
+
+#ifndef __ORG_SCILAB_MODULES_GRAPHIC_OBJECTS_GRAPHICOBJECTBUILDER__
+#define __ORG_SCILAB_MODULES_GRAPHIC_OBJECTS_GRAPHICOBJECTBUILDER__
+#include <iostream>
+#include <string>
+#include <string.h>
+#include <stdlib.h>
+#include <jni.h>
+
+#include "GiwsException.hxx"
+
+ #if defined(_MSC_VER) /* Defined anyway with Visual */
+ #include <Windows.h>
+ #else
+ typedef signed char byte;
+ #endif
+
+
+#ifndef GIWSEXPORT
+# if defined(_MSC_VER) || defined(__WIN32__) || defined(__CYGWIN__)
+# if defined(STATIC_LINKED)
+# define GIWSEXPORT
+# else
+# define GIWSEXPORT __declspec(dllexport)
+# endif
+# else
+# if __GNUC__ >= 4
+# define GIWSEXPORT __attribute__ ((visibility ("default")))
+# else
+# define GIWSEXPORT
+# endif
+# endif
+#endif
+
+namespace org_scilab_modules_graphic_objects {
+class GIWSEXPORT GraphicObjectBuilder {
+
+private:
+JavaVM * jvm;
+
+protected:
+jmethodID jstringconstructRectanglesjstringjava_lang_StringjdoubledoublejdoubledoublejdoubledoublejdoubledoublejintintjintintjintintjintintID; // cache method id
+
+
+
+jobject instance;
+jclass instanceClass; // cache class
+
+
+// Caching (if any)
+
+
+/**
+* Get the environment matching to the current thread.
+*/
+virtual JNIEnv * getCurrentEnv();
+
+public:
+// Constructor
+/**
+* Create a wrapping of the object from a JNIEnv.
+* It will call the default constructor
+* @param JEnv_ the Java Env
+*/
+GraphicObjectBuilder(JavaVM * jvm_);
+
+/**
+* Create a wrapping of an already existing object from a JNIEnv.
+* The object must have already been instantiated
+* @param JEnv_ the Java Env
+* @param JObj the object
+*/
+GraphicObjectBuilder(JavaVM * jvm_, jobject JObj);
+
+
+/**
+* This is a fake constructor to avoid the constructor
+* chaining when dealing with extended giws classes
+*/
+#ifdef FAKEGIWSDATATYPE
+GraphicObjectBuilder(fakeGiwsDataType::fakeGiwsDataType /* unused */) {}
+#endif
+
+// Destructor
+~GraphicObjectBuilder();
+
+// Generic method
+// Synchronization methods
+/**
+* Enter monitor associated with the object.
+* Equivalent of creating a "synchronized(obj)" scope in Java.
+*/
+void synchronize();
+
+/**
+* Exit monitor associated with the object.
+* Equivalent of ending a "synchronized(obj)" scope.
+*/
+void endSynchronize();
+
+// Methods
+static char* constructRectangles(JavaVM * jvm_, char const* pparentsubwinUID, double x, double y, double height, double width, int foreground, int background, int isfilled, int isline);
+
+
+ /**
+ * Get class name to use for static methods
+ * @return class name to use for static methods
+ */
+
+ static const std::string className()
+ {
+ return "org/scilab/modules/graphic_objects/GraphicObjectBuilder";
+ }
+
+};
+
+
+}
+#endif
<?xml version="1.0"?>
<package name="org.scilab.modules.graphic_objects">
+ <object name="GraphicObjectBuilder">
+ <method name="constructRectangles" returnType="String" modifier="static">
+ <parameter name="pparentsubwinUID" type="String"/>
+ <parameter name="x" type="double"/>
+ <parameter name="y" type="double"/>
+ <parameter name="height" type="double"/>
+ <parameter name="width" type="double"/>
+ <parameter name="foreground" type="int"/>
+ <parameter name="background" type="int"/>
+ <parameter name="isfilled" type="int"/>
+ <parameter name="isline" type="int"/>
+ </method>
+ </object>
<object name="CallGraphicController">
<method name="deleteGraphicObject" returnType="void" modifier="static">
<parameter name="id" type="String"/>
#include "setGraphicObjectProperty.h"
#include "getGraphicObjectProperty.h"
+#include "createGraphicObject.h"
#include "graphicObjectProperties.h"
#include "CurrentFigure.h"
#include "CurrentSubwin.h"
/* check if the auto_clear property is on and then erase everything */
checkRedrawing();
- newObjUID = ConstructRectangle(psubwinUID , *x, *y, *height, *width,
- foreground, background, isfilled, isline);
+ /*newObjUID = ConstructRectangle(psubwinUID , *x, *y, *height, *width,
+ foreground, background, isfilled, isline);*/
+
+ newObjUID = constructRectangles(psubwinUID, *x, *y, *height, *width,
+ foreground == NULL ? -1 : *foreground,
+ background == NULL ? -1 : *background,
+ (int)isfilled, (int)isline);
if (newObjUID == NULL)
{
/* compute and merge new specified bounds with data bounds */
switch (iflag[1])
{
- case 0: /* do not change data bounds */
- break;
- case 1 :
- case 3 :
- case 5 :
- case 7 : /* Force data bounds=ebox */
- drect[0] = ebox[0]; /*xmin*/
- drect[2] = ebox[2]; /*ymin*/
- drect[1] = ebox[1]; /*xmax*/
- drect[3] = ebox[3]; /*ymax*/
- drect[4] = ebox[4]; /*zmin*/
- drect[5] = ebox[5]; /*zmax*/
- break;
- case 2 :
- case 4 :
- case 6 :
- case 8:/* Force data bounds to the x and y bounds */
- getDrect(x, (*m1) * (*n1), &drect[0], &drect[1], dataBounds[0], dataBounds[1]);
- getDrect(y, (*m2) * (*n2), &drect[2], &drect[3], dataBounds[2], dataBounds[3]);
- getDrect(z, (*m3) * (*n3), &drect[4], &drect[5], dataBounds[4], dataBounds[5]);
- break;
+ case 0: /* do not change data bounds */
+ break;
+ case 1 :
+ case 3 :
+ case 5 :
+ case 7 : /* Force data bounds=ebox */
+ drect[0] = ebox[0]; /*xmin*/
+ drect[2] = ebox[2]; /*ymin*/
+ drect[1] = ebox[1]; /*xmax*/
+ drect[3] = ebox[3]; /*ymax*/
+ drect[4] = ebox[4]; /*zmin*/
+ drect[5] = ebox[5]; /*zmax*/
+ break;
+ case 2 :
+ case 4 :
+ case 6 :
+ case 8:/* Force data bounds to the x and y bounds */
+ getDrect(x, (*m1) * (*n1), &drect[0], &drect[1], dataBounds[0], dataBounds[1]);
+ getDrect(y, (*m2) * (*n2), &drect[2], &drect[3], dataBounds[2], dataBounds[3]);
+ getDrect(z, (*m3) * (*n3), &drect[4], &drect[5], dataBounds[4], dataBounds[5]);
+ break;
}
/* merge data bounds and drect */
}
/* =================================================
- * Analyze arguments to find entity type
- * ================================================= */
+ * Analyze arguments to find entity type
+ * ================================================= */
if (*isfac == 1)
{
}
/* =================================================
- * Construct the Entities
- * ================================================= */
+ * Construct the Entities
+ * ================================================= */
/*Distinction here between SCI_PARAM3D1 and others*/
if ( typeof3d != SCI_PARAM3D1 )
for (i = 0; i < *n; ++i)
{
/* F.Leray Pb here: In fact we do not create a Surface but one or several 3D Polylines
- Pb comes when wanting to access the fields "surface_color" or "flag" for example
- in function sciSet (cf. matdes.c).
- Question 1: Are these properties accessible from a SCI_PARAM3D1 ?
- Question 2: Is "flag" obsolete and replaced by "color_mode"?*/
+ Pb comes when wanting to access the fields "surface_color" or "flag" for example
+ in function sciSet (cf. matdes.c).
+ Question 1: Are these properties accessible from a SCI_PARAM3D1 ?
+ Question 2: Is "flag" obsolete and replaced by "color_mode"?*/
if ((*n > 0) && (zcol != (double *)NULL))
{
{
int intzcol = (int) zcol[i];
pNewPolylineUID = ConstructPolyline
- (currentSubwinUID,
- &(x[*m * i]), &(y[*m * i]), &(z[*m * i]), 0, *m, 1,
- &intzcol, NULL, NULL, NULL, NULL, TRUE, FALSE, FALSE, FALSE);
+ (currentSubwinUID,
+ &(x[*m * i]), &(y[*m * i]), &(z[*m * i]), 0, *m, 1,
+ &intzcol, NULL, NULL, NULL, NULL, TRUE, FALSE, FALSE, FALSE);
}
else
{
int intzcol = (int) - zcol[i];
pNewPolylineUID = ConstructPolyline
- (currentSubwinUID,
- &(x[*m * i]), &(y[*m * i]), &(z[*m * i]), 0, *m, 1,
- NULL, NULL, &intzcol, NULL, NULL, FALSE, FALSE, TRUE, FALSE);
+ (currentSubwinUID,
+ &(x[*m * i]), &(y[*m * i]), &(z[*m * i]), 0, *m, 1,
+ NULL, NULL, &intzcol, NULL, NULL, FALSE, FALSE, TRUE, FALSE);
}
}
else
}
/* =================================================
- * Redraw Figure
- * ================================================= */
+ * Redraw Figure
+ * ================================================= */
// subwin has been modified
checkRedrawing();
pobjUID = ConstructAxis(
- psubwinUID,
- dir, tics, x, *nx, y, *ny, val, subint, format, font, textcol, ticscol, flag, seg, nb_tics_labels);
+ psubwinUID,
+ dir, tics, x, *nx, y, *ny, val, subint, format, font, textcol, ticscol, flag, seg, nb_tics_labels);
if (pobjUID == NULL)
{