本文整理汇总了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;
}
示例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);
}
示例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);
}
示例4: onStop
import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
@Override
public void onStop()
{
super.onStop();
if(GazeManager.getInstance().isCalibrating())
GazeManager.getInstance().calibrationAbort();
}
示例5: stopCalibration
import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
public void stopCalibration()
{
if( null != mCalibrationSequence)
mCalibrationSequence.stop();
if(GazeManager.getInstance().isCalibrating())
GazeManager.getInstance().calibrationAbort();
}
示例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);
});
}
示例7: handleConnectButtonAction
import com.theeyetribe.clientsdk.GazeManager; //导入依赖的package包/类
@FXML
private void handleConnectButtonAction(ActionEvent event)
{
//TODO: Handle progress connection timeout
GazeManager.getInstance().activateAsync();
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
示例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());
}
示例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();
}