/* Uiml.Net: a .Net UIML renderer (http://lumumba.uhasselt.be/kris/research/uiml.net) Copyright (C) 2003 Kris Luyten (kris.luyten@uhasselt.be) Expertise Centre for Digital Media (http://edm.uhasselt.be) Hasselt University This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ namespace Uiml{ using System; using System.Xml; using System.Collections; /// /// Implements the structure element of Uiml. Instead of allowing several parts as "top"-elements /// this implementation only allows one part as a top element. When the structure element /// has several part elements it embeds these children as the children of one part element "Top". /// Top will be the only child of structure then. /// ///<!ELEMENT structure (part*)> ///<!ATTLIST structure id NMTOKEN #IMPLIED /// source CDATA #IMPLIED /// how (append|cascade|replace) "replace" /// export (hidden|optional|required) "optional"> /// public class Structure : UimlAttributes, IUimlElement{ private Part m_top; public Structure() { } public Structure(XmlNode n) { Process(n); } /// ///Processes the structure subtree /// /// ///precondition: n has children /// public void Process(XmlNode n) { if(n.Name != IAM) return; base.ReadAttributes(n); if(n.ChildNodes.Count == 1) { m_top = new Part(n.ChildNodes[0]); } else { m_top = new Part("top-container"); m_top.Class = "Frame"; XmlNodeList xnl = n.ChildNodes; for(int i=0; i