📄 filter.java
字号:
import javax.swing.*;
import javax.swing.text.*;
abstract public class Filter implements Runnable
{
protected Pipe input_;
protected Pipe output_;
// private JTextArea resultDisp;
/*Thread control flag. */
private boolean is_started_ = false;
public Filter(Pipe input, Pipe output)
{
input_ = input;
output_ = output;
//resultDisp=resultPanel;
}
public void start() //开始一个线程
{
if(!is_started_)
{
is_started_ = true;
Thread thread = new Thread(this);
thread.start();
}
}
public void stop()
{
is_started_ = false;
}
public void run() //当一个线程开始时,这个方法自动运行
{
transform();
}
//它的子类将实现它,此方法的目的是将 "input" 中的数据经过“变换”写到"output 中
abstract protected void transform();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -