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.projectview.view;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.io.File;
import java.util.Collection;
import java.util.LinkedList;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
public class OutputTableRenderer extends DefaultTableCellRenderer {
private static final long serialVersionUID = -3026076129551731012L;
private static Logger logger = LogManager.getLogger(OutputTableRenderer.class);
private static Logger logger = Logger.getLogger(OutputTableRenderer.class);
private Collection<String> markedOutputFiles;
public OutputTableRenderer() {
......
package org.vadere.gui.projectview.view;
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.ProjectFinishedListener;
import org.vadere.simulator.projects.SimulationResult;
import org.vadere.simulator.projects.VadereProject;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.awt.event.ActionEvent;
......@@ -22,7 +22,7 @@ import java.util.LinkedList;
import javax.swing.*;
public class ProjectRunResultDialog implements ProjectFinishedListener {
private static Logger logger = LogManager.getLogger(ProjectRunResultDialog.class);
private static Logger logger = Logger.getLogger(ProjectRunResultDialog.class);
private final ProjectView projectView;
private final ProjectViewModel projectViewModel;
......
package org.vadere.gui.projectview.view;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.postvisualization.control.Player;
import org.vadere.gui.projectview.VadereApplication;
......@@ -43,6 +42,7 @@ import org.vadere.simulator.projects.Scenario;
import org.vadere.simulator.projects.SingleScenarioFinishedListener;
import org.vadere.simulator.projects.VadereProject;
import org.vadere.util.io.IOUtils;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.awt.event.ActionEvent;
......@@ -73,7 +73,7 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
* Static variables
*/
private static final long serialVersionUID = -2081363246241235943L;
private static Logger logger = LogManager.getLogger(ProjectView.class);
private static Logger logger = Logger.getLogger(ProjectView.class);
/** Store a reference to the main window as "owner" parameter for dialogs. */
private static ProjectView mainWindow;
......
package org.vadere.gui.projectview.view;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.onlinevisualization.OnlineVisualization;
import org.vadere.gui.postvisualization.view.PostvisualizationWindow;
......@@ -15,6 +14,7 @@ import org.vadere.simulator.projects.VadereProject;
import org.vadere.state.attributes.ModelAttributeFactory;
import org.vadere.state.scenario.Topography;
import org.vadere.state.util.StateJsonConverter;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.awt.event.ActionEvent;
......@@ -29,7 +29,7 @@ import javax.swing.border.EmptyBorder;
public class ScenarioPanel extends JPanel implements IProjectChangeListener, ProjectFinishedListener {
private static Logger logger = LogManager.getLogger(ScenarioPanel.class);
private static Logger logger = Logger.getLogger(ScenarioPanel.class);
private static final long serialVersionUID = 0L;
private JTabbedPane tabbedPane;
......
package org.vadere.gui.projectview.view;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.io.InputStream;
import java.util.prefs.Preferences;
import javax.imageio.ImageIO;
import javax.swing.AbstractButton;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import com.fasterxml.jackson.core.JsonProcessingException;
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;
......@@ -38,8 +17,20 @@ import org.vadere.state.events.json.EventInfoStore;
import org.vadere.state.scenario.Topography;
import org.vadere.state.util.StateJsonConverter;
import org.vadere.util.io.IOUtils;
import org.vadere.util.logging.Logger;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.io.InputStream;
import java.util.prefs.Preferences;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
/**
* Shows text like the JSON formatted attributes.
......@@ -48,7 +39,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
*/
public class TextView extends JPanel implements IJsonView {
private static Logger logger = LogManager.getLogger(TextView.class);
private static Logger logger = Logger.getLogger(TextView.class);
private AttributeType attributeType;
private String default_folder;
......
package org.vadere.gui.projectview.view;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.projectview.VadereApplication;
import org.vadere.util.io.IOUtils;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.util.prefs.Preferences;
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.awt.*;
import java.util.prefs.Preferences;
public class VDialogManager {
private static Logger logger = LogManager.getLogger(VDialogManager.class);
private static Logger logger = Logger.getLogger(VDialogManager.class);
private static final FileFilter PROJECT_FILTER = new FileNameExtensionFilter("Vadere Project", "project");
public static String saveProjectDialog() {
......
package org.vadere.gui.renderer.agent;
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.components.view.DefaultRenderer;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.ScenarioElement;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.util.Random;
......@@ -16,7 +16,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class AgentRender implements Renderer {
private static Logger logger = LogManager.getLogger(AgentRender.class);
private static Logger logger = Logger.getLogger(AgentRender.class);
private static final Integer COLOR_NUM = 9;
private Random random;
......
package org.vadere.gui.topographycreator.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.Priority;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.awt.event.ActionEvent;
......@@ -20,7 +19,7 @@ public class ActionRedo extends AbstractAction {
private static final long serialVersionUID = 4975524648404524891L;
private final UndoManager undoManager;
private final TopographyAction action;
private static Logger logger = LogManager.getLogger(ActionRedo.class);
private static Logger logger = Logger.getLogger(ActionRedo.class);
public ActionRedo(final String name, final ImageIcon icon, final UndoManager undoManager,
final TopographyAction action) {
......@@ -34,7 +33,7 @@ public class ActionRedo extends AbstractAction {
try {
undoManager.redo();
} catch (CannotRedoException e) {
logger.log(Priority.DEBUG, "Cannot redo! List of edits is empty!");
logger.debug("Cannot redo! List of edits is empty!");
Toolkit.getDefaultToolkit().beep();
}
action.actionPerformed(arg0);
......
package org.vadere.gui.topographycreator.control;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.Priority;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.awt.event.ActionEvent;
......@@ -21,7 +20,7 @@ public class ActionUndo extends AbstractAction {
private static final long serialVersionUID = 6022031098257929748L;
private final UndoManager undoManager;
private final TopographyAction action;
private static Logger logger = LogManager.getLogger(ActionUndo.class);
private static Logger logger = Logger.getLogger(ActionUndo.class);
public ActionUndo(final String name, final ImageIcon icon, UndoManager undoManager, final TopographyAction action) {
super(name, icon);
......@@ -34,7 +33,7 @@ public class ActionUndo extends AbstractAction {
try {
undoManager.undo();
} catch (CannotUndoException e) {
logger.log(Priority.DEBUG, "Cannot undo! List of edits is empty!");
logger.debug("Cannot undo! List of edits is empty!");
Toolkit.getDefaultToolkit().beep();
}
......
package org.vadere.meshing.mesh.gen;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.SpaceFillingCurve;
import org.vadere.meshing.mesh.inter.IIncrementalTriangulation;
import org.vadere.meshing.mesh.inter.IMesh;
import org.vadere.meshing.mesh.inter.IPointConstructor;
import org.vadere.meshing.mesh.inter.IPointLocator;
import org.vadere.meshing.mesh.inter.IIncrementalTriangulation;
import org.vadere.util.geometry.GeometryUtils;
import org.vadere.meshing.SpaceFillingCurve;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.MPoint;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import java.util.*;
import org.vadere.util.logging.Logger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
......@@ -27,7 +33,7 @@ import java.util.stream.Stream;
* @param <P> the type of the points (containers)
*/
public class AMesh<P extends IPoint> implements IMesh<P, AVertex<P>, AHalfEdge<P>, AFace<P>>, Cloneable {
private final static Logger log = LogManager.getLogger(AMesh.class);
private final static Logger log = Logger.getLogger(AMesh.class);
private List<AFace<P>> faces;
private boolean elementRemoved;
private int numberOfVertices;
......
package org.vadere.meshing.mesh.gen;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.meshing.mesh.inter.IFace;
import org.vadere.meshing.mesh.inter.IHalfEdge;
import org.vadere.meshing.mesh.inter.IVertex;
......@@ -9,8 +8,13 @@ import org.vadere.util.geometry.GeometryUtils;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VLine;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.logging.Logger;
import java.util.*;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Optional;
import java.util.Set;
/**
* unfinished!
......@@ -18,7 +22,7 @@ import java.util.*;
*/
public class ConstrainedTriangulation<P extends IPoint, V extends IVertex<P>, E extends IHalfEdge<P>, F extends IFace<P>> extends IncrementalTriangulation<P, V, E, F> {
private static Logger log = LogManager.getLogger(ConstrainedTriangulation.class);
private static Logger log = Logger.getLogger(ConstrainedTriangulation.class);
private Set<E> constrainedHE;
private Collection<VLine> constrains;
......
package org.vadere.meshing.mesh.gen;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.mesh.inter.IFace;
import org.vadere.meshing.mesh.inter.IHalfEdge;
import org.vadere.meshing.mesh.inter.IIncrementalTriangulation;
import org.vadere.meshing.mesh.inter.IMesh;
import org.vadere.meshing.mesh.inter.IPointLocator;
import org.vadere.meshing.mesh.inter.ITriEventListener;
import org.vadere.meshing.mesh.inter.IIncrementalTriangulation;
import org.vadere.meshing.mesh.inter.IVertex;
import org.vadere.util.geometry.GeometryUtils;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.logging.LogLevel;
import org.vadere.util.logging.Logger;
import java.util.ArrayList;
import java.util.Iterator;
......@@ -50,10 +49,10 @@ import java.util.function.Supplier;
* @param <F> the type of the faces
*/
public class DelaunayHierarchy<P extends IPoint, V extends IVertex<P>, E extends IHalfEdge<P>, F extends IFace<P>> implements IPointLocator<P, V, E, F> {
private static Logger log = LogManager.getLogger(DelaunayHierarchy.class);
private static Logger log = Logger.getLogger(DelaunayHierarchy.class);
static {
log.setLevel(Level.DEBUG);
log.setLevel(LogLevel.DEBUG);
}
/**
......
package org.vadere.meshing.mesh.gen;
import org.apache.commons.lang3.tuple.Triple;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.mesh.inter.IFace;
import org.vadere.meshing.mesh.inter.IHalfEdge;
import org.vadere.meshing.mesh.inter.IIncrementalTriangulation;
import org.vadere.meshing.mesh.inter.IMesh;
import org.vadere.meshing.mesh.inter.IPointConstructor;
import org.vadere.meshing.mesh.inter.IPointLocator;
import org.vadere.meshing.mesh.inter.ITriConnectivity;
import org.vadere.meshing.mesh.inter.IIncrementalTriangulation;
import org.vadere.meshing.mesh.inter.IVertex;
import org.vadere.meshing.mesh.iterators.FaceIterator;
import org.vadere.meshing.mesh.triangulation.BowyerWatsonSlow;
......@@ -22,6 +19,8 @@ import org.vadere.util.geometry.shapes.VLine;
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.LogLevel;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.util.ArrayList;
......@@ -79,10 +78,10 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
private double edgeCoincidenceTolerance = 0.0001;
private final Predicate<E> illegalPredicate;
private static Logger log = LogManager.getLogger(IncrementalTriangulation.class);
private static Logger log = Logger.getLogger(IncrementalTriangulation.class);
static {
ITriConnectivity.log.setLevel(Level.INFO);
ITriConnectivity.log.setLevel(LogLevel.INFO);
}
/**
......
package org.vadere.meshing.mesh.gen;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.vadere.meshing.mesh.inter.IFace;
......@@ -11,6 +10,7 @@ import org.vadere.meshing.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VPolygon;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.logging.Logger;
import java.awt.*;
import java.awt.image.BufferedImage;
......@@ -31,7 +31,7 @@ import java.util.function.Predicate;
*/
public class MeshRenderer<P extends IPoint, V extends IVertex<P>, E extends IHalfEdge<P>, F extends IFace<P>> {
private static final Logger log = LogManager.getLogger(MeshRenderer.class);
private static final Logger log = Logger.getLogger(MeshRenderer.class);
/**
* The mesh which will be rendered.
......
package org.vadere.meshing.mesh.gen;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.mesh.inter.IMesh;
import org.vadere.meshing.mesh.inter.IPointLocator;
import org.vadere.meshing.mesh.inter.IIncrementalTriangulation;
import org.vadere.meshing.mesh.inter.IMesh;
import org.vadere.meshing.mesh.inter.IPointConstructor;
import org.vadere.meshing.mesh.inter.IPointLocator;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.logging.Logger;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
......@@ -19,7 +23,7 @@ import java.util.stream.Stream;
*/
public class PMesh<P extends IPoint> implements IMesh<P, PVertex<P>, PHalfEdge<P>, PFace<P>> {
private static Logger log = LogManager.getLogger(PMesh.class);
private static Logger log = Logger.getLogger(PMesh.class);
private int numberOfEdges;
private int numberOfFaces;
......
package org.vadere.meshing.mesh.inter;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.mesh.gen.IncrementalTriangulation;
import org.vadere.meshing.mesh.iterators.EdgeIterator;
import org.vadere.util.geometry.GeometryUtils;
import org.vadere.meshing.mesh.gen.IncrementalTriangulation;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.logging.Logger;
import java.util.ArrayList;
import java.util.HashSet;
......@@ -38,7 +38,7 @@ public interface IPolyConnectivity<P extends IPoint, V extends IVertex<P>, E ext
/**
* A logger to debug some code.
*/
Logger log = LogManager.getLogger(IPolyConnectivity.class);
Logger log = Logger.getLogger(IPolyConnectivity.class);
/**
* <p>Returns the mesh of this poly-connectivity {@link IPolyConnectivity}.</p>
......
package org.vadere.meshing.mesh.inter;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.mesh.gen.DelaunayHierarchy;
import org.vadere.util.geometry.GeometryUtils;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.logging.Logger;
import java.util.LinkedList;
import java.util.Optional;
......@@ -41,7 +39,7 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
/**
* A logger for debug and information reasons.
*/
Logger log = LogManager.getLogger(ITriConnectivity.class);
Logger log = Logger.getLogger(ITriConnectivity.class);
/**
* A Random number generator to randomly walk through the trinagulation.
......
package org.vadere.meshing.mesh.iterators;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.meshing.mesh.inter.IFace;
import org.vadere.meshing.mesh.inter.IHalfEdge;
import org.vadere.meshing.mesh.inter.IMesh;
import org.vadere.meshing.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.logging.Logger;
import java.util.Iterator;
......@@ -20,7 +20,7 @@ import java.util.Iterator;
*/
public class AdjacentVertexIterator<P extends IPoint, V extends IVertex<P>, E extends IHalfEdge<P>, F extends IFace<P>> implements Iterator<V> {
private static Logger log = LogManager.getLogger(AdjacentVertexIterator.class);
private static Logger log = Logger.getLogger(AdjacentVertexIterator.class);
private IMesh<P, V, E, F> mesh;
private IncidentEdgeIterator<P, V, E, F> incidentEdgeIterator;
......
package org.vadere.meshing.mesh.iterators;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.meshing.mesh.inter.IFace;
import org.vadere.meshing.mesh.inter.IHalfEdge;
import org.vadere.meshing.mesh.inter.IMesh;
import org.vadere.meshing.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.logging.Logger;
import java.util.Iterator;
......@@ -22,7 +22,7 @@ import java.util.Iterator;
*/
public class IncidentEdgeIterator<P extends IPoint, V extends IVertex<P>, E extends IHalfEdge<P>, F extends IFace<P>> implements Iterator<E> {
private static Logger log = LogManager.getLogger(IncidentEdgeIterator.class);
private static Logger log = Logger.getLogger(IncidentEdgeIterator.class);
private IMesh<P, V, E, F> mesh;
private E current;
private E edge;
......
package org.vadere.meshing.mesh.triangulation.improver;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.meshing.mesh.gen.PFace;
import org.vadere.meshing.mesh.gen.PHalfEdge;
import org.vadere.meshing.mesh.gen.PVertex;
import org.vadere.meshing.mesh.inter.IIncrementalTriangulation;
import org.vadere.meshing.mesh.inter.IMesh;