Commit 2641f1a0 authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck
Browse files

remove dependency to log4j. Add Logging Facade

parent 83475864
package org.vadere.gui.postvisualization.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.postvisualization.model.PostvisualizationModel;
import javax.swing.*;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;
// TODO [priority=low] [task=refactoring] - no strict separation between control and view
public class EJSliderAction implements MouseListener {
private static Logger logger = LogManager.getLogger(EJSliderAction.class);
private static Logger logger = Logger.getLogger(EJSliderAction.class);
private final JSlider slider;
public EJSliderAction(final JSlider slider) {
......
package org.vadere.gui.postvisualization.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.postvisualization.model.PostvisualizationModel;
import org.vadere.util.logging.Logger;
public class Player implements Runnable {
private static Logger logger = LogManager.getLogger(Player.class);
private static Logger logger = Logger.getLogger(Player.class);
private static volatile Player instance;
private Thread currentThread;
private int currentStep;
......
......@@ -2,13 +2,12 @@ package org.vadere.gui.postvisualization.control;
import com.fasterxml.jackson.databind.JsonNode;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.gui.postvisualization.model.PedestrianColorTableModel;
import org.vadere.gui.postvisualization.model.PostvisualizationModel;
import org.vadere.util.io.parser.JsonLogicParser;
import org.vadere.util.io.parser.VPredicate;
import org.vadere.util.logging.Logger;
import java.text.ParseException;
......@@ -20,7 +19,7 @@ import javax.swing.event.TableModelListener;
*/
public class TableListenerLogicExpression implements TableModelListener {
private static final Logger logger = LogManager.getLogger(TableListenerLogicExpression.class);
private static final Logger logger = Logger.getLogger(TableListenerLogicExpression.class);
private PostvisualizationModel model;
private PedestrianColorTableModel pedestrianColorTableModel;
......
package org.vadere.gui.postvisualization.model;
import java.awt.*;
import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.fasterxml.jackson.databind.JsonNode;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.gui.components.model.SimulationModel;
import org.vadere.gui.postvisualization.control.TableListenerLogicExpression;
......@@ -30,15 +15,29 @@ import org.vadere.state.scenario.TopographyIterator;
import org.vadere.state.simulation.Step;
import org.vadere.state.simulation.Trajectory;
import org.vadere.state.util.StateJsonConverter;
import org.vadere.util.data.cellgrid.CellGrid;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.io.parser.VPredicate;
import org.vadere.util.data.cellgrid.CellGrid;
import org.vadere.util.logging.Logger;
import com.fasterxml.jackson.databind.JsonNode;
import java.awt.*;
import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class PostvisualizationModel extends SimulationModel<PostvisualizationConfig> {
private static Logger logger = LogManager.getLogger(PostvisualizationModel.class);
private static Logger logger = Logger.getLogger(PostvisualizationModel.class);
private Step step;
......
package org.vadere.gui.postvisualization.utils;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.model.DefaultModel;
import org.vadere.gui.components.model.DefaultSimulationConfig;
import org.vadere.gui.components.model.SimulationModel;
import org.vadere.gui.components.view.SimulationRenderer;
import org.vadere.gui.postvisualization.model.PostvisualizationModel;
import org.vadere.gui.postvisualization.view.PostvisualizationRenderer;
import org.vadere.util.logging.Logger;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
public class ImageGenerator<T extends DefaultSimulationConfig> {
private static Logger logger = LogManager.getLogger(ImageGenerator.class);
private static Logger logger = Logger.getLogger(ImageGenerator.class);
private SimulationRenderer renderer;
private SimulationModel<? extends DefaultSimulationConfig> model;
......
package org.vadere.gui.postvisualization.utils;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.Priority;
import org.apache.log4j.lf5.LogLevel;
import org.jcodec.api.awt.SequenceEncoder;
import org.vadere.gui.components.utils.Resources;
import org.vadere.gui.postvisualization.PostVisualisation;
import org.vadere.gui.postvisualization.model.PostvisualizationModel;
import org.vadere.gui.postvisualization.view.PostvisualizationRenderer;
import org.vadere.util.logging.Logger;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
......@@ -22,7 +20,7 @@ import java.util.prefs.Preferences;
import javax.swing.*;
public class MovRecorder implements IRecorder {
private static Logger logger = LogManager.getLogger(MovRecorder.class);
private static Logger logger = Logger.getLogger(MovRecorder.class);
private static Resources resources = Resources.getInstance("postvisualization");
private final PostvisualizationModel model;
......
package org.vadere.gui.postvisualization.utils;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.util.data.cellgrid.CellGrid;
import org.vadere.util.data.cellgrid.CellGridConverter;
import org.vadere.util.data.cellgrid.CellState;
import org.vadere.util.data.cellgrid.PathFindingTag;
import org.vadere.util.logging.Logger;
import java.io.BufferedReader;
import java.io.File;
......@@ -15,7 +14,7 @@ import java.io.IOException;
import java.util.List;
public class PotentialFieldContainer {
private static Logger logger = LogManager.getLogger(PotentialFieldContainer.class);
private static Logger logger = Logger.getLogger(PotentialFieldContainer.class);
private List<CellGrid> potentialFields;
......
......@@ -2,21 +2,22 @@ package org.vadere.gui.postvisualization.utils;
import org.apache.batik.dom.GenericDOMImplementation;
import org.apache.batik.svggen.SVGGraphics2D;
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.view.SimulationRenderer;
import org.vadere.gui.postvisualization.model.PostvisualizationModel;
import org.vadere.gui.postvisualization.view.PostvisualizationRenderer;
import org.vadere.util.logging.Logger;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
import java.io.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
public class SVGGenerator {
private static Logger logger = LogManager.getLogger(SVGGenerator.class);
private static Logger logger = Logger.getLogger(SVGGenerator.class);
private SimulationRenderer renderer;
private final SimulationModel<? extends DefaultSimulationConfig> model;
......
package org.vadere.gui.postvisualization.utils;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.gui.components.model.DefaultSimulationConfig;
import org.vadere.gui.components.model.SimulationModel;
import org.vadere.gui.components.view.DefaultRenderer;
import org.vadere.gui.components.view.SimulationRenderer;
import org.vadere.gui.postvisualization.model.PostvisualizationModel;
import org.vadere.state.scenario.*;
import org.vadere.state.scenario.Agent;
import org.vadere.state.scenario.Obstacle;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.ScenarioElement;
import org.vadere.state.scenario.Source;
import org.vadere.state.scenario.Stairs;
import org.vadere.state.scenario.Target;
import org.vadere.state.scenario.Topography;
import org.vadere.state.simulation.Step;
import org.vadere.state.simulation.Trajectory;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.PathIterator;
import java.io.*;
import java.util.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.Locale;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static java.awt.geom.PathIterator.*;
import static java.awt.geom.PathIterator.SEG_CLOSE;
import static java.awt.geom.PathIterator.SEG_CUBICTO;
import static java.awt.geom.PathIterator.SEG_LINETO;
import static java.awt.geom.PathIterator.SEG_MOVETO;
import static java.awt.geom.PathIterator.SEG_QUADTO;
/**
* Convert the (Java) scenario description into a TikZ representation.
......@@ -44,7 +61,7 @@ import static java.awt.geom.PathIterator.*;
*/
public class TikzGenerator {
private final static Logger logger = LogManager.getLogger(TikzGenerator.class);
private final static Logger logger = Logger.getLogger(TikzGenerator.class);
private final SimulationRenderer renderer;
private final SimulationModel<? extends DefaultSimulationConfig> model;
private final String[] translationTable;
......
......@@ -3,8 +3,6 @@ package org.vadere.gui.postvisualization.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.model.DefaultSimulationConfig;
import org.vadere.gui.components.model.SimulationModel;
import org.vadere.gui.components.utils.Messages;
......@@ -13,16 +11,17 @@ import org.vadere.gui.components.utils.SwingUtils;
import org.vadere.gui.components.view.SettingsDialog;
import org.vadere.gui.postvisualization.control.ActionCloseSettingDialog;
import org.vadere.gui.postvisualization.utils.ImageGenerator;
import javax.swing.*;
import org.vadere.util.logging.Logger;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import javax.swing.*;
public class ImageSizeDialog extends JDialog {
private static Logger logger = LogManager.getLogger(SettingsDialog.class);
private static Logger logger = Logger.getLogger(SettingsDialog.class);
private static Resources resources = Resources.getInstance("postvisualization");
private double scale;
private SimulationModel<? extends DefaultSimulationConfig> model;
......
package org.vadere.gui.postvisualization.view;
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Stream;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.util.visualization.ColorHelper;
import org.vadere.gui.components.view.DefaultRenderer;
import org.vadere.gui.components.view.SimulationRenderer;
import org.vadere.gui.postvisualization.model.PostvisualizationModel;
......@@ -18,11 +8,19 @@ import org.vadere.state.scenario.Agent;
import org.vadere.state.simulation.Step;
import org.vadere.state.simulation.Trajectory;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.logging.Logger;
import org.vadere.util.visualization.ColorHelper;
import java.awt.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Stream;
public class PostvisualizationRenderer extends SimulationRenderer {
private static final double MIN_ARROW_LENGTH = 0.1;
private static Logger logger = LogManager.getLogger(PostvisualizationRenderer.class);
private static Logger logger = Logger.getLogger(PostvisualizationRenderer.class);
private PostvisualizationModel model;
private final Map<Integer, VPoint> lastPedestrianPositions;
......
package org.vadere.gui.projectview;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.projectview.view.ProjectView;
import org.vadere.util.io.IOUtils;
import org.vadere.util.logging.Logger;
import java.io.IOException;
import java.util.prefs.BackingStoreException;
......@@ -18,7 +18,7 @@ import java.util.prefs.Preferences;
*/
public class VadereApplication {
public static final String preferencesFilename = "VadereTestingSuite.preferences.xml";
private static Logger logger = LogManager.getLogger(VadereApplication.class);
private static Logger logger = Logger.getLogger(VadereApplication.class);
public static void main(String[] args) {
logger.info("starting Vadere GUI...");
......
package org.vadere.gui.projectview.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.projectview.model.ProjectViewModel;
import org.vadere.simulator.projects.Scenario;
import org.vadere.simulator.projects.ProjectWriter;
import org.vadere.simulator.projects.Scenario;
import org.vadere.util.io.IOUtils;
import javax.swing.*;
import org.vadere.util.logging.Logger;
import java.awt.event.ActionEvent;
import java.io.IOException;
import javax.swing.*;
public abstract class ActionAbstractAddScenario extends AbstractAction {
private static final long serialVersionUID = 1L;
private static Logger logger = LogManager.getLogger(ActionAbstractAddScenario.class);
private static Logger logger = Logger.getLogger(ActionAbstractAddScenario.class);
private ProjectViewModel model;
......
package org.vadere.gui.projectview.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.projectview.model.ProjectViewModel;
import org.vadere.gui.projectview.utils.ApplicationWriter;
import org.vadere.gui.projectview.view.VDialogManager;
import org.vadere.util.io.IOUtils;
import org.vadere.util.logging.Logger;
import javax.swing.*;
import java.io.IOException;
import java.util.prefs.BackingStoreException;
import javax.swing.*;
public abstract class ActionAbstractSaveProject extends AbstractAction {
private static final long serialVersionUID = 1L;
private static Logger logger = LogManager.getLogger(ActionAbstractSaveProject.class);
private static Logger logger = Logger.getLogger(ActionAbstractSaveProject.class);
protected ProjectViewModel model;
......
package org.vadere.gui.projectview.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.projectview.model.ProjectViewModel;
import org.vadere.simulator.projects.Scenario;
import org.vadere.simulator.projects.dataprocessing.DataProcessingJsonManager;
import org.vadere.state.scenario.Topography;
import org.vadere.util.logging.Logger;
import java.io.IOException;
......@@ -17,7 +17,7 @@ import java.io.IOException;
public class ActionAddScenario extends ActionAbstractAddScenario {
private static final long serialVersionUID = 1L;
private static Logger logger = LogManager.getLogger(ActionAddScenario.class);
private static Logger logger = Logger.getLogger(ActionAddScenario.class);
private Topography topography;
......
package org.vadere.gui.projectview.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.projectview.model.ProjectViewModel;
import org.vadere.simulator.projects.ProjectWriter;
import org.vadere.simulator.projects.Scenario;
import org.vadere.util.logging.Logger;
import java.awt.event.ActionEvent;
import java.io.IOException;
......@@ -15,7 +15,7 @@ import javax.swing.*;
public class ActionCloneScenario extends AbstractAction {
private static final long serialVersionUID = 1L;
private static Logger logger = LogManager.getLogger(ActionCloneScenario.class);
private static Logger logger = Logger.getLogger(ActionCloneScenario.class);
private ProjectViewModel model;
public ActionCloneScenario(final String name, final ProjectViewModel model) {
......
package org.vadere.gui.projectview.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.projectview.model.ProjectViewModel;
import org.vadere.gui.projectview.view.VDialogManager;
import org.vadere.util.logging.Logger;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.util.prefs.BackingStoreException;
import javax.swing.*;
public class ActionCloseApplication extends AbstractAction {
private static final long serialVersionUID = 1L;
private static Logger logger = LogManager.getLogger(ActionCloseApplication.class);
private static Logger logger = Logger.getLogger(ActionCloseApplication.class);
private ProjectViewModel model;
......
package org.vadere.gui.projectview.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.projectview.model.ProjectViewModel;
import org.vadere.simulator.projects.ProjectWriter;
import org.vadere.util.io.IOUtils;
import org.vadere.util.logging.Logger;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.io.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.nio.file.Paths;
import javax.swing.*;
public class ActionConvertScenarioToWMP extends AbstractAction {
private static Logger logger = LogManager.getLogger(ActionConvertScenarioToWMP.class);
private static Logger logger = Logger.getLogger(ActionConvertScenarioToWMP.class);
private ProjectViewModel model;
public ActionConvertScenarioToWMP(final String name, final ProjectViewModel model) {
......
package org.vadere.gui.projectview.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.projectview.model.ProjectViewModel;
import org.vadere.gui.projectview.view.ProjectView;
import org.vadere.simulator.projects.VadereProject;
import org.vadere.util.logging.Logger;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.util.ArrayList;
import java.util.concurrent.ConcurrentHashMap;
import javax.swing.*;
public class ActionCreateProject extends AbstractAction {
private static final long serialVersionUID = 1L;
private static Logger logger = LogManager.getLogger(ActionCreateProject.class);
private static Logger logger = Logger.getLogger(ActionCreateProject.class);
private ProjectViewModel model;
......
package org.vadere.gui.projectview.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.projectview.model.ProjectViewModel;
import org.vadere.gui.projectview.view.VTable;
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 javax.swing.*;
public class ActionDeleteOutputDirectories extends AbstractAction {
private static final long serialVersionUID