• 大小: 123KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: 其他
  • 标签: 软件构造  

资源简介

这是哈工大软件构造实验三、四的实验源码,曾经在这课上面也还是花了不少功夫。包括基本所有的加分项目和异常处理

资源截图

代码片段和文件信息

package application;

import java.awt.EventQueue;
import java.awt.FileDialog;
import java.awt.FlowLayout;
import java.awt.GridLayout;

import javax.swing.Jframe;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JDialog;

import static helper.GraphMetrics.*;
import static helper.ParseCommandHelper.*;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JTextField;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;

import edge.Edge;
import edge.SameMovieHyperEdge;
import edge.SocialNetworkEdge;
import edge.WordEdge;
import edu.uci.ics.jung.algorithms.layout.CircleLayout;
import edu.uci.ics.jung.algorithms.layout.Layout;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.ObservableGraph;
import edu.uci.ics.jung.visualization.BasicVisualizationServer;
import edu.uci.ics.jung.visualization.decorators.ToStringLabeller;
import factory.GraphFactory;
import factory.GraphPoetFactory;
import vertex.Vertex;
import vertex.Word;

import java.awt.Panel;

import com.jgoodies.forms.layout.FormSpecs;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import java.awt.event.ActionListener;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.awt.event.ActionEvent;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;

public class Applicationframework> {

    private Jframe frame;
    private JTextField command;
    private JTextField graph_degree;
    private JTextField radius;
    private JTextField diameter;
    private JTextField vertex_label;
    private JTextField edge_label;
    private JTextField vertices;
    private JTextField edges;
    JTextArea console;

    private GraphFactory factory;
    protected graph.Graph graph;
    private final ByteArrayOutputStream mem;
    /**
     * Launch the application.
     */
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                Applicationframework window = new Applicationframework<>(new GraphPoetFactory());
                window.visualize();
            }
        });
    }

    protected Applicationframework(GraphFactory factory) {
        this.factory = factory;
        mem = new ByteArrayOutputStream();
        System.setOut(new PrintStream(mem));
        initialize();
    }

    /**
     * Initialize the contents of the frame.
     */
    private void initialize() {
        frame = new Jframe();
        frame.setBackground(new Color(240 240 240));
        frame.setBounds(100 100 488 528);
        frame.setResizab

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-04-11 20:49  src\
     文件        6148  2019-04-11 20:50  src\.DS_Store
     目录           0  2019-04-11 20:50  __MACOSX\
     目录           0  2019-04-11 20:50  __MACOSX\src\
     文件         120  2019-04-11 20:50  __MACOSX\src\._.DS_Store
     目录           0  2018-05-13 11:04  src\graph\
     文件        6307  2018-05-20 12:00  src\graph\GraphPoet.java
     目录           0  2019-04-11 20:50  __MACOSX\src\graph\
     文件         218  2018-05-20 12:00  __MACOSX\src\graph\._GraphPoet.java
     文件       15242  2018-05-20 15:18  src\graph\MovieGraph.java
     文件         218  2018-05-20 15:18  __MACOSX\src\graph\._MovieGraph.java
     文件        6501  2018-05-13 18:19  src\graph\Graph.java
     文件         218  2018-05-13 18:19  __MACOSX\src\graph\._Graph.java
     文件        7954  2018-05-19 21:51  src\graph\ConcreteGraph.java
     文件         218  2018-05-19 21:51  __MACOSX\src\graph\._ConcreteGraph.java
     文件        8329  2018-05-20 16:47  src\graph\NetworkTopology.java
     文件         218  2018-05-20 16:47  __MACOSX\src\graph\._NetworkTopology.java
     文件       16020  2018-05-20 16:16  src\graph\SocialNetwork.java
     文件         218  2018-05-20 16:16  __MACOSX\src\graph\._SocialNetwork.java
     目录           0  2018-05-17 00:14  src\edge\
     文件        1313  2018-05-13 15:13  src\edge\FriendConnection.java
     目录           0  2019-04-11 20:50  __MACOSX\src\edge\
     文件         218  2018-05-13 15:13  __MACOSX\src\edge\._FriendConnection.java
     文件         699  2018-05-13 15:05  src\edge\CommentConnection.java
     文件         218  2018-05-13 15:05  __MACOSX\src\edge\._CommentConnection.java
     文件        2484  2018-05-13 11:04  src\edge\UndirectedEdge.java
     文件         218  2018-05-13 11:04  __MACOSX\src\edge\._UndirectedEdge.java
     文件        5518  2018-05-20 14:57  src\edge\NetworkConnection.java
     文件         218  2018-05-20 14:57  __MACOSX\src\edge\._NetworkConnection.java
     文件        2510  2018-05-17 00:11  src\edge\MovieSameActorEdge.java
     文件         218  2018-05-17 00:11  __MACOSX\src\edge\._MovieSameActorEdge.java
............此处省略160个文件信息

评论

共有 条评论

相关资源