001 /* sillyview : a free model-view-controller system for Java 002 * Copyright (C) 2004 T.J. Willis 003 * 004 * This program is free software; you can redistribute it and/or 005 * modify it under the terms of the GNU General Public License 006 * as published by the Free Software Foundation; either version 2 007 * of the License, or (at your option) any later version. 008 * 009 * This program is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 012 * GNU General Public License for more details. 013 * 014 * You should have received a copy of the GNU General Public License 015 * along with this program; if not, write to the Free Software 016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. 017 * 018 * $Header: /cvsroot/sillyview/sillyview/src/net/sourceforge/sillyview/WidgetView.java,v 1.2 2004/05/15 01:58:51 tj_willis Exp $ 019 */ 020 package net.sourceforge.sillyview; 021 import java.util.Map; 022 023 /** 024 * A base interface for views. Every view must be able to set a token, 025 * and get a token, as well as set/get it's backing model. 026 * 027 * @author <a href="mailto:tj_willis@users.sourceforge.net">T.J. Willis</a> 028 * @version 1.0 029 * @opt operations 030 * @has - Has 1 net.sourceforge.sillyview.WidgetModel 031 */ 032 public interface WidgetView { 033 /** 034 * Used to set boolean properties to true. 035 * 036 */ 037 static final String TRUE = "TRUE"; 038 /** 039 * Used to set boolean properties to false. 040 * 041 */ 042 static final String FALSE = "FALSE"; 043 /** 044 * Used to set a view's title. 045 * 046 */ 047 public static String TITLE = "<@TITLE>"; 048 049 /** 050 * Describe <code>setToken</code> method here. 051 * 052 * @param key an <code>Object</code> value 053 * @param value an <code>Object</code> value 054 */ 055 void setToken (Object key, Object value); 056 /** 057 * Describe <code>addTokens</code> method here. 058 * 059 * @param props a <code>Map</code> value 060 */ 061 void addTokens (Map < Object, Object > props); 062 /** 063 * Describe <code>getValue</code> method here. 064 * 065 * @param key an <code>Object</code> value 066 * @return an <code>Object</code> value 067 */ 068 Object getValue (Object key); 069 /** 070 * Describe <code>getModel</code> method here. 071 * 072 * @return a <code>WidgetModel</code> value 073 */ 074 WidgetModel getModel (); 075 /** 076 * Describe <code>setModel</code> method here. 077 * 078 * @param newModel a <code>WidgetModel</code> value 079 */ 080 void setModel (WidgetModel newModel); 081 082 }