2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2007 - INRIA - Bruno JOFRET
4 * Copyright (C) 2011 - DIGITEO - Vincent COUVERT
6 * This file must be used under the terms of the CeCILL.
7 * This source file is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at
10 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
14 package org.scilab.modules.gui.tab;
16 import org.scilab.modules.gui.console.Console;
17 import org.scilab.modules.gui.canvas.Canvas;
18 import org.scilab.modules.gui.events.callback.CommonCallBack;
19 import org.scilab.modules.gui.helpbrowser.HelpBrowser;
20 import org.scilab.modules.gui.menubar.MenuBar;
21 import org.scilab.modules.gui.uidisplaytree.UiDisplayTree;
22 import org.scilab.modules.gui.textbox.TextBox;
23 import org.scilab.modules.gui.toolbar.ToolBar;
24 import org.scilab.modules.gui.tree.Tree;
25 import org.scilab.modules.gui.utils.Position;
26 import org.scilab.modules.gui.utils.Size;
29 * Interface for tabs in Scilab GUIs
30 * Describe all what the "widget" tab
31 * must be able to do as a GUI Component
32 * @author Bruno JOFRET
34 public interface SimpleTab {
37 * Gets the Name of a tab
38 * @return the Name of the tab
43 * Sets the Name of a tab
44 * @param newTabName the Name we want to set to the tab
46 void setName(String newTabName);
49 * We want to be able to add directly a Console in a Tab.
50 * @param member the member to add
51 * @return the position of the console in the member list.
53 int addMember(Console member);
56 * We want to be able to add directly a HelpBrowser in a Tab.
57 * @param member the member to add
58 * @return the position of the HelpBrowser in the member list.
60 int addMember(HelpBrowser member);
63 * We want to be able to add directly a Console in a Tab.
64 * @param member the member to add
65 * @return the position of the console in the member list.
67 int addMember(Canvas member);
69 int addMember(UiDisplayTree member);
70 void removeMember(UiDisplayTree member);
73 * We want to be able to remove directly a Canvas from a Tab.
74 * @param member canvas to remove
76 void removeMember(Canvas member);
80 * We want to be able to add directly a PopupMenu in a Tab.
81 * @param member the PopupMenu to add
82 * @return the position of the PopupMenu in the member list.
84 int addMember(Tree member);
88 * We want to be able to remove directly a Tree Overview from a Tab.
89 * @param member Tree OverView to remove
91 void removeMember(Tree member);
94 * Gets the size of an Tab (width and height)
95 * @return the size of the Tab
100 * Sets the size of an Tab (width and height)
101 * @param newSize the size we want to set to the Tab
103 void setDims(Size newSize);
106 * Gets the position of an Tab (X-coordinate and Y-corrdinate)
107 * @return the position of the Tab
109 Position getPosition();
112 * Sets the position of an Tab (X-coordinate and Y-corrdinate)
113 * @param newPosition the position we want to set to the Tab
115 void setPosition(Position newPosition);
118 * Gets the visibility status of an Tab
119 * @return the visibility status of the Tab (true if the Tab is visible, false if not)
124 * Sets the visibility status of an Tab
125 * @param newVisibleState the visibility status we want to set for the Tab
126 * (true if the Tab is visible, false if not)
128 void setVisible(boolean newVisibleState);
136 * Get the current status of the Tab in its parent
137 * @return true is the tab is the tab currently "on top" in its parent
139 boolean isCurrentTab();
142 * Set the parent window id for this tab
143 * @param id the id of the parent window
145 void setParentWindowId(String id);
148 * Get the parent window id for this tab
149 * @return the id of the parent window
151 String getParentWindowId();
154 * Get the MenuBar associated to this tab
155 * @return MenuBar the MenuBar associated.
157 MenuBar getMenuBar();
160 * Set the MenuBar associated to this tab
161 * @param newMenuBar : the MenuBar to associate.
163 void setMenuBar(MenuBar newMenuBar);
166 * Get the ToolBar associated to this tab
167 * @return ToolBar the ToolBar associated.
169 ToolBar getToolBar();
172 * Set the ToolBar associated to this tab
173 * @param newToolBar : the ToolBar to associate.
175 void setToolBar(ToolBar newToolBar);
178 * Get the InfoBar associated to this tab
179 * @return infoBar the InfoBar associated.
181 TextBox getInfoBar();
184 * Set the InfoBar associated to this tab
185 * @param newInfoBar the InfoBar to associate.
187 void setInfoBar(TextBox newInfoBar);
190 * Set the callback of the tab
191 * @param callback the CallBack to set
193 void setCallback(CommonCallBack callback);
196 * Set this tab as the current tab of its parent Window
201 * Set the background color of the tab.
202 * @param red red channel of the color
203 * @param green green channel
204 * @param blue blue channel
206 void setBackground(double red, double green, double blue);
209 * Specify whether the canvas should fit the parent tab size
210 * (and consequently the scrollpane size) or not
211 * @param onOrOff true to enable autoresize mode
213 void setAutoResizeMode(boolean onOrOff);
216 * @return whether the resize mode is on or off
218 boolean getAutoResizeMode();
221 * Get the part of the axes which is currently viewed
222 * @return [x,y,w,h] array
224 int[] getViewingRegion();
227 * Specify a new viewport for the axes
228 * For SwingScilabCanvas viewport can not be modified
229 * since it match the parent tab size
230 * @param posX X coordinate of upper left point of the viewport within the canvas
231 * @param posY Y coordinate of upper left point of the viewport within the canvas
232 * @param width width of the viewport
233 * @param height height of the viewport
235 void setViewingRegion(int posX, int posY, int width, int height);
239 * @return size of the axes in pixels
245 * @param newSize set a new axes size
247 void setAxesSize(Size newSize);
250 * Set the event handler of the Canvas
251 * @param command the name of the Scilab function to call
253 void setEventHandler(String command);
256 * Set the status of the event handler of the Canvas
257 * @param status is true to set the event handler active
259 void setEventHandlerEnabled(boolean status);