/* Copyright 2002 Graham Ritchie This file is part of Intellego. Intellego is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Intellego 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 General Public License for more details. You should have received a copy of the GNU General Public License along with Intellego; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package main; import interfaces.*; import javax.swing.*; import java.awt.*; import java.lang.*; import java.util.*; import java.awt.geom.*; /** * Provides a simple display for any SimWorld * * @author Graham Ritchie */ class SimpleDisplay extends SimDisplay { private SimWorld world; private Graphics2D g2; private BasicStroke stroke; private Color color; /** * Sets up this display * * @param s the SimWorld to be displayed */ public SimpleDisplay(SimWorld s) { // set world world=s; this.repaint(); stroke=new BasicStroke(1.0f,BasicStroke.CAP_SQUARE,BasicStroke.JOIN_BEVEL); } /** * Main repaint method */ public void paintComponent(Graphics g) { // paint background super.paintComponent(g); this.setBackground(Color.white); // cast g to a Graphics2D instance g2=(Graphics2D)g; // get the world's object list LinkedList list=world.getObjectList(); // draw a shape for each object for (int i=0;i