📄 jisuan.java
字号:
public Zuhemianban(String str)
{
super();
this.setBackground(Color.white);
this.setBorder(BorderFactory.createTitledBorder(null,str,0,0,new Font("宋体",Font.PLAIN,13)));
}
}
class Inputint extends TextField implements TextListener //输入整型文本框
{
public Inputint()
{
super(10);
this.addTextListener(this);
this.setText("0");
}
public int getint()
{
if(this.getText().length()==0)
return 0;
return Integer.parseInt(this.getText().trim());
}
public void textValueChanged(TextEvent e) //实现文本监听器,检测输入的合法性
{
String s=this.getText();
char[] c=s.toCharArray();
for(int i=0;i<c.length;i++)
{
if(!Character.isDigit(c[i]))
{
JOptionPane.showMessageDialog(null,"你输入的应该为整数!");
this.setText("0");
}
}
}
}
class Inputfloat extends TextField implements TextListener //输入浮点数文本框
{
public Inputfloat()
{
super(10);
this.addTextListener(this);
this.setText("0");
}
public float getfloat()
{
if(this.getText().length()==0)
return 0;
return Float.parseFloat(this.getText().trim());
}
public void textValueChanged(TextEvent e) //实现文本监听器,检测输入的合法性
{
String s=this.getText();
char[] c=s.toCharArray();
for(int i=0;i<c.length;i++)
{
if(!Character.isDigit(c[i]) && c[i]!='.')
{
JOptionPane.showMessageDialog(null,"你输入的应该为数字!");
this.setText("0");
}
}
}
}
class Qita extends Zuhemianban //其他得分情况面板
{
private Checkbox zeng=new Checkbox("加");
private Checkbox jian=new Checkbox("减");
private Inputfloat fenshu=new Inputfloat();
private TextArea beizhu=new TextArea(4,20);
public Qita()
{
super("其他得分情况");
Panel p=new Panel();
CheckboxGroup cp=new CheckboxGroup();
this.zeng.setCheckboxGroup(cp);
this.jian.setCheckboxGroup(cp);
this.zeng.setState(true);
p.setLayout(new GridLayout(4,1));
p.add(this.zeng);
p.add(this.jian);
p.add(this.fenshu);
p.add(new Label("请输入得分原因:"));
this.setLayout(new GridLayout(2,1));
this.add(p);
this.add(this.beizhu);
}
public float getscore()
{
float score=this.fenshu.getfloat();
if(this.zeng.getState())
return score;
else
return -score;
}
public String getbeizhu()
{
return this.beizhu.getText()+";";
}
}
class Zhengzhisuzhi extends Zuhemianban //政治素质类
{
private String beizhu="";
private Checkbox malie=new Checkbox("马列理论课学习成绩优+1");
private Checkbox rudangshenqing=new Checkbox("递交入党申请书+0.5");
private Checkbox rudangjijifenzi=new Checkbox("模范作用入党积极分子+1");
private Checkbox dangyuan=new Checkbox("模范作用的党员+1.5");
private Inputint quexicishu=new Inputint();
public Zhengzhisuzhi() //政治素质类的构造函数
{
super("政治素质(基本分18分)");
this.setLayout(new GridLayout(7,1));
this.add(this.malie);
this.add(this.rudangshenqing);
this.add(this.rudangjijifenzi);
this.add(this.dangyuan);
this.add(new Label("党章学习缺席次数:-0.5/次"));
this.add(this.quexicishu);
}
public float getscore()
{
beizhu="";
float score=18;
if(this.malie.getState())
{
score+=1;
beizhu+=this.malie.getLabel()+";";
}
if(this.rudangshenqing.getState())
{
score+=0.5;
beizhu+=this.rudangshenqing.getLabel()+";";
}
if(this.rudangjijifenzi.getState())
{
score+=1;
beizhu+=this.rudangjijifenzi.getLabel()+";";
}
if(this.dangyuan.getState())
{
score+=1.5;
beizhu+=this.dangyuan.getLabel()+";";
}
if(this.quexicishu.getint()!=0)
{
score-=this.quexicishu.getint()*0.5;
beizhu+="党章学习缺席"+this.quexicishu.getint()+"次;";
}
return score;
}
public String getbeizhu() //获取备注内容
{
return beizhu;
}
}
class Fajiguannian extends Zuhemianban //法纪观念小模块
{
private String yuanyin="";
private Checkbox jianyiyongwei=new Checkbox("见义勇为维护国家财产+5");
private Checkbox yiwuxianxue=new Checkbox("参加义务献血+2");
private Checkbox yuanpiping=new Checkbox("受院通报批评-3");
private Checkbox xipiping=new Checkbox("受系通报批评-2");
private Checkbox weifangongyu=new Checkbox("违反公寓管理条例-1");
public Fajiguannian() //构造函数
{
super("法纪观念(基本分18分)");
this.setLayout(new GridLayout(7,1));
this.add(this.jianyiyongwei);
this.add(this.yiwuxianxue);
this.add(this.yuanpiping);
this.add(this.xipiping);
this.add(this.weifangongyu);
}
public float getscore() //获取法纪观念得分情况
{
yuanyin="";
float score=18;
if(this.jianyiyongwei.getState())
{
score+=5;
yuanyin+=this.jianyiyongwei.getLabel()+";";
}
if(this.yiwuxianxue.getState())
{
score+=2;
yuanyin+=this.yiwuxianxue.getLabel()+";";
}
if(this.yuanpiping.getState())
{
score-=3;
yuanyin+=this.yuanpiping.getLabel()+";";
}
if(this.xipiping.getState())
{
score-=2;
yuanyin+=this.xipiping.getLabel()+";";
}
if(this.weifangongyu.getState())
{
score-=1;
yuanyin+=this.weifangongyu.getLabel()+";";
}
return score;
}
public String getbeizhu() //获取法纪观念得分情况的说明
{
return yuanyin;
}
}
class Xuexitaidu extends Zuhemianban //学习态度小模块
{
private String beizhu="";
private Checkbox youxiusushe=new Checkbox("系学风优秀宿舍成员+1 ");
private Checkbox youxiubanji=new Checkbox("系学风优秀班级成员+1");
private Inputint kuangke=new Inputint();
private Inputint chidao=new Inputint();
public Xuexitaidu() //构造函数
{
super("学习态度(基本分18分)");
this.setLayout(new GridLayout(7,1));
this.add(this.youxiusushe);
this.add(this.youxiubanji);
this.add(new Label("旷课节数:-0.5/节"));
this.add(this.kuangke);
this.add(new Label("迟到节数:-0.2/节"));
this.add(this.chidao);
}
public float getscore() //取得学习态度得分
{
beizhu="";
float score=18;
if(this.youxiusushe.getState())
{
score+=1;
beizhu+=this.youxiusushe.getLabel()+";";
}
if(this.youxiubanji.getState())
{
score+=1;
beizhu+=this.youxiubanji.getLabel()+";";
}
int i=this.kuangke.getint();
if(i!=0)
{
score-=i*0.5;
beizhu+="旷课" + i + "节;";
}
i=this.chidao.getint();
if(i!=0)
{
score-=i*0.2;
beizhu+="迟到" + i + "节;";
}
return score;
}
public String getbeizhu() //获取得分情况说明
{
return beizhu;
}
}
class Pindexiuyang extends Zuhemianban //品德修养小模块
{
private String beizhu="";
private Checkbox pohuaicaichan=new Checkbox("破坏公共财产-5");
private Checkbox weifanzhiqin=new Checkbox("违反值勤周规定-1");
private Checkbox weifanneiwu=new Checkbox("违反内务管理条例-1");
private Checkbox wenmingsushe=new Checkbox("院系文明宿舍成员+1");
private Choice sushechengyuan=new Choice();
public Pindexiuyang() //构造函数
{
super("品德修养(基本分18分)");
this.setLayout(new GridLayout(7,1));
this.sushechengyuan.add("请选择所在宿舍的星级 ");
this.sushechengyuan.add("五星级+2");
this.sushechengyuan.add("三星级+0");
this.sushechengyuan.add("一星级-2");
this.sushechengyuan.add("不列级宿舍-5");
this.add(this.pohuaicaichan);
this.add(this.weifanzhiqin);
this.add(this.weifanneiwu);
this.add(this.wenmingsushe);
this.add(this.sushechengyuan);
}
public float getscore() //获取品德修养的得分
{
beizhu="";
float score=18;
if(this.pohuaicaichan.getState())
{
score-=5;
beizhu+=this.pohuaicaichan.getLabel()+";";
}
if(this.weifanzhiqin.getState())
{
score-=1;
beizhu+=this.weifanzhiqin.getLabel()+";";
}
if(this.weifanneiwu.getState())
{
score-=1;
beizhu+=this.weifanneiwu.getLabel()+";";
}
if(this.wenmingsushe.getState())
{
score+=1;
beizhu+=this.wenmingsushe.getLabel()+";";
}
switch(sushechengyuan.getSelectedIndex())
{
case 1:score+=2;
beizhu=beizhu+"五星级宿舍成员+2;";
break;
case 3:score-=2;
beizhu+="一星级宿舍成员-2;";
break;
case 4:score-=5;
beizhu+="不列级宿舍成员-5;";
break;
}
return score;
}
public String getbeizhu() //获取得分说明
{
return beizhu;
}
}
class Laodongshijian extends Zuhemianban //劳动实践小模块
{
private Checkbox qiansan=new Checkbox("系劳动总评前三名+1 ");
private Inputint cishu=new Inputint();
private String beizhu="";
public Laodongshijian() //构造函数
{
super("劳动实践(基本分18分)");
this.setLayout(new GridLayout(7,1));
this.add(this.qiansan);
this.add(new Label("义务劳动次数:+0.5/次"));
this.add(this.cishu);
}
public float getscore() //获取劳动实践得分
{
beizhu="";
float score=18;
if(this.qiansan.getState())
{
score+=1;
beizhu+=this.qiansan.getLabel()+";";
}
int i=this.cishu.getint();
if(i!=0)
{
score+=i*0.5;
beizhu+="义务劳动" + i+ "次;";
}
return score;
}
public String getbeizhu() //获取劳动实践得分情况说明
{
return beizhu;
}
}
class Jiangchengfen extends Zuhemianban //政治思想素质奖惩得分小模块
{
private Choice xianjingeren=new Choice();
private Choice youxiu=new Choice();
private Choice chufa=new Choice();
private String beizhu="";
public Jiangchengfen() //构造函数
{
super("政治思想素质奖惩得分");
this.setLayout(new GridLayout(7,1));
this.xianjingeren.add("请选择先进个人的等级");
this.xianjingeren.add("省先进个人+5");
this.xianjingeren.add("市先进个人+3");
this.xianjingeren.add("院先进个人+2");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -