@@ DEV @@ : Try to use Java MVC for graphics component.
[scilab.git] / scilab / modules / graphics / macros / %h_p.sci
index 99b6588..0b14b5f 100644 (file)
@@ -23,42 +23,42 @@ function %h_p(h)
             t="Handle of type """+h.type+""" with properties:"
             t=[t;part('=',ones(1,length(t)))]
         end
-        
+
         select h.type
-        
+
         // Polyline
         // =====================================================================
-        
+
         case "Polyline"
-            
-            if size(h.data,'*') > 10 then 
+
+            if size(h.data,'*') > 10 then
                 d="matrix "+strcat(string(size(h.data)),'x')
             else
                 d=sci2exp(h.data,0)
                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),'x'),end
             end
-            
-            if size(h.x_shift,'*') > 10 then 
+
+            if size(h.x_shift,'*') > 10 then
                 bxs="matrix "+strcat(string(size(h.x_shift)),'x')
             else
                 bxs=sci2exp(h.x_shift,0)
                 if length(bxs)>70 then bxs="matrix "+strcat(string(size(h.x_shift)),'x'),end
             end
-            
-            if size(h.y_shift,'*') > 10 then 
+
+            if size(h.y_shift,'*') > 10 then
                 bys="matrix "+strcat(string(size(h.y_shift)),'x')
             else
                 bys=sci2exp(h.y_shift,0)
                 if length(bys)>70 then bys="matrix "+strcat(string(size(h.y_shift)),'x'),end
             end
-            
-            if size(h.z_shift,'*') > 10 then 
+
+            if size(h.z_shift,'*') > 10 then
                 bzs="matrix "+strcat(string(size(h.z_shift)),'x')
             else
                 bzs=sci2exp(h.z_shift,0)
                 if length(bzs)>70 then bzs="matrix "+strcat(string(size(h.z_shift)),'x'),end
             end
-            
+
             u=h.user_data;
             t=[t;
                 "parent: "+h.parent.type
@@ -90,10 +90,10 @@ function %h_p(h)
                 "clip_box = "+sci2exp(h.clip_box)
                 "user_data = "+fmtuser_data(u)
             ]
-        
+
         // Compound
         // =====================================================================
-        
+
         case "Compound"
             u=h.user_data
             t=[t;
@@ -101,12 +101,12 @@ function %h_p(h)
             "children: "+fmtchildren(h.children)
             "visible = "+sci2exp(h.visible)
             "user_data = "+fmtuser_data(u)]
-        
+
         // Axes
         // =====================================================================
-        
+
         case "Axes"
-    
+
             T=h.x_ticks
             if size(T.locations,'*')>9 then
                 locx="matrix "+strcat(string(size(T.locations)),'x')
@@ -117,7 +117,7 @@ function %h_p(h)
                 if length(locx)>70 then locx="matrix "+strcat(string(size(T.locations)),'x'), end
                 if length(labx)>70 then labx="matrix "+strcat(string(size(T.labels)),'x'), end
             end
-            
+
             T=h.y_ticks
             if size(T.locations,'*')>9 then
                 locy="matrix "+strcat(string(size(T.locations)),'x')
@@ -128,7 +128,7 @@ function %h_p(h)
                 if length(locy)>70 then locx="matrix "+strcat(string(size(T.locations)),'x'), end
                 if length(laby)>70 then labx="matrix "+strcat(string(size(T.labels)),'x'), end
             end
-            
+
             T=h.z_ticks
             if size(T.locations,'*')>9 then
                 locz="matrix "+strcat(string(size(T.locations)),'x')
@@ -139,7 +139,7 @@ function %h_p(h)
                 if length(locz)>70 then locx="matrix "+strcat(string(size(T.locations)),'x'), end
                 if length(labz)>70 then labx="matrix "+strcat(string(size(T.labels)),'x'), end
             end
-            
+
             u=h.user_data
             t=[t;
                 "parent: "+h.parent.type
@@ -203,10 +203,10 @@ function %h_p(h)
                 "clip_box = "+sci2exp(h.clip_box,0)
                 "user_data = "+fmtuser_data(h.user_data)
             ]
-        
+
         // Legend
         // =====================================================================
-        
+
         case "Legend"
          t=[t;
             "parent: "+h.parent.type
@@ -217,7 +217,7 @@ function %h_p(h)
             "font_size = "+string(h.font_size)
             "font_color = "+string(h.font_color)
             "fractional_font = " + sci2exp(h.fractional_font)
-            "links = " +  fmtchildren(h.links) 
+            "links = " +  fmtchildren(h.links)
             "legend_location = " + sci2exp(h.legend_location)
             "position = " + sci2exp(h.position)
             "line_mode = "+sci2exp(h.line_mode)
@@ -229,10 +229,10 @@ function %h_p(h)
             "clip_box = "+sci2exp(h.clip_box,0)
             "user_data = "+fmtuser_data(h.user_data)
              ]
-        
+
         // Rectangle
         // =====================================================================
-        
+
         case "Rectangle"
             u=h.user_data
             t=[t;
@@ -256,10 +256,10 @@ function %h_p(h)
                 "clip_box = "+sci2exp(h.clip_box,0)
                 "user_data = "+fmtuser_data(u)
             ]
-        
+
         // Arc
         // =====================================================================
-        
+
         case "Arc"
             u=h.user_data
             t=[t;
@@ -273,15 +273,15 @@ function %h_p(h)
                 "background = "+string(h.background)
                 "data = "+sci2exp(h.data,0)
                 "visible = "+sci2exp(h.visible)
-                "arc_drawing_method = " + sci2exp(h.arc_drawing_method) 
+                "arc_drawing_method = " + sci2exp(h.arc_drawing_method)
                 "clip_state = "+sci2exp(h.clip_state)
                 "clip_box = "+sci2exp(h.clip_box,0)
                 "user_data = "+fmtuser_data(u)
             ]
-        
+
         // Figure
         // =====================================================================
-        
+
         case "Figure"
             u=h.user_data
             t=[t;
@@ -306,39 +306,40 @@ function %h_p(h)
                 "event_handler_enable = " + sci2exp( h.event_handler_enable ) ;
                 "user_data = "+fmtuser_data(u)
                 "tag = "+sci2exp(h.tag)
+                "UID = "+sci2exp(h.UID)
             ]
-        
+
         // Grayplot
         // =====================================================================
-       
+
         case "Grayplot"
             Data = h.data
-            if size(Data.x,'*') > 10 then 
+            if size(Data.x,'*') > 10 then
                 dx="matrix "+strcat(string(size(Data.x)),'x')
             else
                 dx=sci2exp(Data.x,0)
                 if length(dx)>70 then d="matrix "+strcat(string(size(Data.x)),'x'),end
             end
-            
-            if size(Data.y,'*') > 10 then 
+
+            if size(Data.y,'*') > 10 then
                 dy="matrix "+strcat(string(size(Data.y)),'x')
             else
                 dy=sci2exp(Data.y,0)
                 if length(dy)>70 then d="matrix "+strcat(string(size(Data.y)),'x'),end
             end
-        
-            if size(Data.z,'*') > 10 then 
+
+            if size(Data.z,'*') > 10 then
                 dz="matrix "+strcat(string(size(Data.z)),'x')
             else
                 dz=sci2exp(Data.z,0)
                 if length(dz)>70 then d="matrix "+strcat(string(size(Data.z)),'x'),end
             end
-            
+
             u=h.user_data
             t=[t;
                 "parent: "+h.parent.type
                 "children: "+fmtchildren(h.children)
-                "visible = "+sci2exp(h.visible) 
+                "visible = "+sci2exp(h.visible)
                 "data.x = "+dx
                 "data.y = "+dy
                 "data.z = "+dz
@@ -347,15 +348,15 @@ function %h_p(h)
                 "clip_box = "+sci2exp(h.clip_box,0)
                 "user_data = "+fmtuser_data(u)
             ]
-        
+
         // Matplot
         // =====================================================================
-        
-        
+
+
         case "Matplot"
-            if size(h.data,'*') > 10 then 
+            if size(h.data,'*') > 10 then
                 d="matrix "+strcat(string(size(h.data)),'x')
-            else     
+            else
                 d=sci2exp(h.data,0)
                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),'x'),end
             end
@@ -369,29 +370,29 @@ function %h_p(h)
                 "clip_box = "+sci2exp(h.clip_box,0)
                 "user_data = "+fmtuser_data(u)
             ]
-        
+
         // Fec
         // =====================================================================
         case "Fec"
             u=h.user_data
-            if size(h.data,'*') > 10 then 
+            if size(h.data,'*') > 10 then
                 d="matrix "+strcat(string(size(h.data)),'x')
             else
                 d=sci2exp(h.data,0)
                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),'x'),end
             end
-            
-            if size(h.triangles,'*') > 10 then 
+
+            if size(h.triangles,'*') > 10 then
                 f="matrix "+strcat(string(size(h.triangles)),'x')
             else
                 f=sci2exp(h.triangles,0)
                 if length(f)>70 then f="matrix "+strcat(string(size(h.triangles)),'x'),end
             end
-            
+
             t=[t;
                 "parent: "+h.parent.type
                 "children: "+fmtchildren(h.children)
-                "visible = "+sci2exp(h.visible) 
+                "visible = "+sci2exp(h.visible)
                 "data = "+d
                 "triangles = "+f
                 "z_bounds = "+sci2exp(h.z_bounds,0)
@@ -406,27 +407,27 @@ function %h_p(h)
 
         // Segs
         // =====================================================================
-        
+
         case "Segs"
-            if size(h.data,'*') > 10 then 
+            if size(h.data,'*') > 10 then
                 d="matrix "+strcat(string(size(h.data)),'x')
             else
                 d=sci2exp(h.data,0)
                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),'x'),end
             end
-            
-            if size(h.segs_color,'*') > 10 then 
+
+            if size(h.segs_color,'*') > 10 then
                 c="matrix "+strcat(string(size(h.segs_color)),'x')
             else
                 c=sci2exp(h.segs_color,0)
                 if length(c)>70 then c="matrix "+strcat(string(size(h.segs_color)),'x'),end
             end
-            
+
             u=h.user_data
             t=[t;
                 "parent: "+h.parent.type
                 "children: "+fmtchildren(h.children)
-                "visible = "+sci2exp(h.visible) 
+                "visible = "+sci2exp(h.visible)
                 "data = "+d
                 "line_mode = "+sci2exp(h.line_mode)
                 "line_style = "+string(h.line_style)
@@ -446,42 +447,42 @@ function %h_p(h)
 
         // Champ
         // =====================================================================
-        
+
         case "Champ"
             Data = h.data
-            if size(Data.x,'*') > 10 then 
+            if size(Data.x,'*') > 10 then
                 dx="matrix "+strcat(string(size(Data.x)),'x')
             else
                 dx=sci2exp(Data.x,0)
                 if length(dx)>70 then d="matrix "+strcat(string(size(Data.x)),'x'),end
             end
-            
-            if size(Data.y,'*') > 10 then 
+
+            if size(Data.y,'*') > 10 then
                 dy="matrix "+strcat(string(size(Data.y)),'x')
             else
                 dy=sci2exp(Data.y,0)
                 if length(dy)>70 then d="matrix "+strcat(string(size(Data.y)),'x'),end
             end
-            
-            if size(Data.fx,'*') > 10 then 
+
+            if size(Data.fx,'*') > 10 then
                 dfx="matrix "+strcat(string(size(Data.fx)),'x')
             else
                 dfx=sci2exp(Data.fx,0)
                 if length(dfx)>70 then d="matrix "+strcat(string(size(Data.fx)),'x'),end
             end
-            
-            if size(Data.fy,'*') > 10 then 
+
+            if size(Data.fy,'*') > 10 then
                 dfy="matrix "+strcat(string(size(Data.fy)),'x')
             else
                 dfy=sci2exp(Data.fy,0)
                 if length(dfy)>70 then d="matrix "+strcat(string(size(Data.fy)),'x'),end
             end
-            
+
             u=h.user_data
             t=[t;
                 "parent: "+h.parent.type
                 "children: "+fmtchildren(h.children)
-                "visible = "+sci2exp(h.visible) 
+                "visible = "+sci2exp(h.visible)
                 "data.x = "+dx
                 "data.y = "+dy
                 "data.fx = "+dfx
@@ -494,10 +495,10 @@ function %h_p(h)
                 "clip_box = "+sci2exp(h.clip_box,0)
                 "user_data = "+fmtuser_data(u)
             ]
-        
+
         // Text
         // =====================================================================
-        
+
         case "Text"
             u=h.user_data
             T=sci2exp(h.text,0)
@@ -505,11 +506,11 @@ function %h_p(h)
             t=[t;
                 "parent: "+h.parent.type
                 "children: "+fmtchildren(h.children)
-                "visible = "+sci2exp(h.visible) 
+                "visible = "+sci2exp(h.visible)
                 "text = "+T
                 "alignment = "+sci2exp(h.alignment) ;
                 "data = "+sci2exp(h.data,0)
-                "box = "+sci2exp(h.box) 
+                "box = "+sci2exp(h.box)
                 "line_mode = " + sci2exp(h.line_mode);
                 "fill_mode = " + sci2exp(h.fill_mode);
                 "text_box = "+sci2exp(h.text_box,0)
@@ -526,17 +527,17 @@ function %h_p(h)
                 "clip_box = "+sci2exp(h.clip_box,0)
                 "user_data = "+fmtuser_data(u)
             ]
-        
+
         // Title
         // =====================================================================
-        
+
         case "Title"
             T=sci2exp(h.text,0)
             if length(T)>70 then T="string array "+strcat(string(size(h.text)),'x'),end
             t=[t;
                 "parent: "+h.parent.type
                 "children: "+fmtchildren(h.children)
-                "visible = "+sci2exp(h.visible) 
+                "visible = "+sci2exp(h.visible)
                 "text = "+T
                 "foreground = "+string(h.foreground)
                 "font_style = "+string(h.font_style)
@@ -544,7 +545,7 @@ function %h_p(h)
                 "fractional_font = " + sci2exp(h.fractional_font)
                 "font_angle = "+string(h.font_angle)
             ]
-        
+
         // Label
         // =====================================================================
 
@@ -553,7 +554,7 @@ function %h_p(h)
             if length(T)>70 then T="string array "+strcat(string(size(h.text)),'x'),end
             t=[t;
                 "parent: "+h.parent.type
-                "visible = "+sci2exp(h.visible) 
+                "visible = "+sci2exp(h.visible)
                 "text = "+T;
                 "font_foreground = " + string(h.font_foreground) ;
                 "foreground = "+string(h.foreground)
@@ -567,34 +568,34 @@ function %h_p(h)
                 "position = "+sci2exp(h.position,0)
                 "auto_rotation = "+sci2exp(h.auto_rotation)
             ]
-        
+
         // Plot3d
         // =====================================================================
         case "Plot3d"
             Data = h.data
-            if size(Data.x,'*') > 10 then 
+            if size(Data.x,'*') > 10 then
                 dx="matrix "+strcat(string(size(Data.x)),'x')
             else
                 dx=sci2exp(Data.x,0)
                 if length(dx)>70 then d="matrix "+strcat(string(size(Data.x)),'x'),end
             end
-            
-            if size(Data.y,'*') > 10 then 
+
+            if size(Data.y,'*') > 10 then
                 dy="matrix "+strcat(string(size(Data.y)),'x')
             else
                 dy=sci2exp(Data.y,0)
                 if length(dy)>70 then d="matrix "+strcat(string(size(Data.y)),'x'),end
             end
-            
-            if size(Data.z,'*') > 10 then 
+
+            if size(Data.z,'*') > 10 then
                 dz="matrix "+strcat(string(size(Data.z)),'x')
             else
                 dz=sci2exp(Data.z,0)
                 if length(dz)>70 then d="matrix "+strcat(string(size(Data.z)),'x'),end
             end
-            
+
             u=h.user_data
-            
+
             if size(Data) == 5 then // There is a color
                 if size(Data.color,'*') > 10 then
                     dcolor="matrix "+strcat(string(size(Data.color)),'x')
@@ -602,11 +603,11 @@ function %h_p(h)
                     dcolor=sci2exp(Data.color,0)
                     if length(dcolor)>70 then dcolor="matrix "+strcat(string(size(Data.color)),'x'),end
                 end
-                
+
                 t=[t;
                     "parent: "+h.parent.type
                     "children: "+fmtchildren(h.children)
-                    "visible = "+sci2exp(h.visible) 
+                    "visible = "+sci2exp(h.visible)
                     "surface_mode = "+sci2exp(h.surface_mode)
                     "foreground = "+string(h.foreground)
                     "thickness = "+string(h.thickness)
@@ -618,7 +619,7 @@ function %h_p(h)
                     "mark_background = "+string(h.mark_background)
                     "data.x = "+dx
                     "data.y = "+dy
-                    "data.z "+dz  
+                    "data.z "+dz
                     "data.color (not used) = "+dcolor
                     "color_mode = "+string(h.color_mode)
                     "color_flag = "+sci2exp(h.color_flag,0)
@@ -631,7 +632,7 @@ function %h_p(h)
                 t=[t;
                     "parent: "+h.parent.type
                     "children: "+fmtchildren(h.children)
-                    "visible = "+sci2exp(h.visible) 
+                    "visible = "+sci2exp(h.visible)
                     "surface_mode = "+sci2exp(h.surface_mode)
                     "foreground = "+string(h.foreground)
                     "thickness = "+string(h.thickness)
@@ -652,35 +653,35 @@ function %h_p(h)
                     "user_data = "+fmtuser_data(u)
                 ]
             end
-        
+
         // Fac3d
         // =====================================================================
-        
+
         case "Fac3d"
             Data = h.data
-            if size(Data.x,'*') > 10 then 
+            if size(Data.x,'*') > 10 then
                 dx="matrix "+strcat(string(size(Data.x)),'x')
             else
                 dx=sci2exp(Data.x,0)
                 if length(dx)>70 then d="matrix "+strcat(string(size(Data.x)),'x'),end
             end
-            
-            if size(Data.y,'*') > 10 then 
+
+            if size(Data.y,'*') > 10 then
                 dy="matrix "+strcat(string(size(Data.y)),'x')
             else
                 dy=sci2exp(Data.y,0)
                 if length(dy)>70 then d="matrix "+strcat(string(size(Data.y)),'x'),end
             end
-        
-            if size(Data.z,'*') > 10 then 
+
+            if size(Data.z,'*') > 10 then
                 dz="matrix "+strcat(string(size(Data.z)),'x')
             else
                 dz=sci2exp(Data.z,0)
                 if length(dz)>70 then d="matrix "+strcat(string(size(Data.z)),'x'),end
             end
-        
+
             u=h.user_data;
-        
+
             if size(Data) == 5 then // There is a color
                 if size(Data.color,'*') > 10 then
                     dcolor="matrix "+strcat(string(size(Data.color)),'x')
@@ -688,11 +689,11 @@ function %h_p(h)
                     dcolor=sci2exp(Data.color,0)
                     if length(dcolor)>70 then dcolor="matrix "+strcat(string(size(Data.color)),'x'),end
                 end
-                
+
                 t=[t;
                     "parent: "+h.parent.type
                     "children: "+fmtchildren(h.children)
-                    "visible = "+sci2exp(h.visible) 
+                    "visible = "+sci2exp(h.visible)
                     "surface_mode = "+sci2exp(h.surface_mode)
                     "foreground = "+string(h.foreground)
                     "thickness = "+string(h.thickness)
@@ -704,7 +705,7 @@ function %h_p(h)
                     "mark_background = "+string(h.mark_background)
                     "data.x = "+dx
                     "data.y = "+dy
-                    "data.z = "+dz  
+                    "data.z = "+dz
                     "data.color = "+dcolor
                     "color_mode = "+string(h.color_mode)
                     "color_flag = "+sci2exp(h.color_flag,0)
@@ -718,7 +719,7 @@ function %h_p(h)
                 t=[t;
                     "parent: "+h.parent.type
                     "children: "+fmtchildren(h.children)
-                    "visible = "+sci2exp(h.visible) 
+                    "visible = "+sci2exp(h.visible)
                     "surface_mode = "+sci2exp(h.surface_mode)
                     "foreground = "+string(h.foreground)
                     "thickness = "+string(h.thickness)
@@ -739,30 +740,30 @@ function %h_p(h)
                     "user_data = "+fmtuser_data(u)
                 ]
             end
-        
+
         // Param3d
         // =====================================================================
-        
+
         case "Param3d"
             u=h.user_data;
-            if size(h.data,'*') > 10 then 
+            if size(h.data,'*') > 10 then
                 d="matrix "+strcat(string(size(h.data)),'x')
             else
                 d=sci2exp(h.data,0)
                 if length(d)>70 then d="matrix "+strcat(string(size(h.data)),'x'),end
             end
-            
-            if size(h.surface_color,'*') > 10 then 
+
+            if size(h.surface_color,'*') > 10 then
                 c="matrix "+strcat(string(size(h.surface_color)),'x')
             else
                 c=sci2exp(h.surface_color,0)
                 if length(c)>70 then c="matrix "+strcat(string(size(h.surface_color)),'x'),end
             end
-            
+
             t=[t;
                 "parent: "+h.parent.type
                 "children: "+fmtchildren(h.children)
-                "visible = "+sci2exp(h.visible) 
+                "visible = "+sci2exp(h.visible)
                 "line_mode = "+sci2exp(h.line_mode)
                 "foreground = "+string(h.foreground)
                 "thickness = "+string(h.thickness)
@@ -779,10 +780,10 @@ function %h_p(h)
                 "surface_color = "+c
                 "user_data = "+fmtuser_data(u)
             ]
-        
+
         // Axis
         // =====================================================================
-    
+
         case "Axis"
             u=h.user_data;
             T=sci2exp(h.tics_labels,0)
@@ -806,17 +807,17 @@ function %h_p(h)
                 "clip_box = "+sci2exp(h.clip_box,0)
                 "user_data = "+fmtuser_data(u)
             ]
-        
+
         // uimenu
         // =====================================================================
-        
+
         case "uimenu"
             t=[t;
                 "Parent: "+h.parent.type
                 "Children: "+fmtchildren(h.children)
                "Enable = "+sci2exp(h.enable)
                 "Foregroundcolor = "+sci2exp(h.foregroundcolor,0)
-                "Label = "+h.label 
+                "Label = "+h.label
                 //"Handle_visible = "+sci2exp(h.handle_visible)
                 //"Position = "+sci2exp(h.position,0)
                 "Visible = "+sci2exp(h.visible)
@@ -825,10 +826,10 @@ function %h_p(h)
                "Checked: "+sci2exp(h.checked)
                "Tag = "+h.tag
             ]
-        
+
         // uicontextmenu
         // =====================================================================
-        
+
         case "uicontextmenu"
             t=[t;
                 "Parent: "+h.parent.type
@@ -837,7 +838,7 @@ function %h_p(h)
 
        // uicontrol
         // =====================================================================
-        
+
         case "uicontrol"
             u=h.user_data;
             t=[t;
@@ -870,7 +871,7 @@ function %h_p(h)
             "Userdata = "+fmtuser_data(u)
             "Tag = "+h.tag
             ]
-            
+
         end
     end
     write(%io(2),t)
@@ -880,14 +881,14 @@ endfunction
 
 
 function t=fmtchildren(c)
-    if c==[] then 
+    if c==[] then
         t='[]'
     else
         if size(c,'*')<10 then
             t=sci2exp(c.type,0)
-            if length(t)>70 then t="matrix "+strcat(string(size(c)),'x'),end 
+            if length(t)>70 then t="matrix "+strcat(string(size(c)),'x'),end
         else
-            t="matrix "+strcat(string(size(c)),'x')   
+            t="matrix "+strcat(string(size(c)),'x')
         end
     end
 endfunction
@@ -897,7 +898,7 @@ function t=fmtuser_data(d)
     td= type(d)
     if or(td==[1 2 3 4 8 10 15]) then
         t=sci2exp(d,0)
-        if length(t)>70 then t=typeof(d)+" "+strcat(string(size(d)),'x'),end 
+        if length(t)>70 then t=typeof(d)+" "+strcat(string(size(d)),'x'),end
     elseif or(td==16) then
         t=typeof(d)+" "+strcat(string(size(d)),'x'),
     elseif or(td==17) then