📄 mytimertask.java
字号:
/*
*
* Filename: MyTimerTask.java
* - contains definition of the class MyTimerTask. It is a TimerTask with run method used to invoke method in
* Main object ImageAlbum for changing image showing on screen after the time interval chosen by user has
* been elapsed.
*
*
* Application Name: Image Album Demo
* Version: 2.0
* Release Date: 27th September, 2002
* Author: Edmund Wong, Application Engineer, Metrowerks Hong Kong
*
*
* (c) Copyright. 2002. Metrowerks Corp. ALL RIGHTS RESERVED.
* This code is provided "AS IS" without warranty of any kind and subject to Metrowerks Sample Application
* End User License Agreement. NO EXTERNAL DISTRIBUTION OR COMMERCIALIZATION OF THE SOFTWARE IS PERMITTED
* EXCEPT BY WRITTEN AGREEMENT OF METROWERKS."
*/
import java.util.*;
/**
* Create MyTimerTask class for implementing the task (change image) to be run by the timer during slide show
*/
public class MyTimerTask extends TimerTask {
public PhotoCanvas photoCanvas; // reference for main object ImageAlbum
public ImageAlbum imageAlbumReference; // reference for main object ImageAlbum
/**
* Constructor of MyTimerTask
*/
MyTimerTask(PhotoCanvas photoCanvas, ImageAlbum imageAlbumReference){
this.photoCanvas = photoCanvas;
this.imageAlbumReference = imageAlbumReference;
}
/**
* Run method of MyTimerTask - action: show next image on screen
*/
public void run() {
imageAlbumReference.changeNextPhoto(photoCanvas);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -