⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mosmain.java

📁 本程序是在软件模拟的计算机系统上设计一个多道程序的操作系统MOS
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
	    this.var_comm_label.setForeground(Color.RED);
	    this.var_next_label = new JLabel("0");
	    var.var_next_label = this.var_next_label;
	    this.var_next_label.setFont(f2);
	    this.var_next_label.setForeground(Color.RED);
	    this.v1_cputat_box = Box.createVerticalBox();
	    this.v1_cputat_box.add(this.ptr_label);
	    this.v1_cputat_box.add(Box.createVerticalStrut(5));
	    this.v1_cputat_box.add(this.r_label);
	    this.v1_cputat_box.add(Box.createVerticalStrut(5));
	    this.v1_cputat_box.add(this.comm_label);
	    this.v1_cputat_box.add(Box.createVerticalStrut(5));
	    this.v3_cputat_box = Box.createVerticalBox();
	    this.v3_cputat_box.add(this.var_ptr_label);
	    this.v3_cputat_box.add(Box.createVerticalStrut(5));
	    this.v3_cputat_box.add(this.var_r_label);
	    this.v3_cputat_box.add(Box.createVerticalStrut(5));
	    this.v3_cputat_box.add(this.var_comm_label);
	    this.v3_cputat_box.add(Box.createVerticalStrut(5));
	    this.v2_cputat_box = Box.createVerticalBox();
	    this.v2_cputat_box.add(this.pc_label);
	    this.v2_cputat_box.add(Box.createVerticalStrut(5));
	    this.v2_cputat_box.add(this.c_label);
	    this.v2_cputat_box.add(Box.createVerticalStrut(5));
	    this.v2_cputat_box.add(this.next_label);
	    this.v2_cputat_box.add(Box.createVerticalStrut(5));
	    this.v4_cputat_box = Box.createVerticalBox();
	    this.v4_cputat_box.add(this.var_pc_label);
	    this.v4_cputat_box.add(Box.createVerticalStrut(5));
	    this.v4_cputat_box.add(this.var_c_label);
	    this.v4_cputat_box.add(Box.createVerticalStrut(5));
	    this.v4_cputat_box.add(this.var_next_label);
	    this.v4_cputat_box.add(Box.createVerticalStrut(5));
	    this.h_cputat_box = Box.createHorizontalBox();
	    this.h_cputat_box.setBorder(BorderFactory.createTitledBorder(edge2,
	    		"",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,f3));
	    this.h_cputat_box.add(Box.createHorizontalStrut(10));
	    this.h_cputat_box.add(this.v1_cputat_box);
	    this.h_cputat_box.add(this.v3_cputat_box);
	    this.h_cputat_box.add(Box.createHorizontalStrut(10));
	    this.h_cputat_box.add(this.v2_cputat_box);
	    this.h_cputat_box.add(this.v4_cputat_box);
	    this.h_cputat_box.add(Box.createHorizontalStrut(10));

	    this.cpu_stat_label = new JLabel("cpu state");
	    this.cpu_stat_label.setForeground(Color.BLUE);
	    this.cpu_stat_label.setBackground(Color.GRAY);
	    this.cpu_stat_label.setFont(f);
	    this.cpu_stat_box = Box.createVerticalBox();
	    this.cpu_stat_box.setBackground(new Color(0,255,255));
	    this.cpu_stat_box.setBorder(BorderFactory.createTitledBorder(edge2,
	    		"寄存器信息",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,f3));
//	    this.cpu_stat_box.add(this.cpu_stat_label);
//	    this.cpu_stat_box.add(Box.createVerticalStrut(5));
	    this.cpu_stat_box.add(this.h_cputat_box);
//	    this.cpu_stat_box.add(Box.createVerticalStrut(25));

//	    sys box;
	    this.time_label = new JLabel("Time :");
	    this.time_label.setFont(f);
	    this.time_label.setForeground(Color.BLUE);
	    this.rtime_label = new JLabel("RTime:");
	    this.rtime_label.setFont(f);
	    this.rtime_label.setForeground(Color.BLUE);
	    this.pi_label = new JLabel("   PI    :");
	    this.pi_label.setFont(f);
	    this.pi_label.setForeground(Color.BLUE);
	    this.ioi_label = new JLabel("   IOI   :");
	    this.ioi_label.setFont(f);
	    this.ioi_label.setForeground(Color.BLUE);
	    this.si_label = new JLabel("   SI     :");
	    this.si_label.setFont(f);
	    this.si_label.setForeground(Color.BLUE);
	    this.ti_label = new JLabel("   TI     :");
	    this.ti_label.setFont(f);
	    this.ti_label.setForeground(Color.BLUE);
	    this.var_time_label = new JLabel("0");
	    var.var_time_label = this.var_time_label;
	    this.var_time_label.setFont(f);
	    this.var_time_label.setForeground(Color.RED);
	    this.var_rtime_label = new JLabel("0");
	    var.var_rtime_label = this.var_rtime_label;
	    this.var_rtime_label.setFont(f);
	    this.var_rtime_label.setForeground(Color.RED);
	    this.var_pi_label = new JLabel("0");
	    var.var_pi_label = this.var_pi_label;
	    this.var_pi_label.setFont(f);
	    this.var_pi_label.setForeground(Color.RED);
	    this.var_ioi_label = new JLabel("0 ");
	    var.var_ioi_label = this.var_ioi_label;
	    this.var_ioi_label.setFont(f);
	    this.var_ioi_label.setForeground(Color.RED);
	    this.var_si_label = new JLabel("0");
	    var.var_si_label = this.var_si_label;
	    this.var_si_label.setFont(f);
	    this.var_si_label.setForeground(Color.RED);
	    this.var_ti_label = new JLabel("0");
	    var.var_ti_label = this.var_ti_label;
	    this.var_ti_label.setFont(f);
	    this.var_ti_label.setForeground(Color.RED);
	    this.v1_systat_box = Box.createVerticalBox();
	    this.v1_systat_box.add(this.time_label);
	    this.v1_systat_box.add(Box.createVerticalStrut(5));
	    this.v1_systat_box.add(this.pi_label);
	    this.v1_systat_box.add(Box.createVerticalStrut(5));
	    this.v1_systat_box.add(this.ioi_label);
	    this.v1_systat_box.add(Box.createVerticalStrut(5));
	    this.v2_systat_box = Box.createVerticalBox();
	    this.v2_systat_box.add(this.rtime_label);
	    this.v2_systat_box.add(Box.createVerticalStrut(5));
	    this.v2_systat_box.add(this.si_label);
	    this.v2_systat_box.add(Box.createVerticalStrut(5));
	    this.v2_systat_box.add(this.ti_label);
	    this.v2_systat_box.add(Box.createVerticalStrut(5));
	    this.v3_systat_box = Box.createVerticalBox();
	    this.v3_systat_box.add(this.var_time_label);
	    this.v3_systat_box.add(Box.createVerticalStrut(5));
	    this.v3_systat_box.add(this.var_pi_label);
	    this.v3_systat_box.add(Box.createVerticalStrut(5));
	    this.v3_systat_box.add(this.var_ioi_label);
	    this.v3_systat_box.add(Box.createVerticalStrut(5));
	    this.v4_systat_box = Box.createVerticalBox();
	    this.v4_systat_box.add(this.var_rtime_label);
	    this.v4_systat_box.add(Box.createVerticalStrut(5));
	    this.v4_systat_box.add(this.var_si_label);
	    this.v4_systat_box.add(Box.createVerticalStrut(5));
	    this.v4_systat_box.add(this.var_ti_label);
	    this.v4_systat_box.add(Box.createVerticalStrut(5));
	    this.h_systat_box = Box.createHorizontalBox();
	    this.h_systat_box.setBorder(BorderFactory.createTitledBorder(edge2,
	    		"",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,f3));
	    this.h_systat_box.add(Box.createHorizontalStrut(20));
	    this.h_systat_box.add(this.v1_systat_box);
	    this.h_systat_box.add(this.v3_systat_box);
	    this.h_systat_box.add(Box.createHorizontalStrut(20));
	    this.h_systat_box.add(this.v2_systat_box);
	    this.h_systat_box.add(this.v4_systat_box);
	    this.h_systat_box.add(Box.createHorizontalStrut(20));

	    this.sys_label = new JLabel("system state");
	    this.sys_label.setForeground(Color.BLUE);
	    this.sys_label.setBackground(Color.GRAY);
	    this.sys_label.setFont(f);
	    this.sys_box = Box.createVerticalBox();
	    this.sys_box.setBackground(new Color(0,255,255));
	    this.sys_box.setBorder(BorderFactory.createTitledBorder(edge2,
	    		"系统信息",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,f3));
//	    this.sys_box.add(this.sys_label);
//	    this.sys_box.add(Box.createVerticalStrut(5));
	    this.sys_box.add(this.h_systat_box);
//	    this.sys_box.add(Box.createVerticalStrut(25));

	    this.show_prtsys_box = Box.createHorizontalBox();
	    this.show_prtsys_box.setBorder(BorderFactory.createTitledBorder(edge2,
	    		"",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,f3));
//	    this.show_prtsys_box.add(Box.createHorizontalStrut(15));
	    this.show_prtsys_box.add(this.cpu_stat_box);
	    this.show_prtsys_box.add(Box.createHorizontalStrut(10));
	    this.show_prtsys_box.add(this.sys_box);
	    this.show_prtsys_box.add(Box.createHorizontalStrut(15));

//	    creat mm_disk area;
	    this.mm_label = new JLabel("mm area");
	    this.mm_label.setFont(f);
	    this.mm_label.setForeground(Color.BLUE);
	    this.mm_var_label = new JLabel("addr      var");
	    this.mm_var_label.setFont(f2);
	    this.mm_var_label.setForeground(new Color(210,105,130));
	    this.mm_area = new JTextArea(10,10);
	    for(int i = 0; i < 10; i++) {
	    	s = "";
	    	mm_data = mm.mmRead(i * 4, FinalVar.MM_READ_WORD);
	    	for(int j = 0; j < 4; j++)
	    		s = s + mm_data[j];
	    	this.mm_area.append("   00" + i + "     "+s + "\n");
	    }
	    for(int i = 10; i < 100; i++) {
	    	s = "";
	    	mm_data = mm.mmRead(i * 4, FinalVar.MM_READ_WORD);
	    	for(int j = 0; j < 4; j++)
	    		s = s + mm_data[j];
	    	this.mm_area.append("   0" + i + "     "+s + "\n");
	    }
	    for(int i = 100; i < 300; i++) {
	    	s = "";
	    	mm_data = mm.mmRead(i * 4, FinalVar.MM_READ_WORD);
	    	for(int j = 0; j < 4; j++)
	    		s = s + mm_data[j];
	    	this.mm_area.append("   " + i + "     "+s + "\n");
	    }
	    var.mm_area = this.mm_area;
	    this.mm_area.setFont(f2);
	    this.mm_area.setEditable(false);
	    this.mm_area.setForeground(new Color(220,20,160));
	    this.mm_area.setBackground(Color.WHITE);
	    this.mm_box = Box.createVerticalBox();
	    this.mm_box.setBackground(new Color(220,105,130));
	    this.mm_box.setBorder(BorderFactory.createTitledBorder(edge1,
	    		"内存",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,f3));
//	    this.mm_box.add(this.mm_label);
	    this.mm_box.add(this.mm_var_label);
	    this.mm_scr_pane = new JScrollPane(this.mm_area);
	    this.mm_box.add(this.mm_scr_pane);
	    this.mm_box.add(Box.createVerticalStrut(10));

	    this.disk_label = new JLabel("disk area");
	    this.disk_label.setFont(f2);
	    this.disk_label.setForeground(Color.BLUE);
	    this.disk_area = new JTextArea(10,10);
	    var.disk_area = this.disk_area;
	    this.disk_area.setFont(f);
	    this.disk_area.setEditable(false);
	    for(int i = 0; i < 100; i++) {
	    	this.disk_data = this.disk.diskRead((byte)i);
	    	if(i < 1) {
	    		for(int j = 0; j < 10; j++) {
	    			s = "";
	    			int k ;
	    			for(k = 0; k < 4; k++)
	    				s = s + this.disk_data[j * 4 + k];
	    			this.disk_area.append("   000" + j + "     " + s + "\n");
	    		}
	    	}
	    	else if(i < 10) {
	    		for(int j = 0; j < 10; j++) {
	    			s = "";
	    			int k ;
	    			for(k = 0; k < 4; k++)
	    				s = s + this.disk_data[j * 4 + k];
	    			this.disk_area.append("   00" + (i * 10 + j) + "     " + s + "\n");
	    		}
	    	}
	    	else if(i < 100) {
	    		for(int j = 0; j < 10; j++) {
	    			s = "";
	    			int k ;
	    			for(k = 0; k < 4; k++)
	    				s = s + this.disk_data[j * 4 + k];
	    			this.disk_area.append("   0" + (i * 10 + j) + "     " + s + "\n");
	    		}
	    	}
	    }
	    this.disk_var_label = new JLabel("addr      value");
	    this.disk_var_label.setFont(f2);
	    this.disk_var_label.setForeground(new Color(220,105,130));
	    this.disk_area.setBackground(Color.WHITE);
	    this.disk_area.setForeground(new Color(220,20,160));
	    this.disk_box = Box.createVerticalBox();
	    this.disk_box.setBackground(new Color(220,105,130));
	    this.disk_box.setBorder(BorderFactory.createTitledBorder(edge1,
	    		"磁盘",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,f3));
//	    this.disk_box.add(this.disk_label);
	    this.disk_box.add(this.disk_var_label);
	    this.disk_scr_pane = new JScrollPane(this.disk_area);
	    this.disk_scr_pane.setForeground(new Color(220,105,130));
	    this.disk_box.add(this.disk_scr_pane);
	    this.disk_box.add(Box.createVerticalStrut(10));

	    this.show_mmdisk_box = Box.createHorizontalBox();
	    this.show_mmdisk_box.setBorder(BorderFactory.createTitledBorder(edge1,
	    		"",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,f3));
	    this.show_mmdisk_box.add(Box.createVerticalStrut(10));
	    this.show_mmdisk_box.add(this.mm_box);
	    this.show_mmdisk_box.add(Box.createVerticalStrut(10));
	    this.show_mmdisk_box.add(this.disk_box);
	    this.show_mmdisk_box.add(Box.createVerticalStrut(15));


//		 初始化进度条标签
	    jl_progress = new JLabel[3];
	    var.jl_progress = this.jl_progress;
		jl_progress[0] = new JLabel("None");
		this.jl_progress[0].setHorizontalAlignment(JLabel.CENTER);
	    this.jl_progress[0].setFont(this.f_job);
	    this.jl_progress[0].setForeground(Color.RED);
		this.jl_progress[0].setBorder(BorderFactory.createTitledBorder(edge1,
	    		"",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,f3));
		jl_progress[1] = new JLabel("None");
		this.jl_progress[1].setHorizontalAlignment(JLabel.CENTER);
		this.jl_progress[1].setFont(this.f_job);
	    this.jl_progress[1].setForeground(Color.RED);
		this.jl_progress[1].setBorder(BorderFactory.createTitledBorder(edge1,
	    		"",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,f3));
		jl_progress[2] = new JLabel("None");
		this.jl_progress[2].setHorizontalAlignment(JLabel.CENTER);
		this.jl_progress[2].setFont(this.f_job);
	    this.jl_progress[2].setForeground(Color.RED);
		this.jl_progress[2].setBorder(BorderFactory.createTitledBorder(edge1,
	    		"",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,f3));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -