Esempio n. 1
0
  /**
   * **************************************************** Constructs AppW for applets
   *
   * @param undoActive if true you can undo by CTRL+Z and redo by CTRL+Y
   * @param ae article element
   * @param gf frame
   * @param dimension 3 for 3d, 2 otherwise
   * @param laf look and feel
   */
  public AppWapplet(
      ArticleElement ae,
      GeoGebraFrameBoth gf,
      final boolean undoActive,
      int dimension,
      GLookAndFeel laf) {
    super(ae, dimension, laf, null);
    this.frame = gf;
    setAppletHeight(frame.getComputedHeight());
    setAppletWidth(frame.getComputedWidth());

    this.useFullGui =
        !isApplet()
            || ae.getDataParamShowAlgebraInput(false)
            || ae.getDataParamShowToolBar(false)
            || ae.getDataParamShowMenuBar(false)
            || ae.getDataParamEnableRightClick();

    Log.info(
        "GeoGebra "
            + GeoGebraConstants.VERSION_STRING
            + " "
            + GeoGebraConstants.BUILD_DATE
            + " "
            + Window.Navigator.getUserAgent());
    initCommonObjects();
    initing = true;

    this.euclidianViewPanel = new EuclidianDockPanelW(this, allowStylebar());
    // (EuclidianDockPanelW)getGuiManager().getLayout().getDockManager().getPanel(App.VIEW_EUCLIDIAN);
    this.canvas = this.euclidianViewPanel.getCanvas();
    canvas.setWidth("1px");
    canvas.setHeight("1px");
    canvas.setCoordinateSpaceHeight(1);
    canvas.setCoordinateSpaceWidth(1);
    initCoreObjects(undoActive, this);
    afterCoreObjectsInited();
    resetFonts();
    Browser.removeDefaultContextMenu(this.getArticleElement());
    if (ae.getDataParamApp() && !this.getLAF().isSmart()) {
      RootPanel.getBodyElement().addClassName("application");
    }
    if (this.showMenuBar()) {
      // opening file -> this was inited before
      if (getLoginOperation() == null) {
        initSignInEventFlow(new LoginOperationW(this), ae.isEnableUsageStats());
      }
    } else {
      if (Browser.runningLocal() && ae.isEnableUsageStats()) {
        new GeoGebraTubeAPIWSimple(has(Feature.TUBE_BETA)).checkAvailable(null);
      }
    }
  }
Esempio n. 2
0
 private void refreshSplitLayoutPanel() {
   if (frame != null
       && frame.getWidgetCount() != 0
       && frame.getWidgetIndex(getSplitLayoutPanel()) == -1
       && frame.getWidgetIndex(oldSplitLayoutPanel) != -1) {
     int wi = frame.getWidgetIndex(oldSplitLayoutPanel);
     frame.remove(oldSplitLayoutPanel);
     frame.insert(getSplitLayoutPanel(), wi);
     oldSplitLayoutPanel = getSplitLayoutPanel();
     Browser.removeDefaultContextMenu(getSplitLayoutPanel().getElement());
   }
 }
Esempio n. 3
0
  private void attachSplitLayoutPanel() {
    boolean oldSLPanelChanged = oldSplitLayoutPanel == getSplitLayoutPanel() ? false : true;
    oldSplitLayoutPanel = getSplitLayoutPanel();

    if (oldSplitLayoutPanel != null) {
      if (getArticleElement().getDataParamShowMenuBar(false)) {
        this.splitPanelWrapper = new HorizontalPanel();
        // TODO
        splitPanelWrapper.add(oldSplitLayoutPanel);
        if (this.menuShowing) {
          splitPanelWrapper.add(frame.getMenuBar(this));
        }
        frame.add(splitPanelWrapper);

      } else {
        frame.add(oldSplitLayoutPanel);
      }
      Browser.removeDefaultContextMenu(getSplitLayoutPanel().getElement());

      if (has(Feature.FIX_KEYBOARD_POSITION) && !oldSLPanelChanged) {
        return;
      }

      ClickStartHandler.init(
          oldSplitLayoutPanel,
          new ClickStartHandler() {
            @Override
            public void onClickStart(int x, int y, final PointerEventType type) {
              updateAVStylebar();

              if (!CancelEventTimer.cancelKeyboardHide()) {
                Timer timer =
                    new Timer() {
                      @Override
                      public void run() {
                        getAppletFrame().keyBoardNeeded(false, null);
                      }
                    };
                timer.schedule(0);
              }
            }
          });
    }
  }