📄 operationalizationbox.java
字号:
package toocom.ui;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.awt.*;
import toocom.ocgl.*;
/**
* This class represents the labeled box used in the form dedicated to the operationalization
* of axioms.
*
* @author Fr閐閞ic F黵st
*/
public class OperationalizationBox extends Box{
private Axiom a;
private JComboBox box;
/** Creates a combobox for the given axiom and with the given context of use selected. If
* cou is null, the inferential and explicite context of use is selected. */
public OperationalizationBox(Language l, Axiom a, ContextOfUse cou){
super(BoxLayout.X_AXIS);
this.add(new JLabel(a.getTerm(l)));
this.box = new JComboBox();
for(Iterator i = ContextOfUse.getAllAvailableContexts().iterator();i.hasNext();){
box.addItem(((ContextOfUse) i.next()).getTerm(l));
}
this.box.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
setContextOfUse();
}
});
this.add(box);
this.a = a;
if(cou != null){
if(cou.isInferential()){
if(cou.isExplicit()) this.box.setSelectedIndex(0);
else this.box.setSelectedIndex(1);
}
else{
if(cou.isExplicit()) this.box.setSelectedIndex(2);
else this.box.setSelectedIndex(3);
}
}
}
public void setContextOfUse(){
if(this.box.getSelectedIndex() == 0) this.a.setContextOfUse(new ContextOfUse(true,true));
if(this.box.getSelectedIndex() == 1) this.a.setContextOfUse(new ContextOfUse(true,false));
if(this.box.getSelectedIndex() == 2) this.a.setContextOfUse(new ContextOfUse(false,true));
if(this.box.getSelectedIndex() == 3) this.a.setContextOfUse(new ContextOfUse(false,false));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -