2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2008 - INRIA - Vincent Couvert
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
13 package org.scilab.modules.gui.waitbar;
15 import org.scilab.modules.gui.bridge.ScilabBridge;
16 import org.scilab.modules.gui.uielement.ScilabUIElement;
17 import org.scilab.modules.gui.utils.Position;
18 import org.scilab.modules.gui.utils.Size;
19 import org.scilab.modules.gui.utils.UIElementMapper;
22 * WaitBars/ProgressBars used by Scilab
23 * @author Vincent COUVERT
25 public class ScilabWaitBar extends ScilabUIElement implements WaitBar {
27 private SimpleWaitBar component;
32 protected ScilabWaitBar() {
33 component = ScilabBridge.createWaitBar();
34 component.setElementId(UIElementMapper.add(this));
38 * Creates a Scilab WaitBar
39 * @return the created WaitBar
41 public static WaitBar createWaitBar() {
42 return new ScilabWaitBar();
46 * Gets this Bridge component object
47 * @return this Bridge component object
49 public SimpleWaitBar getAsSimpleWaitBar() {
54 * Set the title of the WaitBar
55 * @param title the title to set
57 public void setTitle(String title) {
58 ScilabBridge.setTitle(this, title);
62 * Set the message of the WaitBar
63 * @param message the message to set
65 public void setMessage(String[] message) {
66 ScilabBridge.setMessage(this, message);
70 * Set the current value of the WaitBar
71 * @param value the value to set
73 public void setValue(int value) {
74 ScilabBridge.setValue(this, value);
81 ScilabBridge.close(this);
85 * Indicates if the total execution time is known
86 * @param status true if the total progress time in unknown
88 public void setIndeterminateMode(boolean status) {
89 ScilabBridge.setIndeterminateMode(this, status);
93 * Should not be used, just here to implemeent org.scilab.modules.gui.UIElement#draw()
96 throw new UnsupportedOperationException();
100 * Should not be used, just here to implemeent org.scilab.modules.gui.UIElement#getDims()
103 public Size getDims() {
104 throw new UnsupportedOperationException();
108 * Should not be used, just here to implemeent org.scilab.modules.gui.UIElement#draw()
111 public Position getPosition() {
112 throw new UnsupportedOperationException();
116 * Should not be used, just here to implemeent org.scilab.modules.gui.UIElement#draw()
119 public boolean isVisible() {
120 throw new UnsupportedOperationException();
124 * Should not be used, just here to implemeent org.scilab.modules.gui.UIElement#draw()
125 * @param newSize is never used
127 public void setDims(Size newSize) {
128 throw new UnsupportedOperationException();
132 * Should not be used, just here to implemeent org.scilab.modules.gui.UIElement#draw()
133 * @param newPosition is never used
135 public void setPosition(Position newPosition) {
136 throw new UnsupportedOperationException();
140 * Should not be used, just here to implemeent org.scilab.modules.gui.UIElement#draw()
141 * @param newVisibleState is never used
143 public void setVisible(boolean newVisibleState) {
144 throw new UnsupportedOperationException();