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


Java GazeManager类代码示例

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


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

示例1: startTracker

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
public static int startTracker(){
    Globs.tracker = GazeManager.getInstance();
    boolean success = Globs.tracker.activate(GazeManager.ApiVersion.VERSION_1_0, GazeManager.ClientMode.PUSH);

    if(success){

        if(Globs.tracker.getNumGazeListeners() == 0) {
            final GazeListener gazeListener = new GazeListener();
            Globs.tracker.addGazeListener(gazeListener);
        }
        System.out.println("Tracker Activated Successfully");
        return Globs.TRACKER_ACTIVATED;
    }

    System.out.println("Failed to activate tracker. Make sure the eyeTribe server is running.");
    return Globs.TRACKER_FAILED_TO_ACTIVATE;
}
 
开发者ID:sradevski,项目名称:EyeTribe-Web-Socket-Server,代码行数:18,代码来源:ClientMessageHandler.java

示例2: main

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
public static void main(String[] args) {

        final GazeManager gm = GazeManager.getInstance();
        gm.activate();
        final GazeListener gazeListener = new GazeListener();
        gm.addGazeListener(gazeListener);
    }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:8,代码来源:TETSimple.java

示例3: main

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
public static void main(String argv[]) {

        final GazeManager gm = GazeManager.getInstance();
        log.info("" + gm.activate());
        final IGazeListener gazeListener = new GazeListener();
        gm.addGazeListener(gazeListener);
    }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:8,代码来源:EyeTribeServer.java

示例4: onStop

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
@Override
public void onStop()
{
    super.onStop();

    if(GazeManager.getInstance().isCalibrating())
        GazeManager.getInstance().calibrationAbort();
}
 
开发者ID:EyeTribe,项目名称:tet-java-client,代码行数:9,代码来源:SceneCalibrationController.java

示例5: stopCalibration

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
public void stopCalibration()
{
    if( null != mCalibrationSequence)
        mCalibrationSequence.stop();

    if(GazeManager.getInstance().isCalibrating())
        GazeManager.getInstance().calibrationAbort();
}
 
开发者ID:EyeTribe,项目名称:tet-java-client,代码行数:9,代码来源:SceneCalibrationController.java

示例6: onGazeUpdate

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
@Override
public void onGazeUpdate(GazeData gazeData)
{
    Platform.runLater(() -> {

        if (!mIsRecievingFrames)
        {
            if(null != progress)
            {
                progress.setVisible(false);

                initGazeButtons();

                rating.setRating(JavaFxCalibUtils.getCalibRating(GazeManager.getInstance().getLastCalibrationResult()));

                mIsRecievingFrames = true;
            }
        }

        Point2D gaze = GazeFrameCache.getInstance().getLastSmoothedGazeCoordinates();
        if (null != gaze) {
            gazeIndicator.setVisible(true);
            javafx.geometry.Point2D rootAnchor = getGazeIndicatorAnchor(gaze);
            gazeIndicator.setX(rootAnchor.getX());
            gazeIndicator.setY(rootAnchor.getY());
        } else
            gazeIndicator.setVisible(false);
    });
}
 
开发者ID:EyeTribe,项目名称:tet-java-client,代码行数:30,代码来源:SceneEvaluationController.java

示例7: handleConnectButtonAction

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
@FXML
private void handleConnectButtonAction(ActionEvent event)
{
    //TODO: Handle progress connection timeout

    GazeManager.getInstance().activateAsync();
}
 
开发者ID:EyeTribe,项目名称:tet-java-client,代码行数:8,代码来源:SceneMainController.java

示例8: updateState

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
private void updateState()
{
    if(GazeManager.getInstance().isActivated())
    {
        connectBtn.setVisible(false);
        connect.setVisible(false);

        if(GazeManager.getInstance().isCalibrated())
        {
            calibrationBtn.setVisible(true);
            calibrationBtn.setText(bundle.getString("btn.recalibrate"));

            evaluateBtn.setVisible(true);

            rating.setRating(JavaFxCalibUtils.getCalibRating(GazeManager.getInstance().getLastCalibrationResult()));
        }
        else
        {
            calibrationBtn.setVisible(true);
            calibrationBtn.setText(bundle.getString("btn.calibrate"));

            evaluateBtn.setVisible(false);
        }

        rating.setVisible(true);
    }
    else
    {
        connect.setVisible(true);
        connectBtn.setVisible(true);
        calibrationBtn.setVisible(false);
    }

    progress.setVisible(false);
}
 
开发者ID:EyeTribe,项目名称:tet-java-client,代码行数:36,代码来源:SceneMainController.java

示例9: GazeFrameCache

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
private GazeFrameCache(int timeLimit)
{
    mFrames = new GazeDataDeque(timeLimit);
    mValidFramePredicate = new ValidFrame();

    //init user distance values
    mLastEyesVecHalf = new Point2D(.2f, 0f);
    mLastEyeDistance = 1f - ((mMinEyesDistance + ((mMaxEyesDistance - mMinEyesDistance) * .5f)) / mMaxEyesDistance);
    mLastUserPosition = new Point3D(GazeManager.getInstance().getScreenResolutionWidth() >> 1, GazeManager.getInstance().getScreenResolutionHeight() >> 1, mLastEyeDistance);
}
 
开发者ID:EyeTribe,项目名称:tet-java-client,代码行数:11,代码来源:GazeFrameCache.java

示例10: start

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception
{
    mStage = primaryStage;
    mStage.initStyle(StageStyle.UNDECORATED);

    mScreen = Screen.getPrimary();

    loadMainScene();

    //initial placement of window, center bottom. Ensures best calibration for large screens
    javafx.geometry.Rectangle2D bounds = mScreen.getVisualBounds();
    if(mScene.getWidth() < bounds.getWidth() && mScene.getHeight() < bounds.getHeight())
    {
        mStage.setX((bounds.getWidth() - mScene.getWidth()) * .5f);
        mStage.setY(bounds.getHeight() - mScene.getHeight());
    }
    else
    {
        //if screen bounds smaller than stage, shrink stage
        if(mScene.getWidth() > bounds.getWidth())
        {
            mStage.setWidth(bounds.getWidth());
        }
        if(mScene.getHeight() > bounds.getHeight())
        {
            mStage.setHeight(bounds.getHeight());
        }
    }

    GazeManager.getInstance().addGazeListener(this);
    GazeManager.getInstance().activateAsync();
}
 
开发者ID:EyeTribe,项目名称:tet-java-client,代码行数:34,代码来源:Main.java

示例11: stop

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
@Override
public void stop() throws Exception
{
    if(null != mCurrentController)
        mCurrentController.onStop();

    // deactivating, listener removed at part of this call
    GazeManager.getInstance().deactivate();
}
 
开发者ID:EyeTribe,项目名称:tet-java-client,代码行数:10,代码来源:Main.java

示例12: parseJsonResponse

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
public T parseJsonResponse(JsonObject response, Gson gson)
{
    if(GazeManager.IS_DEBUG_MODE)
        System.out.println("parseJsonResponse: " + type.getSimpleName());

    return gson.fromJson(response, type);
}
 
开发者ID:EyeTribe,项目名称:tet-java-client,代码行数:8,代码来源:Request.java

示例13: toJsonString

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
public String toJsonString(Gson gson)
{
    if(GazeManager.IS_DEBUG_MODE)
        System.out.println("toJsonString: " + this.getClass().getSimpleName());

    return gson.toJson(this, this.getClass());
}
 
开发者ID:EyeTribe,项目名称:tet-java-client,代码行数:8,代码来源:Request.java

示例14: resetCalibration

import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
public void resetCalibration()
{
    stopCalibration();

    mAnchors = JavaFxCalibUtils.initCalibrationPoints(NUM_CALIB_ROWS, NUM_CALIB_COLUMNS, innerRoot.getWidth(), innerRoot.getHeight(), mCalibPadding, mCalibPadding, true);

    mCalibrationSequence = initAnimations(instruct, calibPoint, mAnchors, false);

    GazeManager.getInstance().calibrationStart(mAnchors.size(), this);

    mCalibrationSequence.play();
}
 
开发者ID:EyeTribe,项目名称:tet-java-client,代码行数:13,代码来源:SceneCalibrationController.java


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