Examples Visualisation, TextArea functionality
This commit is contained in:
parent
6060796ddd
commit
f00057ee6e
@ -40,6 +40,9 @@ public class OurAlgorithm extends Algorithm {
|
||||
* @return a LogElementList containing the algorithm processing single steps
|
||||
*/
|
||||
public LogElementList<OurLogElement> run() {
|
||||
OurParameterArea currentParameterArea = (OurParameterArea) this.getParameterArea();
|
||||
this.setCurrentGraph(currentParameterArea.getSelectedGraph());
|
||||
|
||||
|
||||
Random random = new Random();
|
||||
|
||||
|
@ -5,7 +5,6 @@ import logging.LogElementList;
|
||||
import visualisation.HybridWindow;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
@ -51,17 +50,16 @@ public class OurApplication {
|
||||
|
||||
|
||||
|
||||
|
||||
LogElementList<OurLogElement> logList=new LogElementList<OurLogElement>();
|
||||
OurParameterArea parameterArea = new OurParameterArea();
|
||||
OurDrawArea drawArea = new OurDrawArea(myGraph.getLogList(),"GraphVisualization");
|
||||
OurTextArea textArea = new OurTextArea(myGraph.getLogList());
|
||||
OurDrawArea drawArea = new OurDrawArea(logList,"GraphVisualization");
|
||||
OurTextArea textArea = new OurTextArea(logList);
|
||||
OurAlgorithm algorithm = new OurAlgorithm(parameterArea);
|
||||
OurLegendArea legendArea = new OurLegendArea();
|
||||
HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea> applet = new HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea>(drawArea, textArea, parameterArea, algorithm, myGraph.getLogList(), legendArea);
|
||||
HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea> applet = new HybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea>(drawArea, textArea, parameterArea, algorithm, logList, legendArea);
|
||||
|
||||
|
||||
drawArea.setCurrentGraph(myGraph.getScreenGraph());
|
||||
algorithm.setCurrentGraph(myGraph);
|
||||
|
||||
|
||||
JFrame frame = new JFrame("Visualise");
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
@ -49,6 +49,7 @@ public class OurDrawArea extends DrawArea{
|
||||
public void draw(Graphics g) {
|
||||
|
||||
OurLogElement logElement = (OurLogElement) logList.get();
|
||||
this.setCurrentGraph(((OurLogElement) logList.get()).getGraph());
|
||||
logElement.getGraph().draw(g);
|
||||
for(Edge screenEdge : currentGraph.getEdges()){
|
||||
g.drawString(screenEdge.getMarking(), (screenEdge.getSource().getXpos() + screenEdge.getDestination().getXpos())/2, (screenEdge.getSource().getYpos() + screenEdge.getDestination().getYpos())/2);
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user