Add interactive zoom_rect.
[scilab.git] / scilab / modules / renderer / src / cpp / SetJavaProperty.cpp
1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2007 - INRIA - Jean-Baptiste Silvy
4  * desc : Interface functions between between SetProperty functions and the C++/Java part of module
5  * 
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at    
10  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11  *
12  */
13
14 #include "SetJavaProperty.h"
15 #include "getHandleDrawer.h"
16 #include "figureDrawing/DrawableFigure.h"
17 #include "subwinDrawing/DrawableSubwin.h"
18
19 using namespace sciGraphics ;
20
21 /*---------------------------------------------------------------------------------*/
22 void sciSetJavaColormap( sciPointObj * pFigure, const double rgbMat[], int nbColor )
23 {
24   getFigureDrawer(pFigure)->setColorMap( rgbMat, nbColor ) ;
25 }
26 /*---------------------------------------------------------------------------------*/
27 void sciSetJavaFigureSize( sciPointObj * pFigure, const int size[2] )
28 {
29   getFigureDrawer(pFigure)->setSize(size) ;
30 }
31 /*---------------------------------------------------------------------------------*/
32 void sciSetJavaWindowSize( sciPointObj * pFigure, const int size[2] )
33 {
34   getFigureDrawer(pFigure)->setWindowSize(size) ;
35 }
36 /*---------------------------------------------------------------------------------*/
37 void sciSetJavaWindowPosition( sciPointObj * pFigure, const int pos[2] )
38 {
39   getFigureDrawer(pFigure)->setWindowPosition(pos) ;
40 }
41 /*---------------------------------------------------------------------------------*/
42 void sciSetJavaInfoMessage( sciPointObj * pFigure, const char * infoMessage )
43 {
44   getFigureDrawer(pFigure)->setInfoMessage(infoMessage);
45 }
46 /*---------------------------------------------------------------------------------*/
47 void sciSetJavaPixmapMode(sciPointObj * pFigure, BOOL onOrOff)
48 {
49   getFigureDrawer(pFigure)->setPixmapMode(onOrOff == TRUE);
50 }
51 /*---------------------------------------------------------------------------------*/
52 void sciSetJavaRenderingEnable(sciPointObj * pFigure, BOOL isEnable)
53 {
54   getFigureDrawer(pFigure)->setRenderingEnable(isEnable == TRUE);
55 }
56 /*---------------------------------------------------------------------------------*/
57 BOOL sciJavaZoomRect(sciPointObj * pSubwin, int posX, int posY, int width, int height)
58 {
59   if (getSubwinDrawer(pSubwin)->getCamera()->zoomRect(posX, posY, width, height))
60   {
61     return TRUE;
62   }
63   else
64   {
65     return FALSE;
66   }
67 }
68 /*---------------------------------------------------------------------------------*/
69 void sciSetJavaAutoResizeMode(sciPointObj * pFigure, BOOL resizeMode)
70 {
71   getFigureDrawer(pFigure)->setAutoResizeMode(resizeMode == TRUE);
72 }
73 /*---------------------------------------------------------------------------------*/
74 void sciSetJavaViewport(sciPointObj * pFigure, const int viewport[4])
75 {
76   getFigureDrawer(pFigure)->setViewport(viewport);
77 }
78 /*---------------------------------------------------------------------------------*/
79 void sciSetJavaBackground(sciPointObj * pFigure, int backColor)
80 {
81   getFigureDrawer(pFigure)->setBackgroundColor(backColor);
82 }
83 /*---------------------------------------------------------------------------------*/