2024-07-02 19:13:30 +00:00
|
|
|
package OurApplication;
|
|
|
|
|
2024-07-03 17:41:46 +00:00
|
|
|
import graph.*;
|
2024-07-02 19:13:30 +00:00
|
|
|
import logging.LogElementList;
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
|
|
|
/**
|
2024-07-08 22:17:31 +00:00
|
|
|
* Entry point for the OurApplication, demonstrating logging and visualization integration.
|
|
|
|
* This application sets up a graphical interface using Swing components to visualize graphs
|
|
|
|
* and log algorithmic operations.
|
|
|
|
*
|
|
|
|
* @see OurAlgorithm Provides the algorithmic logic for processing graphs.
|
|
|
|
* @see OurDrawArea Displays and interacts with the graph visualization.
|
|
|
|
* @see OurHybridWindow Combines visual components and algorithmic operations.
|
|
|
|
* @see OurLogElement Represents individual logging elements.
|
|
|
|
* @see OurParameterArea Manages parameters for graph operations.
|
|
|
|
* @see OurTextArea Displays log messages and algorithm progress.
|
|
|
|
* @see OurLegendArea Provides legend information for the graphical interface.
|
|
|
|
* @see JPanel Swing panel used in the graphical interface.
|
2024-07-02 19:13:30 +00:00
|
|
|
*/
|
|
|
|
public class OurApplication {
|
|
|
|
|
|
|
|
/**
|
2024-07-08 22:17:31 +00:00
|
|
|
* Default constructor for OurApplication.
|
|
|
|
* Initializes the application components and starts the graphical interface.
|
2024-07-02 19:13:30 +00:00
|
|
|
*/
|
|
|
|
public OurApplication() {
|
|
|
|
super();
|
|
|
|
}
|
2024-07-08 22:17:31 +00:00
|
|
|
|
2024-07-02 19:13:30 +00:00
|
|
|
/**
|
2024-07-08 22:17:31 +00:00
|
|
|
* Main method to launch the OurApplication.
|
|
|
|
* Initializes necessary components, creates a graphical window, and starts the application.
|
|
|
|
*
|
|
|
|
* @param args command-line arguments (not used)
|
2024-07-02 19:13:30 +00:00
|
|
|
*/
|
2024-07-08 22:17:31 +00:00
|
|
|
public static void main(String[] args){
|
2024-07-02 19:13:30 +00:00
|
|
|
|
2024-07-08 22:17:31 +00:00
|
|
|
// Create a directed graph instance
|
2024-07-05 15:06:51 +00:00
|
|
|
DirectedGraph<VertexMarking, EdgeMarking> myGraph = new DirectedGraph<>();
|
|
|
|
System.out.println(myGraph.toString());
|
|
|
|
|
2024-07-08 22:17:31 +00:00
|
|
|
// Initialize logging elements
|
2024-07-07 21:39:17 +00:00
|
|
|
LogElementList<OurLogElement> logList = new LogElementList<>();
|
2024-07-08 22:17:31 +00:00
|
|
|
|
|
|
|
// Create UI components
|
2024-07-02 22:46:21 +00:00
|
|
|
OurParameterArea parameterArea = new OurParameterArea();
|
2024-07-07 17:49:31 +00:00
|
|
|
OurMethodButtons methodButtons = new OurMethodButtons();
|
2024-07-08 22:17:31 +00:00
|
|
|
OurDrawArea drawArea = new OurDrawArea(logList, "GraphVisualization");
|
2024-07-07 14:27:22 +00:00
|
|
|
OurTextArea textArea = new OurTextArea(logList);
|
2024-07-07 17:49:31 +00:00
|
|
|
OurAlgorithm algorithm = new OurAlgorithm(parameterArea, methodButtons);
|
2024-07-02 22:46:21 +00:00
|
|
|
OurLegendArea legendArea = new OurLegendArea();
|
2024-07-07 14:29:45 +00:00
|
|
|
|
2024-07-08 22:17:31 +00:00
|
|
|
// Create a HybridWindow instance combining all UI components
|
|
|
|
OurHybridWindow<OurDrawArea, OurTextArea, OurParameterArea, OurAlgorithm, OurLogElement, OurLegendArea, OurMethodButtons> applet =
|
|
|
|
new OurHybridWindow<>(drawArea, textArea, parameterArea, algorithm, logList, legendArea, methodButtons);
|
|
|
|
|
|
|
|
// Create and configure the main JFrame
|
2024-07-02 22:46:21 +00:00
|
|
|
JFrame frame = new JFrame("Visualise");
|
2024-07-02 19:13:30 +00:00
|
|
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
frame.getContentPane().add(applet);
|
|
|
|
frame.pack();
|
|
|
|
applet.init();
|
|
|
|
applet.start();
|
2024-07-08 22:17:31 +00:00
|
|
|
frame.setSize(1350, 800);
|
2024-07-02 19:13:30 +00:00
|
|
|
frame.setVisible(true);
|
|
|
|
}
|
|
|
|
}
|