memnoyau.java

来自「这是一个在linux环境下」· Java 代码 · 共 49 行

JAVA
49
字号
package fr.umlv.projet.fenetre.preformance;

import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JPanel;
/** 
 *  The Panel to display the "Memory of de Noyau" in the Panel  
 * {@link fr.umlv.projet.fenetre.preformance.Preformance Preformance}.
 * @author HUANG Wei & Ma Xiao Jun
 * 
 */
public class MemNoyau extends JPanel {
private String Total = " ";
private String Paginee = " ";
private String NPaginee = " ";
private static int w = 0;
private static int h = 0;

protected@Override void paintComponent(Graphics graphic){
	Graphics2D g = (Graphics2D)graphic; 
	super.paintComponent(g);
	w = this.getWidth();
	h = this.getHeight();
	g.drawString("Total",5,15);
	g.drawString(Total,w-5-Total.length()*7,15);
	
	g.drawString("Paginee",5,15+(h-25)/2);
	g.drawString(Paginee,w-5-Paginee.length()*7,15+(h-25)/2);
	
	g.drawString("non Paginee",5,h-10);
	g.drawString(NPaginee,w-5-NPaginee.length()*7,h-10);		
}

/**
 * to refresh the datas of the Panel "Memory of de Noyau".
 * @param Total 
 * @param Paginee
 * @param NPaginee
 */

public void refresh(String Total,String Paginee,String NPaginee){
	this.Total = Total;
	this.Paginee = Paginee;
	this.NPaginee = NPaginee;
	
}
}

⌨️ 快捷键说明

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