2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
15 #include "setGraphicObjectProperty.h"
16 #include "graphicObjectProperties.h"
17 #include "getScilabJavaVM.h"
23 #include "CallGraphicController.hxx"
24 #include "DataController.hxx"
26 using namespace org_scilab_modules_graphic_objects;
28 void setGraphicObjectRelationship(char const* _parentId, char const* _childId)
30 CallGraphicController::setGraphicObjectRelationship(getScilabJavaVM(), _parentId, _childId);
33 BOOL setGraphicObjectProperty(char const* _pstID, char const* _pstName, void const* _pvValue, _ReturnType_ _valueType, int numElements)
37 double doubleValue = 0.;
39 BOOL boolValue = FALSE;
41 // Special Case for data, no need to go through Java.
42 if (strncmp(_pstName, __GO_DATA_MODEL__, strlen(__GO_DATA_MODEL__)) == 0)
44 result = BOOLtobool(DataController::setGraphicObjectProperty(_pstID, _pstName, _pvValue, numElements));
45 CallGraphicController::setGraphicObjectProperty(getScilabJavaVM(), _pstID, __GO_DATA_MODEL__, _pstID);
46 return booltoBOOL(result);
52 result = CallGraphicController::setGraphicObjectProperty(getScilabJavaVM(), _pstID, _pstName, (char *)_pvValue);
55 case jni_string_vector :
56 result = CallGraphicController::setGraphicObjectProperty(getScilabJavaVM(), _pstID, _pstName, (char**)_pvValue, numElements);
60 doubleValue = *(double*)_pvValue;
61 result = CallGraphicController::setGraphicObjectProperty(getScilabJavaVM(), _pstID, _pstName, (double)doubleValue);
64 case jni_double_vector :
65 result = CallGraphicController::setGraphicObjectProperty(getScilabJavaVM(), _pstID, _pstName, (double*)_pvValue, numElements);
70 intValue = *(int*)_pvValue;
72 result = CallGraphicController::setGraphicObjectProperty(getScilabJavaVM(), _pstID, _pstName, (int)intValue);
76 result = CallGraphicController::setGraphicObjectProperty(getScilabJavaVM(), _pstID, _pstName, (int*)_pvValue, numElements);
81 boolValue = *(BOOL*)_pvValue;
83 result = CallGraphicController::setGraphicObjectProperty(getScilabJavaVM(), _pstID, _pstName, BOOLtobool(boolValue));
86 case jni_bool_vector :
88 result = CallGraphicController::setGraphicObjectProperty(getScilabJavaVM(), _pstID, _pstName, (bool*)_pvValue, numElements);
97 return booltoBOOL(result);