Ejemplo n.º 1
0
  protected void updateSettings() {
    // gif-panel
    try { // TODO only update modified value

      // screenshot
      int sctype = screenshotTransparentBt.getValue() ? 0 : 1;
      storageControler.setValue(KEY_SCREENSHOT_BG_TYPE, sctype);
      storageControler.setValue(KEY_SCREENSHOT_BG_VALUE, screenshotColorBox.getValue());

      storageControler.setValue(KEY_GIF_WITH_BACKGROUND, backgroundCheck.getValue());
      storageControler.setValue(KEY_GIF_WITH_BONE, boneCheck.getValue());
      storageControler.setValue(KEY_GIF_WITH_IK, ikCheck.getValue());

      if (transparentBt.getValue()) {
        storageControler.setValue(KEY_GIF_BG_TYPE, 0);
      } else if (colorBt.getValue()) {
        storageControler.setValue(KEY_GIF_BG_TYPE, 1);
        storageControler.setValue(KEY_GIF_BG_VALUE, colorBox.getValue());
      } else if (imageBt.getValue()) {
        storageControler.setValue(KEY_GIF_BG_TYPE, 2);
      }

      storageControler.setValue(KEY_GIF_WIDTH, widthBox.getValue());
      storageControler.setValue(KEY_GIF_HEIGHT, heightBox.getValue());

      storageControler.setValue(KEY_GIF_QUALITY, qualityBox.getValue());
      storageControler.setValue(KEY_GIF_SPEED, speedBox.getValue());

    } catch (StorageException e) {
      // possible quote error
      PoseEditor.alert(e.getMessage());
    }
  }
Ejemplo n.º 2
0
  private Widget createScreenshotPanel() {
    VerticalPanel panel = new VerticalPanel();
    panel.setSize("100%", "100%");

    // background
    Label label2 = new Label("Background");
    panel.add(label2);
    HorizontalPanel bgTypes = new HorizontalPanel();
    bgTypes.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    panel.add(bgTypes);
    screenshotTransparentBt = new RadioButton("scbgtype", "Transparent");
    screenshotTransparentBt.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {
          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            updatePreviewCanvas();
          }
        });

    bgTypes.add(screenshotTransparentBt); // stop because not support so far

    screenshotColorBt = new RadioButton("scbgtype", "Color");
    bgTypes.add(screenshotColorBt);

    screenshotColorBox = new ColorBox();
    screenshotColorBox.setValue("#333333");
    bgTypes.add(screenshotColorBox);

    return panel;
  }
Ejemplo n.º 3
0
  public Canvas createBgCanvas() {
    CanvasUtils.clear(bgCanvas);
    if (transparentBt.getValue()) {
      // do nothing
    } else if (colorBt.getValue()) {
      String bg = colorBox.getValue();
      CanvasUtils.fillRect(bgCanvas, bg);
    } else if (imageBt.getValue()) {
      if (bgImage != null) {
        // TODO set pos,scale,rot from simplelogo
        CanvasUtils.drawCenter(bgCanvas, bgImage);
      }
    }

    return bgCanvas;
  }
Ejemplo n.º 4
0
  public void synchUI() {

    if (!initialized) { // do late
      initialize();
      initialized = true;
    }
    LogUtils.log(
        "sync:pos:"
            + PoseEditor.poseEditor.getRootPositionXRange()
            + ","
            + PoseEditor.poseEditor.getRootPositionYRange()
            + ","
            + PoseEditor.poseEditor.getCameraZ());

    // gif-panel
    backgroundCheck.setValue(isGifShowBackground());
    boneCheck.setValue(isGifShowBone());
    ikCheck.setValue(isGifShowIk());

    int screenshottype = getScreenshotBackgroundType();
    if (screenshottype == 0) {
      screenshotTransparentBt.setValue(true);
    } else if (screenshottype == 1) {
      screenshotColorBt.setValue(true);
      String scvalue = getScreenshotBackgroundValue();
      screenshotColorBox.setValue(scvalue);
    }

    lastBgImage = bgImage; // store for cancel
    lastBgLabel = bgImageLabel.getText();

    int bgType = storageControler.getValue(KEY_GIF_BG_TYPE, 1); // sadlly transparent not support
    String bgValue = storageControler.getValue(KEY_GIF_BG_VALUE, "#000000");

    LogUtils.log(bgType + "," + bgValue);

    if (bgType == 0) {
      transparentBt.setValue(true);
    } else if (bgType == 1) {
      colorBt.setValue(true);
      colorBox.setValue(bgValue);
    } else if (bgType == 2) {
      imageBt.setValue(true);
    }

    widthBox.setValue(Math.max(1, getGifWidth()));
    heightBox.setValue(Math.max(1, getGifHeight()));

    qualityBox.setValue(getGifQuality());
    speedBox.setValue(getGifSpeed());

    // keep value before set,if change value listener change others.
    int x = PoseEditor.poseEditor.getRootPositionXRange();
    int y = PoseEditor.poseEditor.getRootPositionYRange();
    int z = (int) (PoseEditor.poseEditor.getCameraZ() * 10);

    settingPositionXRange.setValue(x);
    settingPositionYRange.setValue(y);
    settingPositionZRange.setValue(z);

    lastRangeX = x;
    lastRangeY = y;
    lastRangeZ = z;

    updateCanvasSize();

    updatePreviewCanvas();
  }