/*
* Copyright (c) 2008 Paul C. Buetow, vs@dev.buetow.org
*
* This program 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.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU 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.
*
* All icons of the icons/ folder are under a Creative Commons
* Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
*
* The icon's homepage is http://code.google.com/p/ultimate-gnome/
*/
package simulator;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
import core.*;
import core.time.*;
import events.*;
import events.implementations.*;
import events.internal.*;
import prefs.*;
import prefs.editors.*;
import serialize.*;
import utils.*;
/**
* The class VSSimulatorCanvas. An instance of this object represents the
* graphical paint area of a simulator. It contains all graphic calculations.
* Also the simulator thread takes place in this class in a loop! This class
* is probably the most cryptic of the whole simulator source code. This is
* this way in order to gain more performance of the painting area!
*
* @author Paul C. Buetow
*/
public class VSSimulatorCanvas extends Canvas
implements Runnable, VSSerializable {
/** The serial version uid */
private static final long serialVersionUID = 1L;
/** The highlighted process. */
private VSProcess highlightedProcess;
/** The simulator. */
private VSSimulator simulator;
/** The prefs. */
private VSPrefs prefs;
/** The logging. */
private VSLogging logging;
/** The num processes. */
private volatile int numProcesses;
/** The seconds spaceing. */
private int secondsSpaceing;
/** The thread sleep. */
private int threadSleep;
/** The until time. Until then goes the simulator? */
private long untilTime;
/** The simulator is paused. */
private volatile boolean isPaused = true;
/** The simulator thread is stopped. */
private volatile boolean hasThreadStopped = false;
/** The simulator is finished. */
private volatile boolean hasFinished = false;
/** The simulator is resetted. */
private volatile boolean isResetted = false;
/** The simulator is anti aliased. */
private volatile boolean isAntiAliased = false;
/** The simulator's anti
|