From 0f7e7dc855ce45c7b3dc6df12210049a66acf69b Mon Sep 17 00:00:00 2001 From: Bruno JOFRET Date: Fri, 18 Jul 2014 13:21:23 +0200 Subject: [PATCH] [Clean] Remove old ScilabUiTable Change-Id: Ib35cf654a2e83777761b566724c2ff146e7c9306 --- .../scilab/modules/gui/bridge/ScilabBridge.java | 273 ------------------ .../gui/bridge/tab/SwingScilabDockablePanel.java | 34 --- .../gui/bridge/uitable/SwingScilabUiTable.java | 4 +- .../scilab/modules/gui/tab/ScilabTabBridge.java | 20 -- .../java/org/scilab/modules/gui/tab/SimpleTab.java | 14 - .../scilab/modules/gui/uitable/ScilabUiTable.java | 302 -------------------- .../modules/gui/uitable/ScilabUiTableBridge.java | 282 ------------------ .../scilab/modules/gui/uitable/SimpleUiTable.java | 39 --- .../org/scilab/modules/gui/uitable/UiTable.java | 45 --- 9 files changed, 2 insertions(+), 1011 deletions(-) delete mode 100644 scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/ScilabUiTable.java delete mode 100644 scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/ScilabUiTableBridge.java delete mode 100644 scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/SimpleUiTable.java delete mode 100644 scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/UiTable.java diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/ScilabBridge.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/ScilabBridge.java index 6411aee..012f719 100644 --- a/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/ScilabBridge.java +++ b/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/ScilabBridge.java @@ -78,9 +78,6 @@ import org.scilab.modules.gui.tree.Tree; import org.scilab.modules.gui.uidisplaytree.ScilabUiDisplayTreeBridge; import org.scilab.modules.gui.uidisplaytree.SimpleUiDisplayTree; import org.scilab.modules.gui.uidisplaytree.UiDisplayTree; -import org.scilab.modules.gui.uitable.ScilabUiTableBridge; -import org.scilab.modules.gui.uitable.SimpleUiTable; -import org.scilab.modules.gui.uitable.UiTable; import org.scilab.modules.gui.utils.Position; import org.scilab.modules.gui.utils.Size; import org.scilab.modules.gui.window.ScilabWindowBridge; @@ -499,25 +496,6 @@ public class ScilabBridge { return ScilabTabBridge.addMember(tab, member); } - /** - * Add a member (dockable element) to a tab and returns the index of this member - * @param tab the tab which we want to add the UiTable to - * @param member the UiTable to add - * @return the position of the UiTable in the member list. - */ - public static int addMember(Tab tab, UiTable member) { - return ScilabTabBridge.addMember(tab, member); - } - - /** - * Remove a UiTable member from a tab - * @param tab the tab which we want to remove the UiTable from - * @param member the UiTable to remove - */ - public static void removeMember(Tab tab, UiTable member) { - ScilabTabBridge.removeMember(tab, member); - } - public static int addMember(Tab tab, UiDisplayTree member) { return ScilabTabBridge.addMember(tab, member); } @@ -2817,257 +2795,6 @@ public class ScilabBridge { } /**********************/ - /* UiTable Bridge */ - /**********************/ - - /** - * Creates a new UiTable - * @return the created UiTable - */ - public static SimpleUiTable createUiTable() { - return ScilabUiTableBridge.createUiTable(); - } - - /** - * Sets the Text of a UiTable - * @param uiTable the UiTable we want to set the Text of - * @param newText the Text to set for the UiTable - */ - public static void setText(UiTable uiTable, String newText) { - ScilabUiTableBridge.setText(uiTable, newText); - } - - /** - * Gets the text of an UiTable - * @param uiTable the UiTable we want to get the text of - * @return the text of the UiTable - */ - public static String getText(UiTable uiTable) { - return ScilabUiTableBridge.getText(uiTable); - } - - /** - * Draws a Scilab UiTable - * @param uiTable the UiTable to draw - * @see org.scilab.modules.ihm.UIElement#draw() - */ - public static void draw(UiTable uiTable) { - ScilabUiTableBridge.draw(uiTable); - } - - /** - * Gets the dimensions (width and height) of a Scilab UiTable - * @param uiTable the UiTable we want to get the dimensions of - * @return the size of the uiTable - * @see org.scilab.modules.ihm.UIElement#getDims() - */ - public static Size getDims(UiTable uiTable) { - return ScilabUiTableBridge.getDims(uiTable); - } - - /** - * Gets the position (X-coordinate and Y-coordinate) of a Scilab uiTable - * @param uiTable the uiTable we want to get the position of - * @return the position of the uiTable - * @see org.scilab.modules.ihm.UIElement#getPosition() - */ - public static Position getPosition(UiTable uiTable) { - return ScilabUiTableBridge.getPosition(uiTable); - } - - /** - * Gets the visibility status of a Scilab UiTable - * @param uiTable the uiTable we want to get the visiblity status of - * @return the visibility status of the uiTable (true if the uiTable is visible, false if not) - * @see org.scilab.modules.ihm.UIElement#isVisible() - */ - public static boolean isVisible(UiTable uiTable) { - return ScilabUiTableBridge.isVisible(uiTable); - } - - /** - * Sets the dimensions (width and height) of a Scilab UiTable - * @param uiTable the uiTable we want to set the dimensions of - * @param newSize the size we want to set to the uiTable - * @see org.scilab.modules.ihm.UIElement#setDims(org.scilab.modules.ihm.utils.Size) - */ - public static void setDims(UiTable uiTable, Size newSize) { - ScilabUiTableBridge.setDims(uiTable, newSize); - } - - /** - * Sets the position (X-coordinate and Y-coordinate) of a Scilab uiTable - * @param uiTable the uiTable we want to set the position of - * @param newPosition the position we want to set to the uiTable - * @see org.scilab.modules.ihm.UIElement#setPosition(org.scilab.modules.ihm.utils.Position) - */ - public static void setPosition(UiTable uiTable, Position newPosition) { - ScilabUiTableBridge.setPosition(uiTable, newPosition); - } - - /** - * Sets the visibility status of a Scilab UiTable - * @param uiTable the uiTable we want to set the visiblity status of - * @param newVisibleState the visibility status we want to set to the uiTable (true to set the uiTable visible, false else) - * @see org.scilab.modules.ihm.UIElement#setVisible(boolean) - */ - public static void setVisible(UiTable uiTable, boolean newVisibleState) { - ScilabUiTableBridge.setVisible(uiTable, newVisibleState); - } - - /** - * Set the Background color of the UiTable - * @param uiTable the UiTable we want to set the background of - * @param color the Color - */ - public static void setBackground(UiTable uiTable, Color color) { - ScilabUiTableBridge.setBackground(uiTable, color); - } - - /** - * Get the Background color of the UiTable - * @param uiTable the UiTable we want to get the background of - * @return the Color - */ - public static Color getBackground(UiTable uiTable) { - return ScilabUiTableBridge.getBackground(uiTable); - } - - /** - * Set the Foreground color of the UiTable - * @param uiTable the UiTable we want to set the foreground of - * @param color the Color - */ - public static void setForeground(UiTable uiTable, Color color) { - ScilabUiTableBridge.setForeground(uiTable, color); - } - - /** - * Get the Foreground color of the UiTable - * @param uiTable the UiTable we want to get the foreground of - * @return the Color - */ - public static Color getForeground(UiTable uiTable) { - return ScilabUiTableBridge.getForeground(uiTable); - } - - /** - * Set the font of the UiTable. - * @param uiTable the UiTable we want to set the font of - * @param font the font - */ - public static void setFont(UiTable uiTable, Font font) { - ScilabUiTableBridge.setFont(uiTable, font); - } - - /** - * Get the font of the UiTable. - * @param uiTable the UiTable we want to get the font of - * @return the font - */ - public static Font getFont(UiTable uiTable) { - return ScilabUiTableBridge.getFont(uiTable); - } - - /** - * Set if the UiTable is enabled or not - * @param uiTable the UiTable we want to set the status of - * @param status true if the UiTable is enabled - */ - public static void setEnabled(UiTable uiTable, boolean status) { - ScilabUiTableBridge.setEnabled(uiTable, status); - } - - /** - * Gets the enable status of a UiTable - * @param uiTable the UiTable we want to get the status of - * @return the enable status of the UiTable (true if the UiTable is enabled, false if not) - */ - public static boolean isEnabled(UiTable uiTable) { - return ScilabUiTableBridge.isEnabled(uiTable); - } - - /** - * Add a callback to the UiTable - * @param uiTable the UiTable we want to set the callback of - * @param callback the Callback to set. - */ - public static void setCallback(UiTable uiTable, CommonCallBack callback) { - ScilabUiTableBridge.setCallback(uiTable, callback); - } - - /** - * Set the horizontal alignment for the UiTable text - * @param uiTable the UiTable we want to set the alignment of - * @param alignment the value for the alignment (See ScilabAlignment.java) - */ - public static void setHorizontalAlignment(UiTable uiTable, String alignment) { - ScilabUiTableBridge.setHorizontalAlignment(uiTable, alignment); - } - - /** - * Set the vertical alignment for the UiTable text - * @param uiTable the UiTable we want to set the alignment of - * @param alignment the value for the alignment (See ScilabAlignment.java) - */ - public static void setVerticalAlignment(UiTable uiTable, String alignment) { - ScilabUiTableBridge.setVerticalAlignment(uiTable, alignment); - } - - /** - * Set the Relief of the UiTable - * @param uiTable the UiTable which we want to set the Relief of - * @param reliefType the type of the relief to set (See ScilabRelief.java) - */ - public static void setRelief(UiTable uiTable, String reliefType) { - ScilabUiTableBridge.setRelief(uiTable, reliefType); - } - - /** - * Delete the UiTable - * @param uiTable the UiTable to be destroyed - */ - public static void destroy(UiTable uiTable) { - ScilabUiTableBridge.destroy(uiTable); - } - - /** - * Give the focus to the UiTable - * @param uiTable the UiTable - */ - public static void requestFocus(UiTable uiTable) { - ScilabUiTableBridge.requestFocus(uiTable); - } - - /** - * Sets the column names for uitable - * @param uiTable the UiTable - * @param text the String that contains column names delimited by a '|'. Example: 1|2|3|4 - */ - public static void setColnames(UiTable uiTable, String text) { - ScilabUiTableBridge.setColnames(uiTable, text); - } - - /** - * Sets the row names for uitable - * @param uiTable the UiTable - * @param text the String that contains row names delimited by a '|'. Example: 1|2|3|4 - */ - public static void setRownames(UiTable uiTable, String text) { - ScilabUiTableBridge.setRownames(uiTable, text); - } - - /** - * Sets the Data for uitable - * @param uiTable the UiTable - * @param text the String that contains row data delimited by a '|' - * and column data delimited by " ". Example: 1.26 3.47 | a b | d e | a b - */ - public static void setData(UiTable uiTable, String text) { - ScilabUiTableBridge.setData(uiTable, text); - } - - /**********************/ /* UiDisplayTree Bridge */ /**********************/ diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabDockablePanel.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabDockablePanel.java index 86ed6fb..207f38f 100644 --- a/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabDockablePanel.java +++ b/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/tab/SwingScilabDockablePanel.java @@ -87,7 +87,6 @@ import org.scilab.modules.gui.textbox.TextBox; import org.scilab.modules.gui.toolbar.ToolBar; import org.scilab.modules.gui.tree.Tree; import org.scilab.modules.gui.uidisplaytree.UiDisplayTree; -import org.scilab.modules.gui.uitable.UiTable; import org.scilab.modules.gui.utils.BarUpdater; import org.scilab.modules.gui.utils.ClosingOperationsManager; import org.scilab.modules.gui.utils.Position; @@ -715,39 +714,6 @@ public class SwingScilabDockablePanel extends View implements SimpleTab, FocusLi } /** - * Add a member (dockable element) to container and returns its index - * @param member the member to add - * @return index of member in ArrayList - */ - public int addMember(UiTable member) { - return this.addMember((SwingScilabUiTable) member.getAsSimpleUiTable()); - } - - /** - * Add a member (dockable element) to container and returns its index - * @param member the member to add - * @return index of member in ArrayList - */ - private int addMember(SwingScilabUiTable member) { - return 0; - } - - /** - * Remove a UiTable from its container - * @param member the UiTable to remove - */ - public void removeMember(UiTable member) { - this.removeMember((SwingScilabUiTable) member.getAsSimpleUiTable()); - } - - /** - * Remove a UiTable from its container - * @param member the UiTable to remove - */ - private void removeMember(SwingScilabUiTable member) { - } - - /** * Add a Tree member (dockable element) to container and returns its index * @param member the member to add * @return index of member in ArrayList diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/uitable/SwingScilabUiTable.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/uitable/SwingScilabUiTable.java index 918cd9e..78ec055 100644 --- a/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/uitable/SwingScilabUiTable.java +++ b/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/uitable/SwingScilabUiTable.java @@ -32,19 +32,19 @@ import org.scilab.modules.gui.events.callback.CommonCallBack; import org.scilab.modules.gui.menubar.MenuBar; import org.scilab.modules.gui.textbox.TextBox; import org.scilab.modules.gui.toolbar.ToolBar; -import org.scilab.modules.gui.uitable.SimpleUiTable; import org.scilab.modules.gui.utils.Position; import org.scilab.modules.gui.utils.PositionConverter; import org.scilab.modules.gui.utils.ScilabAlignment; import org.scilab.modules.gui.utils.ScilabRelief; import org.scilab.modules.gui.utils.ScilabSwingUtilities; import org.scilab.modules.gui.utils.Size; +import org.scilab.modules.gui.widget.Widget; /** * Swing implementation for Scilab UiTable in GUIs * @author Han DONG */ -public class SwingScilabUiTable extends JScrollPane implements SwingViewObject, SimpleUiTable { +public class SwingScilabUiTable extends JScrollPane implements SwingViewObject, Widget { private static final long serialVersionUID = -5497171010652701217L; diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/tab/ScilabTabBridge.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/tab/ScilabTabBridge.java index eb6df79..a59b736 100644 --- a/scilab/modules/gui/src/java/org/scilab/modules/gui/tab/ScilabTabBridge.java +++ b/scilab/modules/gui/src/java/org/scilab/modules/gui/tab/ScilabTabBridge.java @@ -19,7 +19,6 @@ import org.scilab.modules.gui.console.Console; import org.scilab.modules.gui.events.callback.CommonCallBack; import org.scilab.modules.gui.helpbrowser.HelpBrowser; import org.scilab.modules.gui.menubar.MenuBar; -import org.scilab.modules.gui.uitable.UiTable; import org.scilab.modules.gui.uidisplaytree.UiDisplayTree; import org.scilab.modules.gui.tree.Tree; import org.scilab.modules.gui.utils.Position; @@ -176,25 +175,6 @@ public class ScilabTabBridge { return (tab.getAsSimpleTab().addMember(member)); } - /** - * Add a member (dockable element) to a tab and returns the index of this member - * @param tab the tab which we want to add the UiTable to - * @param member the UiTable to add - * @return the position of the UiTable in the member list. - */ - public static int addMember(Tab tab, UiTable member) { - return (tab.getAsSimpleTab().addMember(member)); - } - - /** - * Remove a UiTable member from a tab - * @param tab the tab which we want to remove the UiTable from - * @param member the UiTable to add - */ - public static void removeMember(Tab tab, UiTable member) { - tab.getAsSimpleTab().removeMember(member); - } - public static int addMember(Tab tab, UiDisplayTree member) { return (tab.getAsSimpleTab().addMember(member)); } diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/tab/SimpleTab.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/tab/SimpleTab.java index 8db2bac..ba890cd 100644 --- a/scilab/modules/gui/src/java/org/scilab/modules/gui/tab/SimpleTab.java +++ b/scilab/modules/gui/src/java/org/scilab/modules/gui/tab/SimpleTab.java @@ -18,7 +18,6 @@ import org.scilab.modules.gui.canvas.Canvas; import org.scilab.modules.gui.events.callback.CommonCallBack; import org.scilab.modules.gui.helpbrowser.HelpBrowser; import org.scilab.modules.gui.menubar.MenuBar; -import org.scilab.modules.gui.uitable.UiTable; import org.scilab.modules.gui.uidisplaytree.UiDisplayTree; import org.scilab.modules.gui.textbox.TextBox; import org.scilab.modules.gui.toolbar.ToolBar; @@ -71,19 +70,6 @@ public interface SimpleTab { void removeMember(UiDisplayTree member); /** - * We want to be able to add directly a UiTable in a Tab. - * @param member the UiTable to add - * @return the position of the UiTable in the member list. - */ - int addMember(UiTable member); - - /** - * Remove a UiTable from a Tab. - * @param member the UiTable to remove - */ - void removeMember(UiTable member); - - /** * We want to be able to remove directly a Canvas from a Tab. * @param member canvas to remove */ diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/ScilabUiTable.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/ScilabUiTable.java deleted file mode 100644 index 6bae3f0..0000000 --- a/scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/ScilabUiTable.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2010 - Han DONG - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt - * - */ - -package org.scilab.modules.gui.uitable; - -import java.awt.Color; -import java.awt.Font; - -import org.scilab.modules.gui.bridge.ScilabBridge; -import org.scilab.modules.gui.events.callback.CommonCallBack; -import org.scilab.modules.gui.utils.Position; -import org.scilab.modules.gui.utils.Size; -import org.scilab.modules.gui.widget.ScilabWidget; - -/** - * Swing implementation for Scilab UiTable in GUIs - * @author Han DONG - */ -public class ScilabUiTable extends ScilabWidget implements UiTable { - - private SimpleUiTable component; - - /** - * Constructor - */ - protected ScilabUiTable() { - component = ScilabBridge.createUiTable(); - } - - /** - * Creates a Scilab UiTable object - * @return the created UiTable - */ - public static UiTable createUiTable() { - return new ScilabUiTable(); - } - - /** - * Gets this Bridge component object - * @return this Bridge component object - */ - public SimpleUiTable getAsSimpleUiTable() { - return component; - } - - /** - * Sets the text of a UiTable - * @param newText the text to set to the UiTable - */ - public void setText(String newText) { - ScilabBridge.setText(this, newText); - } - - public void setEmptyText() { - setText(null); - } - - /** - * Gets the text of a UiTable - * @return text of the UiTable - */ - public String getText() { - return ScilabBridge.getText(this); - } - - /** - * Draws a UiTable - */ - public void draw() { - ScilabBridge.draw(this); - } - - /** - * Sets the dimensions (width and height) of a swing Scilab element - * @param newSize the dimensions to set to the element - * @see org.scilab.modules.gui.uielement.UIElement#setDims(org.scilab.modules.gui.utils.Size) - */ - public void setDims(Size newSize) { - ScilabBridge.setDims(this, newSize); - } - - /** - * Gets the dimensions (width and height) of a swing Scilab element - * @return the dimensions (width and height) of the element - * @see org.scilab.modules.gui.uielement.UIElement#getDims(org.scilab.modules.gui.utils.Size) - */ - public Size getDims() { - return ScilabBridge.getDims(this); - } - - /** - * Gets the position (X-coordinate and Y-coordinate) of a Scilab element - * @return the position of the element - * @see org.scilab.modules.gui.uielement.UIElement#getPosition() - */ - public Position getPosition() { - return ScilabBridge.getPosition(this); - } - - /** - * Sets the position (X-coordinate and Y-coordinate) of a Scilab element - * @param newPosition the position we want to set to the element - * @see org.scilab.modules.gui.uielement.UIElement#setPosition(org.scilab.modules.gui.utils.Position) - */ - public void setPosition(Position newPosition) { - ScilabBridge.setPosition(this, newPosition); - } - - /** - * Gets the visibility status of an UIElement - * @return the visibility status of the UIElement (true if the UIElement is visible, false if not) - */ - public boolean isVisible() { - return ScilabBridge.isVisible(this); - } - - /** - * Sets the visibility status of a Menu - * @param newVisibleState the visibility status we want to set for the UIElement - * (true if the UIElement is visible, false if not) - */ - public void setVisible(boolean newVisibleState) { - ScilabBridge.setVisible(this, newVisibleState); - } - - /** - * To get the Background color of the element. - * @return color the Color - */ - public Color getBackground() { - return ScilabBridge.getBackground(this); - } - - /** - * To get the Font of the element. - * @return font the Font - */ - public Font getFont() { - return ScilabBridge.getFont(this); - } - - /** - * To get the Foreground color of the element. - * @return color the Color - */ - public Color getForeground() { - return ScilabBridge.getForeground(this); - } - - /** - * To set the Background color of the element. - * @param color the Color - */ - public void setBackground(Color color) { - ScilabBridge.setBackground(this, color); - } - - /** - * To set the Font of the element. - * @param font the Font - */ - public void setFont(Font font) { - ScilabBridge.setFont(this, font); - } - - /** - * To set the Foreground color of the element. - * @param color the Color - */ - public void setForeground(Color color) { - ScilabBridge.setForeground(this, color); - } - - /** - * Add a callback to the UiTable - * @param callback the CallBack to set. - */ - public void setCallback(CommonCallBack callback) { - ScilabBridge.setCallback(this, callback); - } - - /** - * Set if the UiTable is enabled or not - * @param status true if the UiTable is enabled - */ - public void setEnabled(boolean status) { - ScilabBridge.setEnabled(this, status); - } - - /** - * Gets the enable status of a UiTable - * @return the enable status of the UiTable (true if the UiTable is enabled, false if not) - */ - public boolean isEnabled() { - return ScilabBridge.isEnabled(this); - } - - /** - * Set the horizontal alignment for the UiTable text - * @param alignment the value for the alignment (See ScilabAlignment.java) - */ - public void setHorizontalAlignment(String alignment) { - ScilabBridge.setHorizontalAlignment(this, alignment); - } - - /** - * Set the vertical alignment for the UiTable text - * @param alignment the value for the alignment (See ScilabAlignment.java) - */ - public void setVerticalAlignment(String alignment) { - ScilabBridge.setVerticalAlignment(this, alignment); - } - - /** - * Set the Relief of the UiTable - * @param reliefType the type of the relief to set (See ScilabRelief.java) - */ - public void setRelief(String reliefType) { - ScilabBridge.setRelief(this, reliefType); - } - - /** - * Delete the UiTable - */ - public void destroy() { - ScilabBridge.destroy(this); - } - - /** - * Give the focus to the UiTable - */ - public void requestFocus() { - ScilabBridge.requestFocus(this); - } - - /** - * Sets the column names for uitable - * @param text the String that contains column names delimited by "|" - */ - public void setColnames(String text) { - ScilabBridge.setColnames(this, text); - } - - /** - * Sets the column names for uitable - * @param text the String that contains column names delimited by "|" - */ - public void setColumnNames(String[] text) { - //ScilabBridge.setColnames(this, text); - } - - /** - * Sets the row names for uitable - * @param text the String that contains row name delimited by a "|" - */ - public void setRownames(String text) { - ScilabBridge.setRownames(this, text); - } - - /** - * Sets the row names for uitable - * @param text the String that contains row name delimited by a "|" - */ - public void setRowNames(String[] text) { - //ScilabBridge.setRownames(this, text); - } - - /** - * Sets the data for uitable - * @param text the String that contains row data delimited by a '|' - * and column data delimited by " ". Example: 1.26 3.47 | a b | d e | a b - */ - public void setData(String text) { - ScilabBridge.setData(this, text); - } - - @Override - public void setToolTipText(String tooltipText) { - // TODO Auto-generated method stub - } - - @Override - public void resetBackground() { - // TODO Auto-generated method stub - - } - - @Override - public void resetForeground() { - // TODO Auto-generated method stub - - } -} diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/ScilabUiTableBridge.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/ScilabUiTableBridge.java deleted file mode 100644 index 75a6754..0000000 --- a/scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/ScilabUiTableBridge.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2010 - Han DONG - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt - * - */ - -package org.scilab.modules.gui.uitable; - -import java.awt.Color; -import java.awt.Font; - -import org.scilab.modules.gui.bridge.uitable.SwingScilabUiTable; -import org.scilab.modules.gui.events.callback.CommonCallBack; -import org.scilab.modules.gui.utils.Position; -import org.scilab.modules.gui.utils.Size; - -/** - * Bridge for Scilab UiTables in GUIs - * @author Han DONG - */ -public class ScilabUiTableBridge { - - /** - * Constructor - */ - protected ScilabUiTableBridge() { - throw new UnsupportedOperationException(); /* Prevents calls from subclass */ - } - - /** - * Creates a Scilab UiTable - * @return the created UiTable - */ - public static SimpleUiTable createUiTable() { - return new SwingScilabUiTable(); - } - - /** - * Sets the Text of a Scilab UiTable - * @param uiTable the UiTable we want to set the Text of - * @param newText the Text we want to set to the UiTable - */ - public static void setText(UiTable uiTable, String newText) { - uiTable.getAsSimpleUiTable().setText(newText); - } - - /** - * Sets the Text of a Scilab UiTable - * @param uiTable the UiTable we want to get the Text of - * @return the text of the UiTable - */ - public static String getText(UiTable uiTable) { - return uiTable.getAsSimpleUiTable().getText(); - } - - /** - * Draws a Scilab uiTable - * @param uiTable the uiTable to draw - * @see org.scilab.modules.gui.UIElement#draw() - */ - public static void draw(UiTable uiTable) { - uiTable.getAsSimpleUiTable().draw(); - } - - /** - * Gets the dimensions (width and height) of a Scilab UiTable - * @param uiTable the uiTable we want to get the dimensions of - * @return the size of the uiTable - * @see org.scilab.modules.gui.UIElement#getDims() - */ - public static Size getDims(UiTable uiTable) { - return uiTable.getAsSimpleUiTable().getDims(); - } - - /** - * Gets the position (X-coordinate and Y-coordinate) of a Scilab uiTable - * @param uiTable the uiTable we want to get the position of - * @return the position of the uiTable - * @see org.scilab.modules.gui.UIElement#getPosition() - */ - public static Position getPosition(UiTable uiTable) { - return uiTable.getAsSimpleUiTable().getPosition(); - } - - /** - * Gets the visibility status of a Scilab UiTable - * @param uiTable the uiTable we want to get the visiblity status of - * @return the visibility status of the uiTable (true if the uiTable is visible, false if not) - * @see org.scilab.modules.gui.UIElement#isVisible() - */ - public static boolean isVisible(UiTable uiTable) { - return uiTable.getAsSimpleUiTable().isVisible(); - } - - /** - * Sets the dimensions (width and height) of a Scilab UiTable - * @param uiTable the uiTable we want to set the dimensions of - * @param newSize the size we want to set to the uiTable - * @see org.scilab.modules.gui.UIElement#setDims(org.scilab.modules.gui.utils.Size) - */ - public static void setDims(UiTable uiTable, Size newSize) { - uiTable.getAsSimpleUiTable().setDims(newSize); - } - - /** - * Sets the position (X-coordinate and Y-coordinate) of a Scilab uiTable - * @param uiTable the uiTable we want to set the position of - * @param newPosition the position we want to set to the uiTable - * @see org.scilab.modules.gui.UIElement#setPosition(org.scilab.modules.gui.utils.Position) - */ - public static void setPosition(UiTable uiTable, Position newPosition) { - uiTable.getAsSimpleUiTable().setPosition(newPosition); - } - - /** - * Sets the visibility status of a Scilab UiTable - * @param uiTable the uiTable we want to set the visiblity status of - * @param newVisibleState the visibility status we want to set to the uiTable (true to set the uiTable visible, false else) - * @see org.scilab.modules.gui.UIElement#setVisible(boolean) - */ - public static void setVisible(UiTable uiTable, boolean newVisibleState) { - uiTable.getAsSimpleUiTable().setVisible(newVisibleState); - } - - /** - * Add a callback to the UiTable - * @param uiTable the UiTable we want to set the callback of - * @param callback the CallBack to set. - */ - public static void setCallback(UiTable uiTable, CommonCallBack callback) { - uiTable.getAsSimpleUiTable().setCallback(callback); - } - - /** - * To set the Background color of the UiTable - * @param uiTable the UiTable we want to set the background of - * @param color the Color - */ - public static void setBackground(UiTable uiTable, Color color) { - uiTable.getAsSimpleUiTable().setBackground(color); - } - - /** - * Get the Background color of the UiTable - * @param uiTable the UiTable we want to get the background of - * @return the Color - */ - public static Color getBackground(UiTable uiTable) { - return uiTable.getAsSimpleUiTable().getBackground(); - } - - /** - * To set the Foreground color of the uiTable - * @param uiTable the UiTable we want to set the foreground of - * @param color the Color - */ - public static void setForeground(UiTable uiTable, Color color) { - uiTable.getAsSimpleUiTable().setForeground(color); - } - - /** - * Get the Foreground color of the UiTable - * @param uiTable the UiTable we want to get the foreground of - * @return the Color - */ - public static Color getForeground(UiTable uiTable) { - return uiTable.getAsSimpleUiTable().getForeground(); - } - - /** - * Set the font of the UiTable. - * @param uiTable the UiTable we want to set the font of - * @param font the font - */ - public static void setFont(UiTable uiTable, Font font) { - uiTable.getAsSimpleUiTable().setFont(font); - } - - /** - * Get the font of the UiTable. - * @param uiTable the UiTable we want to get the font of - * @return the font - */ - public static Font getFont(UiTable uiTable) { - return uiTable.getAsSimpleUiTable().getFont(); - } - - /** - * Set if the UiTable is enabled or not - * @param uiTable the UiTable we want to set the status of - * @param status true if the UiTable is enabled - */ - public static void setEnabled(UiTable uiTable, boolean status) { - uiTable.getAsSimpleUiTable().setEnabled(status); - } - - /** - * Gets the enable status of a UiTable - * @param uiTable the UiTable we want to get the status of - * @return the enable status of the UiTable (true if the UiTable is enabled, false if not) - */ - public static boolean isEnabled(UiTable uiTable) { - return uiTable.getAsSimpleUiTable().isEnabled(); - } - - /** - * Set the horizontal alignment for the UiTable text - * @param uiTable the UiTable we want to set the alignment of - * @param alignment the value for the alignment (See ScilabAlignment.java) - */ - public static void setHorizontalAlignment(UiTable uiTable, String alignment) { - uiTable.getAsSimpleUiTable().setHorizontalAlignment(alignment); - } - - /** - * Set the vertical alignment for the UiTable text - * @param uiTable the UiTable we want to set the alignment of - * @param alignment the value for the alignment (See ScilabAlignment.java) - */ - public static void setVerticalAlignment(UiTable uiTable, String alignment) { - uiTable.getAsSimpleUiTable().setVerticalAlignment(alignment); - } - - /** - * Set the Relief of the UiTable - * @param uiTable the UiTable which we want to set the Relief of - * @param reliefType the type of the relief to set (See ScilabRelief.java) - */ - public static void setRelief(UiTable uiTable, String reliefType) { - uiTable.getAsSimpleUiTable().setRelief(reliefType); - } - - /** - * Delete the UiTable - * @param uiTable the UiTable to be destroyed - */ - public static void destroy(UiTable uiTable) { - uiTable.getAsSimpleUiTable().destroy(); - } - - /** - * Give the focus to the UiTable - * @param uiTable the UiTable - */ - public static void requestFocus(UiTable uiTable) { - uiTable.getAsSimpleUiTable().requestFocus(); - } - - /** - * Sets the column namesfor uitable - * @param text the String that contains column names delimited by a '|' - */ - public static void setColnames(UiTable uiTable, String text) { - // TODO remove - //uiTable.getAsSimpleUiTable().setColnames(text); - } - - /** - * Sets the row names for uitable - * @param text the String that contains row name delimited by a '|' - */ - public static void setRownames(UiTable uiTable, String text) { - // TODO remove - //uiTable.getAsSimpleUiTable().setRownames(text); - } - - /** - * Sets the data for uitable - * @param text the String that contains row data delimited by a '|' - * and column data delimited by " ". Example: 1.26 3.47 | a b | d e | a b - */ - public static void setData(UiTable uiTable, String text) { - // TODO remove - //uiTable.getAsSimpleUiTable().setData(text); - } -} diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/SimpleUiTable.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/SimpleUiTable.java deleted file mode 100644 index 4aac9a6..0000000 --- a/scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/SimpleUiTable.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2010 - Han DONG - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt - * - */ -package org.scilab.modules.gui.uitable; - -import org.scilab.modules.gui.text.SimpleText; - -/** - * Interface for ScilabUiTableBridge the associated object to Scilab GUIs UiTable - * @author Han DONG - */ -public interface SimpleUiTable extends SimpleText { - - /** - * Sets the column names for uitable - * @param names the column names - */ - void setColumnNames(String[] names); - - /** - * Sets the row name for uitable - * @param names the row names - */ - void setRowNames(String[] names); - - /** - * Sets the data for uitable - * @param text the data as string - */ - void setData(String[] text); -} diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/UiTable.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/UiTable.java deleted file mode 100644 index 4e00cc6..0000000 --- a/scilab/modules/gui/src/java/org/scilab/modules/gui/uitable/UiTable.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2010 - Han DONG - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt - * - */ - -package org.scilab.modules.gui.uitable; - -import org.scilab.modules.gui.text.Text; - -/** - * Interface for UiTable associated to objects in Scilab GUIs - * @author Han DONG - */ -public interface UiTable extends Text { - - /** - * Gets this Bridge component object - * @return this Bridge component object - */ - SimpleUiTable getAsSimpleUiTable(); - - /** - * Sets the column names for uitable - * @param names the column names - */ - void setColumnNames(String[] names); - - /** - * Sets the row name for uitable - * @param names the row names - */ - void setRowNames(String[] names); - - /** - * Sets the data for uitable - */ - void setData(String text); -} -- 1.7.9.5