dcel rdy for test
This commit is contained in:
parent
9b986b74f2
commit
6df2c38c14
11
pom.xml
11
pom.xml
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -28,5 +28,12 @@
|
|||
<artifactId>jfreechart</artifactId>
|
||||
<version>1.0.14</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/junit/junit -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -40,5 +40,4 @@ public class Arrangement {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -37,8 +37,10 @@ public class DoublyConnectedEdgeList {
|
|||
|
||||
edge.setOrigin(source);
|
||||
edge.setID(id);
|
||||
edge.setTwin(twin);
|
||||
twin.setOrigin(destination);
|
||||
twin.setID("#" + id);
|
||||
twin.setTwin(edge);
|
||||
|
||||
source.setIncidentEdge(edge);
|
||||
destination.setIncidentEdge(twin);
|
||||
|
@ -53,7 +55,7 @@ public class DoublyConnectedEdgeList {
|
|||
face.setID(id);
|
||||
Edge tempEdge;
|
||||
|
||||
if (!outerComponent.equals(null)){
|
||||
if (outerComponent != null) {
|
||||
tempEdge = outerComponent;
|
||||
do {
|
||||
tempEdge.setIncidentFace(face);
|
||||
|
@ -61,8 +63,9 @@ public class DoublyConnectedEdgeList {
|
|||
} while (!tempEdge.equals(outerComponent));
|
||||
}
|
||||
|
||||
if (!innerComponent.equals(null)){
|
||||
LinkedList<Edge> componentlist = face.getInnerComponents();
|
||||
if (innerComponent != null) {
|
||||
LinkedList<Edge> componentlist;
|
||||
componentlist = face.getInnerComponents();
|
||||
componentlist.add(innerComponent);
|
||||
tempEdge = innerComponent;
|
||||
do {
|
||||
|
@ -74,12 +77,32 @@ public class DoublyConnectedEdgeList {
|
|||
return null;
|
||||
}
|
||||
|
||||
public void createConnection(Edge edge, Edge pred){
|
||||
edge.setPrev(pred);
|
||||
pred.setNext(edge);
|
||||
public void createConnection(Edge edge, Edge succ) {
|
||||
edge.setNext(succ);
|
||||
succ.setPrev(edge);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public LinkedList<Node> getNodes() {
|
||||
return nodes;
|
||||
}
|
||||
|
||||
public void setNodes(LinkedList<Node> nodes) {
|
||||
this.nodes = nodes;
|
||||
}
|
||||
|
||||
public LinkedList<Edge> getEdges() {
|
||||
return edges;
|
||||
}
|
||||
|
||||
public void setEdges(LinkedList<Edge> edges) {
|
||||
this.edges = edges;
|
||||
}
|
||||
|
||||
public LinkedList<Face> getFaces() {
|
||||
return faces;
|
||||
}
|
||||
|
||||
public void setFaces(LinkedList<Face> faces) {
|
||||
this.faces = faces;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package Model;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
|
||||
/**
|
||||
|
@ -18,6 +17,7 @@ public class Face {
|
|||
|
||||
public Face() {
|
||||
new Face(null, null);
|
||||
this.innerComponents = new LinkedList<>();
|
||||
}
|
||||
|
||||
public Face(Edge outerComponent, LinkedList<Edge> innerComponents) {
|
||||
|
|
|
@ -2,7 +2,7 @@ package Presenter;
|
|||
|
||||
import Model.Arrangement;
|
||||
import Model.Coordinates;
|
||||
import View.*;
|
||||
import View.MainFrame;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
|
@ -117,6 +117,7 @@ public class Presenter {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/***************************************************************************************************************************
|
||||
* Getter und Setter Methoden
|
||||
***************************************************************************************************************************/
|
||||
|
|
|
@ -4,16 +4,15 @@ import Model.Coordinates;
|
|||
import org.jfree.chart.ChartFactory;
|
||||
import org.jfree.chart.ChartPanel;
|
||||
import org.jfree.chart.JFreeChart;
|
||||
import org.jfree.chart.axis.ValueAxis;
|
||||
import org.jfree.chart.plot.PlotOrientation;
|
||||
import org.jfree.chart.plot.XYPlot;
|
||||
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
|
||||
import org.jfree.chart.axis.ValueAxis;
|
||||
import org.jfree.data.xy.XYSeries;
|
||||
import org.jfree.data.xy.XYSeriesCollection;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.Dimension;
|
||||
import java.util.LinkedList;
|
||||
|
||||
/**
|
||||
|
@ -93,6 +92,4 @@ public class ArrangementDialog extends JPanel {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package View;
|
||||
|
||||
import org.jfree.ui.action.ActionMenuItem;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package Model;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Implementierung verschiedener Algorithmen zur Berechnung von Ausgleichsgeraden.
|
||||
*
|
||||
* @Author: Armin Wolf
|
||||
* @Email: a_wolf28@uni-muenster.de
|
||||
* @Date: 30.05.2017.
|
||||
*/
|
||||
public class DoublyConnectedEdgeListTest {
|
||||
|
||||
private static DoublyConnectedEdgeList dcel;
|
||||
private static Node v1, v2, v3 ,v4, v5;
|
||||
private static Edge e1, e2, e3, e4, e5, e6;
|
||||
private static Face f1, f2, f3;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
dcel = new DoublyConnectedEdgeList();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testCases(){
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue