001/*
002 The instance of this class would be able to visualize the value of a token
003 within a text field that is placed into a container.
004
005 Copyright (c) 2011-2014 The Regents of the University of California.
006 All rights reserved.
007 Permission is hereby granted, without written agreement and without
008 license or royalty fees, to use, copy, modify, and distribute this
009 software and its documentation for any purpose, provided that the above
010 copyright notice and the following two paragraphs appear in all copies
011 of this software.
012
013 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
014 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
015 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
016 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
017 SUCH DAMAGE.
018
019 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
020 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
021 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
022 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
023 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
024 ENHANCEMENTS, OR MODIFICATIONS.
025
026 PT_COPYRIGHT_VERSION_2
027 COPYRIGHTENDKEY
028 */
029
030package ptolemy.actor.lib.gui;
031
032import ptolemy.actor.injection.PortableContainer;
033import ptolemy.actor.lib.Sink;
034import ptolemy.data.Token;
035import ptolemy.kernel.util.IllegalActionException;
036import ptolemy.kernel.util.NameDuplicationException;
037
038///////////////////////////////////////////////////////////////////
039//// TextFieldContainerInterface
040
041/**
042 * The instance of this class would be able to visualize the value of a token
043 * within a text field that is placed into a container.  MonitorValue and Const are
044 * two classes using it.
045 * @author Ishwinder Singh
046 * @version $Id$
047 * @since Ptolemy II 10.0
048 * @Pt.ProposedRating Red (ahuseyno)
049 * @Pt.AcceptedRating Red (ahuseyno)
050 */
051public interface TextFieldContainerInterface {
052
053    /** Initiate .
054     * @param sink Object of the Sink actor.
055     * @exception IllegalActionException If the entity cannot be contained
056     * by the proposed container.
057     * @exception NameDuplicationException If the container already has an
058     * actor with this name.
059     */
060    public void init(Sink sink)
061            throws IllegalActionException, NameDuplicationException;
062
063    /** Place the visual representation of the actor into the specified container.
064     *  @param container The container in which to place the object
065     */
066    void place(PortableContainer container);
067
068    /** Set the text to the value of the token.
069     * @param token The token containing the value
070     */
071    void setValue(Token token);
072}