当前位置: 首页>>代码示例>>Java>>正文


Java Characters类代码示例

本文整理汇总了Java中net.rim.device.api.system.Characters的典型用法代码示例。如果您正苦于以下问题:Java Characters类的具体用法?Java Characters怎么用?Java Characters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Characters类属于net.rim.device.api.system包,在下文中一共展示了Characters类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: keyControl

import net.rim.device.api.system.Characters; //导入依赖的package包/类
protected boolean keyControl(char c, int status, int time) {
    if(c == Characters.CONTROL_VOLUME_UP || c == Characters.CONTROL_VOLUME_DOWN) {
        int i = MMAPIPlayer.getGlobalVolume();
        if(i == -1) {
            i = 70;
        }
        if(c == Characters.CONTROL_VOLUME_UP) {
            MMAPIPlayer.setGlobalVolume(Math.min(100, i + 4));
        } else {
            MMAPIPlayer.setGlobalVolume(Math.max(0, i - 4));
        }
        if(BlackBerryImplementation.getVolumeListener() != null) {
            BlackBerryImplementation.getVolumeListener().fireActionEvent(new ActionEvent(this, c));
            return true;
        }
    }
    return super.keyControl(c, status, time);
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:19,代码来源:BlackBerryCanvas.java

示例2: keyControl

import net.rim.device.api.system.Characters; //导入依赖的package包/类
protected boolean keyControl(char c, int status, int time) {
    if (c == Characters.CONTROL_VOLUME_UP) {
        AudioPlayer.instance.incVolume();
        return true;
    } else if (c == Characters.CONTROL_VOLUME_DOWN) {
        AudioPlayer.instance.decVolume();
        return true;
    } else {
        return super.keyControl(c, status, time);
    }
}
 
开发者ID:yanex,项目名称:vika,代码行数:12,代码来源:VkMainScreen.java

示例3: keyChar

import net.rim.device.api.system.Characters; //导入依赖的package包/类
protected boolean keyChar(char character, int status, int time) {
    if (character == Characters.ENTER) {
        raiseClick();
        return true;
    }

    return super.keyChar(character, status, time);
}
 
开发者ID:yanex,项目名称:vika,代码行数:9,代码来源:FocusableField.java

示例4: keyDown

import net.rim.device.api.system.Characters; //导入依赖的package包/类
protected boolean keyDown(int keycode, int time) {
    if (Keypad.map(Keypad.key(keycode), Keypad.status(keycode)) == Characters.ENTER) {
        isActive = true;
        invalidate();
    }

    return super.keyDown(keycode, time);
}
 
开发者ID:yanex,项目名称:vika,代码行数:9,代码来源:FocusableField.java

示例5: keyUp

import net.rim.device.api.system.Characters; //导入依赖的package包/类
protected boolean keyUp(int keycode, int time) {
    if (Keypad.map(Keypad.key(keycode), Keypad.status(keycode)) == Characters.ENTER) {
        isActive = false;
        invalidate();
        return true;
    }

    return super.keyUp(keycode, time);
}
 
开发者ID:yanex,项目名称:vika,代码行数:10,代码来源:FocusableField.java

示例6: keyChar

import net.rim.device.api.system.Characters; //导入依赖的package包/类
protected boolean keyChar(char character, int status, int time) {
    if (character == Characters.ENTER) {
        boolean ret = super.keyChar(character, status, time);
        if (!ret) {
            raiseClick();
        }
        return true;
    }

    return super.keyChar(character, status, time);
}
 
开发者ID:yanex,项目名称:vika,代码行数:12,代码来源:FocusableHFM.java

示例7: captureVideo

import net.rim.device.api.system.Characters; //导入依赖的package包/类
public void captureVideo(ActionListener response) {
    captureCallback = new EventDispatcher();
    captureCallback.addListener(response);

    UiApplication.getUiApplication().addFileSystemJournalListener(new FileSystemJournalListener() {

        private long lastUSN;
        private String videoPath;

        public void fileJournalChanged() {
            // next sequence number file system will use
            long USN = FileSystemJournal.getNextUSN();

            for (long i = USN - 1; i >= lastUSN && i < USN; --i) {
                FileSystemJournalEntry entry = FileSystemJournal.getEntry(i);
                if (entry == null) {
                    break;
                }

                String path = entry.getPath();
                if (entry.getEvent() == FileSystemJournalEntry.FILE_ADDED
                        && videoPath == null) {
                    int index = path.indexOf(".3GP");
                    if (index != -1) {
                        videoPath = path;
                    }
                } else if (entry.getEvent() == FileSystemJournalEntry.FILE_RENAMED) {
                    if (path != null && path.equals(videoPath)) {
                        //close the camera
                        UiApplication.getUiApplication().removeFileSystemJournalListener(this);

                        try {
                            EventInjector.KeyEvent inject = new EventInjector.KeyEvent(EventInjector.KeyEvent.KEY_DOWN, Characters.ESCAPE, 0, 200);
                            inject.post();
                            inject.post();
                        } catch (Exception e) {
                            //try to close the camera
                        }

                        captureCallback.fireActionEvent(new ActionEvent("file://" + path));
                        captureCallback = null;
                        videoPath = null;
                        break;
                    }
                }
            }
            lastUSN = USN;
        }
    });
    app.setWaitingForReply(true);
    synchronized (UiApplication.getEventLock()) {
        Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments(CameraArguments.ARG_VIDEO_RECORDER));
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:55,代码来源:BlackBerryOS5Implementation.java


注:本文中的net.rim.device.api.system.Characters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。