diff options
Diffstat (limited to 'sources')
62 files changed, 483 insertions, 1930 deletions
diff --git a/sources/core/VSAbstractProcess.java b/sources/core/VSAbstractProcess.java index 5f8987a..83ff99d 100644 --- a/sources/core/VSAbstractProcess.java +++ b/sources/core/VSAbstractProcess.java @@ -1,40 +1,23 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 core; -import java.awt.*; -import java.io.*; -import java.util.*; - -import core.time.*; -//import events.*; -//import events.implementations.*; -import prefs.*; -import protocols.*; -import serialize.*; -import simulator.*; -import utils.*; +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; + +import core.time.VSLamportTime; +import core.time.VSTime; +import core.time.VSVectorTime; +import prefs.VSPrefs; +import prefs.VSSerializablePrefs; +import protocols.VSAbstractProtocol; +import serialize.VSSerialize; +import simulator.VSLogging; +import simulator.VSSimulatorVisualization; +import utils.VSPriorityQueue; +import utils.VSRandom; +import utils.VSTools; /** * The class VSAbstractProcess, an object of this class represents a process @@ -42,8 +25,7 @@ import utils.*; * * @author Paul C. Buetow */ -public abstract class VSAbstractProcess extends VSSerializablePrefs - implements VSSerializable { +public abstract class VSAbstractProcess extends VSSerializablePrefs { /** The data serialization id. */ protected static final long serialVersionUID = 1L; @@ -261,7 +243,7 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs final int numProcesses = simulatorVisualization.getNumProcesses(); for (int i = 0; i < numProcesses; ++i) - vectorTime.add(new Long(0)); + vectorTime.add(Long.valueOf(0)); } /** @@ -277,7 +259,7 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs final int numProcesses = simulatorVisualization.getNumProcesses(); for (int i = numProcesses; i > 0; --i) - vectorTime.add(new Long(0)); + vectorTime.add(Long.valueOf(0)); } /** @@ -368,7 +350,7 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs */ public synchronized void isCrashed(boolean isCrashed) { this.isCrashed = isCrashed; - crashHistory.add(new Long(globalTime)); + crashHistory.add(Long.valueOf(globalTime)); if (!hasCrashed) hasCrashed = true; } @@ -514,7 +496,7 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs */ public synchronized void increaseVectorTime() { vectorTime.set(processNum, - new Long(vectorTime.get(processNum).longValue()+1)); + Long.valueOf(vectorTime.get(processNum).longValue()+1)); vectorTime.setGlobalTime(globalTime); vectorTimeHistory.add(vectorTime.getCopy()); } @@ -530,7 +512,7 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs for (int i = 0; i < size; ++i) { if (i == processNum) - vectorTime.set(i, new Long(vectorTime.get(i).longValue()+1)); + vectorTime.set(i, Long.valueOf(vectorTime.get(i).longValue()+1)); else if (vectorTimeUpdate.get(i) > vectorTime.get(i)) vectorTime.set(i, vectorTimeUpdate.get(i)); } @@ -673,24 +655,23 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs + "; id: " + processID + ")"); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); - objectOutputStream.writeObject(new Integer(processID)); - objectOutputStream.writeObject(new Integer(protocolsToReset.size())); + objectOutputStream.writeObject(Integer.valueOf(processID)); + objectOutputStream.writeObject(Integer.valueOf(protocolsToReset.size())); for (VSAbstractProtocol protocol : protocolsToReset) { objectOutputStream.writeObject(protocol.getClassname()); protocol.serialize(serialize, objectOutputStream); } /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { @@ -699,7 +680,6 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs /* Bugfix, being compatible with old versions */ super.deleteLong("process.localTime"); - updateFromPrefs_(); if (VSSerialize.DEBUG) diff --git a/sources/core/VSInternalProcess.java b/sources/core/VSInternalProcess.java index 6bb9c66..c2166b9 100644 --- a/sources/core/VSInternalProcess.java +++ b/sources/core/VSInternalProcess.java @@ -1,37 +1,16 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 core; -import java.awt.*; +import java.awt.Color; -import core.time.*; -import events.*; -import events.implementations.*; -import prefs.*; -import protocols.*; -import simulator.*; -import utils.*; +import core.time.VSVectorTime; +import events.VSAbstractEvent; +import events.VSRegisteredEvents; +import events.implementations.VSProcessCrashEvent; +import prefs.VSPrefs; +import protocols.VSAbstractProtocol; +import simulator.VSLogging; +import simulator.VSSimulatorVisualization; +import utils.VSPriorityQueue; /** * The class VSInternalProcess, an object of this class represents a process @@ -372,9 +351,9 @@ public class VSInternalProcess extends VSAbstractProcess { * simulator. */ public synchronized void addedAProcess() { - vectorTime.add(new Long(0)); + vectorTime.add(Long.valueOf(0)); for (VSVectorTime vectorTime : vectorTimeHistory) - vectorTime.add(new Long(0)); + vectorTime.add(Long.valueOf(0)); } /** diff --git a/sources/core/VSMessage.java b/sources/core/VSMessage.java index b53060d..28e1b84 100644 --- a/sources/core/VSMessage.java +++ b/sources/core/VSMessage.java @@ -1,30 +1,7 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 core; -import core.time.*; -import events.*; +import core.time.VSVectorTime; +import events.VSRegisteredEvents; import prefs.VSPrefs; /** @@ -34,9 +11,6 @@ import prefs.VSPrefs; * @author Paul C. Buetow */ public class VSMessage extends VSPrefs { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The constant IS_SERVER_MESSAGE. */ public static final boolean IS_SERVER_MESSAGE = true; diff --git a/sources/core/VSMessageStub.java b/sources/core/VSMessageStub.java index f635335..95a515b 100644 --- a/sources/core/VSMessageStub.java +++ b/sources/core/VSMessageStub.java @@ -1,32 +1,5 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 core; -//import core.time.*; -//import events.*; -//import prefs.VSPrefs; - /** * An object of this class represents a message stub. A message stub allows * to run the init method on a VSMessage object. The init method should be @@ -35,9 +8,6 @@ package core; * @author Paul C. Buetow */ public class VSMessageStub { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The message */ private VSMessage message; @@ -58,4 +28,3 @@ public class VSMessageStub { message.init(process, protocolClassname, isServerMessage); } } - diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java index 2d44139..3e06a7f 100644 --- a/sources/core/VSTask.java +++ b/sources/core/VSTask.java @@ -1,39 +1,23 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 -2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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 core; -import java.io.*; - -import events.*; -import events.implementations.*; -import events.internal.*; -import exceptions.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +import events.VSAbstractEvent; +import events.VSRegisteredEvents; +import events.implementations.VSProcessCrashEvent; +import events.implementations.VSProcessRecoverEvent; +import events.internal.VSAbstractInternalEvent; +import events.internal.VSMessageReceiveEvent; +import events.internal.VSProtocolEvent; +import exceptions.VSEventNotCopyableException; import prefs.VSPrefs; import protocols.VSAbstractProtocol; -import serialize.*; //import utils.*; +import serialize.VSNotSerializable; +import serialize.VSSerializable; +import serialize.VSSerialize; /** * The class VSTask, an object of this class represents a task to do or done. @@ -44,10 +28,7 @@ import serialize.*; * * @author Paul C. Buetow */ -public class VSTask implements Comparable, VSSerializable { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - +public class VSTask implements Comparable<Object>, VSSerializable { /** The Constant LOCAL. Used for the constructor if it's a local timed * task. */ @@ -450,9 +431,9 @@ public class VSTask implements Comparable, VSSerializable { ObjectOutputStream objectOutputStream) throws IOException { /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); - objectOutputStream.writeObject(new Integer(process.getProcessNum())); + objectOutputStream.writeObject(Integer.valueOf(process.getProcessNum())); if (event.getClassname() == null) event.init(process); @@ -461,22 +442,21 @@ public class VSTask implements Comparable, VSSerializable { System.out.println("Serializing: " + event.getClassname()); objectOutputStream.writeObject(event.getClassname()); - objectOutputStream.writeObject(new Integer(event.getID())); + objectOutputStream.writeObject(Integer.valueOf(event.getID())); event.serialize(serialize, objectOutputStream); - objectOutputStream.writeObject(new Integer(taskNum)); - objectOutputStream.writeObject(new Long(taskTime)); - objectOutputStream.writeObject(new Boolean(isGlobalTimed)); - objectOutputStream.writeObject(new Boolean(isProgrammed)); + objectOutputStream.writeObject(Integer.valueOf(taskNum)); + objectOutputStream.writeObject(Long.valueOf(taskTime)); + objectOutputStream.writeObject(Boolean.valueOf(isGlobalTimed)); + objectOutputStream.writeObject(Boolean.valueOf(isProgrammed)); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/core/VSTaskManager.java b/sources/core/VSTaskManager.java index 643462a..f2ad734 100644 --- a/sources/core/VSTaskManager.java +++ b/sources/core/VSTaskManager.java @@ -1,36 +1,17 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 -2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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 core; -import java.io.*; -import java.util.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.PriorityQueue; -import prefs.*; -import serialize.*; -import simulator.*; -import utils.*; +import prefs.VSPrefs; +import serialize.VSSerializable; +import serialize.VSSerialize; +import simulator.VSSimulatorVisualization; +import utils.VSPriorityQueue; /** * The class VSTaskManager, it is responsible that all tasks will get @@ -40,9 +21,6 @@ import utils.*; * @author Paul C. Buetow */ public class VSTaskManager implements VSSerializable { - /** The seriao version uid */ - private static final long serialVersionUID = 1L; - /** The simulator canvas. */ private VSSimulatorVisualization simulatorVisualization; @@ -510,7 +488,7 @@ public class VSTaskManager implements VSSerializable { ObjectOutputStream objectOutputStream) throws IOException { /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); ArrayList<VSTask> serializeThoseTasks = new ArrayList<VSTask>(); @@ -538,19 +516,18 @@ public class VSTaskManager implements VSSerializable { } objectOutputStream.writeObject( - new Integer(serializeThoseTasks.size())); + Integer.valueOf(serializeThoseTasks.size())); for (VSTask task : serializeThoseTasks) task.serialize(serialize, objectOutputStream); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/core/time/VSLamportTime.java b/sources/core/time/VSLamportTime.java index 5716f2b..be1226b 100644 --- a/sources/core/time/VSLamportTime.java +++ b/sources/core/time/VSLamportTime.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 core.time; /** @@ -29,9 +6,6 @@ package core.time; * @author Paul C. Buetow */ public class VSLamportTime implements VSTime { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** Specified the global time of the lamport timestamp. It's used for * correct painting position in the simulator canvas paint area. */ diff --git a/sources/core/time/VSTime.java b/sources/core/time/VSTime.java index b689f34..d46e0e4 100644 --- a/sources/core/time/VSTime.java +++ b/sources/core/time/VSTime.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 core.time; /** diff --git a/sources/core/time/VSVectorTime.java b/sources/core/time/VSVectorTime.java index de9deeb..4e63b3c 100644 --- a/sources/core/time/VSVectorTime.java +++ b/sources/core/time/VSVectorTime.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 core.time; import java.util.ArrayList; @@ -112,7 +89,7 @@ public class VSVectorTime extends ArrayList<Long> implements VSTime { */ public Long get(int index) { if (index >= super.size()) - return new Long(0); + return Long.valueOf(0); return super.get(index); } diff --git a/sources/events/VSAbstractEvent.java b/sources/events/VSAbstractEvent.java index 934fbcf..f61f76f 100644 --- a/sources/events/VSAbstractEvent.java +++ b/sources/events/VSAbstractEvent.java @@ -1,36 +1,15 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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 events; -import java.io.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import core.VSAbstractProcess; import core.VSInternalProcess; -import exceptions.*; -import prefs.*; -import serialize.*; +import exceptions.VSEventNotCopyableException; +import prefs.VSPrefs; +import prefs.VSSerializablePrefs; +import serialize.VSSerialize; /** * The class VSAbstractEvent. This abstract class defines the basic framework @@ -40,9 +19,6 @@ import serialize.*; * @author Paul C. Buetow */ abstract public class VSAbstractEvent extends VSSerializablePrefs { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The prefs. */ public VSPrefs prefs; @@ -224,21 +200,20 @@ abstract public class VSAbstractEvent extends VSSerializablePrefs { System.out.println("Serializing: VSAbstractEvent; id="+getID()); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); - objectOutputStream.writeObject(new Integer(super.getID())); + objectOutputStream.writeObject(Integer.valueOf(super.getID())); objectOutputStream.writeObject(eventShortname); objectOutputStream.writeObject(eventClassname); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/events/VSCopyableEvent.java b/sources/events/VSCopyableEvent.java index 5862c6d..23125ce 100644 --- a/sources/events/VSCopyableEvent.java +++ b/sources/events/VSCopyableEvent.java @@ -1,29 +1,5 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 events; - /** * The interface VSCopyableEvent, all events which implement this class * are copyable. diff --git a/sources/events/VSRegisteredEvents.java b/sources/events/VSRegisteredEvents.java index 0c53e98..57c28c7 100644 --- a/sources/events/VSRegisteredEvents.java +++ b/sources/events/VSRegisteredEvents.java @@ -1,33 +1,14 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 events; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Set; +import java.util.Vector; -import prefs.*; -import core.*; -import utils.*; +import core.VSInternalProcess; +import prefs.VSPrefs; +import utils.VSClassLoader; /** * The class VSRegisteredEvents. This class is responsible to manage all @@ -38,9 +19,6 @@ import utils.*; * @author Paul C. Buetow */ public final class VSRegisteredEvents { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The event classnames by eventnames. */ private static HashMap<String,String> eventClassnamesByNames = new HashMap<String,String>(); @@ -80,37 +58,6 @@ public final class VSRegisteredEvents { */ public static void init(VSPrefs prefs_) { prefs = prefs_; - - /* - registerEvent("events.implementations.VSProcessCrashEvent", - "Prozessabsturz"); - registerEvent("events.implementations.VSProcessRecoverEvent", - "Prozesswiederbelebung"); - registerEvent("protocols.implementations.VSBasicMulticastProtocol", - "Basic Multicast", "Basic Multicast"); - registerEvent("protocols.implementations.VSBerkelyTimeProtocol", - "Berkeley Algorithmus zur internen Sync.", "Berkeley"); - registerEvent("protocols.implementations.VSBroadcastProtocol", - "Broadcast"); - registerEvent("protocols.implementations.VSDummyProtocol", - "Beispiel/Dummy"); - registerEvent("protocols.implementations.VSExternalTimeSyncProtocol", - "Christians Methode zur externen Sync.", "Christians"); - registerEvent("protocols.implementations.VSInternalTimeSyncProtocol", - "Interne Synchronisation", "Interne Sync."); - registerEvent("protocols.implementations.VSOnePhaseCommitProtocol", - "Ein-Phasen Commit", "1-Phasen Commit"); - registerEvent("protocols.implementations.VSPingPongProtocol", - "Ping Pong"); - registerEvent("protocols.implementations.VSReliableMulticastProtocol", - "Reliable Multicast", "Reliable Multicast"); - registerEvent("protocols.implementations.VSTwoPhaseCommitProtocol", - "Zwei-Phasen Commit", "2-Phasen Commit"); - */ - - /* Using the NEW way. The old way above (specifying protocol names - in this file still works as well */ - registerEvent("events.implementations.VSProcessCrashEvent"); registerEvent("events.implementations.VSProcessRecoverEvent"); registerEvent("protocols.implementations.VSBasicMulticastProtocol"); @@ -161,7 +108,7 @@ public final class VSRegisteredEvents { if (serverProtocol.hasOnServerStart()) isOnServerStartProtocol.put(protocolClassname, - new Boolean(true)); + Boolean.valueOf(true)); } } } @@ -384,16 +331,6 @@ public final class VSRegisteredEvents { * * @param eventClassname the event classname * @param eventName the event name - */ - private static void registerEvent(String eventClassname, String eventName) { - registerEvent(eventClassname, eventName, null); - } - - /** - * Registers an event. - * - * @param eventClassname the event classname - * @param eventName the event name * @param eventShortname the event shortname */ private static void registerEvent(String eventClassname, String eventName, diff --git a/sources/events/implementations/VSProcessCrashEvent.java b/sources/events/implementations/VSProcessCrashEvent.java index 84c4b36..d9d4df1 100644 --- a/sources/events/implementations/VSProcessCrashEvent.java +++ b/sources/events/implementations/VSProcessCrashEvent.java @@ -1,31 +1,8 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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 events.implementations; -import events.*; -import simulator.*; +import events.VSAbstractEvent; +import events.VSCopyableEvent; +import simulator.VSMain; /** * The class VSProcessCrashEvent. This event makes a process to crash. @@ -34,9 +11,6 @@ import simulator.*; */ public class VSProcessCrashEvent extends VSAbstractEvent implements VSCopyableEvent { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /* (non-Javadoc) * @see events.VSCopyableEvent#initCopy(events.VSAbstractEvent) */ diff --git a/sources/events/implementations/VSProcessRecoverEvent.java b/sources/events/implementations/VSProcessRecoverEvent.java index 9aba31d..fc47bbd 100644 --- a/sources/events/implementations/VSProcessRecoverEvent.java +++ b/sources/events/implementations/VSProcessRecoverEvent.java @@ -1,31 +1,8 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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 events.implementations; -import events.*; -import simulator.*; +import events.VSAbstractEvent; +import events.VSCopyableEvent; +import simulator.VSMain; /** * The class VSProcessRecoverEvent. This event makes a process to recover if @@ -35,9 +12,6 @@ import simulator.*; */ public class VSProcessRecoverEvent extends VSAbstractEvent implements VSCopyableEvent { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /* (non-Javadoc) * @see events.VSCopyableEvent#initCopy(events.VSAbstractEvent) */ diff --git a/sources/events/internal/VSAbstractInternalEvent.java b/sources/events/internal/VSAbstractInternalEvent.java index 3d2d6b3..e8e2d13 100644 --- a/sources/events/internal/VSAbstractInternalEvent.java +++ b/sources/events/internal/VSAbstractInternalEvent.java @@ -1,30 +1,8 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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 events.internal; -import java.io.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import events.VSAbstractEvent; import serialize.VSSerialize; @@ -36,14 +14,11 @@ import serialize.VSSerialize; * @author Paul C. Buetow */ abstract public class VSAbstractInternalEvent extends VSAbstractEvent { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /* (non-Javadoc) * @see events.VSAbstractEvent#createShortname()() */ protected String createShortname(String savedShortname) { - return savedShortname; + return savedShortname; } /* (non-Javadoc) @@ -56,17 +31,16 @@ abstract public class VSAbstractInternalEvent extends VSAbstractEvent { super.serialize(serialize, objectOutputStream); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/events/internal/VSMessageReceiveEvent.java b/sources/events/internal/VSMessageReceiveEvent.java index c7f9113..323a6d8 100644 --- a/sources/events/internal/VSMessageReceiveEvent.java +++ b/sources/events/internal/VSMessageReceiveEvent.java @@ -1,30 +1,5 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 events.internal; -//import java.io.*; - import core.VSMessage; import protocols.VSAbstractProtocol; import serialize.VSNotSerializable; @@ -37,8 +12,6 @@ import serialize.VSNotSerializable; */ public class VSMessageReceiveEvent extends VSAbstractInternalEvent implements VSNotSerializable { - /** The serioal version uid */ - private static final long serialVersionUID = 1L; /** The message. */ private VSMessage message; @@ -63,8 +36,7 @@ public class VSMessageReceiveEvent extends VSAbstractInternalEvent * @see events.VSAbstractEvent#onStart() */ public void onStart() { - boolean onlyRelevantMessages = process.getPrefs().getBoolean( - "sim.messages.relevant"); + boolean onlyRelevantMessages = process.getPrefs().getBoolean("sim.messages.relevant"); //String eventName = message.getName(); String protocolClassname = message.getProtocolClassname(); diff --git a/sources/events/internal/VSProtocolEvent.java b/sources/events/internal/VSProtocolEvent.java index f9a531c..c39b639 100644 --- a/sources/events/internal/VSProtocolEvent.java +++ b/sources/events/internal/VSProtocolEvent.java @@ -1,33 +1,13 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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 events.internal; -import java.io.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import core.VSInternalProcess; -import events.*; +import events.VSAbstractEvent; +import events.VSCopyableEvent; +import events.VSRegisteredEvents; import protocols.VSAbstractProtocol; import serialize.VSSerialize; @@ -42,9 +22,6 @@ import serialize.VSSerialize; */ public class VSProtocolEvent extends VSAbstractInternalEvent implements VSCopyableEvent { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The protocol classname. */ private String protocolClassname; @@ -160,21 +137,20 @@ public class VSProtocolEvent extends VSAbstractInternalEvent super.serialize(serialize, objectOutputStream); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); objectOutputStream.writeObject(protocolClassname); - objectOutputStream.writeObject(new Boolean(isClientProtocol)); - objectOutputStream.writeObject(new Boolean(isProtocolActivation)); + objectOutputStream.writeObject(Boolean.valueOf(isClientProtocol)); + objectOutputStream.writeObject(Boolean.valueOf(isProtocolActivation)); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/events/internal/VSProtocolScheduleEvent.java b/sources/events/internal/VSProtocolScheduleEvent.java index 6a0eed5..9c708ad 100644 --- a/sources/events/internal/VSProtocolScheduleEvent.java +++ b/sources/events/internal/VSProtocolScheduleEvent.java @@ -1,33 +1,12 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 events.internal; -import java.io.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; -//import events.*; import protocols.VSAbstractProtocol; -import serialize.*; +import serialize.VSNotSerializable; +import serialize.VSSerialize; /** * The class VSProtocolScheduleEvent, this event is used if a protocol (which @@ -38,9 +17,6 @@ import serialize.*; */ public class VSProtocolScheduleEvent extends VSAbstractInternalEvent implements VSNotSerializable { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The event is a server protocol schedule. */ private boolean isServerSchedule; /* true = server, false = client */ @@ -125,17 +101,16 @@ public class VSProtocolScheduleEvent extends VSAbstractInternalEvent super.serialize(serialize, objectOutputStream); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/exceptions/VSEventNotCopyableException.java b/sources/exceptions/VSEventNotCopyableException.java index 3eb89e6..f542db8 100644 --- a/sources/exceptions/VSEventNotCopyableException.java +++ b/sources/exceptions/VSEventNotCopyableException.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 exceptions; /** diff --git a/sources/exceptions/VSNegativeNumberException.java b/sources/exceptions/VSNegativeNumberException.java index 890ca71..edf2049 100644 --- a/sources/exceptions/VSNegativeNumberException.java +++ b/sources/exceptions/VSNegativeNumberException.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 exceptions; /** diff --git a/sources/exceptions/VSParseIntegerVectorException.java b/sources/exceptions/VSParseIntegerVectorException.java index 0fa61c1..19c2b82 100644 --- a/sources/exceptions/VSParseIntegerVectorException.java +++ b/sources/exceptions/VSParseIntegerVectorException.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 exceptions; /** diff --git a/sources/prefs/VSDefaultPrefs.java b/sources/prefs/VSDefaultPrefs.java index dfb2d2c..cfa579c 100644 --- a/sources/prefs/VSDefaultPrefs.java +++ b/sources/prefs/VSDefaultPrefs.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 prefs; import java.awt.Color; @@ -33,9 +10,6 @@ import java.awt.event.KeyEvent; * @author Paul C. Buetow */ public class VSDefaultPrefs extends VSSerializablePrefs { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** * Inits a prefs object with default values. * diff --git a/sources/prefs/VSDefaultPrefsDE.java b/sources/prefs/VSDefaultPrefsDE.java index cffa009..fb2eacb 100644 --- a/sources/prefs/VSDefaultPrefsDE.java +++ b/sources/prefs/VSDefaultPrefsDE.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 prefs; import java.awt.Color; @@ -33,9 +10,6 @@ import java.awt.event.KeyEvent; * @author Paul C. Buetow */ public class VSDefaultPrefsDE extends VSSerializablePrefs { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** * Inits a prefs object with default values. * @@ -72,7 +46,7 @@ public class VSDefaultPrefsDE extends VSSerializablePrefs { */ public void fillDefaultStrings() { initString("lang.de.about", "About"); - initString("lang.de.about.info", "Dieses Programm wurde von Paul Bütow im Rahmen der Diplomarbeit \"Objektorientierte Entwicklung eines GUI-basierten Tools für die ereignisbasierte Simulator verteilter Systeme\" bei Prof. Dr.-Ing. Oßmann als 1. Prüfer sowie Betreuer und Prof. Dr. rer. nat. Fassbender als 2. Prüfer erstellt. Bei Fehlern bitte eine kurze Mail mit Fehlerbeschreibung an vs@paul.buetow.org schicken!"); + initString("lang.de.about.info", "Dieses Programm wurde von Paul Bütow im Rahmen der Diplomarbeit \"Objektorientierte Entwicklung eines GUI-basierten Tools für die ereignisbasierte Simulator verteilter Systeme\" bei Prof. Dr.-Ing. Oßmann als 1. Prüfer sowie Betreuer und Prof. Dr. rer. nat. Fassbender als 2. Prüfer erstellt. Bei Fehlern bitte eine kurze Mail mit Fehlerbeschreibung an paul at buetow punkt org schicken!"); initString("lang.de.activate", "aktivieren"); initString("lang.de.activated", "aktiviert"); initString("lang.de.actualize", "Aktualisieren"); diff --git a/sources/prefs/VSPrefs.java b/sources/prefs/VSPrefs.java index 9f3be24..ea128df 100644 --- a/sources/prefs/VSPrefs.java +++ b/sources/prefs/VSPrefs.java @@ -1,33 +1,16 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 prefs; import java.awt.Color; -import java.io.*; -import java.util.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Set; +import java.util.Vector; -import serialize.*; +import serialize.VSSerialize; /** * The class VSPrefs, this class is for dynamic data storage. It can hold @@ -36,9 +19,6 @@ import serialize.*; * @author Paul C. Buetow */ public class VSPrefs { - /** Check if we want to overwrite description strings */ - //private boolean useDefaultStrings = false; - /** The Constant BOOLEAN_PREFIX. */ public static final String BOOLEAN_PREFIX = "Boolean: "; @@ -93,9 +73,6 @@ public class VSPrefs { /** The units. */ private HashMap<String,String> units; - /** The Constant serialVersionUID. */ - private static final long serialVersionUID = 4L; - /** The id counter. */ private static int idCounter; @@ -293,7 +270,7 @@ public class VSPrefs { Boolean val = booleanPrefs.get(key); if (val == null) - return new Boolean(false); + return Boolean.valueOf(false); return val; } @@ -316,7 +293,7 @@ public class VSPrefs { * @param val the val */ public void initBoolean(String key, boolean val) { - initBoolean(key, new Boolean(val)); + initBoolean(key, Boolean.valueOf(val)); } /** @@ -348,7 +325,7 @@ public class VSPrefs { * @param val the val */ public void setBoolean(String key, boolean val) { - setBoolean(key, new Boolean(val)); + setBoolean(key, Boolean.valueOf(val)); } /* Color methods */ @@ -473,7 +450,7 @@ public class VSPrefs { * @param val the val */ public void initFloat(String key, float val) { - initFloat(key, new Float(val)); + initFloat(key, Float.valueOf(val)); } /** @@ -518,7 +495,7 @@ public class VSPrefs { * @param val the val */ public void setFloat(String key, float val) { - setFloat(key, new Float(val)); + setFloat(key, Float.valueOf(val)); } /* Integer methods */ @@ -570,7 +547,7 @@ public class VSPrefs { */ public void initInteger(String key, int val) { if (!integerPrefs.containsKey(key)) - setInteger(key, new Integer(val)); + setInteger(key, Integer.valueOf(val)); } /** @@ -663,7 +640,7 @@ public class VSPrefs { * @param val the val */ public void setInteger(String key, int val) { - setInteger(key, new Integer(val)); + setInteger(key, Integer.valueOf(val)); } /* Integer vector methods */ @@ -801,7 +778,7 @@ public class VSPrefs { * @param val the val */ public void initLong(String key, long val) { - initLong(key, new Long(val)); + initLong(key, Long.valueOf(val)); } /** @@ -855,7 +832,7 @@ public class VSPrefs { * @param val the val */ public void setLong(String key, long val) { - setLong(key, new Long(val)); + setLong(key, Long.valueOf(val)); } /* String methods */ @@ -929,7 +906,7 @@ public class VSPrefs { VSSerialize serialize, ObjectOutputStream objectOutputStream) throws IOException { /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); objectOutputStream.writeObject(booleanPrefs); objectOutputStream.writeObject(colorPrefs); @@ -943,7 +920,7 @@ public class VSPrefs { objectOutputStream.writeObject(restrictions); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) @@ -1198,13 +1175,4 @@ public class VSPrefs { return allKeys; } - - /** - * Not overwrite description string defaults - */ - /* - public void useDefaultStrings(boolean value) { - useDefaultStrings = value; - } - */ } diff --git a/sources/prefs/VSPrefsRestriction.java b/sources/prefs/VSPrefsRestriction.java index 52ab744..27e828d 100644 --- a/sources/prefs/VSPrefsRestriction.java +++ b/sources/prefs/VSPrefsRestriction.java @@ -1,29 +1,9 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 prefs; -import java.io.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; import java.util.Vector; /** @@ -77,8 +57,8 @@ abstract public class VSPrefsRestriction implements Serializable { */ public void writeObject(ObjectOutputStream out) throws IOException { - out.writeObject(new Integer(minValue)); - out.writeObject(new Integer(maxValue)); + out.writeObject(Integer.valueOf(minValue)); + out.writeObject(Integer.valueOf(maxValue)); } /* (non-Javadoc) diff --git a/sources/prefs/VSSerializablePrefs.java b/sources/prefs/VSSerializablePrefs.java index 69ad3f7..b175b41 100644 --- a/sources/prefs/VSSerializablePrefs.java +++ b/sources/prefs/VSSerializablePrefs.java @@ -1,32 +1,12 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 prefs; -import java.io.*; //import java.util.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; -import serialize.*; +import serialize.VSSerializable; +import serialize.VSSerialize; /** * The class VSSerializablePrefs, this class is used if the VSPrefs should @@ -35,8 +15,6 @@ import serialize.*; * @author Paul C. Buetow */ public class VSSerializablePrefs extends VSPrefs implements VSSerializable { - /** The Constant serialVersionUID. */ - private static final long serialVersionUID = 4L; /* (non-Javadoc) * @see serialize.VSSerializable#serialize(serialize.VSSerialize, * java.io.ObjectOutputStream) @@ -51,7 +29,6 @@ public class VSSerializablePrefs extends VSPrefs implements VSSerializable { * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/prefs/editors/VSAbstractBetterEditor.java b/sources/prefs/editors/VSAbstractBetterEditor.java index 9d3fb88..87296b6 100644 --- a/sources/prefs/editors/VSAbstractBetterEditor.java +++ b/sources/prefs/editors/VSAbstractBetterEditor.java @@ -1,33 +1,13 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 prefs.editors; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.Color; +import java.awt.Container; +import java.awt.event.ActionEvent; + +import javax.swing.BoxLayout; +import javax.swing.JPanel; -import prefs.*; +import prefs.VSPrefs; /** * The class VSAbstractBetterEditor, is an improved VSAbstractEditor. @@ -35,14 +15,9 @@ import prefs.*; * @author Paul C. Buetow */ public abstract class VSAbstractBetterEditor extends VSAbstractEditor { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The content pane. */ private Container contentPane; - /** The info area. */ - /** The title. */ private String title; diff --git a/sources/prefs/editors/VSAbstractEditor.java b/sources/prefs/editors/VSAbstractEditor.java index 38f0226..e849a50 100644 --- a/sources/prefs/editors/VSAbstractEditor.java +++ b/sources/prefs/editors/VSAbstractEditor.java @@ -1,35 +1,33 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 prefs.editors; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import java.util.*; - -import utils.*; -import prefs.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.GridBagLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Set; +import java.util.Vector; + +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextField; + +import prefs.VSPrefs; +import prefs.VSPrefsRestriction; +import utils.VS3Tupel; +import utils.VSFrame; /** * The class VSAbstractEditor, an object of this class is used in order to @@ -38,9 +36,6 @@ import prefs.*; * @author Paul C. Buetow */ public abstract class VSAbstractEditor implements ActionListener { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The boolean keys. */ private ArrayList<String> booleanKeys; @@ -66,7 +61,7 @@ public abstract class VSAbstractEditor implements ActionListener { private HashMap<String,JCheckBox> booleanFields; /** The integer fields. */ - private HashMap<String,JComboBox> integerFields; + private HashMap<String,JComboBox<Integer>> integerFields; /** The vector fields. */ private HashMap<String,JTextField> vectorFields; @@ -219,7 +214,7 @@ public abstract class VSAbstractEditor implements ActionListener { colorFields = new HashMap<String,JTextField>(); floatFields = new HashMap<String,JTextField>(); - integerFields = new HashMap<String,JComboBox>(); + integerFields = new HashMap<String,JComboBox<Integer>>(); vectorFields = new HashMap<String,JTextField>(); longFields = new HashMap<String,JTextField>(); booleanFields = new HashMap<String,JCheckBox>(); @@ -337,7 +332,7 @@ public abstract class VSAbstractEditor implements ActionListener { * * @return the tupel representing the component */ - protected VS3Tupel<String,Component,JComboBox> createIntegerComponent( + protected VS3Tupel<String,Component,JComboBox<Integer>> createIntegerComponent( String fullKey, String key, VSPrefs prefsToEdit) { String descr = prefs.getDescription(fullKey); if (descr == null) @@ -345,7 +340,7 @@ public abstract class VSAbstractEditor implements ActionListener { String label = descr == null ? fullKey : descr; Integer integer = prefsToEdit.getInteger(key); Integer initialSelection[] = { integer }; - JComboBox valComboBox = new JComboBox(initialSelection); + JComboBox<Integer> valComboBox = new JComboBox<>(initialSelection); VSPrefsRestriction settingRestriction = prefsToEdit.getRestriction(fullKey); @@ -364,10 +359,10 @@ public abstract class VSAbstractEditor implements ActionListener { } for (int i = minValue; i <= maxValue; ++i) - valComboBox.addItem(new Integer(i)); + valComboBox.addItem(Integer.valueOf(i)); valComboBox.setBorder(null); - return new VS3Tupel<String,Component,JComboBox>(label, + return new VS3Tupel<String,Component,JComboBox<Integer>>(label, createUnitPanel(prefsToEdit, valComboBox, fullKey), valComboBox); } @@ -571,7 +566,7 @@ public abstract class VSAbstractEditor implements ActionListener { for (String key : integerKeys) { String fullKey = VSPrefs.INTEGER_PREFIX + key; - VS3Tupel<String,Component,JComboBox> tupel = + VS3Tupel<String,Component,JComboBox<Integer>> tupel = createIntegerComponent(fullKey, key, prefsToEdit); labels.put(fullKey, tupel.getA()); components.put(fullKey, tupel.getB()); @@ -779,7 +774,7 @@ public abstract class VSAbstractEditor implements ActionListener { for (String fullKey : fullKeys) { String key = fullKey.substring(fullKey.indexOf(": ") + 2); if (fullKey.startsWith(VSPrefs.INTEGER_PREFIX)) { - VS3Tupel<String,Component,JComboBox> tupel = + VS3Tupel<String,Component,JComboBox<Integer>> tupel = createIntegerComponent(fullKey, key, prefsToAdd); this.integerKeys.add(prefsKey+key); this.integerFields.put(prefsKey+key, tupel.getC()); @@ -862,7 +857,7 @@ public abstract class VSAbstractEditor implements ActionListener { */ protected void resetPrefs() { for (String key : integerKeys) { - JComboBox valComboBox = integerFields.get(key); + JComboBox<Integer> valComboBox = integerFields.get(key); valComboBox.setSelectedIndex(0); } @@ -900,7 +895,7 @@ public abstract class VSAbstractEditor implements ActionListener { for (String key : stringKeys) { String keys[] = getKeys(key); - JTextField valField = stringFields.get(keys); + JTextField valField = stringFields.get(key); valField.setText(prefsToEditMap.get(keys[1]).getString(keys[0])); } } @@ -931,7 +926,7 @@ public abstract class VSAbstractEditor implements ActionListener { for (String key : integerKeys) { String keys[] = getKeys(key); - JComboBox valComboBox = integerFields.get(key); + JComboBox<Integer> valComboBox = integerFields.get(key); prefsToEditMap.get( keys[1]).setInteger(keys[0], (Integer) valComboBox.getSelectedItem()); diff --git a/sources/prefs/editors/VSColorChooser.java b/sources/prefs/editors/VSColorChooser.java index 532cdae..4f53fb4 100644 --- a/sources/prefs/editors/VSColorChooser.java +++ b/sources/prefs/editors/VSColorChooser.java @@ -1,31 +1,14 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 prefs.editors; -import java.awt.*; -import javax.swing.*; -import javax.swing.event.*; +import java.awt.BorderLayout; +import java.awt.Color; + +import javax.swing.BorderFactory; +import javax.swing.JColorChooser; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import prefs.VSPrefs; diff --git a/sources/prefs/editors/VSEditorFrame.java b/sources/prefs/editors/VSEditorFrame.java index 3bbee1d..650a619 100644 --- a/sources/prefs/editors/VSEditorFrame.java +++ b/sources/prefs/editors/VSEditorFrame.java @@ -1,34 +1,15 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 prefs.editors; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPanel; -import prefs.*; -import utils.*; +import prefs.VSPrefs; +import utils.VSFrame; /** * The class VSEditorFrame, this is a wrapper around an VSAbstractEditor diff --git a/sources/prefs/editors/VSEditorTable.java b/sources/prefs/editors/VSEditorTable.java index 4fff4a2..30ae30c 100644 --- a/sources/prefs/editors/VSEditorTable.java +++ b/sources/prefs/editors/VSEditorTable.java @@ -1,37 +1,22 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 prefs.editors; -import java.util.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.util.ArrayList; -import java.awt.*; -//import java.io.*; -import javax.swing.*; -import javax.swing.table.*; -import javax.swing.text.*; +import javax.swing.AbstractCellEditor; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableColumn; +import javax.swing.text.Style; +import javax.swing.text.StyleConstants; -import prefs.*; +import prefs.VSPrefs; /** * The class VSEditorTable, each VSAbstractEditor uses an object of this class @@ -43,12 +28,6 @@ public class VSEditorTable extends JTable { /** The serial version uid */ private static final long serialVersionUID = 1L; - /** The Constant MIN_ROWS. */ - //private static final int MIN_ROWS = 20; - - /** The prefs. */ - //private VSPrefs prefs; - /** The nodes. */ private ArrayList<VSNode> nodes; @@ -59,9 +38,6 @@ public class VSEditorTable extends JTable { * The class VSNode. */ private class VSNode { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The key. */ private String key; diff --git a/sources/prefs/editors/VSProcessEditor.java b/sources/prefs/editors/VSProcessEditor.java index 0009f9a..8035085 100644 --- a/sources/prefs/editors/VSProcessEditor.java +++ b/sources/prefs/editors/VSProcessEditor.java @@ -1,36 +1,15 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 prefs.editors; -import java.awt.event.*; -import javax.swing.*; -import java.util.*; +import java.awt.event.ActionEvent; +import java.util.ArrayList; -import core.*; -import protocols.*; -import events.*; +import javax.swing.JButton; +import javax.swing.JPanel; + +import core.VSInternalProcess; +import events.VSRegisteredEvents; import prefs.VSPrefs; +import protocols.VSAbstractProtocol; /** * The class VSProcessEditor, is for editing a VSInternalProcess object. @@ -38,9 +17,6 @@ import prefs.VSPrefs; * @author Paul C. Buetow */ public class VSProcessEditor extends VSAbstractBetterEditor { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The process. */ private VSInternalProcess process; diff --git a/sources/prefs/editors/VSSimulatorEditor.java b/sources/prefs/editors/VSSimulatorEditor.java index 137ca77..53eea0a 100644 --- a/sources/prefs/editors/VSSimulatorEditor.java +++ b/sources/prefs/editors/VSSimulatorEditor.java @@ -1,33 +1,13 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 prefs.editors; -import java.awt.event.*; -import javax.swing.*; +import java.awt.event.ActionEvent; -import simulator.*; -import prefs.*; +import javax.swing.JButton; +import javax.swing.JPanel; + +import prefs.VSPrefs; +import simulator.VSSimulator; +import simulator.VSSimulatorFrame; /** * The class VSSimulatorEditor, is for editing a VSSimulator object. @@ -35,9 +15,6 @@ import prefs.*; * @author Paul C. Buetow */ public class VSSimulatorEditor extends VSAbstractBetterEditor { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The constant OPENED_NEW_WINDOW */ public static final boolean OPENED_NEW_WINDOW = true; diff --git a/sources/protocols/VSAbstractProtocol.java b/sources/protocols/VSAbstractProtocol.java index c837490..0317d07 100644 --- a/sources/protocols/VSAbstractProtocol.java +++ b/sources/protocols/VSAbstractProtocol.java @@ -1,36 +1,17 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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 protocols; -import java.io.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.util.ArrayList; -import core.*; -import events.*; -import events.internal.*; -import serialize.*; +import core.VSInternalProcess; +import core.VSMessage; +import core.VSMessageStub; +import core.VSTask; +import events.VSAbstractEvent; +import events.internal.VSProtocolScheduleEvent; +import serialize.VSSerialize; import simulator.VSSimulatorVisualization; /** @@ -40,9 +21,6 @@ import simulator.VSSimulatorVisualization; * @author Paul C. Buetow */ abstract public class VSAbstractProtocol extends VSAbstractEvent { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The protocol has an onServerStart method */ protected static final boolean HAS_ON_SERVER_START = true; @@ -442,19 +420,18 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { super.serialize(serialize, objectOutputStream); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); - objectOutputStream.writeObject(new Boolean(hasOnServerStart)); + objectOutputStream.writeObject(Boolean.valueOf(hasOnServerStart)); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { @@ -466,9 +443,7 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { /** For later backwards compatibility, to add more stuff */ objectInputStream.readObject(); - this.hasOnServerStart = ((Boolean) - objectInputStream.readObject()).booleanValue(); - + this.hasOnServerStart = ((Boolean) objectInputStream.readObject()).booleanValue(); /** For later backwards compatibility, to add more stuff */ objectInputStream.readObject(); } diff --git a/sources/protocols/implementations/VSBasicMulticastProtocol.java b/sources/protocols/implementations/VSBasicMulticastProtocol.java index 9be8b32..3172b8f 100644 --- a/sources/protocols/implementations/VSBasicMulticastProtocol.java +++ b/sources/protocols/implementations/VSBasicMulticastProtocol.java @@ -1,30 +1,7 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 protocols.implementations; -import protocols.VSAbstractProtocol; import core.VSMessage; +import protocols.VSAbstractProtocol; /** * The class VSBasicMulticastProtocol, an implementation of the basic multicast @@ -33,9 +10,6 @@ import core.VSMessage; * @author Paul C. Buetow */ public class VSBasicMulticastProtocol extends VSAbstractProtocol { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** * Instantiates a new VSBasicMulticast object. */ diff --git a/sources/protocols/implementations/VSBerkelyTimeProtocol.java b/sources/protocols/implementations/VSBerkelyTimeProtocol.java index c41924f..b348e2d 100644 --- a/sources/protocols/implementations/VSBerkelyTimeProtocol.java +++ b/sources/protocols/implementations/VSBerkelyTimeProtocol.java @@ -1,35 +1,12 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 protocols.implementations; -import protocols.VSAbstractProtocol; -import core.VSMessage; - import java.util.ArrayList; import java.util.HashMap; import java.util.Vector; +import core.VSMessage; +import protocols.VSAbstractProtocol; + /** * The class VSBerkelyTimeProtocol, an implementation of the berkely time * protocol. @@ -37,8 +14,6 @@ import java.util.Vector; * @author Paul C. Buetow */ public class VSBerkelyTimeProtocol extends VSAbstractProtocol { - private static final long serialVersionUID = 1L; - /** * Instantiates a new berkely time protocol. */ @@ -115,10 +90,10 @@ public class VSBerkelyTimeProtocol extends VSAbstractProtocol { else return; /* Process has been handled already or is not listed */ - Long time = new Long(recvMessage.getLong("time")); + Long time = Long.valueOf(recvMessage.getLong("time")); processTimes.put(processID, time); - recvTimes.put(processID, new Long(process.getTime())); + recvTimes.put(processID, Long.valueOf(process.getTime())); /* All peers have told their times */ if (peers.size() == 0) { @@ -151,7 +126,7 @@ public class VSBerkelyTimeProtocol extends VSAbstractProtocol { Long recvTime = recvTimes.get(processID); long rtt = recvTime.longValue() - requestTime; long realProcessTime = localTime + (long) (rtt / 2); - realTimesRTT.put(processID, new Long(realProcessTime)); + realTimesRTT.put(processID, Long.valueOf(realProcessTime)); sum += realProcessTime; } /* Include the time of the local process */ diff --git a/sources/protocols/implementations/VSBroadcastProtocol.java b/sources/protocols/implementations/VSBroadcastProtocol.java index 7d264cf..54fd3b5 100644 --- a/sources/protocols/implementations/VSBroadcastProtocol.java +++ b/sources/protocols/implementations/VSBroadcastProtocol.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 protocols.implementations; import java.util.ArrayList; @@ -35,9 +12,6 @@ import protocols.VSAbstractProtocol; * @author Paul C. Buetow */ public class VSBroadcastProtocol extends VSAbstractProtocol { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The sent messages. */ private ArrayList<Integer> sentMessages; diff --git a/sources/protocols/implementations/VSDummyProtocol.java b/sources/protocols/implementations/VSDummyProtocol.java index 92b2131..e9e6837 100644 --- a/sources/protocols/implementations/VSDummyProtocol.java +++ b/sources/protocols/implementations/VSDummyProtocol.java @@ -1,30 +1,7 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 protocols.implementations; -import protocols.VSAbstractProtocol; import core.VSMessage; +import protocols.VSAbstractProtocol; /** * The class VSDummyProtocol, can be used as a template in order to create @@ -33,9 +10,6 @@ import core.VSMessage; * @author Paul C. Buetow */ public class VSDummyProtocol extends VSAbstractProtocol { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** * Instantiates a new dummy protocol object. */ @@ -77,10 +51,12 @@ public class VSDummyProtocol extends VSAbstractProtocol { public void onClientRecv(VSMessage recvMessage) { log("onClientRecv("+recvMessage+")"); + /* String s = recvMessage.getString("Greeting"); int n = recvMessage.getInteger("A number"); boolean b = recvMessage.getBoolean("A boolean"); float f = recvMessage.getFloat("A float"); + */ } /* (non-Javadoc) diff --git a/sources/protocols/implementations/VSExternalTimeSyncProtocol.java b/sources/protocols/implementations/VSExternalTimeSyncProtocol.java index c008a11..24128f6 100644 --- a/sources/protocols/implementations/VSExternalTimeSyncProtocol.java +++ b/sources/protocols/implementations/VSExternalTimeSyncProtocol.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 protocols.implementations; import core.VSMessage; @@ -33,9 +10,6 @@ import protocols.VSAbstractProtocol; * @author Paul C. Buetow */ public class VSExternalTimeSyncProtocol extends VSAbstractProtocol { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The request time. */ private long requestTime; diff --git a/sources/protocols/implementations/VSInternalTimeSyncProtocol.java b/sources/protocols/implementations/VSInternalTimeSyncProtocol.java index 1e00742..e72c563 100644 --- a/sources/protocols/implementations/VSInternalTimeSyncProtocol.java +++ b/sources/protocols/implementations/VSInternalTimeSyncProtocol.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 protocols.implementations; import core.VSMessage; @@ -33,9 +10,6 @@ import protocols.VSAbstractProtocol; * @author Paul C. Buetow */ public class VSInternalTimeSyncProtocol extends VSAbstractProtocol { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The waiting for response. */ private boolean waitingForResponse; diff --git a/sources/protocols/implementations/VSOnePhaseCommitProtocol.java b/sources/protocols/implementations/VSOnePhaseCommitProtocol.java index 3130cdf..bd3d843 100644 --- a/sources/protocols/implementations/VSOnePhaseCommitProtocol.java +++ b/sources/protocols/implementations/VSOnePhaseCommitProtocol.java @@ -1,33 +1,10 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 protocols.implementations; import java.util.ArrayList; import java.util.Vector; -import protocols.VSAbstractProtocol; import core.VSMessage; +import protocols.VSAbstractProtocol; /** * The class VSOnePhaseCommitProtocol, an implementation of the one phase @@ -36,9 +13,6 @@ import core.VSMessage; * @author Paul C. Buetow */ public class VSOnePhaseCommitProtocol extends VSAbstractProtocol { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /* Server variables */ private boolean ackSent; diff --git a/sources/protocols/implementations/VSPingPongProtocol.java b/sources/protocols/implementations/VSPingPongProtocol.java index 02178e1..b1f3d20 100644 --- a/sources/protocols/implementations/VSPingPongProtocol.java +++ b/sources/protocols/implementations/VSPingPongProtocol.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 protocols.implementations; import core.VSMessage; @@ -32,9 +9,6 @@ import protocols.VSAbstractProtocol; * @author Paul C. Buetow */ public class VSPingPongProtocol extends VSAbstractProtocol { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The client counter. */ private int clientCounter; @@ -131,6 +105,6 @@ public class VSPingPongProtocol extends VSAbstractProtocol { * @see protocols.VSAbstractProtocol#toString() */ public String toString() { - return super.toString() + "; Neue Nachricht da hinter"; + return super.toString() + "; New message afterwards"; } } diff --git a/sources/protocols/implementations/VSReliableMulticastProtocol.java b/sources/protocols/implementations/VSReliableMulticastProtocol.java index 7bdf1e3..e4601ab 100644 --- a/sources/protocols/implementations/VSReliableMulticastProtocol.java +++ b/sources/protocols/implementations/VSReliableMulticastProtocol.java @@ -1,33 +1,10 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 protocols.implementations; import java.util.ArrayList; import java.util.Vector; -import protocols.VSAbstractProtocol; import core.VSMessage; +import protocols.VSAbstractProtocol; /** * The class VSReliableMulticastProtocol, an implementation of the reliable @@ -36,9 +13,6 @@ import core.VSMessage; * @author Paul C. Buetow */ public class VSReliableMulticastProtocol extends VSAbstractProtocol { - /** The serial version uid */ - private static final long serialVersionUID = 2L; - /** * Instantiates a two phase commit protocol object. */ diff --git a/sources/protocols/implementations/VSTwoPhaseCommitProtocol.java b/sources/protocols/implementations/VSTwoPhaseCommitProtocol.java index 122351d..a98fcf6 100644 --- a/sources/protocols/implementations/VSTwoPhaseCommitProtocol.java +++ b/sources/protocols/implementations/VSTwoPhaseCommitProtocol.java @@ -1,33 +1,10 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 protocols.implementations; import java.util.ArrayList; import java.util.Vector; -import protocols.VSAbstractProtocol; import core.VSMessage; +import protocols.VSAbstractProtocol; /** * The class VSTwoPhaseCommitProtocol, an implementation of the two phase @@ -36,9 +13,6 @@ import core.VSMessage; * @author Paul C. Buetow */ public class VSTwoPhaseCommitProtocol extends VSAbstractProtocol { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** * Instantiates a two phase commit protocol object. */ diff --git a/sources/serialize/VSNotSerializable.java b/sources/serialize/VSNotSerializable.java index f307281..f7bec1d 100644 --- a/sources/serialize/VSNotSerializable.java +++ b/sources/serialize/VSNotSerializable.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 serialize; /** diff --git a/sources/serialize/VSSerializable.java b/sources/serialize/VSSerializable.java index f5c6ca0..c115ad9 100644 --- a/sources/serialize/VSSerializable.java +++ b/sources/serialize/VSSerializable.java @@ -1,29 +1,8 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 serialize; -import java.io.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; /** * The Interface VSSerializable, all classes which take part of the serialize/ diff --git a/sources/serialize/VSSerialize.java b/sources/serialize/VSSerialize.java index db3fa6a..f479a2c 100644 --- a/sources/serialize/VSSerialize.java +++ b/sources/serialize/VSSerialize.java @@ -1,34 +1,20 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 serialize; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.util.HashMap; -import javax.swing.*; -import prefs.*; -import simulator.*; +import javax.swing.JFileChooser; + +import prefs.VSDefaultPrefs; +import prefs.VSPrefs; +import prefs.VSSerializablePrefs; +import simulator.VSSimulator; +import simulator.VSSimulatorFrame; /** * The class VSSerialize, this class helps do serialize/deserialize a saved @@ -37,9 +23,6 @@ import simulator.*; * @author Paul C. Buetow */ public final class VSSerialize { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** True if debug mode of serialization/deserialization */ public static final boolean DEBUG = true; @@ -63,7 +46,7 @@ public final class VSSerialize { * Initializes the helper. */ private void init() { - this.serialize = this; + serialize = this; objects = new HashMap<String,Object>(); } diff --git a/sources/simulator/VSCreateTask.java b/sources/simulator/VSCreateTask.java index 86d5d01..9a6426b 100644 --- a/sources/simulator/VSCreateTask.java +++ b/sources/simulator/VSCreateTask.java @@ -1,32 +1,10 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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 core.*; -import events.*; -import events.internal.*; +import core.VSInternalProcess; +import core.VSTask; +import events.VSAbstractEvent; +import events.VSRegisteredEvents; +import events.internal.VSProtocolEvent; /** * The class VSCreateTask, an object of this class represents how new @@ -36,9 +14,6 @@ import events.internal.*; * @author Paul C. Buetow */ public class VSCreateTask { - /** the serial version uid */ - private static final long serialVersionUID = 1L; - /** The event classname. */ private String eventClassname; diff --git a/sources/simulator/VSLogging.java b/sources/simulator/VSLogging.java index c66ced7..66cb563 100644 --- a/sources/simulator/VSLogging.java +++ b/sources/simulator/VSLogging.java @@ -1,33 +1,12 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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.util.*; -import java.util.regex.*; -import javax.swing.*; +import java.util.ArrayList; +import java.util.regex.Matcher; +import java.util.regex.Pattern; -import utils.*; +import javax.swing.JTextArea; + +import utils.VSTools; /** * The class VSLogging, an object of this class is responsible for the loging @@ -36,9 +15,6 @@ import utils.*; * @author Paul C. Buetow */ public class VSLogging { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The loging area. */ private JTextArea logingArea; diff --git a/sources/simulator/VSMain.java b/sources/simulator/VSMain.java index 90b0acb..34a21b7 100644 --- a/sources/simulator/VSMain.java +++ b/sources/simulator/VSMain.java @@ -1,35 +1,13 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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.Component; import java.util.Locale; -import javax.swing.*; -import events.*; -import prefs.*; -//import prefs.editors.*; +import javax.swing.UIManager; + +import events.VSRegisteredEvents; +import prefs.VSDefaultPrefs; +import prefs.VSPrefs; /** * The class VSMain. This class contains the static main method. The simulator @@ -38,9 +16,6 @@ import prefs.*; * @author Paul C. Buetow */ public class VSMain { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The global preferences */ public static VSPrefs prefs; diff --git a/sources/simulator/VSMenuItemStates.java b/sources/simulator/VSMenuItemStates.java index 9dfd916..941dbf5 100644 --- a/sources/simulator/VSMenuItemStates.java +++ b/sources/simulator/VSMenuItemStates.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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; /** @@ -30,9 +7,6 @@ package simulator; * @author Paul C. Buetow */ public class VSMenuItemStates { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The pause state. */ private volatile boolean pause; diff --git a/sources/simulator/VSSimulator.java b/sources/simulator/VSSimulator.java index 189398b..691fb15 100644 --- a/sources/simulator/VSSimulator.java +++ b/sources/simulator/VSSimulator.java @@ -1,43 +1,58 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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.io.*; -import java.util.*; -import javax.swing.*; -import javax.swing.event.*; -import javax.swing.table.*; - -import core.*; -import events.*; -import exceptions.*; -import prefs.*; -import prefs.editors.*; -import serialize.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridBagLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Vector; + +import javax.swing.AbstractButton; +import javax.swing.AbstractCellEditor; +import javax.swing.BoxLayout; +import javax.swing.ButtonModel; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import javax.swing.JSplitPane; +import javax.swing.JTabbedPane; +import javax.swing.JTable; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.ListSelectionModel; +import javax.swing.SwingUtilities; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableColumn; + +import core.VSInternalProcess; +import core.VSTask; +import core.VSTaskManager; +import events.VSRegisteredEvents; +import exceptions.VSNegativeNumberException; +import prefs.VSPrefs; +import prefs.editors.VSProcessEditor; +import serialize.VSSerializable; +import serialize.VSSerialize; /** * The class VSSimulator, an object of this class represents a whole simulator. @@ -69,13 +84,13 @@ public class VSSimulator extends JPanel implements VSSerializable { private JCheckBox vectorTimeActiveCheckBox; /** The global pid combo box. */ - private JComboBox globalPIDComboBox; + private JComboBox<String> globalPIDComboBox; /** The local pid combo box. */ - private JComboBox localPIDComboBox; + private JComboBox<String> localPIDComboBox; /** The processes combo box. */ - private JComboBox processesComboBox; + private JComboBox<String> processesComboBox; /** The local add panel. */ private JPanel localAddPanel; @@ -153,13 +168,12 @@ public class VSSimulator extends JPanel implements VSSerializable { private static int simulatorCounter; /** The simulator num. */ - private static int simulatorNum; + private static volatile int simulatorNum; /** * The class VSTaskManagerTableModel, an object of this class handles * the task manager's JTable. */ - @SuppressWarnings("unchecked") private class VSTaskManagerTableModel extends AbstractTableModel implements MouseListener { /** the serial version uid */ @@ -172,14 +186,11 @@ public class VSSimulator extends JPanel implements VSSerializable { public static final boolean GLOBAL = false; /** The Constant ALL_PROCESSES. */ - public static final boolean ALL_PROCESSES = true; + // public static final boolean ALL_PROCESSES = true; /** The Constant ONE_PROCESS. */ public static final boolean ONE_PROCESS = false; - /** The all processes. */ - public boolean allProcesses; - /** The tasks. */ private ArrayList<VSTask> tasks; @@ -244,7 +255,6 @@ public class VSSimulator extends JPanel implements VSSerializable { */ public void set(VSInternalProcess process, boolean localTasks, boolean allProcesses) { - this.allProcesses = allProcesses; if (allProcesses) { this.tasks = localTasks @@ -356,16 +366,6 @@ public class VSSimulator extends JPanel implements VSSerializable { } /** - * Gets the task at a specified row. - * - * @param row the row - * @return The task - */ - public VSTask getTaskAtRow(int row) { - return tasks.get(row); - } - - /** * Gets the index of a specific task * * @param task The task @@ -538,7 +538,7 @@ public class VSSimulator extends JPanel implements VSSerializable { return valField; case 1: Integer current[] = { (Integer) model.getValueAt(row, col) }; - final JComboBox comboBox = new JComboBox(current); + final JComboBox<Integer> comboBox = new JComboBox<>(current); Integer pids[] = simulatorVisualization.getProcessIDs(); for (Integer pid : pids) @@ -598,7 +598,7 @@ public class VSSimulator extends JPanel implements VSSerializable { private void init(VSPrefs prefs, VSSimulatorFrame simulatorFrame) { this.prefs = prefs; this.simulatorFrame = simulatorFrame; - this.simulatorNum = ++simulatorCounter; + simulatorNum = ++simulatorCounter; this.menuItemStates = new VSMenuItemStates(false, false, false, true); this.localTextFields = new ArrayList<String>(); this.globalTextFields = new ArrayList<String>(); @@ -825,9 +825,9 @@ public class VSSimulator extends JPanel implements VSSerializable { boolean expertMode = prefs.getBoolean("sim.mode.expert"); editPanel.setLayout(new BoxLayout(editPanel, BoxLayout.Y_AXIS)); - processesComboBox = new JComboBox(); - localPIDComboBox = new JComboBox(); - globalPIDComboBox = new JComboBox(); + processesComboBox = new JComboBox<>(); + localPIDComboBox = new JComboBox<>(); + globalPIDComboBox = new JComboBox<>(); lastSelectedProcessNum = 0; int numProcesses = simulatorVisualization.getNumProcesses(); @@ -1026,7 +1026,7 @@ public class VSSimulator extends JPanel implements VSSerializable { addPanel.add(globalPIDComboBox); } - final JComboBox comboBox = new JComboBox(); + final JComboBox<String> comboBox = new JComboBox<>(); JButton takeoverButton = new JButton(prefs.getString("lang.en.takeover")); takeoverButton.setMnemonic(prefs.getInteger("keyevent.takeover")); takeoverButton.addActionListener(new ActionListener() { @@ -1498,12 +1498,12 @@ public class VSSimulator extends JPanel implements VSSerializable { ObjectOutputStream objectOutputStream) throws IOException { /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); simulatorVisualization.serialize(serialize, objectOutputStream); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } @@ -1511,7 +1511,6 @@ public class VSSimulator extends JPanel implements VSSerializable { * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/simulator/VSSimulatorFrame.java b/sources/simulator/VSSimulatorFrame.java index 2304f7e..61ba324 100644 --- a/sources/simulator/VSSimulatorFrame.java +++ b/sources/simulator/VSSimulatorFrame.java @@ -1,39 +1,35 @@ -/* * Copyright (c) 2008 Paul C. Buetow, vs-sim@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.io.*; -import java.util.*; -import javax.swing.*; -import javax.swing.event.*; - -import core.*; -import prefs.*; -import prefs.editors.*; -import serialize.*; -import utils.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.Vector; + +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JTabbedPane; +import javax.swing.JToolBar; +import javax.swing.KeyStroke; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; + +import core.VSInternalProcess; +import prefs.VSDefaultPrefs; +import prefs.VSPrefs; +import prefs.editors.VSEditorFrame; +import prefs.editors.VSSimulatorEditor; +import serialize.VSSerialize; +import utils.VSAboutFrame; +import utils.VSFrame; /** * The class VSSimulatorFrame, an object of this class represents a window diff --git a/sources/simulator/VSSimulatorVisualization.java b/sources/simulator/VSSimulatorVisualization.java index 0f09c0a..5c28eaf 100644 --- a/sources/simulator/VSSimulatorVisualization.java +++ b/sources/simulator/VSSimulatorVisualization.java @@ -1,44 +1,42 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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.*; +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.HierarchyBoundsListener; +import java.awt.event.HierarchyEvent; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.image.BufferStrategy; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.LinkedList; + +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; + +import core.VSInternalProcess; +import core.VSMessage; +import core.VSTask; +import core.VSTaskManager; +import core.time.VSTime; +import events.VSAbstractEvent; +import events.implementations.VSProcessCrashEvent; +import events.implementations.VSProcessRecoverEvent; +import events.internal.VSMessageReceiveEvent; +import prefs.VSPrefs; +import prefs.editors.VSEditorFrame; +import prefs.editors.VSProcessEditor; +import serialize.VSSerializable; +import serialize.VSSerialize; /** * The class VSSimulatorVisualization. An instance of this object represents the @@ -1578,7 +1576,7 @@ public class VSSimulatorVisualization extends Canvas synchronized (processes) { pids = new Integer[numProcesses]; for (int i = 0; i < numProcesses; ++i) - pids[i] = new Integer(processes.get(i).getProcessID()); + pids[i] = Integer.valueOf(processes.get(i).getProcessID()); } return pids; @@ -1766,12 +1764,12 @@ public class VSSimulatorVisualization extends Canvas ObjectOutputStream objectOutputStream) throws IOException { /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); - objectOutputStream.writeObject(new Integer(processCounter)); + objectOutputStream.writeObject(Integer.valueOf(processCounter)); synchronized (processes) { - objectOutputStream.writeObject(new Integer(numProcesses)); + objectOutputStream.writeObject(Integer.valueOf(numProcesses)); for (VSInternalProcess process : processes) process.serialize(serialize, objectOutputStream); } @@ -1779,7 +1777,7 @@ public class VSSimulatorVisualization extends Canvas taskManager.serialize(serialize, objectOutputStream); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) diff --git a/sources/utils/VS3Tupel.java b/sources/utils/VS3Tupel.java index d419d36..ac7ffba 100644 --- a/sources/utils/VS3Tupel.java +++ b/sources/utils/VS3Tupel.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 utils; /** @@ -30,9 +7,6 @@ package utils; * @author Paul C. Buetow */ public final class VS3Tupel<A,B,C> { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The a. */ private A a; diff --git a/sources/utils/VSAboutFrame.java b/sources/utils/VSAboutFrame.java index 32e7810..ef64ffa 100644 --- a/sources/utils/VSAboutFrame.java +++ b/sources/utils/VSAboutFrame.java @@ -1,34 +1,18 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 utils; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JButton; +import javax.swing.JPanel; +import javax.swing.JScrollPane; -import prefs.*; //import utils.*; +import prefs.VSPrefs; /** * The class VSAboutFrame. This class is only for the about window which @@ -37,9 +21,6 @@ import prefs.*; * @author Paul C. Buetow */ public class VSAboutFrame extends VSFrame { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The prefs. */ private VSPrefs prefs; diff --git a/sources/utils/VSClassLoader.java b/sources/utils/VSClassLoader.java index 37d5976..37f4027 100644 --- a/sources/utils/VSClassLoader.java +++ b/sources/utils/VSClassLoader.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 utils; /** @@ -30,9 +7,6 @@ package utils; * @author Paul C. Buetow */ public class VSClassLoader extends ClassLoader { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** * Creates a new instance of the given classname. * @@ -44,7 +18,7 @@ public class VSClassLoader extends ClassLoader { Object object = null; try { - object = super.loadClass(classname, true).newInstance(); + object = super.loadClass(classname, true).getDeclaredConstructor().newInstance(); } catch (Exception e) { System.out.println(e + "; Classname " + classname); diff --git a/sources/utils/VSFrame.java b/sources/utils/VSFrame.java index 8029554..818a72d 100644 --- a/sources/utils/VSFrame.java +++ b/sources/utils/VSFrame.java @@ -1,30 +1,13 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 utils; -import java.awt.*; -import java.awt.event.*; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Toolkit; +import java.awt.Window; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + import javax.swing.JFrame; /** diff --git a/sources/utils/VSInfoArea.java b/sources/utils/VSInfoArea.java index 3168821..645afb1 100644 --- a/sources/utils/VSInfoArea.java +++ b/sources/utils/VSInfoArea.java @@ -1,35 +1,15 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 utils; -import java.awt.*; -import javax.swing.*; -import javax.swing.border.*; +import java.awt.Color; + +import javax.swing.JTextPane; +import javax.swing.border.CompoundBorder; +import javax.swing.border.EmptyBorder; +import javax.swing.border.LineBorder; /** * The class VSInfoArea, an object of this class is used for some information - *areas. E.g. in the VSAboutFrame class. + * areas. E.g. in the VSAboutFrame class. * * @author Paul C. Buetow */ diff --git a/sources/utils/VSPriorityQueue.java b/sources/utils/VSPriorityQueue.java index 443e796..d706352 100644 --- a/sources/utils/VSPriorityQueue.java +++ b/sources/utils/VSPriorityQueue.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 utils; import java.util.PriorityQueue; diff --git a/sources/utils/VSRandom.java b/sources/utils/VSRandom.java index e6978de..6c1de90 100644 --- a/sources/utils/VSRandom.java +++ b/sources/utils/VSRandom.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 utils; import java.util.Random; @@ -31,9 +8,6 @@ import java.util.Random; * @author Paul C. Buetow */ public final class VSRandom extends Random { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** * Instantiates a new VSrandom object. * diff --git a/sources/utils/VSTools.java b/sources/utils/VSTools.java index 6f60993..ceb5760 100644 --- a/sources/utils/VSTools.java +++ b/sources/utils/VSTools.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@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 utils; import java.util.Vector; @@ -32,9 +9,6 @@ import java.util.Vector; * @author Paul C. Buetow */ public final class VSTools { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** * Gets the time string. * @@ -113,7 +87,6 @@ public final class VSTools { } catch (StringIndexOutOfBoundsException e) { } catch (NumberFormatException e) { } - return vec; } } |
