Skip to content

Commit

Permalink
Code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Herzog committed Mar 27, 2021
1 parent 12c73bb commit 67a634b
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Simulator/src/main/java/simulator/events/CallCancelEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public final class CallCancelEvent extends Event {
* @param now Aktuelle Systemzeit
* @param time Zeitpunkt, zu dem der Warteabbruch erfolgen soll
*/
public final void init(long now, long time) {
public void init(long now, long time) {
super.init(time);
waitingStartTime=now;
}

@Override
public final void run(SimData data) {
public void run(SimData data) {
SimulationData simData=(SimulationData)data;
if (simData.loggingActive) simData.logEventExecution(Language.tr("Simulator.Log.CallCancelEvent"),-1," "+String.format(Language.tr("Simulator.Log.CallCancelEvent.Info"),SimData.formatSimTime(time-waitingStartTime)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public final class CallDone1Event extends Event {
@Override
public final void run(SimData data) {
public void run(SimData data) {
SimulationData simData=(SimulationData)data;
if (data.loggingActive) data.logEventExecution(Language.tr("Simulator.Log.CallDone1Event"),-1," "+String.format(Language.tr("Simulator.Log.CallDone1Event.Info"),simData.runModel.batchWorking));

Expand Down
4 changes: 2 additions & 2 deletions Simulator/src/main/java/simulator/events/CallEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public final class CallEvent extends Event {
* @param simData <code>SimulationData</code>-Objekt
* @param count Anzahl der Ankünfte (bei Batch &gt;1)
*/
private final void simCallCount(final SimulationData simData, final int count) {
private void simCallCount(final SimulationData simData, final int count) {
/* Zählung des Anrufs in Bezug zu dem <code>simData.runModel.callsToSimulate</code>-Wert */
simData.runData.calls+=count;

Expand All @@ -58,7 +58,7 @@ private final void simCallCount(final SimulationData simData, final int count) {
}

@Override
public final void run(SimData data) {
public void run(SimData data) {
SimulationData simData=(SimulationData)data;
if (data.loggingActive) data.logEventExecution(Language.tr("Simulator.Log.CallEvent"),-1," "+(isNewCall?Language.tr("Simulator.Log.CallEvent.FreshCall"):Language.tr("Simulator.Log.CallEvent.Retryer")));

Expand Down
2 changes: 1 addition & 1 deletion Simulator/src/main/java/tools/ExportQSModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ public enum Mode {
CONDITION,
/** Zufällig verzweigen */
CHANCE
};
}

/**
* Verzweigemodus
Expand Down
4 changes: 2 additions & 2 deletions Simulator/src/main/java/ui/EditorPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public EditorPanel() {
* @param readOnly Gibt an, ob die Auswahl in der Auswahlbox geändert werden darf
* @return Neu eingefügte Auswahlbox
*/
public static final JComboBox<String> addComboBoxLine(final JPanel parent, final String title, final String[] values, final boolean readOnly) {
public static JComboBox<String> addComboBoxLine(final JPanel parent, final String title, final String[] values, final boolean readOnly) {
addLabel(parent,title);

JPanel p,p2;
Expand Down Expand Up @@ -167,7 +167,7 @@ public static final JComboBox<String> addComboBoxLine(final JPanel parent, final
* @param title Beschriftung der Checkbox
* @return Neu eingefügte Checkbox
*/
public static final JCheckBox addCheckBox(final JPanel parent, final String title) {
public static JCheckBox addCheckBox(final JPanel parent, final String title) {
final JPanel p;
final JCheckBox checkBox;

Expand Down
7 changes: 4 additions & 3 deletions Simulator/src/main/java/ui/EditorPanelBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

import mathtools.distribution.swing.JDistributionPanel;
import simulator.editmodel.EditModel;
import simulator.editmodel.EditModelBase;
import systemtools.MsgBox;
import xml.XMLTools;

Expand Down Expand Up @@ -305,7 +306,7 @@ public final String loadModel(File file) {
String s=newModel.loadFromFile(file);
lastLoadTime=System.currentTimeMillis()-loadStart;
if (s!=null) return s;
if (EditModel.isNewerVersionSystem(newModel.version,EditModel.systemVersion)) {
if (EditModelBase.isNewerVersionSystem(newModel.version,EditModel.systemVersion)) {
MsgBox.warning(getOwnerWindow(),NEWER_VERSION_TITLE,String.format(NEWER_VERSION_INFO,newModel.version));
}

Expand All @@ -328,7 +329,7 @@ public final String loadModelFromStream(final InputStream stream) {
String s=newModel.loadFromStream(stream);
lastLoadTime=System.currentTimeMillis()-loadStart;
if (s!=null) return s;
if (EditModel.isNewerVersionSystem(newModel.version,EditModel.systemVersion)) {
if (EditModelBase.isNewerVersionSystem(newModel.version,EditModel.systemVersion)) {
MsgBox.warning(getOwnerWindow(),NEWER_VERSION_TITLE,String.format(NEWER_VERSION_INFO,newModel.version));
}

Expand All @@ -349,7 +350,7 @@ public final String loadModel(final Element root, final File fileName) {
String s=newModel.loadFromXML(root);
lastLoadTime=System.currentTimeMillis()-loadStart;
if (s!=null) return s;
if (EditModel.isNewerVersionSystem(newModel.version,EditModel.systemVersion)) {
if (EditModelBase.isNewerVersionSystem(newModel.version,EditModel.systemVersion)) {
MsgBox.warning(getOwnerWindow(),NEWER_VERSION_TITLE,String.format(NEWER_VERSION_INFO,newModel.version));
}

Expand Down
3 changes: 2 additions & 1 deletion Simulator/src/main/java/ui/MainPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import systemtools.MainPanelBase;
import systemtools.MsgBox;
import systemtools.commandline.CommandLineDialog;
import systemtools.help.HelpBase;
import systemtools.statistics.StatisticsBasePanel;
import tools.ExportQSModel;
import tools.SetupData;
Expand Down Expand Up @@ -1196,7 +1197,7 @@ private void reloadSetup() {
/* Sprache neu laden? */
if (!setup.language.equals(Language.getCurrentLanguage())) {
setup.resetLanguageWasAutomatically();
Help.hideHelpFrame();
HelpBase.hideHelpFrame();
if (reloadWindow!=null) SwingUtilities.invokeLater(reloadWindow);
} else {
invalidate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import mathtools.NumberTools;
import simulator.Simulator;
import simulator.editmodel.EditModel;
import simulator.editmodel.EditModelBase;
import simulator.statistics.Statistics;
import systemtools.commandline.AbstractCommand;
import systemtools.commandline.BaseCommandLineSystem;
Expand Down Expand Up @@ -121,7 +122,7 @@ protected final void waitForSimulationDone(Simulator simulator, boolean minimalO
*/
protected final Statistics singleSimulation(EditModel editModel, boolean minimalOutput, int maxThreads, PrintStream out) {
/* Modell vorbereiten */
if (EditModel.isNewerVersionSystem(editModel.version,EditModel.systemVersion)) {
if (EditModelBase.isNewerVersionSystem(editModel.version,EditModel.systemVersion)) {
out.println(Language.tr("Dialog.Title.Warning").toUpperCase()+": "+Language.tr("Editor.NewerVersion.Info.Short"));
}
simulator=new Simulator(editModel,null);
Expand Down
2 changes: 1 addition & 1 deletion Simulator/src/main/java/ui/help/Help.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public interface SpecialLinkListener {
* Wird aufgerufen, wenn ein Link zu einem besonderen, internen Ziel angeklickt wurde
* @param href Linkziel des angeklickten Links
*/
public void specialLinkClicked(final String href);
void specialLinkClicked(final String href);
}

@Override
Expand Down

0 comments on commit 67a634b

Please sign in to comment.