CallScilabBridge.java

Go to the documentation of this file.
00001 /*
00002  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
00003  * Copyright (C) 2007-2008 - INRIA - Vincent COUVERT
00004  * 
00005  * This file must be used under the terms of the CeCILL.
00006  * This source file is licensed as described in the file COPYING, which
00007  * you should have received as part of this distribution.  The terms
00008  * are also available at    
00009  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
00010  *
00011  */
00012 
00013 
00014 package org.scilab.modules.gui.bridge;
00015 
00016 import java.awt.Color;
00017 import java.awt.Font;
00018 import java.awt.Image;
00019 import java.awt.Toolkit;
00020 import java.awt.datatransfer.Clipboard;
00021 import java.awt.datatransfer.DataFlavor;
00022 import java.awt.datatransfer.StringSelection;
00023 import java.awt.datatransfer.Transferable;
00024 import java.awt.datatransfer.UnsupportedFlavorException;
00025 import java.awt.print.PrinterJob;
00026 import java.io.FileInputStream;
00027 import java.io.FileNotFoundException;
00028 import java.io.IOException;
00029 
00030 import javax.print.Doc;
00031 import javax.print.DocFlavor;
00032 import javax.print.DocPrintJob;
00033 import javax.print.PrintException;
00034 import javax.print.SimpleDoc;
00035 import javax.print.attribute.HashPrintRequestAttributeSet;
00036 import javax.print.attribute.PrintRequestAttribute;
00037 import javax.print.attribute.PrintRequestAttributeSet;
00038 import javax.print.attribute.standard.OrientationRequested;
00039 import javax.swing.text.BadLocationException;
00040 import javax.swing.text.StyledDocument;
00041 
00042 import org.scilab.modules.console.SciConsole;
00043 import org.scilab.modules.graphic_export.ExportRenderer;
00044 import org.scilab.modules.graphic_export.FileExporter;
00045 import org.scilab.modules.gui.bridge.console.SwingScilabConsole;
00046 import org.scilab.modules.gui.bridge.tab.SwingScilabTab;
00047 import org.scilab.modules.gui.canvas.Canvas;
00048 import org.scilab.modules.gui.checkbox.CheckBox;
00049 import org.scilab.modules.gui.checkbox.ScilabCheckBox;
00050 import org.scilab.modules.gui.colorchooser.ColorChooser;
00051 import org.scilab.modules.gui.colorchooser.ScilabColorChooser;
00052 import org.scilab.modules.gui.console.ScilabConsole;
00053 import org.scilab.modules.gui.contextmenu.ContextMenu;
00054 import org.scilab.modules.gui.contextmenu.ScilabContextMenu;
00055 import org.scilab.modules.gui.editbox.EditBox;
00056 import org.scilab.modules.gui.editbox.ScilabEditBox;
00057 import org.scilab.modules.gui.events.callback.CallBack;
00058 import org.scilab.modules.gui.filechooser.FileChooser;
00059 import org.scilab.modules.gui.filechooser.ScilabFileChooser;
00060 import org.scilab.modules.gui.fontchooser.FontChooser;
00061 import org.scilab.modules.gui.fontchooser.ScilabFontChooser;
00062 import org.scilab.modules.gui.frame.Frame;
00063 import org.scilab.modules.gui.frame.ScilabFrame;
00064 import org.scilab.modules.gui.graphicWindow.ScilabRendererProperties;
00065 import org.scilab.modules.gui.helpbrowser.ScilabHelpBrowser;
00066 import org.scilab.modules.gui.label.Label;
00067 import org.scilab.modules.gui.label.ScilabLabel;
00068 import org.scilab.modules.gui.listbox.ListBox;
00069 import org.scilab.modules.gui.listbox.ScilabListBox;
00070 import org.scilab.modules.gui.menu.Menu;
00071 import org.scilab.modules.gui.menu.ScilabMenu;
00072 import org.scilab.modules.gui.menubar.MenuBar;
00073 import org.scilab.modules.gui.menubar.ScilabMenuBar;
00074 import org.scilab.modules.gui.menuitem.MenuItem;
00075 import org.scilab.modules.gui.menuitem.ScilabMenuItem;
00076 import org.scilab.modules.gui.messagebox.MessageBox;
00077 import org.scilab.modules.gui.messagebox.ScilabMessageBox;
00078 import org.scilab.modules.gui.popupmenu.PopupMenu;
00079 import org.scilab.modules.gui.popupmenu.ScilabPopupMenu;
00080 import org.scilab.modules.gui.pushbutton.PushButton;
00081 import org.scilab.modules.gui.pushbutton.ScilabPushButton;
00082 import org.scilab.modules.gui.radiobutton.RadioButton;
00083 import org.scilab.modules.gui.radiobutton.ScilabRadioButton;
00084 import org.scilab.modules.gui.slider.ScilabSlider;
00085 import org.scilab.modules.gui.slider.Slider;
00086 import org.scilab.modules.gui.tab.Tab;
00087 import org.scilab.modules.gui.utils.ConfigManager;
00088 import org.scilab.modules.gui.utils.ImageExporter;
00089 import org.scilab.modules.gui.utils.Position;
00090 import org.scilab.modules.gui.utils.ScilabPrint;
00091 import org.scilab.modules.gui.utils.ScilabRelief;
00092 import org.scilab.modules.gui.utils.Size;
00093 import org.scilab.modules.gui.utils.UIElementMapper;
00094 import org.scilab.modules.gui.utils.WebBrowser;
00095 import org.scilab.modules.gui.waitbar.ScilabWaitBar;
00096 import org.scilab.modules.gui.waitbar.WaitBar;
00097 import org.scilab.modules.gui.widget.Widget;
00098 import org.scilab.modules.gui.window.ScilabWindow;
00099 import org.scilab.modules.gui.window.Window;
00100 import org.scilab.modules.localization.Messages;
00101 import org.scilab.modules.renderer.FigureMapper;
00102 
00107 public class CallScilabBridge {
00108         
00109         private static final int NB_COLORS = 3;
00110         
00111         private static final int POSITION_SIZE = 4;
00112         
00113         private static final int X_INDEX = 0;
00114         private static final int Y_INDEX = 1;
00115         private static final int WIDTH_INDEX = 2;
00116         private static final int HEIGHT_INDEX = 3;
00117         
00118         private static final String NORMALFONT = "normal";
00119         private static final String OBLIQUEFONT = "oblique";
00120         private static final String ITALICFONT = "italic";
00121         private static final String BOLDFONT = "bold";
00122         private static final int DEFAULTFONTSIZE = 10;
00123         private static final String DEFAULTFONTNAME = "helvetica";
00124 
00125         private static final double DEFAULT_RED_BACKGROUND = 0.8 * 255;
00126         private static final double DEFAULT_GREEN_BACKGROUND = 0.8 * 255;
00127         private static final double DEFAULT_BLUE_BACKGROUND = 0.8 * 255;
00128         
00129         private static final double BUTTON_RED_BACKGROUND = 0.6 * 255;
00130         private static final double BUTTON_GREEN_BACKGROUND = 0.6 * 255;
00131         private static final double BUTTON_BLUE_BACKGROUND = 0.6 * 255;
00132         
00133         private static final double DEFAULT_RED_FOREGROUND = 0;
00134         private static final double DEFAULT_GREEN_FOREGROUND = 0;
00135         private static final double DEFAULT_BLUE_FOREGROUND = 0;
00136         
00137         private static PrintRequestAttributeSet scilabPageFormat = new HashPrintRequestAttributeSet();
00138         private static String tmpPrinterFile = System.getenv("TMPDIR") + "scilabfigure";
00139         
00143         protected CallScilabBridge() {
00144                 throw new UnsupportedOperationException(); /* Prevents calls from subclass */
00145         }
00146         
00147         /******************/
00148         /*                */  
00149         /* CONSOLE BRIDGE */
00150         /*                */  
00151         /******************/
00152         
00157         public static String readLine() {
00158                 return ScilabConsole.getConsole().readLine();
00159         }
00160         
00165         public static void display(String dataToDisplay) {
00166                 ScilabConsole.getConsole().display(dataToDisplay);
00167         }
00168         
00173         public static boolean isWaitingForInput() {
00174                 return ScilabConsole.getConsole().isWaitingForInput();
00175         }
00176 
00180         public static void scilabLinesUpdate() {
00181                 ScilabConsole.getConsole().scilabLinesUpdate();
00182         }
00183         
00187         public static void clear() {
00188                 ScilabConsole.getConsole().clear();
00189         }
00190         
00195         public static void clear(int nbLines) {
00196                 ScilabConsole.getConsole().clear(nbLines);
00197         }
00198         
00203         public static int getCharWithoutOutput() {
00204                 return ScilabConsole.getConsole().getAsSimpleConsole().getCharWithoutOutput();
00205         }
00206         
00210         public static void toHome() {
00211                 ScilabConsole.getConsole().toHome();
00212         }
00213         
00218         public static void setPrompt(String prompt) {
00219                 ScilabConsole.getConsole().setPrompt(prompt);
00220         }
00221         
00225         public static void clearHistory() {
00226                 ScilabConsole.getConsole().clearHistory();
00227         }
00228 
00229         /**************************/
00230         /*                        */
00231         /* OBJECT CREATION BRIDGE */
00232         /*                        */
00233         /**************************/
00234         
00239         public static int newWindow() {
00240                 Window window = ScilabWindow.createWindow();
00241                 return UIElementMapper.add(window);
00242         }
00243 
00248         public static int newMenuBar() {
00249                 MenuBar menuBar = ScilabMenuBar.createMenuBar();
00250                 return UIElementMapper.add(menuBar);
00251         }
00252 
00257         public static int newMenu() {
00258                 MenuItem menuItem = ScilabMenuItem.createMenuItem();
00259                 return UIElementMapper.add(menuItem);
00260         }
00261         
00266         public static int newContextMenu() {
00267                 ContextMenu contextMenu = ScilabContextMenu.createContextMenu();
00268                 return UIElementMapper.add(contextMenu);
00269         }
00270         
00275         public static int newColorChooser() {
00276                 ColorChooser colorChooser = ScilabColorChooser.createColorChooser();
00277                 return UIElementMapper.add(colorChooser);
00278         }
00283         public static int newFileChooser() {
00284                 FileChooser fileChooser = ScilabFileChooser.createFileChooser();
00285                 return UIElementMapper.add(fileChooser);
00286         }
00287                 
00293         public static int newExportFileChooser(int figureId) {
00294                 FileChooser fileChooser = ScilabFileChooser.createExportFileChooser(figureId);
00295                 return UIElementMapper.add(fileChooser);
00296         }
00297         
00302         public static int newFontChooser() {
00303                 FontChooser fontChooser = ScilabFontChooser.createFontChooser();
00304                 return UIElementMapper.add(fontChooser);
00305         }
00306         
00311         public static int newMessageBox() {
00312                 MessageBox messageBox = ScilabMessageBox.createMessageBox();
00313                 return UIElementMapper.add(messageBox);
00314         }
00315         
00320         public static int newWaitBar() {
00321                 WaitBar waitBar = ScilabWaitBar.createWaitBar();
00322                 return UIElementMapper.add(waitBar);
00323         }
00324         
00329         public static int newPushButton() {
00330                 PushButton pushButton = ScilabPushButton.createPushButton();
00331                 int id = UIElementMapper.add(pushButton);
00332                 
00333                 /* Default font */
00334                 setWidgetFontName(id, DEFAULTFONTNAME);
00335                 setWidgetFontWeight(id, NORMALFONT);
00336                 setWidgetFontSize(id, DEFAULTFONTSIZE);
00337                 
00338                 setWidgetRelief(id, ScilabRelief.RAISED);
00339                 
00340                 /* Default colors */
00341                 setWidgetBackgroundColor(id, (int) BUTTON_RED_BACKGROUND, (int) BUTTON_GREEN_BACKGROUND, (int) BUTTON_BLUE_BACKGROUND);
00342                 setWidgetForegroundColor(id, (int) DEFAULT_RED_FOREGROUND, (int) DEFAULT_GREEN_FOREGROUND, (int) DEFAULT_BLUE_FOREGROUND);
00343                 return id;
00344         }
00345 
00350         public static int newEditBox() {
00351                 EditBox editBox = ScilabEditBox.createEditBox();
00352                 int id = UIElementMapper.add(editBox);
00353                 
00354                 /* Default font */
00355                 setWidgetFontName(id, DEFAULTFONTNAME);
00356                 setWidgetFontWeight(id, NORMALFONT);
00357                 setWidgetFontSize(id, DEFAULTFONTSIZE);
00358                 
00359                 setWidgetRelief(id, ScilabRelief.SUNKEN);
00360                 
00361                 /* Default colors */
00362                 setWidgetBackgroundColor(id, (int) DEFAULT_RED_BACKGROUND, (int) DEFAULT_GREEN_BACKGROUND, (int) DEFAULT_BLUE_BACKGROUND);
00363                 setWidgetForegroundColor(id, (int) DEFAULT_RED_FOREGROUND, (int) DEFAULT_GREEN_FOREGROUND, (int) DEFAULT_BLUE_FOREGROUND);
00364                 return id;
00365         }
00366 
00371         public static int newLabel() {
00372                 Label label = ScilabLabel.createLabel();
00373                 int id = UIElementMapper.add(label);
00374                 
00375                 /* Default font */
00376                 setWidgetFontName(id, DEFAULTFONTNAME);
00377                 setWidgetFontWeight(id, NORMALFONT);
00378                 setWidgetFontSize(id, DEFAULTFONTSIZE);
00379                 
00380                 setWidgetRelief(id, ScilabRelief.FLAT);
00381                 
00382                 /* Default colors */
00383                 setWidgetBackgroundColor(id, (int) DEFAULT_RED_BACKGROUND, (int) DEFAULT_GREEN_BACKGROUND, (int) DEFAULT_BLUE_BACKGROUND);
00384                 setWidgetForegroundColor(id, (int) DEFAULT_RED_FOREGROUND, (int) DEFAULT_GREEN_FOREGROUND, (int) DEFAULT_BLUE_FOREGROUND);
00385                 return id;
00386         }
00387 
00392         public static int newCheckBox() {
00393                 CheckBox checkBox = ScilabCheckBox.createCheckBox();
00394                 int id = UIElementMapper.add(checkBox);
00395                 
00396                 /* Default font */
00397                 setWidgetFontName(id, DEFAULTFONTNAME);
00398                 setWidgetFontWeight(id, NORMALFONT);
00399                 setWidgetFontSize(id, DEFAULTFONTSIZE);
00400 
00401                 setWidgetRelief(id, ScilabRelief.FLAT);
00402                 
00403                 /* Default colors */
00404                 setWidgetBackgroundColor(id, (int) DEFAULT_RED_BACKGROUND, (int) DEFAULT_GREEN_BACKGROUND, (int) DEFAULT_BLUE_BACKGROUND);
00405                 setWidgetForegroundColor(id, (int) DEFAULT_RED_FOREGROUND, (int) DEFAULT_GREEN_FOREGROUND, (int) DEFAULT_BLUE_FOREGROUND);
00406                 return id;
00407         }
00408 
00413         public static int newRadioButton() {
00414                 RadioButton radioButton = ScilabRadioButton.createRadioButton();
00415                 int id = UIElementMapper.add(radioButton);
00416 
00417                 /* Default font */
00418                 setWidgetFontName(id, DEFAULTFONTNAME);
00419                 setWidgetFontWeight(id, NORMALFONT);
00420                 setWidgetFontSize(id, DEFAULTFONTSIZE);
00421 
00422                 setWidgetRelief(id, ScilabRelief.FLAT);
00423                 
00424                 /* Default colors */
00425                 setWidgetBackgroundColor(id, (int) DEFAULT_RED_BACKGROUND, (int) DEFAULT_GREEN_BACKGROUND, (int) DEFAULT_BLUE_BACKGROUND);
00426                 setWidgetForegroundColor(id, (int) DEFAULT_RED_FOREGROUND, (int) DEFAULT_GREEN_FOREGROUND, (int) DEFAULT_BLUE_FOREGROUND);
00427                 return id;
00428         }
00429 
00434         public static int newSlider() {
00435                 Slider slider = ScilabSlider.createSlider();
00436                 int id = UIElementMapper.add(slider);
00437 
00438                 /* Default font */
00439                 /* Set a default font because is null when JScrollBar is created */
00440                 slider.setFont(new Font(DEFAULTFONTNAME, Font.PLAIN, DEFAULTFONTSIZE));
00441                 setWidgetFontName(id, DEFAULTFONTNAME);
00442                 setWidgetFontWeight(id, NORMALFONT);
00443                 setWidgetFontSize(id, DEFAULTFONTSIZE);
00444                 
00445                 setWidgetRelief(id, ScilabRelief.FLAT);
00446                 
00447                 /* Default colors */
00448                 setWidgetBackgroundColor(id, (int) DEFAULT_RED_BACKGROUND, (int) DEFAULT_GREEN_BACKGROUND, (int) DEFAULT_BLUE_BACKGROUND);
00449                 setWidgetForegroundColor(id, (int) DEFAULT_RED_FOREGROUND, (int) DEFAULT_GREEN_FOREGROUND, (int) DEFAULT_BLUE_FOREGROUND);
00450                 
00451                 slider.setText(""); /* Because Name property is null at creation */
00452                 slider.setMinimumValue(0);
00453                 slider.setMaximumValue(1);
00454                 slider.setUserValue(0);
00455                 
00456                 return id;
00457         }
00458 
00463         public static int newListBox() {
00464                 ListBox listBox = ScilabListBox.createListBox();
00465                 int id = UIElementMapper.add(listBox);
00466 
00467                 /* Default font */
00468                 setWidgetFontName(id, DEFAULTFONTNAME);
00469                 setWidgetFontWeight(id, NORMALFONT);
00470                 setWidgetFontSize(id, DEFAULTFONTSIZE);
00471                 
00472                 setWidgetRelief(id, ScilabRelief.FLAT);
00473 
00474                 /* Default colors */
00475                 setWidgetBackgroundColor(id, (int) DEFAULT_RED_BACKGROUND, (int) DEFAULT_GREEN_BACKGROUND, (int) DEFAULT_BLUE_BACKGROUND);
00476                 setWidgetForegroundColor(id, (int) DEFAULT_RED_FOREGROUND, (int) DEFAULT_GREEN_FOREGROUND, (int) DEFAULT_BLUE_FOREGROUND);
00477                 return id;
00478         }
00479 
00484         public static int newPopupMenu() {
00485                 PopupMenu popupMenu = ScilabPopupMenu.createPopupMenu();
00486                 int id = UIElementMapper.add(popupMenu);
00487 
00488                 /* Default font */
00489                 setWidgetFontName(id, DEFAULTFONTNAME);
00490                 setWidgetFontWeight(id, NORMALFONT);
00491                 setWidgetFontSize(id, DEFAULTFONTSIZE);
00492                 
00493                 setWidgetRelief(id, ScilabRelief.FLAT);
00494                 
00495                 /* Default colors */
00496                 setWidgetBackgroundColor(id, (int) DEFAULT_RED_BACKGROUND, (int) DEFAULT_GREEN_BACKGROUND, (int) DEFAULT_BLUE_BACKGROUND);
00497                 setWidgetForegroundColor(id, (int) DEFAULT_RED_FOREGROUND, (int) DEFAULT_GREEN_FOREGROUND, (int) DEFAULT_BLUE_FOREGROUND);
00498                 return id;
00499         }
00500 
00505         public static int newFrame() {
00506                 Frame frame = ScilabFrame.createFrame();
00507                 int id = UIElementMapper.add(frame);
00508 
00509                 /* Default font */
00510                 setFrameFontName(id, DEFAULTFONTNAME);
00511                 setFrameFontWeight(id, NORMALFONT);
00512                 setFrameFontSize(id, DEFAULTFONTSIZE);
00513                 
00514                 setFrameRelief(id, ScilabRelief.RIDGE);
00515                 
00516                 /* Default colors */
00517                 setFrameBackgroundColor(id, (int) DEFAULT_RED_BACKGROUND, (int) DEFAULT_GREEN_BACKGROUND, (int) DEFAULT_BLUE_BACKGROUND);
00518                 setFrameForegroundColor(id, (int) DEFAULT_RED_FOREGROUND, (int) DEFAULT_GREEN_FOREGROUND, (int) DEFAULT_BLUE_FOREGROUND);
00519                 
00520                 frame.setText(""); /* Because Name property is null at creation */
00521                 return id;
00522         }
00523         
00530         public static String displayAndWaitContextMenu(int id) {
00531                 return ((ContextMenu) UIElementMapper.getCorrespondingUIElement(id)).getAsSimpleContextMenu().displayAndWait();
00532         }
00533 
00538         public static void destroyWidget(int id) {
00539                 ((Widget) UIElementMapper.getCorrespondingUIElement(id)).destroy();
00540                 UIElementMapper.removeMapping(id);
00541         }
00542 
00547         public static void destroyFrame(int id) {
00548                 ((Frame) UIElementMapper.getCorrespondingUIElement(id)).destroy();
00549                 UIElementMapper.removeMapping(id);
00550         }
00551 
00552         /****************************/
00553         /*                          */
00554         /* OBJECT DIMENSIONS BRIDGE */
00555         /*                          */
00556         /****************************/
00557         
00564         public static void setDims(int objID, int width, int height) {
00565                 UIElementMapper.getCorrespondingUIElement(objID).setDims(new Size(width, height));
00566         }
00567         
00568         /**********************/
00569         /*                    */
00570         /* OBJECT TEXT BRIDGE */
00571         /*                    */
00572         /**********************/
00573         
00579         public static void setWidgetText(int objID, String text) {
00580                 ((Widget) UIElementMapper.getCorrespondingUIElement(objID)).setText(text);
00581         }
00582         
00588         public static String getWidgetText(int objID) {
00589                 return ((Widget) UIElementMapper.getCorrespondingUIElement(objID)).getText();
00590         }
00591 
00597         public static void setFrameText(int objID, String text) {
00598                 ((Frame) UIElementMapper.getCorrespondingUIElement(objID)).setText(text);
00599         }
00600         
00606         public static String getFrameText(int objID) {
00607                 return ((Frame) UIElementMapper.getCorrespondingUIElement(objID)).getText();
00608         }
00609 
00610         /******************/
00611         /*                */
00612         /* PARENT SETTING */
00613         /*                */
00614         /******************/
00615 
00621         public static void setFigureAsParent(int figureID, int objID) {
00622                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00623 
00624                 if (UIElementMapper.getCorrespondingUIElement(objID) instanceof Menu) {
00625                         // Add the menu to the tab
00626                         parentTab.getMenuBar().add((Menu) UIElementMapper.getCorrespondingUIElement(objID));
00627                 } else {
00628                         // obj is a MenuItem that has to be converted to a Menu
00629                         MenuItem menuItem = (MenuItem) UIElementMapper.getCorrespondingUIElement(objID);
00630                         
00631                         Menu menuToAdd = ScilabMenu.createMenu();
00632                         UIElementMapper.removeMapping(objID);
00633                         UIElementMapper.addMapping(objID, menuToAdd);
00634                         
00635                         // Copy all properties from MenuItem to Menu
00636                         menuToAdd.setText(menuItem.getText());
00637                         menuToAdd.setCallback(menuItem.getCallback());
00638                         menuToAdd.setForeground(menuItem.getForeground());
00639                         menuToAdd.setVisible(menuItem.isVisible());
00640                         // End of properties copy
00641                         
00642                         // Add the menu to the tab
00643                         parentTab.getMenuBar().add(menuToAdd);
00644                 }
00645         }
00646         
00652         public static void setPushButtonParent(int figureID, int objID) {
00653                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00654                 PushButton pushButton = (PushButton) UIElementMapper.getCorrespondingUIElement(objID);
00655                 ScilabBridge.addMember(parentTab, pushButton);
00656         }
00657 
00663         public static void removePushButtonFromParent(int figureID, int objID) {
00664                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00665                 PushButton pushButton = (PushButton) UIElementMapper.getCorrespondingUIElement(objID);
00666                 ScilabBridge.removeMember(parentTab, pushButton);
00667         }
00668 
00674         public static void setEditBoxParent(int figureID, int objID) {
00675                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00676                 EditBox editBox = (EditBox) UIElementMapper.getCorrespondingUIElement(objID);
00677                 ScilabBridge.addMember(parentTab, editBox);
00678         }
00679 
00685         public static void removeEditBoxFromParent(int figureID, int objID) {
00686                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00687                 EditBox editBox = (EditBox) UIElementMapper.getCorrespondingUIElement(objID);
00688                 ScilabBridge.removeMember(parentTab, editBox);
00689         }
00690 
00696         public static void setLabelParent(int figureID, int objID) {
00697                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00698                 Label label = (Label) UIElementMapper.getCorrespondingUIElement(objID);
00699                 ScilabBridge.addMember(parentTab, label);
00700         }
00701 
00707         public static void removeLabelFromParent(int figureID, int objID) {
00708                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00709                 Label label = (Label) UIElementMapper.getCorrespondingUIElement(objID);
00710                 ScilabBridge.removeMember(parentTab, label);
00711         }
00712 
00718         public static void setCheckBoxParent(int figureID, int objID) {
00719                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00720                 CheckBox checkBox = (CheckBox) UIElementMapper.getCorrespondingUIElement(objID);
00721                 ScilabBridge.addMember(parentTab, checkBox);
00722         }
00723 
00729         public static void removeCheckBoxFromParent(int figureID, int objID) {
00730                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00731                 CheckBox checkBox = (CheckBox) UIElementMapper.getCorrespondingUIElement(objID);
00732                 ScilabBridge.removeMember(parentTab, checkBox);
00733         }
00734 
00740         public static void setRadioButtonParent(int figureID, int objID) {
00741                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00742                 RadioButton radioButton = (RadioButton) UIElementMapper.getCorrespondingUIElement(objID);
00743                 ScilabBridge.addMember(parentTab, radioButton);
00744         }
00745 
00751         public static void removeRadioButtonFromParent(int figureID, int objID) {
00752                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00753                 RadioButton radioButton = (RadioButton) UIElementMapper.getCorrespondingUIElement(objID);
00754                 ScilabBridge.removeMember(parentTab, radioButton);
00755         }
00756 
00762         public static void setSliderParent(int figureID, int objID) {
00763                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00764                 Slider slider = (Slider) UIElementMapper.getCorrespondingUIElement(objID);
00765                 ScilabBridge.addMember(parentTab, slider);
00766         }
00767 
00773         public static void removeSliderFromParent(int figureID, int objID) {
00774                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00775                 Slider slider = (Slider) UIElementMapper.getCorrespondingUIElement(objID);
00776                 ScilabBridge.removeMember(parentTab, slider);
00777         }
00778 
00784         public static void setListBoxParent(int figureID, int objID) {
00785                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00786                 ListBox listBox = (ListBox) UIElementMapper.getCorrespondingUIElement(objID);
00787                 ScilabBridge.addMember(parentTab, listBox);
00788         }
00789 
00795         public static void removeListBoxFromParent(int figureID, int objID) {
00796                 Tab parentTab = ((ScilabRendererProperties) FigureMapper.getCorrespondingFigure(figureID).getRendererProperties()).getParentTab();
00797                 ListBox listBox = (ListBox)