Commit 18addc62 authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck
Browse files

Merge branch 'assertionLog' into 'master'

Change Log4j1 dependency to Lo4j2

See merge request !42
parents 40ef5847 5f7420d2
Pipeline #88052 passed with stages
in 102 minutes and 25 seconds
package org.vadere.gui.compileScripts;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.util.logging.Logger;
/**
* @author Benedikt Zoennchen
......@@ -10,7 +10,7 @@ import org.apache.log4j.Logger;
*/
public class ClassListGenerator {
private static Logger log = LogManager.getLogger(ClassListGenerator.class);
private static Logger log = Logger.getLogger(ClassListGenerator.class);
public static void main(String... args) {
......
package org.vadere.gui.components.control;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.model.IDefaultModel;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
/**
* Updates the viewport in the model if the viewport of the JScrollpane changes (pixel coordinates).
*
*/
public class JViewportChangeListener implements ChangeListener {
private Logger logger = LogManager.getLogger(JViewportChangeListener.class);
private Logger logger = Logger.getLogger(JViewportChangeListener.class);
private final JScrollBar verticalScrollBar;
private final IDefaultModel defaultModel;
......
package org.vadere.gui.components.control.simulation;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.model.DefaultSimulationConfig;
import org.vadere.gui.components.model.SimulationModel;
import org.vadere.gui.components.utils.Messages;
......@@ -11,6 +9,7 @@ import org.vadere.gui.onlinevisualization.view.IRendererChangeListener;
import org.vadere.gui.postvisualization.PostVisualisation;
import org.vadere.gui.postvisualization.utils.ImageGenerator;
import org.vadere.gui.postvisualization.view.ImageSizeDialog;
import org.vadere.util.logging.Logger;
import java.awt.event.ActionEvent;
import java.awt.image.BufferedImage;
......@@ -24,7 +23,7 @@ import javax.imageio.ImageIO;
import javax.swing.*;
public class ActionGeneratePNG extends AbstractAction implements IRendererChangeListener {
private static Logger logger = LogManager.getLogger(ActionGeneratePNG.class);
private static Logger logger = Logger.getLogger(ActionGeneratePNG.class);
private static Resources resources = Resources.getInstance("global");
private ImageGenerator generator;
private final SimulationModel<? extends DefaultSimulationConfig> model;
......
package org.vadere.gui.components.control.simulation;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.model.DefaultSimulationConfig;
import org.vadere.gui.components.model.SimulationModel;
import org.vadere.gui.components.utils.Messages;
......@@ -10,6 +9,7 @@ import org.vadere.gui.components.view.SimulationRenderer;
import org.vadere.gui.onlinevisualization.view.IRendererChangeListener;
import org.vadere.gui.postvisualization.PostVisualisation;
import org.vadere.gui.postvisualization.utils.SVGGenerator;
import org.vadere.util.logging.Logger;
import java.awt.event.ActionEvent;
import java.io.File;
......@@ -20,7 +20,7 @@ import java.util.prefs.Preferences;
import javax.swing.*;
public class ActionGenerateSVG extends AbstractAction implements IRendererChangeListener {
private static Logger logger = LogManager.getLogger(ActionGenerateSVG.class);
private static Logger logger = Logger.getLogger(ActionGenerateSVG.class);
private static Resources resources = Resources.getInstance("global");
private final SVGGenerator svgGenerator;
private final SimulationModel<? extends DefaultSimulationConfig> model;
......
package org.vadere.gui.components.control.simulation;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.model.DefaultSimulationConfig;
import org.vadere.gui.components.model.SimulationModel;
import org.vadere.gui.components.utils.Messages;
......@@ -10,8 +9,7 @@ import org.vadere.gui.components.view.SimulationRenderer;
import org.vadere.gui.onlinevisualization.view.IRendererChangeListener;
import org.vadere.gui.postvisualization.PostVisualisation;
import org.vadere.gui.postvisualization.utils.TikzGenerator;
import javax.swing.*;
import org.vadere.util.logging.Logger;
import java.awt.event.ActionEvent;
import java.io.File;
......@@ -19,8 +17,10 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.prefs.Preferences;
import javax.swing.*;
public class ActionGenerateTikz extends AbstractAction implements IRendererChangeListener {
private static Logger logger = LogManager.getLogger(ActionGenerateTikz.class);
private static Logger logger = Logger.getLogger(ActionGenerateTikz.class);
private static Resources resources = Resources.getInstance("global");
private final TikzGenerator tikzGenerator;
private final SimulationModel<? extends DefaultSimulationConfig> model;
......
package org.vadere.gui.components.control.simulation;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.control.DefaultSelectionMode;
import org.vadere.gui.components.control.DrawVoronoiDiagramMode;
import org.vadere.gui.components.model.DefaultSimulationConfig;
import org.vadere.gui.components.model.SimulationModel;
import org.vadere.util.logging.Logger;
import javax.swing.*;
import java.awt.event.ActionEvent;
import javax.swing.*;
public class ActionSwapSelectionMode extends ActionVisualization {
private static Logger logger = LogManager.getLogger(ActionSwapSelectionMode.class);
private static Logger logger = Logger.getLogger(ActionSwapSelectionMode.class);
public ActionSwapSelectionMode(final String name, final SimulationModel<? extends DefaultSimulationConfig> model) {
super(name, model);
......
package org.vadere.gui.components.model;
import javax.swing.*;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.control.*;
import org.vadere.gui.components.control.DefaultSelectionMode;
import org.vadere.gui.components.control.IMode;
import org.vadere.gui.components.control.IScaleChangeListener;
import org.vadere.gui.components.control.IViewportChangeListener;
import org.vadere.gui.components.control.ViewportChangeEvent;
import org.vadere.gui.components.view.ISelectScenarioElementListener;
import org.vadere.state.scenario.ScenarioElement;
import org.vadere.state.types.ScenarioElementType;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.logging.Logger;
import org.vadere.util.voronoi.VoronoiDiagram;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.util.*;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Observable;
import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import javax.swing.*;
public abstract class DefaultModel<T extends DefaultConfig> extends Observable implements IDefaultModel<T> {
// private static final int BORDER_WIDTH = 20;
// private static final int BORDER_HEIGHT = 20;
private static Logger log = LogManager.getLogger(DefaultModel.class);
private static Logger log = Logger.getLogger(DefaultModel.class);
private IMode mouseSelectionMode;
......
package org.vadere.gui.components.utils;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.Priority;
import org.jcodec.api.awt.SequenceEncoder;
import org.jetbrains.annotations.NotNull;
import org.vadere.gui.postvisualization.PostVisualisation;
import org.vadere.gui.postvisualization.utils.IRecorder;
import org.vadere.util.logging.Logger;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
......@@ -20,7 +19,7 @@ import java.util.prefs.Preferences;
import javax.swing.*;
public class Recorder implements IRecorder {
private static Logger logger = LogManager.getLogger(Recorder.class);
private static Logger logger = Logger.getLogger(Recorder.class);
private SequenceEncoder enc;
private static Resources resources = Resources.getInstance("global");
......@@ -64,7 +63,7 @@ public class Recorder implements IRecorder {
try {
enc.finish();
} catch (IndexOutOfBoundsException error) {
logger.log(Priority.DEBUG, "Nothing recorded! " + error.getMessage());
logger.debug( "Nothing recorded! %s" , error.getMessage());
}
logger.info(this + " stop recording");
}
......
package org.vadere.gui.components.utils;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import javax.imageio.ImageIO;
import javax.swing.*;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.BufferedOutputStream;
......@@ -16,6 +14,9 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import javax.imageio.ImageIO;
import javax.swing.*;
/**
* The Resource class is for loading, changing, adding and manipulating properties in the
* property file [applicationName]_config.properties. The global_config.properties file
......@@ -26,7 +27,7 @@ import java.util.Properties;
*/
public class Resources {
private static Logger logger = LogManager.getLogger(Resources.class);
private static Logger logger = Logger.getLogger(Resources.class);
private Properties properties = null;
......
......@@ -3,8 +3,6 @@ package org.vadere.gui.components.view;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
import org.fife.ui.rsyntaxtextarea.Theme;
......@@ -18,6 +16,7 @@ import org.vadere.state.attributes.Attributes;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.ScenarioElement;
import org.vadere.state.util.StateJsonConverter;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.io.IOException;
......@@ -33,7 +32,7 @@ import javax.swing.event.DocumentListener;
public class ScenarioElementView extends JPanel implements ISelectScenarioElementListener {
private static final long serialVersionUID = -1567362675580536991L;
private static Logger logger = LogManager.getLogger(ScenarioElementView.class);
private static Logger logger = Logger.getLogger(ScenarioElementView.class);
private JTextArea txtrTextfiletextarea;
private IDefaultModel panelModel;
private DocumentListener documentListener;
......
......@@ -3,8 +3,6 @@ package org.vadere.gui.components.view;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.control.simulation.ActionSetDensityColor;
import org.vadere.gui.components.control.simulation.ActionSetObstacleColor;
import org.vadere.gui.components.control.simulation.ActionSetPedestrianColor;
......@@ -19,9 +17,9 @@ import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.components.utils.Resources;
import org.vadere.gui.components.utils.SwingUtils;
import org.vadere.gui.postvisualization.PostVisualisation;
import org.vadere.gui.postvisualization.control.*;
import org.vadere.gui.postvisualization.control.ActionCloseSettingDialog;
import org.vadere.util.logging.Logger;
import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
......@@ -29,11 +27,13 @@ import java.util.List;
import java.util.Optional;
import java.util.prefs.Preferences;
import javax.swing.*;
/**
* @author Benedikt Zoennchen
*/
public class SettingsDialog extends JDialog {
private static Logger logger = LogManager.getLogger(SettingsDialog.class);
private static Logger logger = Logger.getLogger(SettingsDialog.class);
private static Resources resources = Resources.getInstance("global");
private DefaultSimulationConfig config;
......
package org.vadere.gui.components.view;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Stroke;
import java.awt.geom.Path2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.Collection;
import java.util.stream.Stream;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.util.visualization.ColorHelper;
import org.vadere.gui.components.model.SimulationModel;
import org.vadere.gui.components.utils.CLGaussianCalculator;
import org.vadere.gui.components.utils.Resources;
......@@ -22,10 +9,19 @@ import org.vadere.state.scenario.Agent;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VTriangle;
import org.vadere.util.logging.Logger;
import org.vadere.util.visualization.ColorHelper;
import java.awt.*;
import java.awt.geom.Path2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.Collection;
import java.util.stream.Stream;
public abstract class SimulationRenderer extends DefaultRenderer {
private static Logger logger = LogManager.getLogger(SimulationRenderer.class);
private static Logger logger = Logger.getLogger(SimulationRenderer.class);
private static Resources resources = Resources.getInstance("postvisualization");
private static double MAX_POTENTIAL = 1000.0;
......
package org.vadere.gui.onlinevisualization.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.control.simulation.ActionVisualization;
import org.vadere.gui.components.model.DefaultSimulationConfig;
import org.vadere.gui.components.model.SimulationModel;
import org.vadere.util.logging.Logger;
import java.awt.event.ActionEvent;
import javax.swing.*;
public class ActionShowMesh extends ActionVisualization {
private static Logger logger = LogManager.getLogger(ActionShowMesh.class);
private static Logger logger = Logger.getLogger(ActionShowMesh.class);
public ActionShowMesh(final String name, Icon icon, final SimulationModel<? extends DefaultSimulationConfig> model) {
super(name, icon, model);
......
package org.vadere.gui.onlinevisualization.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.model.DefaultSimulationConfig;
import org.vadere.gui.components.model.SimulationModel;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.components.view.SimulationRenderer;
import org.vadere.gui.onlinevisualization.view.IRendererChangeListener;
import org.vadere.util.logging.Logger;
import javax.swing.*;
import java.awt.event.ActionEvent;
import javax.swing.*;
/**
* @author Benedikt Zoennchen
*/
public class ActionShowPotentialField extends AbstractAction implements IRendererChangeListener {
private static Logger logger = LogManager.getLogger(ActionShowPotentialField.class);
private static Logger logger = Logger.getLogger(ActionShowPotentialField.class);
private final SimulationModel<? extends DefaultSimulationConfig> model;
public ActionShowPotentialField(final String name, final Icon icon, final SimulationModel<? extends DefaultSimulationConfig> model) {
......
package org.vadere.gui.postvisualization;
import org.vadere.gui.postvisualization.view.PostvisualizationWindow;
import org.vadere.util.io.IOUtils;
import org.vadere.util.logging.Logger;
import org.vadere.util.logging.StdOutErrLog;
import java.io.IOException;
import java.util.prefs.BackingStoreException;
import java.util.prefs.InvalidPreferencesFormatException;
import java.util.prefs.Preferences;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.postvisualization.view.PostvisualizationWindow;
import org.vadere.util.io.IOUtils;
public class PostVisualisation {
public static final String preferencesFilename = "PostVisualisation.preferences.xml";
private static Logger logger = LogManager.getLogger(PostVisualisation.class);
private static Logger logger = Logger.getLogger(PostVisualisation.class);
public static void main(String[] args) {
StdOutErrLog.addStdOutErrToLog();
logger.info("starting post visualization ...");
// load settings
loadPreferences();
......
......@@ -12,6 +12,7 @@ import org.vadere.gui.postvisualization.view.PostvisualizationRenderer;
import org.vadere.simulator.projects.io.IOOutput;
import org.vadere.simulator.projects.io.TrajectoryReader;
import org.vadere.util.io.IOUtils;
import org.vadere.util.logging.StdOutErrLog;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
......@@ -29,6 +30,7 @@ import java.util.Optional;
public class PostVisualizationConsole {
public static void main(final String... args) {
StdOutErrLog.addStdOutErrToLog();
ArgumentParser parser = ArgumentParsers.newArgumentParser("prog")
.defaultHelp(true)
.description("Runs the VADERE Postvisualization for image generation.");
......
package org.vadere.gui.postvisualization.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.postvisualization.PostVisualisation;
import org.vadere.util.io.IOUtils;
import org.vadere.util.logging.Logger;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
import javax.swing.*;
public class ActionCloseSettingDialog extends AbstractAction {
private static Logger logger = LogManager.getLogger(ActionCloseSettingDialog.class);
private static Logger logger = Logger.getLogger(ActionCloseSettingDialog.class);
private final JDialog dialog;
public ActionCloseSettingDialog(final JDialog dialog) {
......
package org.vadere.gui.postvisualization.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.control.simulation.ActionVisualization;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.components.utils.Resources;
import org.vadere.gui.components.view.DialogFactory;
import org.vadere.gui.postvisualization.PostVisualisation;
import org.vadere.gui.postvisualization.model.PostvisualizationModel;
import org.vadere.gui.components.view.DialogFactory;
import org.vadere.simulator.projects.Scenario;
import org.vadere.simulator.projects.io.IOOutput;
import org.vadere.util.io.IOUtils;
import org.vadere.util.logging.Logger;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.io.File;
import java.io.IOException;
......@@ -20,8 +19,10 @@ import java.util.Optional;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
import javax.swing.*;
public class ActionOpenFile extends ActionVisualization {
private static Logger logger = LogManager.getLogger(ActionOpenFile.class);
private static Logger logger = Logger.getLogger(ActionOpenFile.class);
private static Resources resources = Resources.getInstance("postvisualization");
private final PostvisualizationModel model;
private String path = null;
......
package org.vadere.gui.postvisualization.control;
import java.awt.event.ActionEvent;
import java.io.IOException;
import javax.swing.Icon;
import javax.swing.JButton;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.control.simulation.ActionVisualization;
import org.vadere.gui.components.utils.Resources;
import org.vadere.gui.postvisualization.model.PostvisualizationModel;
......@@ -15,9 +7,15 @@ import org.vadere.gui.postvisualization.utils.IRecorder;
import org.vadere.gui.postvisualization.utils.MovRecorder;
import org.vadere.gui.postvisualization.view.ImageSizeDialog;
import org.vadere.gui.postvisualization.view.PostvisualizationRenderer;
import org.vadere.util.logging.Logger;
import java.awt.event.ActionEvent;
import java.io.IOException;
import javax.swing.*;
public class ActionRecording extends ActionVisualization {
private static Logger logger = LogManager.getLogger(ActionRecording.class);
private static Logger logger = Logger.getLogger(ActionRecording.class);
private static Resources resources = Resources.getInstance("postvisualization");
private final PostvisualizationModel model;
private JButton button;
......
package org.vadere.gui.postvisualization.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.control.simulation.ActionVisualization;
import org.vadere.gui.postvisualization.model.PostvisualizationModel;
import org.vadere.util.logging.Logger;
import java.awt.event.ActionEvent;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.event.ActionEvent;
public class ActionSetTimeStep extends ActionVisualization implements ChangeListener {
private static Logger logger = LogManager.getLogger(ActionSetTimeStep.class);
private static Logger logger = Logger.getLogger(ActionSetTimeStep.class);
private PostvisualizationModel model;
public ActionSetTimeStep(final String name, PostvisualizationModel model) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment