Examples of PlotsState


Examples of org.rstudio.studio.client.workbench.views.plots.model.PlotsState

}
  
   public void onPlotsChanged(PlotsChangedEvent event)
   {
      // get the event
      PlotsState plotsState = event.getPlotsState();
       
      // clear progress
      view_.setProgress(false);
      manipulatorManager_.setProgress(false);
     
      // if this is the empty plot then clear the display
      // NOTE: we currently return a zero byte PNG as our "empty.png" from
      // the server. this is shown as a blank pane by Webkit, however
      // firefox shows the full URI of the empty.png rather than a blank
      // pane. therefore, we put in this workaround.
      if (plotsState.getFilename().startsWith("empty."))
      {
         view_.showEmptyPlot();
      }
      else
      {
         String url = server_.getGraphicsUrl(plotsState.getFilename());
         view_.showPlot(url);
      }
     
      // activate the plots tab if requested
      if (plotsState.getActivatePlots())
         view_.bringToFront();
     
      // update plot size
      plotSize_ = new Size(plotsState.getWidth(), plotsState.getHeight());

      // manipulator
      manipulatorManager_.setManipulator(plotsState.getManipulator(),
                                         plotsState.getShowManipulator());
     
      // locator
      if (locator_.isActive())
         locate();
     
View Full Code Here

Examples of org.rstudio.studio.client.workbench.views.plots.model.PlotsState

   public void onPlotsChanged(PlotsChangedEvent event)
   {
      shim_.delayLoadPlotsState = null;

      PlotsState plotsState = event.getPlotsState();

      // zero or one plot -- next and previous disabled
      if (plotsState.getPlotCount() <= 1)
      {
         commands_.nextPlot().setEnabled(false);
         commands_.previousPlot().setEnabled(false);
      }
      // first plot (only next is enabled)
      else if (plotsState.getPlotIndex() == 0)
      {
         commands_.nextPlot().setEnabled(true);
         commands_.previousPlot().setEnabled(false);
      }
      // last plot (only back is enabled)
      else if (plotsState.getPlotIndex() ==
              (plotsState.getPlotCount() - 1))
      {
         commands_.nextPlot().setEnabled(false);
         commands_.previousPlot().setEnabled(true);
      }
      // both enabled
      else
      {
         commands_.nextPlot().setEnabled(true);
         commands_.previousPlot().setEnabled(true);
      }

      // other commands which are only enabled if there is at least
      // one plot alive
      boolean hasPlots = plotsState.getPlotCount() >= 1;
      commands_.savePlotAsImage().setEnabled(hasPlots);
      commands_.savePlotAsPdf().setEnabled(hasPlots);
      commands_.copyPlotToClipboard().setEnabled(hasPlots);
      commands_.publishPlotToRPubs().setEnabled(hasPlots);
      commands_.zoomPlot().setEnabled(hasPlots);
      commands_.removePlot().setEnabled(hasPlots);
      commands_.clearPlots().setEnabled(hasPlots);
      commands_.refreshPlot().setEnabled(hasPlots);
      commands_.showManipulator().setEnabled(hasPlots);

      if (plotsState.getActivatePlots() || shim_.loaded)
      {
         shim_.onPlotsChanged(event);
      }
      else
      {
View Full Code Here

Examples of org.rstudio.studio.client.workbench.views.plots.model.PlotsState

            BrowseUrlInfo urlInfo = event.getData();
            eventBus_.fireEvent(new BrowseUrlEvent(urlInfo));
         }
         else if (type.equals(ClientEvent.PlotsStateChanged))
         {
            PlotsState plotsState = event.getData();
            eventBus_.fireEvent(new PlotsChangedEvent(plotsState));
         }
         else if (type.equals(ClientEvent.ViewData))
         {
            DataView dataView = event.getData();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.