Package org.mt4j.components

Examples of org.mt4j.components.MTCanvas$Position


  public Object extractCategoryTokenData(byte[] buffer, int offset, int length) {
    if (length == 0) {
      return null;
    }
    Integer i = Integer.valueOf(Vint8.decode(buffer, new Position(offset)));
    return i;
  }
View Full Code Here


    if (!super.setdoc(docId)) {
      return false;
    }

    // read header - number of enhancements and their lengths
    Position position = new Position();
    nEnhancements = Vint8.decode(buffer, position);
    for (int i = 0; i < nEnhancements; i++) {
      enhancementLength[i] = Vint8.decode(buffer, position);
    }
View Full Code Here

  public Object extractCategoryTokenData(byte[] buffer, int offset, int length) {
    if (length == 0) {
      return null;
    }
    Integer i = Integer.valueOf(Vint8.decode(buffer, new Position(offset)));
    return i;
  }
View Full Code Here

    this.name = name;
    this.mtApplication = mtApplication;
    this.sceneCam = new MTCamera(mtApplication);
    this.sceneCam.update();
    this.sceneCam.setZoomMinDistance(60);
    this.mainCanvas = new MTCanvas(mtApplication, name + " - Main Canvas", sceneCam);
   
//    preDrawActions = new LinkedList<IPreDrawAction>();
    preDrawActions = new ArrayDeque<IPreDrawAction>();
   
    this.registerDefaultGlobalInputProcessors();
View Full Code Here

   *
   * @param lastScene the last scene
   * @param newScene the new scene
   */
  private void sceneChange(Iscene lastScene, Iscene newScene){
    MTCanvas oldCanvas = lastScene.getCanvas();
    MTCanvas newCanvas = newScene.getCanvas();
    currentScene = newScene;
   
    System.out.println("Removing multiple mice cursors from old and add to new canvas.");
    Collection<MouseInfo> mouseInfos = deviceToMouseInfo.values();
    for (Iterator<MouseInfo> iter = mouseInfos.iterator(); iter.hasNext();) {
      MouseInfo mouseInfo = (MouseInfo) iter.next();
      if (mouseInfo.ellipse != null){
        float currentEllipseWidth = 6;
        Vector3D v = new Vector3D(currentEllipseWidth,0,0);
        v.transformDirectionVector(currentScene.getCanvas().getGlobalInverseMatrix());
        float newEllipseWidth = currentEllipseWidth = v.length();
        mouseInfo.ellipse.setWidthXYGlobal(newEllipseWidth*2);
        try {
          oldCanvas.removeChild(mouseInfo.ellipse);
        } catch (Exception e) {
          e.printStackTrace();
        }finally{
          newCanvas.addChild(mouseInfo.ellipse);
        }
//        mouseInfo.ellipse.setCustomAndGlobalCam(currentScene.getSceneCam(), defaultCenterCam);
        mouseInfo.ellipse.attachCamera(defaultCenterCam);
      }
    }
View Full Code Here

  /**
   * Adds the to scene.
   */
  public void addToScene(){
    MTComponent cursorTraceContainer = null;
    MTCanvas canvas = scene.getCanvas();
   
    /*
    //Re-use cursor trace group which is always on top for this menu
    MTComponent[] children = canvas.getChildren();
    for (int i = 0; i < children.length; i++) {
      MTComponent component = children[i];
      if (component instanceof MTOverlayContainer
          &&
        component.getName().equalsIgnoreCase("Cursor Trace group")){
        cursorTraceContainer  = component;
        component.addChild(0, this); //add to cursor trace overlay container
      }
    }
    */
   
//    /*
    //cursor tracer group NOT found in the scene -> add overlay container to canvas
    if (cursorTraceContainer == null){
      overlayGroup.addChild(this);
      canvas.addChild(overlayGroup);
    }
//    */
  }
 
View Full Code Here

  /**
   * Removes the from scene.
   */
  public void removeFromScene(){
    MTComponent cursorTraceContainer = null;
    MTCanvas canvas = scene.getCanvas();
   
    /*
    //Re-use cursor trace group which is always on top for this menu
    MTComponent[] children = canvas.getChildren();
    for (int i = 0; i < children.length; i++) {
      MTComponent component = children[i];
      if (component instanceof MTOverlayContainer
          &&
        component.getName().equalsIgnoreCase("Cursor Trace group")){
        cursorTraceContainer  = component;
        if (cursorTraceContainer.containsChild(this)){
          cursorTraceContainer.removeChild(this);
        }
      }
    }
    */
   
//    /*
    //cursor tracer group NOT found in the scene -> add overlay container to canvas
    if (cursorTraceContainer == null){
      if (canvas.containsChild(overlayGroup)){
        canvas.removeChild(overlayGroup);
      }
    }
//    */
  }
 
View Full Code Here

TOP

Related Classes of org.mt4j.components.MTCanvas$Position

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.