Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- public class ModelFunctions {
- private String fullName;
- private String shortName;
- ModelFunctions(String fullName,String shortName){
- this.fullName=fullName;
- this.shortName=shortName;
- }
- ModelFunctions(){
- }
- public String getFullName() {
- return fullName;
- }
- public String getShortName() {
- return shortName;
- }
- public void setFullName(String fullName) {
- this.fullName = fullName;
- }
- DefaultListModel<ModelFunctions> listModel=new DefaultListModel<ModelFunctions>();
- DefaultListModel<ModelFunctions> returnList(){
- listModel.addElement(new ModelFunctions("sin()","sinus"));
- listModel.addElement(new ModelFunctions("cos()","cosinus"));
- listModel.addElement(new ModelFunctions("tg()","tangens"));
- listModel.addElement(new ModelFunctions("ctg()","cotangens"));
- listModel.addElement(new ModelFunctions("ln()","natural logarithm"));
- listModel.addElement(new ModelFunctions("*pi","multiplication by pi"));
- listModel.addElement(new ModelFunctions("*e","multiplication by e"));
- listModel.addElement(new ModelFunctions("*[L]","multiplication by const Levy"));
- listModel.addElement(new ModelFunctions("+","addition"));
- listModel.addElement(new ModelFunctions("-","subtraction"));
- listModel.addElement(new ModelFunctions("*","multiplication"));
- listModel.addElement(new ModelFunctions("","Last result"));
- return listModel;
- }
- public void lastResult(String result){
- listModel.get(11).setFullName(result);
- }
- @Override
- public String toString(){
- return shortName;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement