📄 tab4_2.html
字号:
<html>
<body>
<font face="Verdana" size="3">Two attributes of <font color="#0000FF">
FadeComponent</font>, (boolean animating) and (Thread animator) are made
accessible to subclasses, such that subclasses can use them to implement "Puase/Resume/Stop
animation" methods. <font color="#0000FF">FadeComponent</font> itself doesn't
provide these methods because deprecated API, i.e. <font color="#0000FF">
Thread.suspend()</font>, <font color="#0000FF">Thread.resume()</font>, and
<font color="#0000FF">Thread.stop()</font> will be used to implement them.</font><p>
<font face="Verdana" size="3">This demo case shows a subclassing implementation of such
methods. Again, in this case, the <font color="#0000FF">SSPRFadeComponent</font>
object is used as a container.</font></p>
<hr>
<pre><font face="Courier New" size="3">import hysun.util.FadeComponent;
public class SSPRFadeComponent extends FadeComponent {
public SSPRFadeComponent() {
super();
}
public SSPRFadeComponent(String pattern, int loops, int steps, int precision) {
super(pattern, loops, steps, precision);
}
public void pauseAnimation() {
if (!this.isAnimating())
return;
this.animator.suspend();
}
public void resumeAnimation() {
if (!this.isAnimating())
return;
this.animator.resume();
}
public void stopAnimation() {
if (!this.isAnimating())
return;
this.animator.stop();
this.animating = false;
}
}</font></pre>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -