2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2001-2002 - INRIA - Mathieu Philipe
4 * Copyright (C) 2002-2004 - INRIA - Djalel Abdemouche
5 * Copyright (C) 2004-2006 - INRIA - Fabrice Leray
6 * Copyright (C) 2005 - INRIA - Jean-Baptiste Silvy
7 * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
8 * Copyright (C) 2010 - DIGITEO - Bruno JOFRET
9 * Copyright (C) 2010-2011 - DIGITEO - Manuel Juliachs
11 * This file must be used under the terms of the CeCILL.
12 * This source file is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at
15 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
19 /*------------------------------------------------------------------------
21 * newGraph Library header
23 * This file contains all functions used to Init or Re-Init the window
24 * (Figure and/or Subwin) to the default graphics properties.
25 --------------------------------------------------------------------------*/
31 #include "strdup_Windows.h"
34 #include "InitObjects.h"
35 #include "SetProperty.h"
36 #include "GetProperty.h"
37 #include "DestroyObjects.h"
38 #include "CloneObjects.h"
39 #include "BuildObjects.h"
41 #include "HandleManagement.h"
42 #include "BasicAlgos.h"
44 #include "MALLOC.h" /* MALLOC */
45 #include "localization.h"
47 #include "createGraphicObject.h"
48 #include "deleteGraphicObject.h"
49 #include "graphicObjectProperties.h"
50 #include "getGraphicObjectProperty.h"
51 #include "setGraphicObjectProperty.h"
53 #include "AxesModel.h"
54 #include "FigureModel.h"
56 #define LABEL_BUFFER_LENGTH 128
58 static char error_message[70]; /* DJ.A 08/01/04 */
60 unsigned short defcolors[] =
62 0, 0, 0, /* Black: DEFAULTBLACK */
64 0, 255, 0, /* Green */
65 0, 255, 255, /* Cyan */
67 255, 0, 255, /* Magenta */
68 255, 255, 0, /* Yellow */
69 255, 255, 255, /* White: DEFAULTWHITE */
70 0, 0, 144, /* Blue4 */
71 0, 0, 176, /* Blue3 */
72 0, 0, 208, /* Blue2 */
73 135, 206, 255, /* LtBlue */
74 0, 144, 0, /* Green4 */
75 0, 176, 0, /* Green3 */
76 0, 208, 0, /* Green2 */
77 0, 144, 144, /* Cyan4 */
78 0, 176, 176, /* Cyan3 */
79 0, 208, 208, /* Cyan2 */
83 144, 0, 144, /* Magenta4 */
84 176, 0, 176, /* Magenta3 */
85 208, 0, 208, /* Magenta2 */
86 128, 48, 0, /* Brown4 */
87 160, 64, 0, /* Brown3 */
88 192, 96, 0, /* Brown2 */
89 255, 128, 128, /* Pink4 */
90 255, 160, 160, /* Pink3 */
91 255, 192, 192, /* Pink2 */
92 255, 224, 224, /* Pink */
93 255, 215, 0 /* Gold */
96 void InitFigureModel(char *pfiguremdlUID)
102 int defaultBackground = -2;
103 int m = NUMCOLORS_SCI;
105 double *pdblColorMap = MALLOC(m * 3 * sizeof(double));
107 int piFigurePosition[2] = { 200, 200 };
108 int piFigureSize[2] = { 620, 590 };
109 int piAxesSize[2] = { 610, 460 };
111 // FIXME : inline this function here ...
113 sciInitGraphicMode(pfiguremdlUID);
115 setGraphicObjectProperty(pfiguremdlUID, __GO_NAME__, _("Graphic window number %d"), jni_string, 1);
118 setGraphicObjectProperty(pfiguremdlUID, __GO_ID__, &iZero, jni_int, 1);
120 // isselected ?? (No more used)
121 // rotstyle = unary (0)
122 setGraphicObjectProperty(pfiguremdlUID, __GO_ROTATION_TYPE__, &iZero, jni_int, 1);
125 setGraphicObjectProperty(pfiguremdlUID, __GO_VISIBLE__, &bTrue, jni_bool, 1);
126 // immediateDrawingMode
127 setGraphicObjectProperty(pfiguremdlUID, __GO_IMMEDIATE_DRAWING__, &bTrue, jni_bool, 1);
129 setGraphicObjectProperty(pfiguremdlUID, __GO_BACKGROUND__, &defaultBackground, jni_int, 1);
131 setGraphicObjectProperty(pfiguremdlUID, __GO_POSITION__, piFigurePosition, jni_int_vector, 2);
133 setGraphicObjectProperty(pfiguremdlUID, __GO_SIZE__, piFigureSize, jni_int_vector, 2);
136 setGraphicObjectProperty(pfiguremdlUID, __GO_AUTORESIZE__, &bTrue, jni_bool, 1);
138 setGraphicObjectProperty(pfiguremdlUID, __GO_AXES_SIZE__, piAxesSize, jni_int_vector, 2);
142 * NULL has been replaced by the empty string as the third argument in order to
143 * avoid a crash due to giws 1.2.4
145 //setGraphicObjectProperty(pfiguremdlUID, __GO_USER_DATA__, "", jni_string, 0);
147 //setGraphicObjectProperty(pfiguremdlUID, __GO_USER_DATA_SIZE__, &iZero, jni_int, 1);
149 setGraphicObjectProperty(pfiguremdlUID, __GO_PIXMAP__, &bFalse, jni_bool, 1);
151 setGraphicObjectProperty(pfiguremdlUID, __GO_INFO_MESSAGE__, "", jni_string, 1);
153 setGraphicObjectProperty(pfiguremdlUID, __GO_EVENTHANDLER__, "", jni_string, 1);
154 // Event Handler Enable
155 setGraphicObjectProperty(pfiguremdlUID, __GO_EVENTHANDLER_ENABLE__, &bFalse, jni_bool, 1);
157 setGraphicObjectProperty(pfiguremdlUID, __GO_TAG__, "", jni_string, 1);
159 if (pdblColorMap == NULL)
161 sprintf(error_message, _("%s: No more memory.\n"), "InitFigureModel");
165 for (i = 0; i < m; i++)
167 pdblColorMap[i] = (double)(defcolors[3 * i] / 255.0);
168 pdblColorMap[i + m] = (double)(defcolors[3 * i + 1] / 255.0);
169 pdblColorMap[i + 2 * m] = (double)(defcolors[3 * i + 2] / 255.0);
172 setGraphicObjectProperty(pfiguremdlUID, __GO_COLORMAP__, pdblColorMap, jni_double_vector, 3 * m);
175 setGraphicObjectProperty(pfiguremdlUID, __GO_PARENT__, "", jni_string, 1);
178 buildFigureMenuBar(pfiguremdlUID);
182 int C2F(graphicsmodels) (void)
185 double clipRegion[4];
186 int clipRegionSet = 0;
190 char *pfiguremdlUID = NULL;
191 char *paxesmdlUID = NULL;
197 // Create default figure by Asking MVC a new one.
198 pfiguremdlUID = createGraphicObject(__GO_FIGUREMODEL__);
199 setFigureModel(pfiguremdlUID);
200 InitFigureModel(pfiguremdlUID);
202 sciInitGraphicMode(pfiguremdlUID);
208 // Create default Axes by Asking MVC a new one.
209 paxesmdlUID = createGraphicObject(__GO_AXESMODEL__);
210 setAxesModel(paxesmdlUID);
212 /* Sets the parent-child relationship between the default Figure and Axes */
213 setGraphicObjectRelationship(pfiguremdlUID, paxesmdlUID);
214 releaseGraphicObjectProperty(-1, pfiguremdlUID, jni_string, 0);
216 /* Axes Model properties */
218 result = InitAxesModel();
222 strcpy(error_message, _("Default axes cannot be created.\n"));
226 /* Margins and clip region */
233 setGraphicObjectProperty(paxesmdlUID, __GO_MARGINS__, margins, jni_double_vector, 4);
240 setGraphicObjectProperty(paxesmdlUID, __GO_CLIP_BOX__, clipRegion, jni_double_vector, 4);
243 setGraphicObjectProperty(paxesmdlUID, __GO_CLIP_BOX_SET__, &clipRegionSet, jni_bool, 1);
246 * Specifies that no high-level drawing function has been called yet.
249 setGraphicObjectProperty(paxesmdlUID, __GO_FIRST_PLOT__, &firstPlot, jni_bool, 1);
251 releaseGraphicObjectProperty(-1, paxesmdlUID, jni_string, 0);
254 ppaxesmdl->FirstPlot = TRUE;
261 * This function has been adapted to the MVC framework, using the
262 * MVC's property set/get calls.
270 int axisLocation = 0;
274 int gridPosition = 0;
278 int defaultNumberTicks = 0;
280 int autoSubticks = 0;
282 int hiddenAxisColor = 0;
286 int *piVisible = &visible;
289 int arcDrawingMethod = 0;
290 int labelsFontStyle = 6;
291 int labelsFontColor = -1;
293 double labelsFontSize = 1;
294 double axesBounds[4];
295 double dataBounds[6];
296 double rotationAngles[2];
297 double tab[] = { 0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. }; /* graduations init. tmptab */
298 /* z-axis initial ticks locations */
299 double tabZTicksLocations[] = { -1.0, -0.8, -0.6, -0.4, -0.2, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0 };
300 char labelBuffer[LABEL_BUFFER_LENGTH];
301 char **stringVector = NULL;
306 double lineWidth = 1.0;
317 /* 0: point, 1: tabulated */
318 int markSizeUnit = 1;
320 char *labelUID = NULL;
322 char *pfiguremdlUID = (char*)getFigureModel();
323 char *paxesmdlUID = (char*)getAxesModel();
325 sciInitGraphicMode(paxesmdlUID);
327 setGraphicObjectProperty(paxesmdlUID, __GO_BACKGROUND__, &background, jni_int, 1);
328 setGraphicObjectProperty(paxesmdlUID, __GO_LINE_COLOR__, &foreground, jni_int, 1);
330 setGraphicObjectProperty(paxesmdlUID, __GO_FONT_SIZE__, &labelsFontSize, jni_double, 1);
331 setGraphicObjectProperty(paxesmdlUID, __GO_FONT_COLOR__, &labelsFontColor, jni_int, 1);
332 setGraphicObjectProperty(paxesmdlUID, __GO_FONT_STYLE__, &labelsFontStyle, jni_int, 1);
334 setGraphicObjectProperty(paxesmdlUID, __GO_LINE_THICKNESS__, &lineWidth, jni_double, 1);
335 setGraphicObjectProperty(paxesmdlUID, __GO_LINE_STYLE__, &lineStyle, jni_int, 1);
337 setGraphicObjectProperty(paxesmdlUID, __GO_MARK_MODE__, &markMode, jni_bool, 1);
338 setGraphicObjectProperty(paxesmdlUID, __GO_LINE_MODE__, &lineMode, jni_bool, 1);
339 setGraphicObjectProperty(paxesmdlUID, __GO_FILL_MODE__, &fillMode, jni_bool, 1);
341 setGraphicObjectProperty(paxesmdlUID, __GO_MARK_STYLE__, &markStyle, jni_int, 1);
342 setGraphicObjectProperty(paxesmdlUID, __GO_MARK_SIZE__, &markSize, jni_int, 1);
343 setGraphicObjectProperty(paxesmdlUID, __GO_MARK_SIZE_UNIT__, &markSizeUnit, jni_int, 1);
345 setGraphicObjectProperty(paxesmdlUID, __GO_MARK_BACKGROUND__, &background, jni_int, 1);
346 setGraphicObjectProperty(paxesmdlUID, __GO_MARK_FOREGROUND__, &foreground, jni_int, 1);
349 setGraphicObjectProperty(paxesmdlUID, __GO_CUBE_SCALING__, &cubeScaling, jni_bool, 1);
351 /* Log flags set to linear for the 3 axes */
354 setGraphicObjectProperty(paxesmdlUID, __GO_X_AXIS_LOG_FLAG__, &logFlag, jni_bool, 1);
355 setGraphicObjectProperty(paxesmdlUID, __GO_Y_AXIS_LOG_FLAG__, &logFlag, jni_bool, 1);
356 setGraphicObjectProperty(paxesmdlUID, __GO_Z_AXIS_LOG_FLAG__, &logFlag, jni_bool, 1);
359 setGraphicObjectProperty(paxesmdlUID, __GO_TICKS_COLOR__, &ticksColor, jni_int, 1);
362 setGraphicObjectProperty(paxesmdlUID, __GO_X_AXIS_SUBTICKS__, &nbSubticks, jni_int, 1);
363 setGraphicObjectProperty(paxesmdlUID, __GO_Y_AXIS_SUBTICKS__, &nbSubticks, jni_int, 1);
364 setGraphicObjectProperty(paxesmdlUID, __GO_Z_AXIS_SUBTICKS__, &nbSubticks, jni_int, 1);
366 /* 0 corresponds to bottom position */
368 setGraphicObjectProperty(paxesmdlUID, __GO_X_AXIS_LOCATION__, &axisLocation, jni_int, 1);
370 /* 4 corresponds to left position */
372 setGraphicObjectProperty(paxesmdlUID, __GO_Y_AXIS_LOCATION__, &axisLocation, jni_int, 1);
374 /* 0 corresponds to OFF */
376 setGraphicObjectProperty(paxesmdlUID, __GO_BOX_TYPE__, &boxType, jni_int, 1);
379 setGraphicObjectProperty(paxesmdlUID, __GO_FILLED__, &filled, jni_bool, 1);
382 setGraphicObjectProperty(paxesmdlUID, __GO_X_AXIS_GRID_COLOR__, &gridColor, jni_int, 1);
383 setGraphicObjectProperty(paxesmdlUID, __GO_Y_AXIS_GRID_COLOR__, &gridColor, jni_int, 1);
384 setGraphicObjectProperty(paxesmdlUID, __GO_Z_AXIS_GRID_COLOR__, &gridColor, jni_int, 1);
387 setGraphicObjectProperty(paxesmdlUID, __GO_LINE_COLOR__, &lineColor, jni_int, 1);
388 setGraphicObjectProperty(paxesmdlUID, __GO_BACKGROUND__, &background, jni_int, 1);
392 setGraphicObjectProperty(paxesmdlUID, __GO_GRID_POSITION__, &gridPosition, jni_int, 1);
394 rotationAngles[0] = 0.0;
395 rotationAngles[1] = 270.0;
397 setGraphicObjectProperty(paxesmdlUID, __GO_ROTATION_ANGLES__, rotationAngles, jni_double_vector, 2);
401 setGraphicObjectProperty(paxesmdlUID, __GO_VIEW__, &view, jni_int, 1);
403 /* Must be set after VIEW, since setting VIEW to 2D overwrites the 3D rotation angles */
404 rotationAngles[0] = 45.0;
405 rotationAngles[1] = 215.0;
407 setGraphicObjectProperty(paxesmdlUID, __GO_ROTATION_ANGLES_3D__, rotationAngles, jni_double_vector, 2);
410 setGraphicObjectProperty(paxesmdlUID, __GO_X_AXIS_VISIBLE__, &axisVisible, jni_bool, 1);
411 setGraphicObjectProperty(paxesmdlUID, __GO_Y_AXIS_VISIBLE__, &axisVisible, jni_bool, 1);
412 setGraphicObjectProperty(paxesmdlUID, __GO_Z_AXIS_VISIBLE__, &axisVisible, jni_bool, 1);
415 setGraphicObjectProperty(paxesmdlUID, __GO_X_AXIS_REVERSE__, &axisReverse, jni_bool, 1);
416 setGraphicObjectProperty(paxesmdlUID, __GO_Y_AXIS_REVERSE__, &axisReverse, jni_bool, 1);
417 setGraphicObjectProperty(paxesmdlUID, __GO_Z_AXIS_REVERSE__, &axisReverse, jni_bool, 1);
419 /* Corresponds to the MVC AUTO_SUBTICKS property (!flagNax is equivalent to AUTO_SUBTICKS) */
421 ppaxesmdl->flagNax = FALSE;
425 setGraphicObjectProperty(paxesmdlUID, __GO_AUTO_SUBTICKS__, &autoSubticks, jni_bool, 1);
427 /* To be corrected when the equivalent of flagnax is implemented within the MVC */
429 setGraphicObjectProperty(paxesmdlUID, __GO_X_AXIS_SUBTICKS__, &nbSubticks, jni_int, 1);
430 setGraphicObjectProperty(paxesmdlUID, __GO_Y_AXIS_SUBTICKS__, &nbSubticks, jni_int, 1);
431 setGraphicObjectProperty(paxesmdlUID, __GO_Z_AXIS_SUBTICKS__, &nbSubticks, jni_int, 1);
434 * The code creating default ticks labels and positions should be put
435 * into the Model. Ticks positions and locations should be computed using the default data bounds
436 * instead of using pre-defined values.
437 * Note that the pre-MVC ticks labels creation code is implemented in the C++ Renderer module
438 * and should be moved to the Java Model's relevant parts (TicksProperty).
442 * Automatic ticks computation must be activated for the 3 axes before setting ticks values to
443 * ensure that the ticks values set are the automatic ticks' ones.
446 setGraphicObjectProperty(paxesmdlUID, __GO_X_AXIS_AUTO_TICKS__, &autoTicks, jni_bool, 1);
447 setGraphicObjectProperty(paxesmdlUID, __GO_Y_AXIS_AUTO_TICKS__, &autoTicks, jni_bool, 1);
448 setGraphicObjectProperty(paxesmdlUID, __GO_Z_AXIS_AUTO_TICKS__, &autoTicks, jni_bool, 1);
450 defaultNumberTicks = 11;
452 setGraphicObjectProperty(paxesmdlUID, __GO_X_AXIS_TICKS_LOCATIONS__, tab, jni_double_vector, defaultNumberTicks);
453 setGraphicObjectProperty(paxesmdlUID, __GO_Y_AXIS_TICKS_LOCATIONS__, tab, jni_double_vector, defaultNumberTicks);
455 stringVector = createStringArray(defaultNumberTicks);
457 if (stringVector == NULL)
463 * A proper format should be used (ChoixFormatE function)
465 for (i = 0; i < defaultNumberTicks; i++)
467 sprintf(labelBuffer, "%.1f", tab[i]);
468 stringVector[i] = strdup(labelBuffer);
470 if (stringVector[i] == NULL)
476 setGraphicObjectProperty(paxesmdlUID, __GO_X_AXIS_TICKS_LABELS__, stringVector, jni_string_vector, defaultNumberTicks);
477 setGraphicObjectProperty(paxesmdlUID, __GO_Y_AXIS_TICKS_LABELS__, stringVector, jni_string_vector, defaultNumberTicks);
480 * The same number of ticks is used now for the x,y and z axes.
481 * Previously, the z-axis contained only 3 ticks (-1, 0, 1). However, the renderer module was
482 * overriding this default number (3) by creating an 11-tick z-axis when required (3D view).
483 * Ticks locations and labels are however different for the z-axis (from -1 to +1 instead of 0 to 1).
485 setGraphicObjectProperty(paxesmdlUID, __GO_Z_AXIS_TICKS_LOCATIONS__, tabZTicksLocations, jni_double_vector, defaultNumberTicks);
487 /* ChoixFormatE should be used */
488 for (i = 0; i < defaultNumberTicks; i++)
490 FREE(stringVector[i]);
492 sprintf(labelBuffer, "%.1f", tabZTicksLocations[i]);
493 stringVector[i] = strdup(labelBuffer);
495 if (stringVector[i] == NULL)
501 setGraphicObjectProperty(paxesmdlUID, __GO_Z_AXIS_TICKS_LABELS__, stringVector, jni_string_vector, defaultNumberTicks);
503 destroyStringArray(stringVector, defaultNumberTicks);
506 * Indicates the direction of projection (0 for the axis corresponding to the direction,
508 * To be implemented within the MVC if determined to be useful.
511 ppaxesmdl->project[0] = 1;
512 ppaxesmdl->project[1] = 1;
513 ppaxesmdl->project[2] = 0;
517 setGraphicObjectProperty(paxesmdlUID, __GO_HIDDEN_AXIS_COLOR__, &hiddenAxisColor, jni_int, 1);
520 setGraphicObjectProperty(paxesmdlUID, __GO_HIDDEN_COLOR__, &hiddenColor, jni_int, 1);
523 setGraphicObjectProperty(paxesmdlUID, __GO_ISOVIEW__, &isoview, jni_bool, 1);
525 /* Axes bounds set to fill the whole drawing area */
530 setGraphicObjectProperty(paxesmdlUID, __GO_AXES_BOUNDS__, axesBounds, jni_double_vector, 4);
539 dataBounds[4] = -1.0;
542 setGraphicObjectProperty(paxesmdlUID, __GO_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
545 getGraphicObjectProperty(pfiguremdlUID, __GO_VISIBLE__, jni_bool, (void**)&piVisible);
546 setGraphicObjectProperty(paxesmdlUID, __GO_VISIBLE__, &visible, jni_bool, 1);
548 /* 0: clipping off */
550 setGraphicObjectProperty(paxesmdlUID, __GO_CLIP_STATE__, &clipState, jni_int, 1);
552 /* "real data bounds" and "data bounds" are initially the same */
553 setGraphicObjectProperty(paxesmdlUID, __GO_REAL_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
556 setGraphicObjectProperty(paxesmdlUID, __GO_TIGHT_LIMITS__, &tightLimits, jni_bool, 1);
558 /* Sets the default arc drawing method to lines (1), which is faster */
559 arcDrawingMethod = 1;
560 setGraphicObjectProperty(paxesmdlUID, __GO_ARC_DRAWING_METHOD__, &arcDrawingMethod, jni_int, 1);
562 /* Creates the Axes model's labels and sets the model as their parent */
563 labelUID = initLabel(paxesmdlUID);
564 setGraphicObjectProperty(paxesmdlUID, __GO_TITLE__, labelUID, jni_string, 1);
565 releaseGraphicObjectProperty(__GO_TITLE__, labelUID, jni_string, 0);
567 labelUID = initLabel(paxesmdlUID);
568 setGraphicObjectProperty(paxesmdlUID, __GO_X_AXIS_LABEL__, labelUID, jni_string, 1);
569 releaseGraphicObjectProperty(__GO_X_AXIS_LABEL__, labelUID, jni_string, 0);
571 labelUID = initLabel(paxesmdlUID);
572 setGraphicObjectProperty(paxesmdlUID, __GO_Y_AXIS_LABEL__, labelUID, jni_string, 1);
573 releaseGraphicObjectProperty(__GO_Y_AXIS_LABEL__, labelUID, jni_string, 0);
575 labelUID = initLabel(paxesmdlUID);
576 setGraphicObjectProperty(paxesmdlUID, __GO_Z_AXIS_LABEL__, labelUID, jni_string, 1);
577 releaseGraphicObjectProperty(__GO_Z_AXIS_LABEL__, labelUID, jni_string, 0);
583 * This function has been adapted to the MVC framework.
584 * Its code ought to be moved to the Java Model implementation,
585 * either within the relevant constructor or an initialization method.
588 /**sciInitGraphicMode
589 * Inits the graphic mode of this object with the default value
591 int sciInitGraphicMode(char *pobjUID)
594 int *piType = &iType;
596 getGraphicObjectProperty(pobjUID, __GO_TYPE__, jni_int, (void **)&piType);
599 * The GO_FIGURE block is never reached as InitFigureModel
600 * is not called at all (was previously called by
601 * the graphicsmodels function).
603 if (iType == __GO_FIGURE__)
605 /* 3: copy pixel drawing mode */
608 if (isFigureModel(pobjUID))
611 * These 3 properties are not used by the Figure object proper, but
612 * rather serve to initialize its children Axes' ones.
614 setGraphicObjectProperty(pobjUID, __GO_PIXEL_DRAWING_MODE__, &xormode, jni_int, 1);
617 else if (iType == __GO_AXES__)
620 * Same values as the ones from the Figure model. These values were copied from the parent
621 * Figure but are for now set using the values below.
624 /* autoClear is the logical not of addPlot (autoClear == 0 corresponds to addPlot == TRUE) */
632 if (isAxesModel(pobjUID))
634 setGraphicObjectProperty(pobjUID, __GO_AUTO_CLEAR__, &autoClear, jni_bool, 1);
635 setGraphicObjectProperty(pobjUID, __GO_AUTO_SCALE__, &autoScale, jni_bool, 1);
636 setGraphicObjectProperty(pobjUID, __GO_ZOOM_ENABLED__, &zoom, jni_bool, 1);
639 * Internal state: was possibly used to avoid accessing the parent Figure's pixel drawing mode
640 * or may be entirely useless, as pixel drawing mode is associated to the whole Figure.
641 * As it has no corresponding MVC property, this call will not set anything.
643 setGraphicObjectProperty(pobjUID, __GO_PIXEL_DRAWING_MODE__, &xormode, jni_int, 1);
646 * This block is never reached at all since since the Axes model
647 * is now cloned within the MVC via a C call.
653 char *paxesmdlUID = (char*)getAxesModel();
655 getGraphicObjectProperty(paxesmdlUID, __GO_AUTO_CLEAR__, jni_bool, (void **)&piTmp);
657 getGraphicObjectProperty(paxesmdlUID, __GO_AUTO_SCALE__, jni_bool, (void **)&piTmp);
659 getGraphicObjectProperty(paxesmdlUID, __GO_ZOOM_ENABLED__, jni_bool, (void **)&piTmp);
662 setGraphicObjectProperty(pobjUID, __GO_AUTO_CLEAR__, &autoClear, jni_bool, 1);
663 setGraphicObjectProperty(pobjUID, __GO_AUTO_SCALE__, &autoScale, jni_bool, 1);
664 setGraphicObjectProperty(pobjUID, __GO_ZOOM_ENABLED__, &zoom, jni_bool, 1);
667 * Internal state: used to avoid accessing the parent's pixel drawing mode
668 * obsolete ? Not implemented yet within the MVC
671 getGraphicObjectProperty(paxesmdlUID, __GO_PIXEL_DRAWING_MODE__, jni_bool, (void **)&piTmp);
674 setGraphicObjectProperty(pobjUID, __GO_PIXEL_DRAWING_MODE__, &xormode, jni_int, 1);
691 case SCI_LABEL: /* F.Leray 28.05.04 */
694 sciprint(_("This object has not any graphic mode\n"));
702 /*---------------------------------------------------------------------------------*/
703 /* allocate and set a new label to default values */
704 char *initLabel(char *parentObjUID)
706 char *newLabel = NULL;
708 int autoPosition = 1;
710 newLabel = createGraphicObject(__GO_LABEL__);
712 /* Hide Label as they are non explicit children */
713 setGraphicObjectProperty(newLabel, __GO_HIDDEN__, &iHidden, jni_bool, 1);
714 setGraphicObjectProperty(newLabel, __GO_AUTO_POSITION__, &autoPosition, jni_bool, 1);
715 setGraphicObjectProperty(newLabel, __GO_AUTO_ROTATION__, &autoPosition, jni_bool, 1);
717 /* Sets the label's parent */
718 setGraphicObjectRelationship(parentObjUID, newLabel);
720 cloneGraphicContext(parentObjUID, newLabel);
721 cloneFontContext(parentObjUID, newLabel);
725 /*---------------------------------------------------------------------------------*/