2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2007 - INRIA - Vincent Couvert
4 * Copyright (C) 2007 - INRIA - Bruno Jofret
5 * Copyright (C) 2010 - DIGITEO - Vincent COUVERT
7 * This file must be used under the terms of the CeCILL.
8 * This source file is licensed as described in the file COPYING, which
9 * you should have received as part of this distribution. The terms
10 * are also available at
11 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
16 package org.scilab.modules.gui.bridge;
18 import java.awt.Color;
19 import java.awt.Cursor;
21 import java.awt.image.BufferedImage;
23 import javax.media.opengl.GL;
25 import org.scilab.modules.gui.canvas.Canvas;
26 import org.scilab.modules.gui.canvas.ScilabCanvas;
27 import org.scilab.modules.gui.canvas.ScilabCanvasBridge;
28 import org.scilab.modules.gui.canvas.SimpleCanvas;
29 import org.scilab.modules.gui.checkboxmenuitem.CheckBoxMenuItem;
30 import org.scilab.modules.gui.checkboxmenuitem.ScilabCheckBoxMenuItemBridge;
31 import org.scilab.modules.gui.checkboxmenuitem.SimpleCheckBoxMenuItem;
32 import org.scilab.modules.gui.colorchooser.ColorChooser;
33 import org.scilab.modules.gui.colorchooser.ScilabColorChooserBridge;
34 import org.scilab.modules.gui.colorchooser.SimpleColorChooser;
35 import org.scilab.modules.gui.console.Console;
36 import org.scilab.modules.gui.console.ScilabConsole;
37 import org.scilab.modules.gui.console.ScilabConsoleBridge;
38 import org.scilab.modules.gui.console.SimpleConsole;
39 import org.scilab.modules.gui.contextmenu.ContextMenu;
40 import org.scilab.modules.gui.contextmenu.ScilabContextMenuBridge;
41 import org.scilab.modules.gui.contextmenu.SimpleContextMenu;
42 import org.scilab.modules.gui.events.callback.CommonCallBack;
43 import org.scilab.modules.gui.filechooser.FileChooser;
44 import org.scilab.modules.gui.filechooser.ScilabFileChooserBridge;
45 import org.scilab.modules.gui.filechooser.SimpleFileChooser;
46 import org.scilab.modules.gui.fontchooser.FontChooser;
47 import org.scilab.modules.gui.fontchooser.ScilabFontChooserBridge;
48 import org.scilab.modules.gui.fontchooser.SimpleFontChooser;
49 import org.scilab.modules.gui.helpbrowser.HelpBrowser;
50 import org.scilab.modules.gui.helpbrowser.ScilabHelpBrowserBridge;
51 import org.scilab.modules.gui.helpbrowser.SimpleHelpBrowser;
52 import org.scilab.modules.gui.menu.Menu;
53 import org.scilab.modules.gui.menu.ScilabMenuBridge;
54 import org.scilab.modules.gui.menu.SimpleMenu;
55 import org.scilab.modules.gui.menubar.MenuBar;
56 import org.scilab.modules.gui.menubar.ScilabMenuBarBridge;
57 import org.scilab.modules.gui.menubar.SimpleMenuBar;
58 import org.scilab.modules.gui.menuitem.MenuItem;
59 import org.scilab.modules.gui.menuitem.ScilabMenuItemBridge;
60 import org.scilab.modules.gui.menuitem.SimpleMenuItem;
61 import org.scilab.modules.gui.messagebox.MessageBox;
62 import org.scilab.modules.gui.messagebox.ScilabMessageBoxBridge;
63 import org.scilab.modules.gui.messagebox.SimpleMessageBox;
64 import org.scilab.modules.gui.separator.ScilabSeparatorBridge;
65 import org.scilab.modules.gui.separator.Separator;
66 import org.scilab.modules.gui.tab.ScilabTabBridge;
67 import org.scilab.modules.gui.tab.SimpleTab;
68 import org.scilab.modules.gui.tab.Tab;
69 import org.scilab.modules.gui.textbox.ScilabTextBoxBridge;
70 import org.scilab.modules.gui.textbox.SimpleTextBox;
71 import org.scilab.modules.gui.textbox.TextBox;
72 import org.scilab.modules.gui.toolbar.ScilabToolBarBridge;
73 import org.scilab.modules.gui.toolbar.SimpleToolBar;
74 import org.scilab.modules.gui.toolbar.ToolBar;
75 import org.scilab.modules.gui.tree.ScilabTreeBridge;
76 import org.scilab.modules.gui.tree.SimpleTree;
77 import org.scilab.modules.gui.tree.Tree;
78 import org.scilab.modules.gui.uidisplaytree.ScilabUiDisplayTreeBridge;
79 import org.scilab.modules.gui.uidisplaytree.SimpleUiDisplayTree;
80 import org.scilab.modules.gui.uidisplaytree.UiDisplayTree;
81 import org.scilab.modules.gui.utils.Position;
82 import org.scilab.modules.gui.utils.Size;
83 import org.scilab.modules.gui.window.ScilabWindowBridge;
84 import org.scilab.modules.gui.window.SimpleWindow;
85 import org.scilab.modules.gui.window.Window;
88 * Main bridge for Scilab Java GUIs
89 * @author Vincent COUVERT
90 * @author Bruno Jofret
92 public class ScilabBridge {
95 * Constructor for ScilabBridge class
97 protected ScilabBridge() {
98 throw new UnsupportedOperationException(); /* Prevents calls from subclass */
106 * Creates a new window
107 * @return the created window
109 public static SimpleWindow createWindow() {
110 return ScilabWindowBridge.createWindow();
114 * Draws a window on screen
115 * @param window the window to be drawn
117 public static void draw(Window window) {
118 ScilabWindowBridge.draw(window);
122 * Deiconify the window and put it in front of other window
123 * @param window the window to raise
125 public static void raise(Window window) {
126 ScilabWindowBridge.raise(window);
130 * Gets the dimensions (width and height) of a window
131 * @param window the window we want to get the dimensions of
132 * @return dimensions of the window
134 public static Size getDims(Window window) {
135 return ScilabWindowBridge.getDims(window);
139 * Sets the dimensions (width and height) of a window
140 * @param window the window we want to set the dimensions of
141 * @param newWindowSize new dimensions of the window
143 public static void setDims(Window window, Size newWindowSize) {
144 ScilabWindowBridge.setDims(window, newWindowSize);
148 * Gets the position (X-coordinate and Y-coordinate) of a window
149 * @param window the window we want to get the position of
150 * @return position of the window
152 public static Position getPosition(Window window) {
153 return ScilabWindowBridge.getPosition(window);
157 * Sets the position (X-coordinate and Y-coordinate) of a window
158 * @param window the window we want to set the position of
159 * @param newWindowPosition new position of the window
161 public static void setPosition(Window window, Position newWindowPosition) {
162 ScilabWindowBridge.setPosition(window, newWindowPosition);
166 * Gets the title of a window
167 * @param window the window we want to get the title of
168 * @return the title of the window
170 public static String getTitle(Window window) {
171 return ScilabWindowBridge.getTitle(window);
175 * Sets the title of a window
176 * @param window the window we want to set the title of
177 * @param newWindowTitle the title to set for the window
179 public static void setTitle(Window window, String newWindowTitle) {
180 ScilabWindowBridge.setTitle(window, newWindowTitle);
184 * Gets the visibility status of a window
185 * @param window the window we want to get the status of
186 * @return visibility status (true if the window is visible, false if not)
188 public static boolean isVisible(Window window) {
189 return ScilabWindowBridge.isVisible(window);
193 * Sets the visibility status for a window
194 * @param window the window we want to set the visibility status of
195 * @param newVisibleState new visibility status for the window
196 * (true set the window visible, false to set the window invisible)
198 public static void setVisible(Window window, boolean newVisibleState) {
199 ScilabWindowBridge.setVisible(window, newVisibleState);
203 * Add a tab to a window
204 * @param window the window which we want to add the tab to
205 * @param newTab the tab to add to the window
207 public static void addTab(Window window, Tab newTab) {
208 ScilabWindowBridge.addTab(window, newTab);
212 * Add a tab to a window
213 * @param window the window which we want to remove the tab from
214 * @param newTab the tab to add to the window
216 public static void removeTab(Window window, Tab newTab) {
217 ScilabWindowBridge.removeTab(window, newTab);
221 * Sets a MenuBar to a window
222 * @param window the window which we want to add the MeunBar to
223 * @param newMenuBar the MeunBar to add to the window
225 public static void addMenuBar(Window window, MenuBar newMenuBar) {
226 ScilabWindowBridge.addMenuBar(window, newMenuBar);
230 * Sets a ToolBar to a window
231 * @param window the window which we want to add the ToolBar to
232 * @param newToolBar the ToolBar to add to the window
234 public static void addToolBar(Window window, ToolBar newToolBar) {
235 ScilabWindowBridge.addToolBar(window, newToolBar);
239 * Sets a InfoBar to a window
240 * @param window the window which we want to add the InfoBar to
241 * @param newInfoBar the InfoBar to add to the window
243 public static void addInfoBar(Window window, TextBox newInfoBar) {
244 ScilabWindowBridge.addInfoBar(window, newInfoBar);
248 * @param window window from which we want the information
249 * @return number of objects (tabs) docked in this window
251 public static int getNbDockedObjects(Window window) {
252 return ScilabWindowBridge.getNbDockedObjects(window);
256 * Update the dimension of the window and its component.
257 * Only useful when the window is not yet visible
258 * @param window window to update
260 public static void updateDimensions(Window window) {
261 ScilabWindowBridge.updateDimensions(window);
266 * @param window window to update
268 public static void windowDeiconified(Window window) {
269 ScilabWindowBridge.windowDeiconified(window);
274 * @param window window to update
276 public static void windowIconified(Window window) {
277 ScilabWindowBridge.windowIconified(window);
282 * @param window window to update
284 public static void windowMaximized(Window window) {
285 ScilabWindowBridge.windowMaximized(window);
289 * Window is in the "normal" state.
290 * @param window window to update
292 public static void windowNormal(Window window) {
293 ScilabWindowBridge.windowNormal(window);
303 * Creates a new ToolBar
304 * @return the created ToolBar
306 public static SimpleToolBar createToolBar() {
307 return ScilabToolBarBridge.createToolBar();
311 * Add a Separator to a Toolbar
312 * @param toolbar the Toolbar which we want to add the Separator to
314 public static void addSeparator(ToolBar toolbar) {
315 ScilabToolBarBridge.addSeparator(toolbar);
319 * Set the visibility of the Toolbar
320 * @param toolbar the ToolBar
321 * @param newVisibleState true to set the toolbar visible
323 public static void setVisible(ToolBar toolbar, boolean newVisibleState) {
324 ScilabToolBarBridge.setVisible(toolbar, newVisibleState);
328 * Get the visibility of the TooBar
329 * @param toolbar the ToolBar
330 * @return true if the ToolBar is Visible
332 public static boolean isVisible(ToolBar toolbar) {
333 return ScilabToolBarBridge.isVisible(toolbar);
341 * Creates a Scilab tab
342 * @param name the name of the tab (used to identify it)
343 * @return the created tab
345 public static SimpleTab createTab(String name) {
346 return ScilabTabBridge.createTab(name);
350 * Creates a Scilab tab
351 * @param name the name of the tab
352 * @param uuid an uuid to identify the tab
353 * @return the created tab
355 public static SimpleTab createTab(String name, String uuid) {
356 return ScilabTabBridge.createTab(name, uuid);
360 * Creates a Scilab tab able to create graphics
361 * @param name the name of the tab (used to identify it)
362 * @param figureId index of the created figure
363 * @return the created tab
365 public static SimpleTab createTab(String name, int figureId) {
366 return ScilabTabBridge.createTab(name, figureId);
370 * Draws a tab on screen
371 * @param tab the tab to be drawn
373 public static void draw(Tab tab) {
374 ScilabTabBridge.draw(tab);
378 * Gets the dimensions (width and height) of a tab
379 * @param tab the tab we want to get the dimensions of
380 * @return the dimensions of the tab
382 public static Size getDims(Tab tab) {
383 return ScilabTabBridge.getDims(tab);
387 * Sets the dimensions (width and height) of a tab
388 * @param tab the tab we want to set the dimensions of
389 * @param newTabSize new dimensions of the tab
391 public static void setDims(Tab tab, Size newTabSize) {
392 ScilabTabBridge.setDims(tab, newTabSize);
396 * Gets the position (X-coordinate and Y-coordinate) of a tab
397 * @param tab the tab we want to get the position of
398 * @return position of the tab
400 public static Position getPosition(Tab tab) {
401 return ScilabTabBridge.getPosition(tab);
405 * Sets the position (X-coordinate and Y-coordinate) of a tab
406 * @param tab the tab we want to set the position of
407 * @param newTabPosition new position of the tab
409 public static void setPosition(Tab tab, Position newTabPosition) {
410 ScilabTabBridge.setPosition(tab, newTabPosition);
414 * Gets the Name of a tab
415 * @param tab the tab we want to get the Name of
416 * @return the Name of the tab
418 public static String getName(Tab tab) {
419 return ScilabTabBridge.getName(tab);
423 * Sets the name of a tab
424 * @param tab the tab we want to set the name of
425 * @param newTabName the name to set for the tab
427 public static void setName(Tab tab, String newTabName) {
428 ScilabTabBridge.setName(tab, newTabName);
432 * Gets the visibility status of a tab
433 * @param tab the tab we want to get the status of
434 * @return visibility status (true if the tab is visible, false if not)
436 public static boolean isVisible(Tab tab) {
437 return ScilabTabBridge.isVisible(tab);
441 * Sets the visibility status of a tab
442 * @param tab the tab we want to set the visibility status of
443 * @param newVisibleState new visibility status for the tab
444 * (true set the tab visible, false to set the tab invisible)
446 public static void setVisible(Tab tab, boolean newVisibleState) {
447 ScilabTabBridge.setVisible(tab, newVisibleState);
451 * Add a member (dockable element) to a tab and returns the index of this member
452 * @param tab the tab where we want to add the member
453 * @param member the member to add
454 * @return index of member
456 public static int addMember(Tab tab, Console member) {
457 return ScilabTabBridge.addMember(tab, member);
461 * We want to be able to add directly a HelpBrowser in a Tab.
462 * @param tab the tab where we want to add the member
463 * @param member the member to add
464 * @return the position of the HelpBrowser in the member list.
466 public static int addMember(Tab tab, HelpBrowser member) {
467 return ScilabTabBridge.addMember(tab, member);
471 * Add a member (dockable element) to a tab and returns the index of this member
472 * @param tab the tab where we want to add the member
473 * @param member the member to add
474 * @return index of member
476 public static int addMember(Tab tab, Canvas member) {
477 return ScilabTabBridge.addMember(tab, member);
481 * Sets a MenuBar to a tab
482 * @param tab the tab which we want to add the MenuBar to
483 * @param newMenuBar the MenuBar to add to the tab
485 public static void addMenuBar(Tab tab, MenuBar newMenuBar) {
486 ScilabTabBridge.addMenuBar(tab, newMenuBar);
490 * Add a member (dockable element) to a tab and returns the index of this member
491 * @param tab the tab which we want to add the Tree Overview to
492 * @param member the Tree Overview to add
493 * @return the position of the Tree Overview in the member list.
495 public static int addMember(Tab tab, Tree member) {
496 return ScilabTabBridge.addMember(tab, member);
499 public static int addMember(Tab tab, UiDisplayTree member) {
500 return ScilabTabBridge.addMember(tab, member);
502 public static void removeMember(Tab tab, UiDisplayTree member) {
503 ScilabTabBridge.removeMember(tab, member);
507 * Remove a member (dockable element) to a tab and returns the index of this member
508 * @param tab the tab where we want to add the member
509 * @param member the member to add
511 public static void removeMember(Tab tab, Canvas member) {
512 ScilabTabBridge.removeMember(tab, member);
516 * Get the current status of the Tab in its parent
517 * @param tab the tab we want to get the status of
518 * @return true is the tab is the tab currently displayed in its parent
520 public static boolean isCurrentTab(Tab tab) {
521 return ScilabTabBridge.isCurrentTab(tab);
525 * Set the parent window id for this tab
526 * @param tab the tab we want to set the parent window id of
527 * @param id the id of the parent window
529 public static void setParentWindowId(Tab tab, int id) {
530 ScilabTabBridge.setParentWindowId(tab, id);
534 * Get the parent window id for this tab
535 * @param tab the tab we want to get the parent window id of
536 * @return the id of the parent window
538 public static int getParentWindowId(Tab tab) {
539 return ScilabTabBridge.getParentWindowId(tab);
543 * Set the callback of the tab
544 * @param tab the tab which we want to set the callback of
545 * @param callback the CallBack to set
547 public static void setCallback(Tab tab, CommonCallBack callback) {
548 ScilabTabBridge.setCallback(tab, callback);
552 * Set this tab as the current tab of its parent Window
555 public static void setCurrent(Tab tab) {
556 ScilabTabBridge.setCurrent(tab);
560 * Set the background color of a tab.
561 * @param tab tab to modify
562 * @param red red channel of the color
563 * @param green green channel
564 * @param blue blue channel
566 public static void setBackground(Tab tab, double red, double green, double blue) {
567 ScilabTabBridge.setBackground(tab, red, green, blue);
571 * Specify whether the canvas should fit the parent tab size
572 * (and consequently the scrollpane size) or not
573 * @param tab tab to modify
574 * @param onOrOff true to enable autoresize mode
576 public static void setAutoResizeMode(Tab tab, boolean onOrOff) {
577 ScilabTabBridge.setAutoResizeMode(tab, onOrOff);
581 * @param tab tab to modify
582 * @return whether the resize mode is on or off
584 public static boolean getAutoResizeMode(Tab tab) {
585 return ScilabTabBridge.getAutoResizeMode(tab);
589 * Get the part of the axes which is currently viewed
590 * @param tab tab to modify
591 * @return [x,y,w,h] array
593 public static int[] getViewingRegion(Tab tab) {
594 return ScilabTabBridge.getViewingRegion(tab);
598 * Specify a new viewport for the axes
599 * Only works if autoresize mode is off
600 * @param tab tab to modify
601 * @param posX X coordinate of upper left point of the viewport within the canvas
602 * @param posY Y coordinate of upper left point of the viewport within the canvas
603 * @param width width of the viewport
604 * @param height height of the viewport
606 public static void setViewingRegion(Tab tab, int posX, int posY, int width, int height) {
607 ScilabTabBridge.setViewingRegion(tab, posX, posY, width, height);
612 * @param tab tab to modify
613 * @return size of the axes in pixels
615 public static Size getAxesSize(Tab tab) {
616 return ScilabTabBridge.getAxesSize(tab);
621 * @param tab tab to modify
622 * @param newSize set a new axes size
624 public static void setAxesSize(Tab tab, Size newSize) {
625 ScilabTabBridge.setAxesSize(tab, newSize);
629 * Set the event handler of the Axes
630 * @param tab tab to modify
631 * @param command the name of the Scilab function to call
633 public static void setEventHandler(Tab tab, String command) {
634 ScilabTabBridge.setEventHandler(tab, command);
638 * Set the status of the event handler of the Axes
639 * @param tab tab to modify
640 * @param status is true to set the event handler active
642 public static void setEventHandlerEnabled(Tab tab, boolean status) {
643 ScilabTabBridge.setEventHandlerEnabled(tab, status);
653 * Creates a Scilab Console
654 * @return the created console
656 public static SimpleConsole createConsole() {
657 return ScilabConsoleBridge.createConsole();
661 * Displays data in the console
662 * @param console the console to display the data in
663 * @param dataToDisplay the data to be displayed
664 * @see org.scilab.modules.console.HelpBrowser#display()
666 public static void display(Console console, String dataToDisplay) {
667 ScilabConsoleBridge.display(console, dataToDisplay);
671 * Reads input data in the console
672 * @param console the console to read the data from
673 * @return the data entered by the user
674 * @see org.scilab.modules.console.HelpBrowser#readLine()
676 public static String readLine(Console console) {
677 return ScilabConsoleBridge.readLine(console);
682 * @param console the console to draw
683 * @see org.scilab.modules.ihm.UIElement#draw()
685 public static void draw(Console console) {
686 ScilabConsoleBridge.draw(console);
690 * Gets the dimensions (width and height) of a Scilab console
691 * @param console the console which we want to get the dimensions of
692 * @return the size of the console
693 * @see org.scilab.modules.ihm.UIElement#getDims()
695 public static Size getDims(Console console) {
696 return ScilabConsoleBridge.getDims(console);
700 * Gets the position (X-coordinate and Y-coordinates) of a Scilab console
701 * @param console the console which we want to get the position of
702 * @return the position of the console
703 * @see org.scilab.modules.ihm.UIElement#getPosition()
705 public static Position getPosition(Console console) {
706 return ScilabConsoleBridge.getPosition(console);
710 * Gets the visibility status of a console
711 * @param console the console which we want to get the visibility status of
712 * @return the visibility status of the console (true if the console is visible, false if not)
713 * @see org.scilab.modules.ihm.UIElement#isVisible()
715 public static boolean isVisible(Console console) {
716 return ScilabConsoleBridge.isVisible(console);
720 * Sets the visibility status of a console
721 * @param console the console which we want to get the visibility status of
722 * @param newVisibleState the visibility status we want to set to the console (true to set the console visible, false else)
723 * @see org.scilab.modules.ihm.UIElement#isVisible()
725 public static void setVisible(Console console, boolean newVisibleState) {
726 ScilabConsoleBridge.setVisible(console, newVisibleState);
730 * Sets the dimensions (width and height) of a Scilab console
731 * @param console the console which we want to set the dimensions of
732 * @param newSize the size we want to set to the console
733 * @see org.scilab.modules.ihm.UIElement#setDims(org.scilab.modules.ihm.utils.Size)
735 public static void setDims(Console console, Size newSize) {
736 ScilabConsoleBridge.setDims(console, newSize);
740 * Sets the position (X-coordinate and Y-coordinate) of a Scilab console
741 * @param console the console which we want to set the position of
742 * @param newPosition the position we want to set to the console
743 * @see org.scilab.modules.ihm.UIElement#setPosition(org.scilab.modules.ihm.utils.Position)
745 public static void setPosition(Console console, Position newPosition) {
746 ScilabConsoleBridge.setPosition(console, newPosition);
750 * Sets the visibility status of a Scilab console
751 * @param console the console which we want to set the visibility status of
752 * @param newVisibleState the visibility status we want to set to the console
753 * @see org.scilab.modules.ihm.UIElement#setVisible(boolean)
755 public static void setPosition(Console console, boolean newVisibleState) {
756 ScilabConsoleBridge.setVisible(console, newVisibleState);
760 * Clears the console (no more scroll history and prompt on top left corner)
761 * @param console the console to be cleared
763 public static void clear(Console console) {
764 ScilabConsoleBridge.clear(console);
768 * Clears lines from the end of the output view
769 * @param console the console to be cleared
770 * @param nbLines the number of lines to be deleted
772 public static void clear(Console console, int nbLines) {
773 ScilabConsoleBridge.clear(console, nbLines);
777 * Puts the prompt in the top left corner of the console
778 * @param console the console used
780 public static void toHome(Console console) {
781 ScilabConsoleBridge.toHome(console);
785 * Reads one user input char
786 * @param console the console used to get the char
787 * @return the data entered by the user
788 * @see fr.scilab.console.HelpBrowser#getCharWithoutOutput()
790 public static int getCharWithoutOutput(Console console) {
791 return ScilabConsoleBridge.getCharWithoutOutput(console);
795 * Sets the prompt displayed in the console
796 * @param console the console where the prompt is set
797 * @param prompt the prompt to be displayed in the console
799 public static void setPrompt(Console console, String prompt) {
800 ScilabConsoleBridge.setPrompt(console, prompt);
804 * Updates Scilab internal variables containing the size of the console
805 * These variables are used to format data before displaying it
806 * @param console object we want to get the size of
808 public static void scilabLinesUpdate(Console console) {
809 ScilabConsoleBridge.scilabLinesUpdate(console);
813 * Get the current status of the console
814 * If the prompt view is visible, Scilab is waiting for commands
815 * @param console object we want to get the status of
816 * @return true is Scilab is waiting for commands
818 public static boolean isWaitingForInput(Console console) {
819 return ScilabConsoleBridge.isWaitingForInput(console);
823 * Clear the commands history
824 * @param console the console we want to clear the history of
826 public static void clearHistory(Console console) {
827 ScilabConsoleBridge.clearHistory(console);
831 * Select all the console contents
832 * @param console the console
834 public static void selectAll(Console console) {
835 ScilabConsoleBridge.selectAll(console);
839 * Put the console selected text in the clipboard
840 * @param console the console
842 public static void copyToClipboard(Console console) {
843 ScilabConsoleBridge.copyToClipboard(console);
847 * Paste clipboard contents in Console input line
848 * @param console the console
850 public static void pasteClipboard(Console console) {
851 ScilabConsoleBridge.pasteClipboard(console);
855 * Cut selected text in the Console input line
856 * @param console the console
858 public static void cutSelection(Console console) {
859 ScilabConsoleBridge.cutSelection(console);
863 * Set the font of the Console
864 * @param console the console
865 * @param font the font to set
867 public static void setFont(Console console, Font font) {
868 ScilabConsoleBridge.setFont(console, font);
872 * Get the font of the Console
873 * @param console the console
876 public static Font getFont(Console console) {
877 return ScilabConsoleBridge.getFont(console);
881 * Get the Foreground Color of the Console
882 * @param console the console
883 * @return the Foreground Color
885 public static Color getForeground(Console console) {
886 return ScilabConsoleBridge.getForeground(console);
890 * Get the Background Color of the Console
891 * @param console the console
892 * @return the Background Color
894 public static Color getBackground(Console console) {
895 return ScilabConsoleBridge.getBackground(console);
899 * Set the Foreground Color of the Console
900 * @param console the console
901 * @param color the Foreground Color
903 public static void setForeground(Console console, Color color) {
904 ScilabConsoleBridge.setForeground(console, color);
908 * Set the Background Color of the Console
909 * @param console the console
910 * @param color the Background Color
912 public static void setBackground(Console console, Color color) {
913 ScilabConsoleBridge.setBackground(console, color);
917 * Set the maximum number of lines stored in the Output
918 * @param console the console
919 * @param nbLines the number of lines
921 public static void setMaxOutputSize(Console console, int nbLines) {
922 ScilabConsoleBridge.setMaxOutputSize(console, nbLines);
926 * Set the cursor pointer over the Console
927 * @param console the console
928 * @param cursor the Cursor to set
930 public static void setCursor(Console console, Cursor cursor) {
931 ScilabConsoleBridge.setCursor(console, cursor);
939 * Creates a Scilab Canvas
940 * @param figureIndex index of the displayed figure
941 * @param antialiasingQuality Specify the number of pass to use for antialiasing.
942 * If its value is 0, then antialiasing is disable.
943 * @return the created canvas
945 public static SimpleCanvas createCanvas(int figureIndex, int antialiasingQuality) {
946 return ScilabCanvasBridge.createCanvas(figureIndex, antialiasingQuality);
950 * Draws a Scilab canvas
951 * @param canvas the canvas to draw
952 * @see org.scilab.modules.ihm.UIElement#draw()
954 public static void draw(Canvas canvas) {
955 ScilabCanvasBridge.draw(canvas);
959 * Gets the dimensions (width and height) of a Scilab Canvas
960 * @param canvas the canvas we want to get the dimensions of
961 * @return the size of the canvas
962 * @see org.scilab.modules.ihm.UIElement#getDims()
964 public static Size getDims(Canvas canvas) {
965 return ScilabCanvasBridge.getDims(canvas);
969 * Gets the position (X-coordinate and Y-coordinate) of a Scilab canvas
970 * @param canvas the canvas we want to get the position of
971 * @return the position of the canvas
972 * @see org.scilab.modules.ihm.UIElement#getPosition()
974 public static Position getPosition(Canvas canvas) {
975 return ScilabCanvasBridge.getPosition(canvas);
979 * Gets the visibility status of a Scilab Canvas
980 * @param canvas the canvas we want to get the visiblity status of
981 * @return the visibility status of the canvas (true if the canvas is visible, false if not)
982 * @see org.scilab.modules.ihm.UIElement#isVisible()
984 public static boolean isVisible(Canvas canvas) {
985 return ScilabCanvasBridge.isVisible(canvas);
989 * Sets the dimensions (width and height) of a Scilab Canvas
990 * @param canvas the canvas we want to set the dimensions of
991 * @param newSize the size we want to set to the canvas
992 * @see org.scilab.modules.ihm.UIElement#setDims(org.scilab.modules.ihm.utils.Size)
994 public static void setDims(Canvas canvas, Size newSize) {
995 ScilabCanvasBridge.setDims(canvas, newSize);
999 * Sets the position (X-coordinate and Y-coordinate) of a Scilab canvas
1000 * @param canvas the canvas we want to set the position of
1001 * @param newPosition the position we want to set to the canvas
1002 * @see org.scilab.modules.ihm.UIElement#setPosition(org.scilab.modules.ihm.utils.Position)
1004 public static void setPosition(Canvas canvas, Position newPosition) {
1005 ScilabCanvasBridge.setPosition(canvas, newPosition);
1009 * Sets the visibility status of a Scilab Canvas
1010 * @param canvas the canvas we want to set the visiblity status of
1011 * @param newVisibleState the visibility status we want to set to the canvas (true to set the canvas visible, false else)
1012 * @see org.scilab.modules.ihm.UIElement#setVisible(boolean)
1014 public static void setVisible(Canvas canvas, boolean newVisibleState) {
1015 ScilabCanvasBridge.setVisible(canvas, newVisibleState);
1019 * @param canvas the canvas we want to display
1021 public static void display(Canvas canvas) {
1022 ScilabCanvasBridge.display(canvas);
1026 * @param canvas the canvas we want to get the GL object from
1027 * @return a GL object
1029 public static GL getGL(Canvas canvas) {
1030 return ScilabCanvasBridge.getGL(canvas);
1034 * @param canvas the canvas of which we want to set the swap buffer mode.
1035 * @param onOrOff set wether the swap buffer mode is on or off.
1037 public static void setAutoSwapBufferMode(Canvas canvas, boolean onOrOff) {
1038 ScilabCanvasBridge.setAutoSwapBufferMode(canvas, onOrOff);
1042 * @param canvas the canvas from which we want to retrieve the swap buffer mode.
1043 * @return set wether the swap buffer mode is on or off.
1045 public static boolean getAutoSwapBufferMode(Canvas canvas) {
1046 return ScilabCanvasBridge.getAutoSwapBufferMode(canvas);
1050 * @param canvas the canvas we want to repaint
1052 public static void repaint(Canvas canvas) {
1053 ScilabCanvasBridge.repaint(canvas);
1058 * Set the background of the Canvas.
1059 * @param canvas the canvas we want to modify
1060 * @param red red channel
1061 * @param green green channel
1062 * @param blue blue channel
1064 public static void setBackgroundColor(Canvas canvas, double red, double green, double blue) {
1065 ScilabCanvasBridge.setBackgroundColor(canvas, red, green, blue);
1069 * Disable the canvas before closing
1070 * @param canvas canvas to close
1072 public static void close(Canvas canvas) {
1073 ScilabCanvasBridge.close(canvas);
1077 * Dump the scilabCanvas to an BufferedImage
1078 * @param scilabCanvas ScilabCanvas
1079 * @return a BufferedImage
1081 public static BufferedImage dumpAsBufferedImage(ScilabCanvas scilabCanvas) {
1082 return ScilabCanvasBridge.dumpAsBufferedImage(scilabCanvas);
1086 * Set double buffer mode on or Off
1087 * @param useSingleBuffer if true use single buffer if false use double buffering
1088 * @param canvas canvas to modify
1090 public static void setSingleBuffered(Canvas canvas, boolean useSingleBuffer) {
1091 ScilabCanvasBridge.setSingleBuffered(canvas, useSingleBuffer);
1095 /* MenuBar Bridge */
1099 * Creates a new MenuBar
1100 * @return the created MenuBar
1102 public static SimpleMenuBar createMenuBar() {
1103 return ScilabMenuBarBridge.createMenuBar();
1107 * Append a Menu to a MenuBar
1108 * @param menuBar the MenuBar which we want to add the newMenu to
1109 * @param newMenu the Menu to add to the MenuBar
1111 public static void add(MenuBar menuBar, Menu newMenu) {
1112 ScilabMenuBarBridge.add(menuBar, newMenu);
1116 /* MenuItem Bridge */
1120 * Creates a new MenuItem
1121 * @return the created MenuItem
1123 public static SimpleMenuItem createMenuItem() {
1124 return createMenuItem(true);
1128 * Creates a new MenuItem
1129 * @param autoCheckedMode if false, menu checking is managed by the user (and not automatically by Java)
1130 * @return the created MenuItem
1132 public static SimpleMenuItem createMenuItem(boolean autoCheckedMode) {
1133 return ScilabMenuItemBridge.createMenuItem(autoCheckedMode);
1137 * Sets the Text of a MenuItem
1138 * @param menuItem the MenuItem we want to set the Text of
1139 * @param newText the Text to set for the MenuItem
1141 public static void setText(MenuItem menuItem, String newText) {
1142 ScilabMenuItemBridge.setText(menuItem, newText);
1146 * set a mnemonic to a MenuItem
1147 * @param menuItem the MenuItem which we want to add the mnemonic to
1148 * @param mnemonic the mnemonic to add to the MenuItem
1150 public static void setMnemonic(MenuItem menuItem, char mnemonic) {
1151 ScilabMenuItemBridge.setMnemonic(menuItem, mnemonic);
1155 * Add a callback to the menu, this callback is a Scilab command
1156 * @param menuItem the MenuItem which we want to add the mnemonic to
1157 * @param callback the CallBack to set.
1159 public static void setCallback(MenuItem menuItem, CommonCallBack callback) {
1160 ScilabMenuItemBridge.setCallback(menuItem, callback);
1164 * Set if the menu item is enabled or not
1165 * @param menuItem the MenuItem which we want to set the status of
1166 * @param status true if the menu item is enabled
1168 public static void setEnabled(MenuItem menuItem, boolean status) {
1169 ScilabMenuItemBridge.setEnabled(menuItem, status);
1173 * Get the enable status of a MenuItem
1174 * @param menuItem the MenuItem which we want to get the status of
1175 * @return the enable status of the MenuItem (true if the MenuItem is enabled, false if not)
1177 public static boolean isEnabled(MenuItem menuItem) {
1178 return ScilabMenuItemBridge.isEnabled(menuItem);
1182 * Get the text to a MenuItem
1183 * @param menuItem the MenuItem which we want to get the text of
1184 * @return the text of the MenuItem
1186 public static String getText(MenuItem menuItem) {
1187 return ScilabMenuItemBridge.getText(menuItem);
1191 * set a mnemonic to a MenuItem
1192 * @param menuItem the MenuItem which we want to set the mnemonic to
1193 * @param mnemonic the new mnemonic to set to the MenuItem
1195 public static void setMnemonic(MenuItem menuItem, int mnemonic) {
1196 ScilabMenuItemBridge.setMnemonic(menuItem, mnemonic);
1200 * Sets the visibility status of a Scilab MenuItem
1201 * @param menuItem the MenuItem we want to set the visiblity status of
1202 * @param newVisibleState the visibility status we want to set to the MenuItem (true to set the MenuItem visible, false else)
1203 * @see org.scilab.modules.ihm.UIElement#setVisible(boolean)
1205 public static void setVisible(MenuItem menuItem, boolean newVisibleState) {
1206 ScilabMenuItemBridge.setVisible(menuItem, newVisibleState);
1210 * Gets the visibility status of a Scilab MenuItem
1211 * @param menuItem the MenuItem we want to get the visiblity status of
1212 * @return the visibility status of the MenuItem (true if the MenuItem is visible, false if not)
1213 * @see org.scilab.modules.ihm.UIElement#isVisible()
1215 public static boolean isVisible(MenuItem menuItem) {
1216 return ScilabMenuItemBridge.isVisible(menuItem);
1220 * Set the Background color of the MenuItem
1221 * @param menuItem the MenuItem we want to set the background of
1222 * @param color the Color
1224 public static void setBackground(MenuItem menuItem, Color color) {
1225 ScilabMenuItemBridge.setBackground(menuItem, color);
1229 * Get the Background color of the MenuItem
1230 * @param menuItem the MenuItem we want to get the background of
1233 public static Color getBackground(MenuItem menuItem) {
1234 return ScilabMenuItemBridge.getBackground(menuItem);
1238 * Set the Foreground color of the MenuItem
1239 * @param menuItem the MenuItem we want to set the foreground of
1240 * @param color the Color
1242 public static void setForeground(MenuItem menuItem, Color color) {
1243 ScilabMenuItemBridge.setForeground(menuItem, color);
1247 * Get the Foreground color of the MenuItem
1248 * @param menuItem the MenuItem we want to get the foreground of
1251 public static Color getForeground(MenuItem menuItem) {
1252 return ScilabMenuItemBridge.getForeground(menuItem);
1256 * Set the font of the MenuItem.
1257 * @param menuItem the MenuItem we want to set the font of
1258 * @param font the font
1260 public static void setFont(MenuItem menuItem, Font font) {
1261 ScilabMenuItemBridge.setFont(menuItem, font);
1265 * Get the font of the MenuItem.
1266 * @param menuItem the MenuItem we want to get the font of
1269 public static Font getFont(MenuItem menuItem) {
1270 return ScilabMenuItemBridge.getFont(menuItem);
1274 * Set the horizontal alignment for the MenuItem text
1275 * @param menuItem the MenuItem we want to set the alignment of
1276 * @param alignment the value for the alignment (See ScilabAlignment.java)
1278 public static void setHorizontalAlignment(MenuItem menuItem, String alignment) {
1279 ScilabMenuItemBridge.setHorizontalAlignment(menuItem, alignment);
1283 * Set the vertical alignment for the MenuItem text
1284 * @param menuItem the MenuItem we want to set the alignment of
1285 * @param alignment the value for the alignment (See ScilabAlignment.java)
1287 public static void setVerticalAlignment(MenuItem menuItem, String alignment) {
1288 ScilabMenuItemBridge.setVerticalAlignment(menuItem, alignment);
1292 * Set the Relief of the MenuItem
1293 * @param menuItem the MenuItem which we want to set the Relief of
1294 * @param reliefType the type of the relief to set (See ScilabRelief.java)
1296 public static void setRelief(MenuItem menuItem, String reliefType) {
1297 ScilabMenuItemBridge.setRelief(menuItem, reliefType);
1301 * Add a MenuItem to the MenuItem
1302 * @param parentMenuItem the MenuItem where we want to add a MenuItem
1303 * @param childMenuItem the MenuItem we want to add
1305 public static void add(MenuItem parentMenuItem, MenuItem childMenuItem) {
1306 ScilabMenuItemBridge.add(parentMenuItem, childMenuItem);
1310 * Add a Menu to the MenuItem
1311 * @param parentMenuItem the MenuItem where we want to add a MenuItem
1312 * @param childMenu the Menu we want to add
1314 public static void add(MenuItem parentMenuItem, Menu childMenu) {
1315 ScilabMenuItemBridge.add(parentMenuItem, childMenu);
1319 * Destroy the MenuItem
1320 * @param menuItem the MenuItem to be destroyed
1322 public static void destroy(MenuItem menuItem) {
1323 ScilabMenuItemBridge.destroy(menuItem);
1327 * Give the focus to the MenuItem
1328 * @param menuItem the MenuItem
1330 public static void requestFocus(MenuItem menuItem) {
1331 ScilabMenuItemBridge.requestFocus(menuItem);
1335 * Retrieve the CallBack associated to this MenuItem
1336 * @param menuItem the MenuItem
1337 * @return the CallBack
1339 public static CommonCallBack getCallback(MenuItem menuItem) {
1340 return ScilabMenuItemBridge.getCallback(menuItem);
1344 * Set if the MenuItem is checked or not
1345 * @param menuItem the MenuItem
1346 * @param status true if the MenuItem is checked
1348 public static void setChecked(MenuItem menuItem, boolean status) {
1349 ScilabMenuItemBridge.setChecked(menuItem, status);
1353 * Get if the MenuItem is checked or not
1354 * @param menuItem the MenuItem
1355 * @return true if the MenuItem is checked
1357 public static boolean isChecked(MenuItem menuItem) {
1358 return ScilabMenuItemBridge.isChecked(menuItem);
1361 /****************************/
1362 /* CheckBox MenuItem Bridge */
1363 /****************************/
1366 * Creates a new CheckBoxMenuItem
1367 * @return the created CheckBoxMenuItem
1369 public static SimpleCheckBoxMenuItem createCheckBoxMenuItem() {
1370 return createCheckBoxMenuItem(true);
1374 * Creates a new CheckBoxMenuItem
1375 * @param autoCheckedMode if false, menu checking is managed by the user (and not automatically by Java)
1376 * @return the created CheckBoxMenuItem
1378 public static SimpleCheckBoxMenuItem createCheckBoxMenuItem(boolean autoCheckedMode) {
1379 return ScilabCheckBoxMenuItemBridge.createCheckBoxMenuItem(autoCheckedMode);
1383 * Add a MenuItem to the CheckBoxMenuItem
1384 * @param parentMenuItem the MenuItem where we want to add a CheckBoxMenuItem
1385 * @param childMenuItem the MenuItem we want to add
1387 public static void add(CheckBoxMenuItem parentMenuItem, MenuItem childMenuItem) {
1388 ScilabMenuItemBridge.add(parentMenuItem, childMenuItem);
1392 * Sets the Text of a CheckBoxMenuItem
1393 * @param checkBoxMenuItem the CheckBoxMenuItem we want to set the Text of
1394 * @param newText the Text to set for the CheckBoxMenuItem
1396 public static void setText(CheckBoxMenuItem checkBoxMenuItem, String newText) {
1397 ScilabCheckBoxMenuItemBridge.setText(checkBoxMenuItem, newText);
1401 * set a mnemonic to a CheckBoxMenuItem
1402 * @param checkBoxMenuItem the CheckBoxMenuItem which we want to add the mnemonic to
1403 * @param mnemonic the mnemonic to add to the CheckBoxMenuItem
1405 public static void setMnemonic(CheckBoxMenuItem checkBoxMenuItem, char mnemonic) {
1406 ScilabCheckBoxMenuItemBridge.setMnemonic(checkBoxMenuItem, mnemonic);
1410 * Add a callback to the menu, this callback is a Scilab command
1411 * @param checkBoxMenuItem the CheckBoxMenuItem which we want to add the mnemonic to
1412 * @param callback the CallBack to set.
1414 public static void setCallback(CheckBoxMenuItem checkBoxMenuItem, CommonCallBack callback) {
1415 ScilabCheckBoxMenuItemBridge.setCallback(checkBoxMenuItem, callback);
1419 * Set if the menu item is enabled or not
1420 * @param checkBoxMenuItem the CheckBoxMenuItem which we want to set the status of
1421 * @param status true if the menu item is enabled
1423 public static void setEnabled(CheckBoxMenuItem checkBoxMenuItem, boolean status) {
1424 ScilabCheckBoxMenuItemBridge.setEnabled(checkBoxMenuItem, status);
1428 * Get the enable status of a CheckBoxMenuItem
1429 * @param checkBoxMenuItem the CheckBoxMenuItem which we want to get the status of
1430 * @return the enable status of the CheckBoxMenuItem (true if the CheckBoxMenuItem is enabled, false if not)
1432 public static boolean isEnabled(CheckBoxMenuItem checkBoxMenuItem) {
1433 return ScilabCheckBoxMenuItemBridge.isEnabled(checkBoxMenuItem);
1437 * Get the text to a CheckBoxMenuItem
1438 * @param checkBoxMenuItem the CheckBoxMenuItem which we want to get the text of
1439 * @return the text of the CheckBoxMenuItem
1441 public static String getText(CheckBoxMenuItem checkBoxMenuItem) {
1442 return ScilabCheckBoxMenuItemBridge.getText(checkBoxMenuItem);
1446 * set a mnemonic to a CheckBoxMenuItem
1447 * @param checkBoxMenuItem the CheckBoxMenuItem which we want to set the mnemonic to
1448 * @param mnemonic the new mnemonic to set to the CheckBoxMenuItem
1450 public static void setMnemonic(CheckBoxMenuItem checkBoxMenuItem, int mnemonic) {
1451 ScilabCheckBoxMenuItemBridge.setMnemonic(checkBoxMenuItem, mnemonic);
1455 * Sets the visibility status of a Scilab CheckBoxMenuItem
1456 * @param checkBoxMenuItem the CheckBoxMenuItem we want to set the visiblity status of
1457 * @param newVisibleState the visibility status we want to set to the CheckBoxMenuItem (true to set the CheckBoxMenuItem visible, false else)
1458 * @see org.scilab.modules.ihm.UIElement#setVisible(boolean)
1460 public static void setVisible(CheckBoxMenuItem checkBoxMenuItem, boolean newVisibleState) {
1461 ScilabCheckBoxMenuItemBridge.setVisible(checkBoxMenuItem, newVisibleState);
1465 * Gets the visibility status of a Scilab CheckBoxMenuItem
1466 * @param checkBoxMenuItem the CheckBoxMenuItem we want to get the visiblity status of
1467 * @return the visibility status of the CheckBoxMenuItem (true if the CheckBoxMenuItem is visible, false if not)
1468 * @see org.scilab.modules.ihm.UIElement#isVisible()
1470 public static boolean isVisible(CheckBoxMenuItem checkBoxMenuItem) {
1471 return ScilabCheckBoxMenuItemBridge.isVisible(checkBoxMenuItem);
1475 * Set the Background color of the CheckBoxMenuItem
1476 * @param checkBoxMenuItem the CheckBoxMenuItem we want to set the background of
1477 * @param color the Color
1479 public static void setBackground(CheckBoxMenuItem checkBoxMenuItem, Color color) {
1480 ScilabCheckBoxMenuItemBridge.setBackground(checkBoxMenuItem, color);
1484 * Get the Background color of the CheckBoxMenuItem
1485 * @param checkBoxMenuItem the CheckBoxMenuItem we want to get the background of
1488 public static Color getBackground(CheckBoxMenuItem checkBoxMenuItem) {
1489 return ScilabCheckBoxMenuItemBridge.getBackground(checkBoxMenuItem);
1493 * Set the Foreground color of the CheckBoxMenuItem
1494 * @param checkBoxMenuItem the CheckBoxMenuItem we want to set the foreground of
1495 * @param color the Color
1497 public static void setForeground(CheckBoxMenuItem checkBoxMenuItem, Color color) {
1498 ScilabCheckBoxMenuItemBridge.setForeground(checkBoxMenuItem, color);
1502 * Get the Foreground color of the CheckBoxMenuItem
1503 * @param checkBoxMenuItem the CheckBoxMenuItem we want to get the foreground of
1506 public static Color getForeground(CheckBoxMenuItem checkBoxMenuItem) {
1507 return ScilabCheckBoxMenuItemBridge.getForeground(checkBoxMenuItem);
1511 * Set the font of the CheckBoxMenuItem.
1512 * @param checkBoxMenuItem the CheckBoxMenuItem we want to set the font of
1513 * @param font the font
1515 public static void setFont(CheckBoxMenuItem checkBoxMenuItem, Font font) {
1516 ScilabCheckBoxMenuItemBridge.setFont(checkBoxMenuItem, font);
1520 * Get the font of the CheckBoxMenuItem.
1521 * @param checkBoxMenuItem the CheckBoxMenuItem we want to get the font of
1524 public static Font getFont(CheckBoxMenuItem checkBoxMenuItem) {
1525 return ScilabCheckBoxMenuItemBridge.getFont(checkBoxMenuItem);
1529 * Set the horizontal alignment for the CheckBoxMenuItem text
1530 * @param checkBoxMenuItem the CheckBoxMenuItem we want to set the alignment of
1531 * @param alignment the value for the alignment (See ScilabAlignment.java)
1533 public static void setHorizontalAlignment(CheckBoxMenuItem checkBoxMenuItem, String alignment) {
1534 ScilabCheckBoxMenuItemBridge.setHorizontalAlignment(checkBoxMenuItem, alignment);
1538 * Set the vertical alignment for the CheckBoxMenuItem text
1539 * @param checkBoxMenuItem the CheckBoxMenuItem we want to set the alignment of
1540 * @param alignment the value for the alignment (See ScilabAlignment.java)
1542 public static void setVerticalAlignment(CheckBoxMenuItem checkBoxMenuItem, String alignment) {
1543 ScilabCheckBoxMenuItemBridge.setVerticalAlignment(checkBoxMenuItem, alignment);
1547 * Set the Relief of the CheckBoxMenuItem
1548 * @param checkBoxMenuItem the CheckBoxMenuItem which we want to set the Relief of
1549 * @param reliefType the type of the relief to set (See ScilabRelief.java)
1551 public static void setRelief(CheckBoxMenuItem checkBoxMenuItem, String reliefType) {
1552 ScilabCheckBoxMenuItemBridge.setRelief(checkBoxMenuItem, reliefType);
1556 * Add a CheckBoxMenuItem to the CheckBoxMenuItem
1557 * @param parentCheckBoxMenuItem the CheckBoxMenuItem where we want to add a CheckBoxMenuItem
1558 * @param childCheckBoxMenuItem the CheckBoxMenuItem we want to add
1560 public static void add(CheckBoxMenuItem parentCheckBoxMenuItem, CheckBoxMenuItem childCheckBoxMenuItem) {
1561 ScilabCheckBoxMenuItemBridge.add(parentCheckBoxMenuItem, childCheckBoxMenuItem);
1565 * Add a Menu to the CheckBoxMenuItem
1566 * @param parentCheckBoxMenuItem the CheckBoxMenuItem where we want to add a CheckBoxMenuItem
1567 * @param childMenu the Menu we want to add
1569 public static void add(CheckBoxMenuItem parentCheckBoxMenuItem, Menu childMenu) {
1570 ScilabCheckBoxMenuItemBridge.add(parentCheckBoxMenuItem, childMenu);
1574 * Destroy the CheckBoxMenuItem
1575 * @param checkBoxMenuItem the CheckBoxMenuItem to be destroyed
1577 public static void destroy(CheckBoxMenuItem checkBoxMenuItem) {
1578 ScilabCheckBoxMenuItemBridge.destroy(checkBoxMenuItem);
1582 * Give the focus to the CheckBoxMenuItem
1583 * @param checkBoxMenuItem the CheckBoxMenuItem
1585 public static void requestFocus(CheckBoxMenuItem checkBoxMenuItem) {
1586 ScilabCheckBoxMenuItemBridge.requestFocus(checkBoxMenuItem);
1590 * Retrieve the CallBack associated to this CheckBoxMenuItem
1591 * @param checkBoxMenuItem the CheckBoxMenuItem
1592 * @return the CallBack
1594 public static CommonCallBack getCallback(CheckBoxMenuItem checkBoxMenuItem) {
1595 return ScilabCheckBoxMenuItemBridge.getCallback(checkBoxMenuItem);
1599 * Set if the CheckBoxMenuItem is checked or not
1600 * @param checkBoxMenuItem the CheckBoxMenuItem
1601 * @param status true if the CheckBoxMenuItem is checked
1603 public static void setChecked(CheckBoxMenuItem checkBoxMenuItem, boolean status) {
1604 ScilabCheckBoxMenuItemBridge.setChecked(checkBoxMenuItem, status);
1608 * Get if the CheckBoxMenuItem is checked or not
1609 * @param checkBoxMenuItem the CheckBoxMenuItem
1610 * @return true if the CheckBoxMenuItem is checked
1612 public static boolean isChecked(CheckBoxMenuItem checkBoxMenuItem) {
1613 return ScilabCheckBoxMenuItemBridge.isChecked(checkBoxMenuItem);
1621 * Creates a new Menu
1622 * @return the created Menu
1624 public static SimpleMenu createMenu() {
1625 return ScilabMenuBridge.createMenu();
1629 * Retrieve the CallBack associated to this Menu
1630 * @param menu the Menu
1631 * @return the CallBack
1633 public static CommonCallBack getCallback(Menu menu) {
1634 return ScilabMenuBridge.getCallback(menu);
1638 * Append a MenuItem to a Menu
1639 * @param menu the Menu which we want to add the MenuItem to
1640 * @param newMenuItem the MenuItem to add to the Menu
1642 public static void add(Menu menu, MenuItem newMenuItem) {
1643 ScilabMenuBridge.add(menu, newMenuItem);
1647 * Append a CheckBoxMenuItem to a Menu
1648 * @param menu the Menu which we want to add the CheckBoxMenuItem to
1649 * @param newCheckBoxMenuItem the MenuItem to add to the Menu
1651 public static void add(Menu menu, CheckBoxMenuItem newCheckBoxMenuItem) {
1652 ScilabMenuBridge.add(menu, newCheckBoxMenuItem);
1656 * Append a Menu to a Menu
1657 * @param menu the Menu which we want to append the Menu to
1658 * @param newSubMenu the Menu to append to the Menu
1660 public static void add(Menu menu, Menu newSubMenu) {
1661 ScilabMenuBridge.add(menu, newSubMenu);
1665 * set a text to a menu
1666 * @param menu the Menu which we want to set the text to
1667 * @param newText the new text to set to the menu
1669 public static void setText(Menu menu, String newText) {
1670 ScilabMenuBridge.setText(menu, newText);
1674 * Get the text to a menu
1675 * @param menu the Menu which we want to get the text of
1676 * @return the text of the menu
1678 public static String getText(Menu menu) {
1679 return ScilabMenuBridge.getText(menu);
1683 * set a mnemonic to a menu
1684 * @param menu the Menu which we want to set the mnemonic to
1685 * @param mnemonic the new mnemonic to set to the menu
1687 public static void setMnemonic(Menu menu, int mnemonic) {
1688 ScilabMenuBridge.setMnemonic(menu, mnemonic);
1692 * Add a Separator to a Menu
1693 * @param menu the Menu which we want to add the Separator to
1695 public static void addSeparator(Menu menu) {
1696 ScilabMenuBridge.addSeparator(menu);
1700 * Set if the menu is enabled or not
1701 * @param menu the menu which we want to set the status of
1702 * @param status true if the menu item is enabled
1704 public static void setEnabled(Menu menu, boolean status) {
1705 ScilabMenuBridge.setEnabled(menu, status);
1709 * Gets the enable status of a Menu
1710 * @param menu the menu which we want to get the status of
1711 * @return the enable status of the Menu (true if the Menu is enabled, false if not)
1713 public static boolean isEnabled(Menu menu) {
1714 return ScilabMenuBridge.isEnabled(menu);
1718 * Sets the visibility status of a Scilab menu
1719 * @param menu the menu we want to set the visiblity status of
1720 * @param newVisibleState the visibility status we want to set to the menu (true to set the menu visible, false else)
1721 * @see org.scilab.modules.ihm.UIElement#setVisible(boolean)
1723 public static void setVisible(Menu menu, boolean newVisibleState) {
1724 ScilabMenuBridge.setVisible(menu, newVisibleState);
1728 * Gets the visibility status of a Scilab Menu
1729 * @param menu the menu we want to get the visiblity status of
1730 * @return the visibility status of the menu (true if the menu is visible, false if not)
1731 * @see org.scilab.modules.ihm.UIElement#isVisible()
1733 public static boolean isVisible(Menu menu) {
1734 return ScilabMenuBridge.isVisible(menu);
1738 * Set the Background color of the menu
1739 * @param menu the menu we want to set the background of
1740 * @param color the Color
1742 public static void setBackground(Menu menu, Color color) {
1743 ScilabMenuBridge.setBackground(menu, color);
1747 * Get the Background color of the menu
1748 * @param menu the menu we want to get the background of
1751 public static Color getBackground(Menu menu) {
1752 return ScilabMenuBridge.getBackground(menu);
1756 * Set the Foreground color of the menu
1757 * @param menu the menu we want to set the foreground of
1758 * @param color the Color
1760 public static void setForeground(Menu menu, Color color) {
1761 ScilabMenuBridge.setForeground(menu, color);
1765 * Get the Foreground color of the menu
1766 * @param menu the menu we want to get the foreground of
1769 public static Color getForeground(Menu menu) {
1770 return ScilabMenuBridge.getForeground(menu);
1774 * Set the font of the menu.
1775 * @param menu the menu we want to set the font of
1776 * @param font the font
1778 public static void setFont(Menu menu, Font font) {
1779 ScilabMenuBridge.setFont(menu, font);
1783 * Get the font of the menu.
1784 * @param menu the menu we want to get the font of
1787 public static Font getFont(Menu menu) {
1788 return ScilabMenuBridge.getFont(menu);
1792 * Add a callback to the menu, this callback is a Scilab command
1793 * @param menu the menu we want to set the callback of
1794 * @param callback the CallBack to set.
1796 public static void setCallback(Menu menu, CommonCallBack callback) {
1797 ScilabMenuBridge.setCallback(menu, callback);
1801 * Set the horizontal alignment for the Menu text
1802 * @param menu the Menu we want to set the alignment of
1803 * @param alignment the value for the alignment (See ScilabAlignment.java)
1805 public static void setHorizontalAlignment(Menu menu, String alignment) {
1806 ScilabMenuBridge.setHorizontalAlignment(menu, alignment);
1810 * Set the vertical alignment for the Menu text
1811 * @param menu the Menu we want to set the alignment of
1812 * @param alignment the value for the alignment (See ScilabAlignment.java)
1814 public static void setVerticalAlignment(Menu menu, String alignment) {
1815 ScilabMenuBridge.setVerticalAlignment(menu, alignment);
1819 * Set the Relief of the Menu
1820 * @param menu the Menu which we want to set the Relief of
1821 * @param reliefType the type of the relief to set (See ScilabRelief.java)
1823 public static void setRelief(Menu menu, String reliefType) {
1824 ScilabMenuBridge.setRelief(menu, reliefType);
1829 * @param menu the Menu to be destroyed
1831 public static void destroy(Menu menu) {
1832 ScilabMenuBridge.destroy(menu);
1836 * Give the focus to the Menu
1837 * @param menu the Menu
1839 public static void requestFocus(Menu menu) {
1840 ScilabMenuBridge.requestFocus(menu);
1844 * Set if the Menu is checked or not
1845 * @param menu the Menu
1846 * @param status true if the Menu is checked
1848 public static void setChecked(Menu menu, boolean status) {
1849 ScilabMenuBridge.setChecked(menu, status);
1853 * Get if the Menu is checked or not
1854 * @param menu the Menu
1855 * @return true if the Menu is checked
1857 public static boolean isChecked(Menu menu) {
1858 return ScilabMenuBridge.isChecked(menu);
1861 /**********************/
1862 /* ContextMenu Bridge */
1863 /**********************/
1866 * Creates a new ContextMenu
1867 * @return the created ContextMenu
1869 public static SimpleContextMenu createContextMenu() {
1870 return ScilabContextMenuBridge.createContextMenu();
1874 * Append a MenuItem to a ContextMenu
1875 * @param contextMenu the ContextMenu which we want to add the MenuItem to
1876 * @param newMenuItem the MenuItem to add to the ContextMenu
1878 public static void add(ContextMenu contextMenu, MenuItem newMenuItem) {
1879 ScilabContextMenuBridge.add(contextMenu, newMenuItem);
1883 * Append a Menu to a ContextMenu
1884 * @param contextMenu the ContextMenu which we want to add the MenuItem to
1885 * @param newMenu the Menu to add to the ContextMenu
1887 public static void add(ContextMenu contextMenu, Menu newMenu) {
1888 ScilabContextMenuBridge.add(contextMenu, newMenu);
1892 * set a text to a ContextMenu
1893 * @param contextMenu the Menu which we want to set the text to
1894 * @param newText the new text to set to the contextMenu
1896 public static void setText(ContextMenu contextMenu, String newText) {
1897 ScilabContextMenuBridge.setText(contextMenu, newText);
1901 * Get the text to a contextMenu
1902 * @param contextMenu the ContextMenu which we want to get the text of
1903 * @return the text of the contextMenu
1905 public static String getText(ContextMenu contextMenu) {
1906 return ScilabContextMenuBridge.getText(contextMenu);
1910 * Set if the contextMenu is enabled or not
1911 * @param contextMenu the contextMenu which we want to set the status of
1912 * @param status true if the contextMenu item is enabled
1914 public static void setEnabled(ContextMenu contextMenu, boolean status) {
1915 ScilabContextMenuBridge.setEnabled(contextMenu, status);
1919 * Gets the enable status of a ContextMenu
1920 * @param contextMenu the contextMenu which we want to get the status of
1921 * @return the enable status of the ContextMenu (true if the ContextMenu is enabled, false if not)
1923 public static boolean isEnabled(ContextMenu contextMenu) {
1924 return ScilabContextMenuBridge.isEnabled(contextMenu);
1928 * Sets the visibility status of a Scilab contextMenu
1929 * @param contextMenu the contextMenu we want to set the visiblity status of
1930 * @param newVisibleState the visibility status we want to set to the contextMenu (true to set the contextMenu visible, false else)
1931 * @see org.scilab.modules.ihm.UIElement#setVisible(boolean)
1933 public static void setVisible(ContextMenu contextMenu, boolean newVisibleState) {
1934 ScilabContextMenuBridge.setVisible(contextMenu, newVisibleState);
1938 * Gets the visibility status of a Scilab ContextMenu
1939 * @param contextMenu the contextMenu we want to get the visiblity status of
1940 * @return the visibility status of the contextMenu (true if the contextMenu is visible, false if not)
1941 * @see org.scilab.modules.ihm.UIElement#isVisible()
1943 public static boolean isVisible(ContextMenu contextMenu) {
1944 return ScilabContextMenuBridge.isVisible(contextMenu);
1948 * Set the Background color of the contextMenu
1949 * @param contextMenu the contextMenu we want to set the background of
1950 * @param color the Color
1952 public static void setBackground(ContextMenu contextMenu, Color color) {
1953 ScilabContextMenuBridge.setBackground(contextMenu, color);
1957 * Get the Background color of the contextMenu
1958 * @param contextMenu the contextMenu we want to get the background of
1961 public static Color getBackground(ContextMenu contextMenu) {
1962 return ScilabContextMenuBridge.getBackground(contextMenu);
1966 * Set the Foreground color of the contextMenu
1967 * @param contextMenu the contextMenu we want to set the foreground of
1968 * @param color the Color
1970 public static void setForeground(ContextMenu contextMenu, Color color) {
1971 ScilabContextMenuBridge.setForeground(contextMenu, color);
1975 * Get the Foreground color of the contextMenu
1976 * @param contextMenu the contextMenu we want to get the foreground of
1979 public static Color getForeground(ContextMenu contextMenu) {
1980 return ScilabContextMenuBridge.getForeground(contextMenu);
1984 * Set the font of the contextMenu.
1985 * @param contextMenu the contextMenu we want to set the font of
1986 * @param font the font
1988 public static void setFont(ContextMenu contextMenu, Font font) {
1989 ScilabContextMenuBridge.setFont(contextMenu, font);
1993 * Get the font of the contextMenu.
1994 * @param contextMenu the contextMenu we want to get the font of
1997 public static Font getFont(ContextMenu contextMenu) {
1998 return ScilabContextMenuBridge.getFont(contextMenu);
2002 * Add a callback to the contextMenu, this callback is a Scilab command
2003 * @param contextMenu the contextMenu we want to set the callback of
2004 * @param callback the CallBack to set.
2006 public static void setCallback(ContextMenu contextMenu, CommonCallBack callback) {
2007 ScilabContextMenuBridge.setCallback(contextMenu, callback);
2011 * Set the horizontal alignment for the ContextMenu text
2012 * @param contextMenu the ContextMenu we want to set the alignment of
2013 * @param alignment the value for the alignment (See ScilabAlignment.java)
2015 public static void setHorizontalAlignment(ContextMenu contextMenu, String alignment) {
2016 ScilabContextMenuBridge.setHorizontalAlignment(contextMenu, alignment);
2020 * Set the vertical alignment for the ContextMenu text
2021 * @param contextMenu the ContextMenu we want to set the alignment of
2022 * @param alignment the value for the alignment (See ScilabAlignment.java)
2024 public static void setVerticalAlignment(ContextMenu contextMenu, String alignment) {
2025 ScilabContextMenuBridge.setVerticalAlignment(contextMenu, alignment);
2029 * Set the Relief of the ContextMenu
2030 * @param contextMenu the ContextMenu which we want to set the Relief of
2031 * @param reliefType the type of the relief to set (See ScilabRelief.java)
2033 public static void setRelief(ContextMenu contextMenu, String reliefType) {
2034 ScilabContextMenuBridge.setRelief(contextMenu, reliefType);
2038 * Delete the ContextMenu
2039 * @param contextMenu the ContextMenu to be destroyed
2041 public static void destroy(ContextMenu contextMenu) {
2042 ScilabContextMenuBridge.destroy(contextMenu);
2046 * Give the focus to the ContextMenu
2047 * @param contextMenu the ContextMenu
2049 public static void requestFocus(ContextMenu contextMenu) {
2050 ScilabContextMenuBridge.requestFocus(contextMenu);
2053 /********************/
2054 /* Separator Bridge */
2055 /********************/
2058 * Creates a new Separator
2059 * @return the created Separator
2061 public static Separator createSeparator() {
2062 return ScilabSeparatorBridge.createSeparator();
2065 /******************/
2066 /* TextBox Bridge */
2067 /******************/
2070 * Creates a new TextBox
2071 * @return the created TextBox
2073 public static SimpleTextBox createTextBox() {
2074 return ScilabTextBoxBridge.createTextBox();
2078 * Sets the Text of a TextBox
2079 * @param textBox the TextBox we want to set the Text of
2080 * @param newText the Text to set for the TextBox
2082 public static void setText(TextBox textBox, String newText) {
2083 ScilabTextBoxBridge.setText(textBox, newText);
2087 * Gets the text of an TextBox
2088 * @param textBox the TextBox we want to get the text of
2089 * @return the text of the TextBox
2091 public static String getText(TextBox textBox) {
2092 return ScilabTextBoxBridge.getText(textBox);
2096 * Draws a Scilab TextBox
2097 * @param textBox the TextBox to draw
2098 * @see org.scilab.modules.ihm.UIElement#draw()
2100 public static void draw(TextBox textBox) {
2101 ScilabTextBoxBridge.draw(textBox);
2105 * Gets the dimensions (width and height) of a Scilab TextBox
2106 * @param textBox the TextBox we want to get the dimensions of
2107 * @return the size of the textBox
2108 * @see org.scilab.modules.ihm.UIElement#getDims()
2110 public static Size getDims(TextBox textBox) {
2111 return ScilabTextBoxBridge.getDims(textBox);
2115 * Gets the position (X-coordinate and Y-coordinate) of a Scilab textBox
2116 * @param textBox the textBox we want to get the position of
2117 * @return the position of the textBox
2118 * @see org.scilab.modules.ihm.UIElement#getPosition()
2120 public static Position getPosition(TextBox textBox) {
2121 return ScilabTextBoxBridge.getPosition(textBox);
2125 * Gets the visibility status of a Scilab TextBox
2126 * @param textBox the textBox we want to get the visiblity status of
2127 * @return the visibility status of the textBox (true if the textBox is visible, false if not)
2128 * @see org.scilab.modules.ihm.UIElement#isVisible()
2130 public static boolean isVisible(TextBox textBox) {
2131 return ScilabTextBoxBridge.isVisible(textBox);
2135 * Set the status of the TextBox
2136 * @param textBox the textBox we want to set the status of
2137 * @param status true if the TextBox is enabled
2138 * @see org.scilab.modules.gui.widget.Widget#setEnabled(boolean)
2140 public static void setEnabled(TextBox textBox, boolean status) {
2141 ScilabTextBoxBridge.setEnabled(textBox, status);
2145 * Gets the enable status of a TextBox
2146 * @param textBox the textBox we want to get the status of
2147 * @return the enable status of the TextBox (true if the TextBox is enabled, false if not)
2149 public static boolean isEnabled(TextBox textBox) {
2150 return ScilabTextBoxBridge.isEnabled(textBox);
2154 * Sets the dimensions (width and height) of a Scilab TextBox
2155 * @param textBox the textBox we want to set the dimensions of
2156 * @param newSize the size we want to set to the textBox
2157 * @see org.scilab.modules.ihm.UIElement#setDims(org.scilab.modules.ihm.utils.Size)
2159 public static void setDims(TextBox textBox, Size newSize) {
2160 ScilabTextBoxBridge.setDims(textBox, newSize);
2164 * Sets the position (X-coordinate and Y-coordinate) of a Scilab textBox
2165 * @param textBox the textBox we want to set the position of
2166 * @param newPosition the position we want to set to the textBox
2167 * @see org.scilab.modules.ihm.UIElement#setPosition(org.scilab.modules.ihm.utils.Position)
2169 public static void setPosition(TextBox textBox, Position newPosition) {
2170 ScilabTextBoxBridge.setPosition(textBox, newPosition);
2174 * Sets the visibility status of a Scilab TextBox
2175 * @param textBox the textBox we want to set the visiblity status of
2176 * @param newVisibleState the visibility status we want to set to the textBox (true to set the textBox visible, false else)
2177 * @see org.scilab.modules.ihm.UIElement#setVisible(boolean)
2179 public static void setVisible(TextBox textBox, boolean newVisibleState) {
2180 ScilabTextBoxBridge.setVisible(textBox, newVisibleState);
2184 * Set the Background color of the textbox
2185 * @param textBox the textbox we want to set the background of
2186 * @param color the Color
2188 public static void setBackground(TextBox textBox, Color color) {
2189 ScilabTextBoxBridge.setBackground(textBox, color);
2193 * Get the Background color of the textbox
2194 * @param textBox the textbox we want to get the background of
2197 public static Color getBackground(TextBox textBox) {
2198 return ScilabTextBoxBridge.getBackground(textBox);
2202 * Set the Foreground color of the textbox
2203 * @param textBox the textbox we want to set the foreground of
2204 * @param color the Color
2206 public static void setForeground(TextBox textBox, Color color) {
2207 ScilabTextBoxBridge.setForeground(textBox, color);
2211 * Get the Foreground color of the textbox
2212 * @param textBox the textbox we want to get the foreground of
2215 public static Color getForeground(TextBox textBox) {
2216 return ScilabTextBoxBridge.getForeground(textBox);
2220 * Set the font of the textbox.
2221 * @param textBox the textbox we want to set the font of
2222 * @param font the font
2224 public static void setFont(TextBox textBox, Font font) {
2225 ScilabTextBoxBridge.setFont(textBox, font);
2229 * Get the font of the textbox.
2230 * @param textBox the textbox we want to get the font of
2233 public static Font getFont(TextBox textBox) {
2234 return ScilabTextBoxBridge.getFont(textBox);
2238 * Add a callback to the TextBox
2239 * @param textBox the TextBox we want to set the callback of
2240 * @param callback the CallBack to set.
2242 public static void setCallback(TextBox textBox, CommonCallBack callback) {
2243 ScilabTextBoxBridge.setCallback(textBox, callback);
2247 * Set the horizontal alignment for the TextBox text
2248 * @param textBox the TextBox we want to set the alignment of
2249 * @param alignment the value for the alignment (See ScilabAlignment.java)
2251 public static void setHorizontalAlignment(TextBox textBox, String alignment) {
2252 ScilabTextBoxBridge.setHorizontalAlignment(textBox, alignment);
2256 * Set the vertical alignment for the TextBox text
2257 * @param textBox the TextBox we want to set the alignment of
2258 * @param alignment the value for the alignment (See ScilabAlignment.java)
2260 public static void setVerticalAlignment(TextBox textBox, String alignment) {
2261 ScilabTextBoxBridge.setVerticalAlignment(textBox, alignment);
2265 * Set the Relief of the TextBox
2266 * @param textBox the TextBox which we want to set the Relief of
2267 * @param reliefType the type of the relief to set (See ScilabRelief.java)
2269 public static void setRelief(TextBox textBox, String reliefType) {
2270 ScilabTextBoxBridge.setRelief(textBox, reliefType);
2274 * Delete the TextBox
2275 * @param textBox the TextBox to be destroyed
2277 public static void destroy(TextBox textBox) {
2278 ScilabTextBoxBridge.destroy(textBox);
2282 * Give the focus to the TextBox
2283 * @param textBox the TextBox
2285 public static void requestFocus(TextBox textBox) {
2286 ScilabTextBoxBridge.requestFocus(textBox);
2289 /***********************/
2290 /* FileChooser Bridge */
2291 /***********************/
2294 * Create a new FileChooser
2295 * @return the created FileChooser
2297 public static SimpleFileChooser createFileChooser() {
2298 return ScilabFileChooserBridge.createFileChooser();
2302 * Create a new ExportFileChooser
2303 * @param figureID exported figure id
2304 * @return the created ExportFileChooser
2306 public static SimpleFileChooser createExportFileChooser(Integer figureUID) {
2307 return ScilabFileChooserBridge.createExportFileChooser(figureUID);
2311 * Set the title of the file chooser
2312 * @param fileChooser the file chooser we want to set the title of
2313 * @param title the title to set
2315 public static void setTitle(FileChooser fileChooser, String title) {
2316 ScilabFileChooserBridge.setTitle(fileChooser, title);
2320 * Set the initial directory used for file search
2321 * @param fileChooser the file chooser we want to set the initial directory of
2322 * @param path the default path
2324 public static void setInitialDirectory(FileChooser fileChooser, String path) {
2325 ScilabFileChooserBridge.setInitialDirectory(fileChooser, path);
2329 * Display this chooser and wait for user selection
2330 * @param fileChooser the file chooser we want to display
2332 public static void displayAndWait(FileChooser fileChooser) {
2333 ScilabFileChooserBridge.displayAndWait(fileChooser);
2337 * Get the number of files selected
2338 * @param fileChooser the file chooser we want to get the selection size of
2339 * @return the number of files selected
2341 public static int getSelectionSize(FileChooser fileChooser) {
2342 return ScilabFileChooserBridge.getSelectionSize(fileChooser);
2346 * Get the names of selected files
2347 * @param fileChooser the file chooser we want to get the selection of
2348 * @return the names of selected files
2350 public static String[] getSelection(FileChooser fileChooser) {
2351 return ScilabFileChooserBridge.getSelection(fileChooser);
2355 * Get the names of selected files
2356 * @param fileChooser the file chooser we want to get the selection of
2357 * @return the names of selected files
2359 public static String[] getSelectionFileNames(FileChooser fileChooser) {
2360 return ScilabFileChooserBridge.getSelectionFileNames(fileChooser);
2364 * Set the flag indicating that we want only select directories
2365 * @param fileChooser the file chooser we want to set the flag of
2367 public static void setDirectorySelectionOnly(FileChooser fileChooser) {
2368 ScilabFileChooserBridge.setDirectorySelectionOnly(fileChooser);
2372 * We customize the file chooser for the graphic export
2373 * by adding format selection
2375 public static void exportCustomFileChooser() {
2376 ScilabFileChooserBridge.createFileChooser();
2380 * Enable the multiple selection
2381 * @param fileChooser the file chooser we want to get the muliple selection
2382 * @param multipleSelection boolean for the multiple selection
2384 public static void setMultipleSelection(FileChooser fileChooser, boolean multipleSelection) {
2385 ScilabFileChooserBridge.setMultipleSelection(fileChooser, multipleSelection);
2389 * Get the path name of selected files
2390 * @param fileChooser the file chooser we want to get the path of selectd files
2391 * @return the path of selected files
2393 public static String getSelectionPathName(FileChooser fileChooser) {
2394 return ScilabFileChooserBridge.getSelectionPathName(fileChooser);
2398 * Set the dialog type (save or open a file ?)
2399 * @param fileChooser the file chooser we want to get the filter indexs
2400 * @param dialogType the dialog type
2402 public static void setUiDialogType(FileChooser fileChooser, int dialogType) {
2403 ScilabFileChooserBridge.setUiDialogType(fileChooser, dialogType);
2406 /*********************/
2407 /* MessageBox Bridge */
2408 /*********************/
2411 * Create a new MessageBox
2412 * @return the created MessageBox
2414 public static SimpleMessageBox createMessageBox() {
2415 return ScilabMessageBoxBridge.createMessageBox();
2419 * Set the title of the MessageBox
2420 * @param messageBox the MessageBox we want to set the title of
2421 * @param title the title to set
2423 public static void setTitle(MessageBox messageBox, String title) {
2424 ScilabMessageBoxBridge.setTitle(messageBox, title);
2428 * Set the message of the MessageBox
2429 * @param messageBox the MessageBox we want to set the mask of
2430 * @param message the message to set
2432 public static void setMessage(MessageBox messageBox, String message) {
2433 ScilabMessageBoxBridge.setMessage(messageBox, message);
2437 * Set the message of the MessageBox (multi-line)
2438 * @param messageBox the MessageBox we want to set the mask of
2439 * @param message the message to set
2441 public static void setMessage(MessageBox messageBox, String[] message) {
2442 ScilabMessageBoxBridge.setMessage(messageBox, message);
2446 * Display this MessageBox and wait for user selection
2447 * @param messageBox the MessageBox we want to display
2449 public static void displayAndWait(MessageBox messageBox) {
2450 ScilabMessageBoxBridge.displayAndWait(messageBox);
2454 * Get the index of the button clicked
2455 * @param messageBox the MessageBox we want to get the answer of
2456 * @return the index of the button clicked
2458 public static int getSelectedButton(MessageBox messageBox) {
2459 return ScilabMessageBoxBridge.getSelectedButton(messageBox);
2463 * Set the indices of the default selected buttons (x_choices)
2464 * @param messageBox the MessageBox we want to set the defaults of
2465 * @param indices the indices of the default selected buttons
2467 public static void setDefaultSelectedButtons(MessageBox messageBox, int[] indices) {
2468 ScilabMessageBoxBridge.setDefaultSelectedButtons(messageBox, indices);
2472 * Get the indices of the user selected buttons (x_choices)
2473 * @param messageBox the MessageBox we want to set the defaults of
2474 * @return the indices of the default selected buttons
2476 public static int[] getUserSelectedButtons(MessageBox messageBox) {
2477 return ScilabMessageBoxBridge.getUserSelectedButtons(messageBox);
2481 * Set the labels of the buttons in the MessageBox
2482 * @param messageBox the MessageBox we want to set the buttons labels of
2483 * @param labels the labels of the buttons
2485 public static void setButtonsLabels(MessageBox messageBox, String[] labels) {
2486 ScilabMessageBoxBridge.setButtonsLabels(messageBox, labels);
2490 * Set the initial values of the editable zone in the MessageBox
2491 * @param messageBox the MessageBox we want to set the initial value of
2492 * @param value the initial values
2494 public static void setInitialValue(MessageBox messageBox, String[] value) {
2495 ScilabMessageBoxBridge.setInitialValue(messageBox, value);
2499 * Get the value of the editable zone in the MessageBox
2500 * @param messageBox the MessageBox we want to get the value of
2503 public static String[] getValue(MessageBox messageBox) {
2504 return ScilabMessageBoxBridge.getValue(messageBox);
2508 * Get the size of the value of the editable zone in the MessageBox
2509 * @param messageBox the MessageBox we want to get the value size of
2510 * @return the value size
2512 public static int getValueSize(MessageBox messageBox) {
2513 return ScilabMessageBoxBridge.getValueSize(messageBox);
2517 * Set the items of the listbox in the MessageBox
2518 * @param messageBox the MessageBox we want to set the items of
2519 * @param items the items to set
2521 public static void setListBoxItems(MessageBox messageBox, String[] items) {
2522 ScilabMessageBoxBridge.setListBoxItems(messageBox, items);
2526 * Get the index of the selected item in the listbox in the MessageBox
2527 * @param messageBox the MessageBox we want to get the selected item of
2530 public static int getSelectedItem(MessageBox messageBox) {
2531 return ScilabMessageBoxBridge.getSelectedItem(messageBox);
2535 * Set the name of the lines labels in the editable zone in the MessageBox
2536 * @param messageBox the MessageBox we want to set the labels
2537 * @param labels the labels
2539 public static void setLineLabels(MessageBox messageBox, String[] labels) {
2540 ScilabMessageBoxBridge.setLineLabels(messageBox, labels);
2544 * Set the name of the columns labels in the editable zone in the MessageBox
2545 * @param messageBox the MessageBox we want to set the labels
2546 * @param labels the labels
2548 public static void setColumnLabels(MessageBox messageBox, String[] labels) {
2549 ScilabMessageBoxBridge.setColumnLabels(messageBox, labels);
2553 * Set the default values of a multi-value editable zone in the MessageBox
2554 * @param messageBox the MessageBox we want to set the default values
2555 * @param values the values
2557 public static void setDefaultInput(MessageBox messageBox, String[] values) {
2558 ScilabMessageBoxBridge.setDefaultInput(messageBox, values);
2562 * Set a MessageBox modal or not
2563 * @param messageBox the MessageBox we want to set the modality of
2564 * @param status true to set the MessageBox modal and false else
2566 public static void setModal(MessageBox messageBox, boolean status) {
2567 ScilabMessageBoxBridge.setModal(messageBox, status);
2571 * Set the MessageBox icon
2572 * @param messageBox the MessageBox we want to set the icon of
2573 * @param name the name of the icon
2575 public static void setIcon(MessageBox messageBox, String name) {
2576 ScilabMessageBoxBridge.setIcon(messageBox, name);
2580 * Set the component used to set the location of the MessageBox (default is Scilab Console)
2581 * @param messageBox the MessageBox we want to set the parent of
2582 * @param parent the tab to be set as parent
2584 public static void setParentForLocation(MessageBox messageBox, SimpleTab parent) {
2585 ScilabMessageBoxBridge.setParentForLocation(messageBox, parent);
2588 /***********************/
2589 /* Help Browser Bridge */
2590 /***********************/
2593 * Create a new Help Browser
2594 * @param helps help chapters and directories
2595 * @param language Scilab current language
2596 * @return the created Help Browser
2598 public static SimpleHelpBrowser createHelpBrowser(String[] helps, String language) {
2599 return ScilabHelpBrowserBridge.createHelpBrowser(helps, language);
2603 * Display the Help Browser
2604 * @param browser the Help Browser
2606 public static void display(HelpBrowser browser) {
2607 ScilabHelpBrowserBridge.display(browser);
2611 * Display the matching items for a specified keyword
2612 * @param browser the Help Browser
2613 * @param keyword the keyword
2615 public static void searchKeywork(HelpBrowser browser, String keyword) {
2616 ScilabHelpBrowserBridge.searchKeywork(browser, keyword);
2620 * Display the result of a full-text search for a specified word
2621 * @param browser the Help Browser
2622 * @param keyword the keyword
2624 public static void fullTextSearch(HelpBrowser browser, String keyword) {
2625 ScilabHelpBrowserBridge.fullTextSearch(browser, keyword);
2629 * Close the HelpBrowser
2630 * @param browser the Help Browser
2632 public static void close(HelpBrowser browser) {
2633 ScilabHelpBrowserBridge.close(browser);
2636 /***********************/
2637 /* FontChooser Bridge */
2638 /***********************/
2641 * Create a new FontChooser
2642 * @param font the default font
2643 * @return the created FontChooser
2645 public static SimpleFontChooser createFontChooser(Font font) {
2646 return ScilabFontChooserBridge.createFontChooser(font);
2650 * Retrieve the selected font, or null
2651 * @param fontChooser the FontChooser
2652 * @return the selected font
2654 public static Font getSelectedFont(FontChooser fontChooser) {
2655 return ScilabFontChooserBridge.getSelectedFont(fontChooser);
2659 * Set the default font name
2660 * @param fontChooser the FontChooser
2661 * @param fontName the default font name
2663 public static void setDefaultFontName(FontChooser fontChooser, String fontName) {
2664 ScilabFontChooserBridge.setDefaultFontName(fontChooser, fontName);
2668 * Set the default font size
2669 * @param fontChooser the FontChooser
2670 * @param fontSize the default font size
2672 public static void setDefaultFontSize(FontChooser fontChooser, int fontSize) {
2673 ScilabFontChooserBridge.setDefaultFontSize(fontChooser, fontSize);
2677 * Set the default font bold attribute
2678 * @param fontChooser the FontChooser
2679 * @param bold the default font bold attribute
2681 public static void setDefaultBold(FontChooser fontChooser, boolean bold) {
2682 ScilabFontChooserBridge.setDefaultBold(fontChooser, bold);
2686 * Set the default font italic attribute
2687 * @param fontChooser the FontChooser
2688 * @param italic the default font italic attribute
2690 public static void setDefaultItalic(FontChooser fontChooser, boolean italic) {
2691 ScilabFontChooserBridge.setDefaultItalic(fontChooser, italic);
2695 * Display the font chooser and wait for a user input
2696 * @param fontChooser the FontChooser
2698 public static void displayAndWait(FontChooser fontChooser) {
2699 ScilabFontChooserBridge.displayAndWait(fontChooser);
2702 /***********************/
2703 /* ColorChooser Bridge */
2704 /***********************/
2707 * Create a new ColorChooser
2708 * @param color the default color
2709 * @return the created ColorChooser
2711 public static SimpleColorChooser createColorChooser(Color color) {
2712 return ScilabColorChooserBridge.createColorChooser(color);
2716 * Set the title of the ColorChooser
2717 * @param colorChooser the ColorChooser
2718 * @param title the title to set
2720 public static void setTitle(ColorChooser colorChooser, String title) {
2721 ScilabColorChooserBridge.setTitle(colorChooser, title);
2725 * Retrieve the selected color, or null
2726 * @param colorChooser the ColorChooser
2727 * @return the selected color
2729 public static Color getSelectedColor(ColorChooser colorChooser) {
2730 return ScilabColorChooserBridge.getSelectedColor(colorChooser);
2734 * Set the default color
2735 * @param colorChooser the ColorChooser
2736 * @param color the default color
2738 public static void setDefaultColor(ColorChooser colorChooser, Color color) {
2739 ScilabColorChooserBridge.setDefaultColor(colorChooser, color);
2743 * Display the font chooser and wait for a user input
2744 * @param colorChooser the ColorChooser
2746 public static void displayAndWait(ColorChooser colorChooser) {
2747 ScilabColorChooserBridge.displayAndWait(colorChooser);
2751 /******************/
2753 /******************/
2756 * Display a given tree
2757 * @param tree a tree structure
2759 public static void showTree(Tree tree) {
2760 ScilabTreeBridge.showTree(tree);
2764 * Create a Scilab Tree
2765 * @param scilabTree a tree structure
2766 * @return a graphical tree
2768 public static SimpleTree createTree(Tree scilabTree) {
2769 return ScilabTreeBridge.createTree(scilabTree);
2773 * Function help on the keyword
2774 * @param console scilab console
2776 public static void helpOnTheKeyword(ScilabConsole console) {
2777 ScilabConsoleBridge.helpOnTheKeyword(console);
2782 * Evaluate the selection with echo
2783 * @param console the console
2785 public static void evaluateSelectionWithEcho(ScilabConsole console) {
2786 ScilabConsoleBridge.evaluateSelectionWithEcho(console);
2790 * Evaluate the selection with no echo
2791 * @param console the console
2793 public static void evaluateSelectionWithNoEcho(ScilabConsole console) {
2794 ScilabConsoleBridge.evaluateSelectionWithNoEcho(console);
2797 /**********************/
2798 /* UiDisplayTree Bridge */
2799 /**********************/
2802 * Creates a new UiDisplayTree
2803 * @return the created UiDisplayTree
2805 public static SimpleUiDisplayTree createUiDisplayTree() {
2806 return ScilabUiDisplayTreeBridge.createUiDisplayTree();
2810 * Sets the Text of a UiDisplayTree
2811 * @param uiTree the UiDisplayTree we want to set the Text of
2812 * @param newText the Text to set for the UiDisplayTree
2814 public static void setText(UiDisplayTree uiTree, String newText) {
2815 ScilabUiDisplayTreeBridge.setText(uiTree, newText);
2819 * Gets the text of an UiDisplayTree
2820 * @param uiTree the UiDisplayTree we want to get the text of
2821 * @return the text of the UiDisplayTree
2823 public static String getText(UiDisplayTree uiTree) {
2824 return ScilabUiDisplayTreeBridge.getText(uiTree);
2828 * Draws a Scilab UiDisplayTree
2829 * @param uiTree the UiDisplayTree to draw
2830 * @see org.scilab.modules.ihm.UIElement#draw()
2832 public static void draw(UiDisplayTree uiTree) {
2833 ScilabUiDisplayTreeBridge.draw(uiTree);
2837 * Gets the dimensions (width and height) of a Scilab UiDisplayTree
2838 * @param uiTree the UiDisplayTree we want to get the dimensions of
2839 * @return the size of the uiTree
2840 * @see org.scilab.modules.ihm.UIElement#getDims()
2842 public static Size getDims(UiDisplayTree uiTree) {
2843 return ScilabUiDisplayTreeBridge.getDims(uiTree);
2847 * Gets the position (X-coordinate and Y-coordinate) of a Scilab uiTree
2848 * @param uiTree the uiTree we want to get the position of
2849 * @return the position of the uiTree
2850 * @see org.scilab.modules.ihm.UIElement#getPosition()
2852 public static Position getPosition(UiDisplayTree uiTree) {
2853 return ScilabUiDisplayTreeBridge.getPosition(uiTree);
2857 * Gets the visibility status of a Scilab UiDisplayTree
2858 * @param uiTree the uiTree we want to get the visiblity status of
2859 * @return the visibility status of the uiTree (true if the uiTree is visible, false if not)
2860 * @see org.scilab.modules.ihm.UIElement#isVisible()
2862 public static boolean isVisible(UiDisplayTree uiTree) {
2863 return ScilabUiDisplayTreeBridge.isVisible(uiTree);
2867 * Sets the dimensions (width and height) of a Scilab UiDisplayTree
2868 * @param uiTree the uiTree we want to set the dimensions of
2869 * @param newSize the size we want to set to the uiTree
2870 * @see org.scilab.modules.ihm.UIElement#setDims(org.scilab.modules.ihm.utils.Size)
2872 public static void setDims(UiDisplayTree uiTree, Size newSize) {
2873 ScilabUiDisplayTreeBridge.setDims(uiTree, newSize);
2877 * Sets the position (X-coordinate and Y-coordinate) of a Scilab uiTree
2878 * @param uiTree the uiTree we want to set the position of
2879 * @param newPosition the position we want to set to the uiTree
2880 * @see org.scilab.modules.ihm.UIElement#setPosition(org.scilab.modules.ihm.utils.Position)
2882 public static void setPosition(UiDisplayTree uiTree, Position newPosition) {
2883 ScilabUiDisplayTreeBridge.setPosition(uiTree, newPosition);
2887 * Sets the visibility status of a Scilab UiDisplayTree
2888 * @param uiTree the uiTree we want to set the visiblity status of
2889 * @param newVisibleState the visibility status we want to set to the uiTree (true to set the uiTree visible, false else)
2890 * @see org.scilab.modules.ihm.UIElement#setVisible(boolean)
2892 public static void setVisible(UiDisplayTree uiTree, boolean newVisibleState) {
2893 ScilabUiDisplayTreeBridge.setVisible(uiTree, newVisibleState);
2897 * Set the Background color of the UiDisplayTree
2898 * @param uiTree the UiDisplayTree we want to set the background of
2899 * @param color the Color
2901 public static void setBackground(UiDisplayTree uiTree, Color color) {
2902 ScilabUiDisplayTreeBridge.setBackground(uiTree, color);
2906 * Get the Background color of the UiDisplayTree
2907 * @param uiTree the UiDisplayTree we want to get the background of
2910 public static Color getBackground(UiDisplayTree uiTree) {
2911 return ScilabUiDisplayTreeBridge.getBackground(uiTree);
2915 * Set the Foreground color of the UiDisplayTree
2916 * @param uiTree the UiDisplayTree we want to set the foreground of
2917 * @param color the Color
2919 public static void setForeground(UiDisplayTree uiTree, Color color) {
2920 ScilabUiDisplayTreeBridge.setForeground(uiTree, color);
2924 * Get the Foreground color of the UiDisplayTree
2925 * @param uiTree the UiDisplayTree we want to get the foreground of
2928 public static Color getForeground(UiDisplayTree uiTree) {
2929 return ScilabUiDisplayTreeBridge.getForeground(uiTree);
2933 * Set the font of the UiDisplayTree.
2934 * @param uiTree the UiDisplayTree we want to set the font of
2935 * @param font the font
2937 public static void setFont(UiDisplayTree uiTree, Font font) {
2938 ScilabUiDisplayTreeBridge.setFont(uiTree, font);
2942 * Get the font of the UiDisplayTree.
2943 * @param uiTree the UiDisplayTree we want to get the font of
2946 public static Font getFont(UiDisplayTree uiTree) {
2947 return ScilabUiDisplayTreeBridge.getFont(uiTree);
2951 * Set if the UiDisplayTree is enabled or not
2952 * @param uiTree the UiDisplayTree we want to set the status of
2953 * @param status true if the UiDisplayTree is enabled
2955 public static void setEnabled(UiDisplayTree uiTree, boolean status) {
2956 ScilabUiDisplayTreeBridge.setEnabled(uiTree, status);
2960 * Gets the enable status of a UiDisplayTree
2961 * @param uiTree the UiDisplayTree we want to get the status of
2962 * @return the enable status of the UiDisplayTree (true if the UiDisplayTree is enabled, false if not)
2964 public static boolean isEnabled(UiDisplayTree uiTree) {
2965 return ScilabUiDisplayTreeBridge.isEnabled(uiTree);
2969 * Add a callback to the UiDisplayTree
2970 * @param uiTree the UiDisplayTree we want to set the callback of
2971 * @param callback the Callback to set.
2973 public static void setCallback(UiDisplayTree uiTree, CommonCallBack callback) {
2974 ScilabUiDisplayTreeBridge.setCallback(uiTree, callback);
2978 * Set the horizontal alignment for the UiDisplayTree text
2979 * @param uiTree the UiDisplayTree we want to set the alignment of
2980 * @param alignment the value for the alignment (See ScilabAlignment.java)
2982 public static void setHorizontalAlignment(UiDisplayTree uiTree, String alignment) {
2983 ScilabUiDisplayTreeBridge.setHorizontalAlignment(uiTree, alignment);
2987 * Set the vertical alignment for the UiDisplayTree text
2988 * @param uiTree the UiDisplayTree we want to set the alignment of
2989 * @param alignment the value for the alignment (See ScilabAlignment.java)
2991 public static void setVerticalAlignment(UiDisplayTree uiTree, String alignment) {
2992 ScilabUiDisplayTreeBridge.setVerticalAlignment(uiTree, alignment);
2996 * Set the Relief of the UiDisplayTree
2997 * @param uiTree the UiDisplayTree which we want to set the Relief of
2998 * @param reliefType the type of the relief to set (See ScilabRelief.java)
3000 public static void setRelief(UiDisplayTree uiTree, String reliefType) {
3001 ScilabUiDisplayTreeBridge.setRelief(uiTree, reliefType);
3005 * Delete the UiDisplayTree
3006 * @param uiTree the UiDisplayTree to be destroyed
3008 public static void destroy(UiDisplayTree uiTree) {
3009 ScilabUiDisplayTreeBridge.destroy(uiTree);
3013 * Give the focus to the UiDisplayTree
3014 * @param uiTree the UiDisplayTree
3016 public static void requestFocus(UiDisplayTree uiTree) {
3017 ScilabUiDisplayTreeBridge.requestFocus(uiTree);
3021 * Sets the tree data to be added to viewport
3022 * @param text the array of strings containing tree data
3024 public static void setData(UiDisplayTree uiTree, String[] text) {
3025 ScilabUiDisplayTreeBridge.setData(uiTree, text);