本文整理汇总了Java中org.microemu.app.ui.DisplayRepaintListener类的典型用法代码示例。如果您正苦于以下问题:Java DisplayRepaintListener类的具体用法?Java DisplayRepaintListener怎么用?Java DisplayRepaintListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DisplayRepaintListener类属于org.microemu.app.ui包,在下文中一共展示了DisplayRepaintListener类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hideNotify
import org.microemu.app.ui.DisplayRepaintListener; //导入依赖的package包/类
@Override
public void hideNotify()
{
((AndroidDeviceDisplay) activity.getEmulatorContext().getDeviceDisplay()).removeDisplayRepaintListener((DisplayRepaintListener) view);
super.hideNotify();
}
示例2: showNotify
import org.microemu.app.ui.DisplayRepaintListener; //导入依赖的package包/类
@Override
public void showNotify()
{
super.showNotify();
activity.post(new Runnable() {
public void run() {
((AndroidDeviceDisplay) activity.getEmulatorContext().getDeviceDisplay()).addDisplayRepaintListener((DisplayRepaintListener) view);
((Canvas) displayable).repaint();
}
});
}
示例3: paintDisplayable
import org.microemu.app.ui.DisplayRepaintListener; //导入依赖的package包/类
public void paintDisplayable(int x, int y, int width, int height) {
rectangle.left = x;
rectangle.top = y;
rectangle.right = x + width;
rectangle.bottom = y + height;
for (int i = 0; i < displayRepaintListeners.size(); i++) {
DisplayRepaintListener l = displayRepaintListeners.get(i);
if (l != null) {
l.repaintInvoked(rectangle);
}
}
}
示例4: addDisplayRepaintListener
import org.microemu.app.ui.DisplayRepaintListener; //导入依赖的package包/类
public void addDisplayRepaintListener(DisplayRepaintListener listener) {
displayRepaintListeners.add(listener);
}
示例5: removeDisplayRepaintListener
import org.microemu.app.ui.DisplayRepaintListener; //导入依赖的package包/类
public void removeDisplayRepaintListener(DisplayRepaintListener listener) {
displayRepaintListeners.remove(listener);
}
示例6: addDisplayRepaintListener
import org.microemu.app.ui.DisplayRepaintListener; //导入依赖的package包/类
public void addDisplayRepaintListener(DisplayRepaintListener l)
{
displayRepaintListener = l;
}
示例7: removeDisplayRepaintListener
import org.microemu.app.ui.DisplayRepaintListener; //导入依赖的package包/类
public void removeDisplayRepaintListener(DisplayRepaintListener l)
{
if (displayRepaintListener == l) {
displayRepaintListener = null;
}
}
示例8: actionPerformed
import org.microemu.app.ui.DisplayRepaintListener; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
if (captureFileChooser == null) {
ExtensionFileFilter fileFilter = new ExtensionFileFilter("GIF files");
fileFilter.addExtension("gif");
captureFileChooser = new JFileChooser();
captureFileChooser.setFileFilter(fileFilter);
captureFileChooser.setDialogTitle("Capture to GIF File...");
captureFileChooser.setCurrentDirectory(new File(Config.getRecentDirectory("recentCaptureDirectory")));
}
if (captureFileChooser.showSaveDialog(Main.this) == JFileChooser.APPROVE_OPTION) {
Config.setRecentDirectory("recentCaptureDirectory", captureFileChooser.getCurrentDirectory()
.getAbsolutePath());
String name = captureFileChooser.getSelectedFile().getName();
if (!name.toLowerCase().endsWith(".gif") && name.indexOf('.') == -1) {
name = name + ".gif";
}
File captureFile = new File(captureFileChooser.getSelectedFile().getParentFile(), name);
if (!allowOverride(captureFile)) {
return;
}
encoder = new AnimatedGifEncoder();
encoder.start(captureFile.getAbsolutePath());
menuStartCapture.setEnabled(false);
menuStopCapture.setEnabled(true);
emulatorContext.getDisplayComponent().addDisplayRepaintListener(new DisplayRepaintListener() {
long start = 0;
public void repaintInvoked(MutableImage image) {
synchronized (Main.this) {
if (encoder != null) {
if (start == 0) {
start = System.currentTimeMillis();
} else {
long current = System.currentTimeMillis();
encoder.setDelay((int) (current - start));
start = current;
}
encoder.addFrame((BufferedImage) ((J2SEMutableImage) image).getImage());
}
}
}
});
}
}
示例9: addDisplayRepaintListener
import org.microemu.app.ui.DisplayRepaintListener; //导入依赖的package包/类
public void addDisplayRepaintListener(DisplayRepaintListener l) {
displayRepaintListener = l;
}
示例10: removeDisplayRepaintListener
import org.microemu.app.ui.DisplayRepaintListener; //导入依赖的package包/类
public void removeDisplayRepaintListener(DisplayRepaintListener l) {
if (displayRepaintListener == l) {
displayRepaintListener = null;
}
}