001/* 002 Interface encapsulating platform dependent code of the PlotterBase from the 003 platform independent parts. 004 005 @Copyright (c) 1998-2014 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.gui; 031 032import ptolemy.kernel.util.IllegalActionException; 033import ptolemy.kernel.util.NameDuplicationException; 034import ptolemy.plot.PlotBoxInterface; 035 036////////////////////////////////////////////////////////////////////////// 037//// PlotterBaseInterface 038/** 039 * Interface encapsulating platform dependent code of the PlotterBase from the 040 * platform independent parts. 041 * @author Anar Huseynov 042 * @version $Id$ 043 * @since Ptolemy II 10.0 044 * @Pt.ProposedRating Red (ahuseyno) 045 * @Pt.AcceptedRating Red (ahuseyno) 046 */ 047public interface PlotterBaseInterface { 048 049 /** 050 * Free up memory when closing. 051 */ 052 public void cleanUp(); 053 054 /** 055 * Bring the plotter frame to the front. 056 */ 057 public void bringToFront(); 058 059 /** 060 * Get the plotter's frame. 061 * @return the plotter's frame. 062 * @see #setFrame(Object) 063 */ 064 public Object getFrame(); 065 066 /** 067 * Get the platform dependent container that contains the plotter. 068 * @return the platform dependent container. 069 * @see #setPlatformContainer(Object) 070 */ 071 public Object getPlatformContainer(); 072 073 /** 074 * Get the plotter tableau. 075 * @return the plotter tableau. 076 */ 077 public Object getTableau(); 078 079 /** 080 * Initialize the implementation. 081 * @param plotterBase the instance that created the implementation. 082 */ 083 public void init(PlotterBase plotterBase); 084 085 /** 086 * Initialize the effigy of the plotter. 087 * @exception IllegalActionException If there is a problem initializing the effigy 088 */ 089 public void initializeEffigy() throws IllegalActionException; 090 091 /** 092 * Initialize window and size attributes. 093 * @exception IllegalActionException if there is a problem creating the attributes. 094 * @exception NameDuplicationException if there is a problem creating the attributes. 095 */ 096 public void initWindowAndSizeProperties() 097 throws IllegalActionException, NameDuplicationException; 098 099 /** 100 * Create a new instance of the PlotBoxInterface implementation. 101 * @return a new instance of the PlotBoxInterface implementation. 102 */ 103 public PlotBoxInterface newPlot(); 104 105 /** 106 * Remove the plot from the current container, if there is one. 107 */ 108 public void remove(); 109 110 /** 111 * Remove the plot from the frame if the container is null. 112 */ 113 public void removeNullContainer(); 114 115 /** 116 * Set the frame of the plotter. 117 * @param frame The frame to set. 118 * @see #getFrame() 119 */ 120 public void setFrame(Object frame); 121 122 /** 123 * Set the title of the tableau. 124 * @param title the title to set. 125 */ 126 public void setTableauTitle(String title); 127 128 /** 129 * Set the platform dependent container of the plotter. 130 * The container can be AWT container or Android view. 131 * @param container the platform dependent container. 132 * @see #getPlatformContainer() 133 */ 134 public void setPlatformContainer(Object container); 135 136 /** 137 * Update size attribute of the plotter. 138 */ 139 public void updateSize(); 140 141 /** 142 * Update values of the attributes. 143 */ 144 public void updateWindowAndSizeAttributes(); 145}