Class SimulationWindow

java.lang.Object
microsim.gui.shell.SimulationWindow

public class SimulationWindow extends 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 Details

    • SimulationWindow

      public SimulationWindow(String model, String key, 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 Details

    • getBounds

      public 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 String getKey()
      Return the key of the SimWindow object
      Returns:
      The key value.
    • getModel

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

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

      public Container getWindow()
      Return the the SimWindow container
    • getDefaultPosition

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

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

      public String toString()
      Overrides:
      toString in class Object