001/*
002 Interface encapsulating platform dependent code of the ImageDisplay from the
003 platform independent parts.
004
005 @Copyright (c) 1998-2016 The Regents of the University of California.
006 All rights reserved.
007
008 Permission is hereby granted, without written agreement and without
009 license or royalty fees, to use, copy, modify, and distribute this
010 software and its documentation for any purpose, provided that the
011 above copyright notice and the following two paragraphs appear in all
012 copies of this software.
013
014 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
015 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
016 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
017 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
018 SUCH DAMAGE.
019
020 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
021 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
022 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
023 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
024 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
025 ENHANCEMENTS, OR MODIFICATIONS.
026
027 PT_COPYRIGHT_VERSION 2
028 COPYRIGHTENDKEY
029 */
030package ptolemy.actor.lib.image;
031
032import java.awt.Color;
033import java.awt.Container;
034
035import ptolemy.data.Token;
036import ptolemy.kernel.util.IllegalActionException;
037import ptolemy.kernel.util.NameDuplicationException;
038
039//////////////////////////////////////////////////////////////////////////
040////ImageDisplayInterface
041/**
042 * Interface encapsulating platform dependent code of the ImageDisplay from the
043 * platform independent parts.
044 * @author Jianwu Wang
045 * @version $Id$
046 * @since Ptolemy II 10.0
047 * @Pt.ProposedRating
048 * @Pt.AcceptedRating
049 */
050public interface ImageDisplayInterface {
051
052    /**
053     * Free up memory when closing.
054     */
055    public void cleanUp();
056
057    /** Display the specified token.
058     *  @param in The token to display
059     *  @exception IllegalActionException If the input is not acceptable to the
060     *   implementation.
061     */
062    public void display(Token in) throws IllegalActionException;
063
064    /** Get the background.
065     *  @return The background color.
066     *  @see #setBackground(Color)
067     */
068    public Color getBackground();
069
070    /**
071     * Get the image's frame.
072     * @return the image's frame.
073     * @see #setFrame(Object)
074     */
075    public Object getFrame();
076
077    /**
078     * Get the platform dependent picture that contains the image.
079     * @return the platform dependent container.
080     * @see #setPicture(Object)
081     */
082    public Object getPicture();
083
084    /**
085     * Get the platform dependent container that contains the image.
086     * @return the platform dependent container.
087     * @see #setPlatformContainer(Object)
088     */
089    public Object getPlatformContainer();
090
091    /**
092     * Get the image tableau.
093     * @return the image tableau.
094     */
095    public Object getTableau();
096
097    /** Initialize an object.  Derived classes should include
098     * class-specific initialization here.
099     * @param imageDisplay The object to be initialized
100     * @exception IllegalActionException If the entity cannot be contained
101     * by the proposed container.
102     * @exception NameDuplicationException If the container already has an
103     * actor with this name.
104     */
105    public void init(ImageDisplay imageDisplay)
106            throws IllegalActionException, NameDuplicationException;
107
108    /**
109     * Initialize the effigy of the image.
110     * @exception IllegalActionException If there is a problem initializing the effigy
111     */
112    public void initializeEffigy() throws IllegalActionException;
113
114    /**
115     * Initialize window and size attributes.
116     * @exception IllegalActionException If there is a problem creating the attributes.
117     * @exception NameDuplicationException If there is a problem creating the attributes.
118     */
119    public void initWindowAndSizeProperties()
120            throws IllegalActionException, NameDuplicationException;
121
122    /** Set the container to be placed.
123     *  @param container The Container to be placed.
124     */
125    public void placeContainer(Container container);
126
127    /** Set the background.
128     *  @param background The background color.
129     *  @see #getBackground()
130     */
131    public void setBackground(Color background);
132
133    /**
134     * Set the frame of the image.
135     * @param frame The frame to set.
136     * @see #getFrame()
137     */
138    public void setFrame(Object frame);
139
140    /**
141     * Set the platform dependent picture of the image.
142     * The container can be AWT container or Android view.
143     * @param picture The picture
144     * @see #getPicture()
145     */
146    public void setPicture(Object picture);
147
148    /**
149     * Set the platform dependent container of the image.
150     * The container can be AWT container or Android view.
151     * @param container the platform dependent container.
152     * @see #getPlatformContainer()
153     */
154    public void setPlatformContainer(Object container);
155
156}