📄 configuration.java
字号:
this.simMeasure = value;
}
public void sethomogenous(boolean value) {
this.homogenous = value;
}
public void setchoice(int choice) {
this.choice = choice;
}
public void setiterations(int its) {
this.iterations = its;
}
public void setndocs(int value) {
this.ndocs = value;
}
public void setnkeys(int value) {
this.nkeys = value;
}
public void setalpha(double value) {
this.alpha = value;
}
public void setnants(int value) {
this.nants = value;
}
public void setdistscale(double distscale) {
this.distscale = distscale;
}
public void setkd(double value) {
this.kd = value;
}
public void setkp(double value) {
this.kp = value;
}
public void setBlocked(boolean value) {
this.blocked = value;
}
/********** simple access functions ********************************************************************/
// value based
public String getbrowser() {
return this.browser;
}
public int getLowerCutoff() {
return this.lowercutoff;
}
public int getUpperCutoff() {
return this.uppercutoff;
}
public int getDimension() {
return this.dim;
}
public boolean getUseDefaults() {
return this.usedefaults;
}
public boolean getBlocked() {
return this.blocked;
}
public int getMethod() {
return this.method;
}
public double getalphastart() {
return this.alpha_start;
}
public double getalphaend() {
return this.alpha_end;
}
public double getalphainterval() {
return this.alpha_interval;
}
public double getkdstart() {
return this.kd_start;
}
public double getkdend() {
return this.kd_end;
}
public double getkdinterval() {
return this.kd_interval;
}
public double getkpstart() {
return this.kp_start;
}
public double getkpend() {
return this.kp_end;
}
public double getkpinterval() {
return this.kp_interval;
}
public boolean getTest() {
return this.test;
}
public boolean getTestData() {
return this.testData;
}
public boolean getadaptalpha() {
//if (method == 2) return false;
return this.adaptAlpha;
}
public boolean getadaptk() {
return this.adaptK;
}
public int getSimMeasure() {
return this.simMeasure;
}
public int getTextMode() {
return this.textMode;
}
public int getxsize() {
return this.xsize;
}
public int getysize() {
return this.ysize;
}
public int getiterations() {
return this.iterations;
}
public int getruns() {
return this.runs;
}
public int getndocs() {
return this.ndocs;
}
public int getnants() {
return this.nants;
}
public int getnkeys() {
return this.nkeys;
}
public double getkd() {
return this.kd;
}
public double getkp() {
return this.kp;
}
public int getsigma() {
return this.sigma;
}
public int getspeed() {
return this.speed;
}
public double getalpha() {
//if (method == 2) return 1.0;
return this.alpha;
}
public int getmemsize() {
return this.memsize;
}
public boolean gethomogenous() {
return this.homogenous;
}
public double getdistscale() {
return this.distscale * this.alpha;
}
public int getchoice() {
return this.choice;
}
// String based
public String getsLowerCutoff() {
return (new Integer(this.lowercutoff)).toString();
}
public String getsUpperCutoff() {
return (new Integer(this.uppercutoff)).toString();
}
public String getsDimension() {
return (new Integer(this.dim)).toString();
}
public String getsUseDefaults() {
return (new Boolean(this.usedefaults)).toString();
}
public String getsalphastart() {
return (new Double(this.alpha_start)).toString();
}
public String getsalphaend() {
return (new Double(this.alpha_end)).toString();
}
public String getsalphainterval() {
return (new Double(this.alpha_interval)).toString();
}
public String getskpstart() {
return (new Double(this.kp_start)).toString();
}
public String getskpend() {
return (new Double(this.kp_end)).toString();
}
public String getskpinterval() {
return (new Double(this.kp_interval)).toString();
}
public String getskdstart() {
return (new Double(this.kd_start)).toString();
}
public String getskdend() {
return (new Double(this.kd_end)).toString();
}
public String getskdinterval() {
return (new Double(this.kd_interval)).toString();
}
public String getsxsize() {
return (new Integer(this.xsize)).toString();
}
public String getsysize() {
return (new Integer(this.ysize)).toString();
}
public String getsruns() {
return (new Integer(this.runs)).toString();
}
public String getsndocs() {
return (new Integer(this.ndocs)).toString();
}
public String getsnants() {
return (new Integer(this.nants)).toString();
}
public String getsnkeys() {
return (new Integer(this.nkeys)).toString();
}
public String getskd() {
return (new Double(this.kd)).toString();
}
public String getskp() {
return (new Double(this.kp)).toString();
}
public String getssigma() {
return (new Integer(this.sigma)).toString();
}
public String getsalpha() {
return (new Double(this.alpha)).toString();
}
public String getsmemsize() {
return (new Integer(this.memsize)).toString();
}
public String getsspeed() {
return (new Integer(this.speed)).toString();
}
/********** Miscellaneous ********************************************************************/
// bring up an interface to save current configuration (plus resulting map as gif)
public void write(String filename) throws IOException {
JDialog dialog = new JDialog();
dialog.setTitle("Description");
dialog.setSize(300, 300);
dialog.getContentPane().setLayout(new BorderLayout());
JLabel label = new JLabel("Please enter file description");
dialog.getContentPane().add(label, BorderLayout.NORTH);
JTextArea description = new JTextArea();
description.setFont(new Font("Serif", Font.ITALIC, 16));
description.setLineWrap(true);
description.setWrapStyleWord(true);
JScrollPane areaScrollPane = new JScrollPane(description);
areaScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
areaScrollPane.setPreferredSize(new Dimension(250, 250));
dialog.getContentPane().add(areaScrollPane, BorderLayout.CENTER);
JButton button = new JButton("OK");
// an new SaveConf Object handles the storage process
button.addActionListener(new SaveConf(dialog, description, this, filename));
Panel buttonbox = new Panel();
buttonbox.setLayout(new BorderLayout());
buttonbox.add(button, BorderLayout.EAST);
dialog.getContentPane().add(buttonbox, BorderLayout.SOUTH);
dialog.show();
}
public void save() {
try {
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("System.conf"));
out.writeObject(this);
out.flush();
out.close();
} catch (Exception e) {
}
}
public Configuration read() {
Configuration newconf = null;
ObjectInputStream in;
try {
in = new ObjectInputStream(new FileInputStream("System.conf"));
} catch (Exception e) {
return null;
}
try {
newconf = (Configuration)in.readObject();
in.close();
} catch (Exception e) {
}
return newconf;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -