Class SimulationWindow


  • public class SimulationWindow
    extends java.lang.Object
    SimWindow keeps preferred dimensions of a simulation windows.

    Title: JAS

    Description: Java Agent-based Simulation library

    Copyright (C) 2002 Michele Sonnessa

    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.1 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.
    Author:
    Michele Sonnessa

    • Constructor Summary

      Constructors 
      Constructor Description
      SimulationWindow​(java.lang.String model, java.lang.String key, java.awt.Container window)
      Create a new window container with the given parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Rectangle getBounds()
      Return the dimension of the managed window.
      java.awt.Rectangle getDefaultPosition()
      Return the default bounds for the window
      java.lang.String getKey()
      Return the key of the SimWindow object
      java.lang.String getModel()
      The owner model id
      java.awt.Container getWindow()
      Return the the SimWindow container
      void setDefaultPosition​(java.awt.Rectangle rectangle)
      Set the default dimensions
      void setWindow​(java.awt.Container container)
      Attach a window to the SimWindow container
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SimulationWindow

        public SimulationWindow​(java.lang.String model,
                                java.lang.String key,
                                java.awt.Container window)
        Create a new window container with the given parameters.
        Parameters:
        model - The id of the model owner
        key - The key used to store the element in the HashMap
        window - The window to be managed
    • Method Detail

      • getBounds

        public java.awt.Rectangle getBounds()
        Return the dimension of the managed window. If the window is not yet created the method returns the default bounds.
        Returns:
        The window dimensions if present or the default ones if not.
      • getKey

        public java.lang.String getKey()
        Return the key of the SimWindow object
        Returns:
        The key value.
      • getModel

        public java.lang.String getModel()
        The owner model id
        Returns:
        A string representing the model id.
      • setWindow

        public void setWindow​(java.awt.Container container)
        Attach a window to the SimWindow container
        Parameters:
        container - A container window object
      • getWindow

        public java.awt.Container getWindow()
        Return the the SimWindow container
      • getDefaultPosition

        public java.awt.Rectangle getDefaultPosition()
        Return the default bounds for the window
        Returns:
        The default position of the window
      • setDefaultPosition

        public void setDefaultPosition​(java.awt.Rectangle rectangle)
        Set the default dimensions
        Parameters:
        rectangle - The new default bounds of the window
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object