/*
 * Copyright (C) 1999-2006 <a href="mailto:adrian.paschke@gmx.de">Adrian Paschke</a>
 * 
 * The RBSLM Environment is part of the Rule Based Service Level Agreement (RBSLA)
 * framework, available at 
 * <a href=" http://ibis.in.tum.de/staff/paschke/rbsla/index.htm">RBSLA</a>
 * 
 * This library 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 of the License, or (at your option) any later version.
 *
 * This library 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 library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package rbsla.environment.view;

import java.awt.Dimension;
import java.awt.Point;
import java.io.Serializable;
import java.util.Hashtable;
import java.util.Observable;


/**
 * Modell of the MVC Pattern.
 * 
 */
public class ViewModell extends Observable implements Serializable
{

    // change this, changes the elements of the property file
    // old property files may not be readable any more

    private String query = "";

    private String viewTitel = "";

    private Dimension dimension = new Dimension(400, 200);

    private Point position = new Point(100, 100);

    private String viewer = "";

    private Hashtable viewerProperties = new Hashtable();

    // transient attributes
    
    transient private String debugText = "";

    transient private String result = "";
    
    {

    }

    public String getQuery()
    {
        return query;
    }

    public void setQuery(String query)
    {
        this.query = query;
        notifyDataChange();
    }

    public String getResult()
    {
        return result;
    }

    public void setResult(String result, String debugText)
    {
        this.result = result;
        this.debugText = debugText;
        notifyDataChange();
    }

    public String getViewTitel()
    {
        return viewTitel;
    }

    public String getDebugText()
    {
        return debugText;
    }

    public void setViewTitel(String viewTitel)
    {
        this.viewTitel = viewTitel;
        notifyDataChange();
    }

    public String getViewerClassName()
    {
        return viewer;
    }

    public void setViewerClassName(String viewer)
    {
        this.viewer = viewer;
        notifyDataChange();
    }

    public Dimension getDimension()
    {
        return dimension;
    }

    public void setDimension(Dimension _dimension)
    {
        dimension = _dimension;
    }

    public Point getPosition()
    {
        return position;
    }

    public void setPosition(Point _position)
    {
        position = _position;
    }

    public Hashtable getViewerProperties()
    {
        return viewerProperties;
    }

    public void setViewerProperties(Hashtable _viewerProperties)
    {
        viewerProperties = _viewerProperties;
        notifyDataChange();
    }

    public void notifyDataChange()
    {
        setChanged();
        notifyObservers();
    }
    
   }