Examples of XYPlotContents


Examples of plotter.xy.XYPlotContents

    yAxisPanButtonPanel.add(yAxisPanDownButton);
    yAxisPanButtonPanel.setOpaque(false);
    plot.getPlotView().add(yAxisPanButtonPanel);
    plot.getPlotView().setComponentZOrder(yAxisPanButtonPanel, 0);
    SpringLayout layout = (SpringLayout) plot.getPlotView().getLayout();
    XYPlotContents contents = plot.getPlotView().getContents();
    layout.putConstraint(SpringLayout.VERTICAL_CENTER, yAxisPanButtonPanel, 0, SpringLayout.VERTICAL_CENTER, contents);
    layout.putConstraint(SpringLayout.EAST, yAxisPanButtonPanel, -1, SpringLayout.EAST, plot.getPlotView().getYAxis());
  }
View Full Code Here

Examples of plotter.xy.XYPlotContents

    xAxisPanButtonPanel.add(xAxisPanRightButton);
    xAxisPanButtonPanel.setOpaque(false);
    plot.getPlotView().add(xAxisPanButtonPanel);
    plot.getPlotView().setComponentZOrder(xAxisPanButtonPanel, 0);
    SpringLayout layout = (SpringLayout) plot.getPlotView().getLayout();
    XYPlotContents contents = plot.getPlotView().getContents();
    layout.putConstraint(SpringLayout.HORIZONTAL_CENTER, xAxisPanButtonPanel, 0, SpringLayout.HORIZONTAL_CENTER, contents);
    layout.putConstraint(SpringLayout.NORTH, xAxisPanButtonPanel, 1, SpringLayout.NORTH, plot.getPlotView().getXAxis());
  }
View Full Code Here

Examples of plotter.xy.XYPlotContents

    plot.getPlotView().setComponentZOrder(topRightCornerResetButton, 0);
    plot.getPlotView().setComponentZOrder(topLeftCornerResetButton, 0);
    plot.getPlotView().setComponentZOrder(bottomRightCornerResetButton, 0);
    plot.getPlotView().setComponentZOrder(bottomLeftCornerResetButton, 0);
    SpringLayout layout = (SpringLayout) plot.getPlotView().getLayout();
    XYPlotContents contents = plot.getPlotView().getContents();
    layout.putConstraint(SpringLayout.NORTH, topRightCornerResetButton, 0, SpringLayout.NORTH, contents);
    layout.putConstraint(SpringLayout.EAST, topRightCornerResetButton, 0, SpringLayout.EAST, contents);
    layout.putConstraint(SpringLayout.NORTH, topLeftCornerResetButton, 0, SpringLayout.NORTH, contents);
    layout.putConstraint(SpringLayout.WEST, topLeftCornerResetButton, 0, SpringLayout.WEST, contents);
    layout.putConstraint(SpringLayout.SOUTH, bottomRightCornerResetButton, 0, SpringLayout.SOUTH, contents);
View Full Code Here

Examples of plotter.xy.XYPlotContents

      xAxisZoomButtonCenterPanel.setVisible(false);
      plot.getPlotView().add(xAxisZoomButtonCenterPanel);
      plot.getPlotView().setComponentZOrder(xAxisZoomButtonCenterPanel, 0);
      xAxisZoomButtonCenterPanel.setOpaque(false);
    SpringLayout layout = (SpringLayout) plot.getPlotView().getLayout();
    XYPlotContents contents = plot.getPlotView().getContents();
    layout.putConstraint(SpringLayout.HORIZONTAL_CENTER, xAxisZoomButtonCenterPanel, 0, SpringLayout.HORIZONTAL_CENTER, contents);
    layout.putConstraint(SpringLayout.NORTH, xAxisZoomButtonCenterPanel, 1, SpringLayout.NORTH, plot.getPlotView().getXAxis());
  }
View Full Code Here

Examples of plotter.xy.XYPlotContents

      yAxisZoomButtonMiddlePanel.setVisible(false);
      plot.getPlotView().add(yAxisZoomButtonMiddlePanel);
      plot.getPlotView().setComponentZOrder(yAxisZoomButtonMiddlePanel, 0);
      yAxisZoomButtonMiddlePanel.setOpaque(false)
    SpringLayout layout = (SpringLayout) plot.getPlotView().getLayout();
    XYPlotContents contents = plot.getPlotView().getContents();
    layout.putConstraint(SpringLayout.VERTICAL_CENTER, yAxisZoomButtonMiddlePanel, 0, SpringLayout.VERTICAL_CENTER, contents);
    layout.putConstraint(SpringLayout.EAST, yAxisZoomButtonMiddlePanel, -1, SpringLayout.EAST, plot.getPlotView().getYAxis());
  }
View Full Code Here

Examples of plotter.xy.XYPlotContents

    assert plot.getPlotView()==null: "Plot already initalized.";

    // Create new instance of the plot
    plot.setPlotView(new XYPlot());
    plot.getPlotView().setBackground(PlotConstants.DEFAULT_PLOT_FRAME_BACKGROUND_COLOR);
    XYPlotContents contents = new XYPlotContents();
    contents.setBackground(Color.black);
    plot.getPlotView().add(contents);
    plot.getPlotView().setPreferredSize(new Dimension(PlotterPlot.PLOT_PREFERED_WIDTH, PlotterPlot.PLOT_PREFERED_HEIGHT));

//    JComponent panel = plot.getPlotPanel();
//    GridBagLayout layout = new GridBagLayout();
View Full Code Here

Examples of plotter.xy.XYPlotContents

  void setupCompressionRatio() {
    AbstractAxis axis = plot.getTimeAxis();
    double start = axis.getStart();
    double end = axis.getEnd();
    assert start != end;
    XYPlotContents contents = plot.getPlotView().getContents();
    // the height or width could be zero if the plot is showing in an area which is closed. One scenario is the inspector area where the slider is
    // closed
    double width = Math.max(0,plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME ? contents.getWidth() : contents.getHeight());
    double compressionScale = width == 0 ? Double.MAX_VALUE : Math.abs(end - start) / width;
    if(plot.getTimeAxisSubsequentSetting() == TimeAxisSubsequentBoundsSetting.SCRUNCH) {
      for(PlotDataSeries s : dataSeries.values()) {
        CompressingXYDataset d = s.getData();
        double scale = d.getCompressionScale();
View Full Code Here

Examples of plotter.xy.XYPlotContents

    if(timeSyncLinePlot == null) {
      AbstractAxis timeAxis = plot.getTimeAxis();
      if (timeAxis instanceof XYAxis) { // Only decorate time-like axes; TODO: move to AbstractAxis?
        timeSyncLinePlot = new XYMarkerLine((XYAxis) timeAxis, time.getTimeInMillis());
        timeSyncLinePlot.setForeground(PlotConstants.TIME_SYNC_LINE_COLOR);
        XYPlotContents contents = plot.getPlotView().getContents();
        contents.add(timeSyncLinePlot);
        contents.revalidate();
      }
    } else {
      timeSyncLinePlot.setValue(time.getTimeInMillis());
    }
  }
View Full Code Here

Examples of plotter.xy.XYPlotContents

   * Remove the time sync line from the plot.
   */
  void removeTimeSyncLine() {
    if (timeSyncLinePlot != null) {
      plot.setUserOperationLockedState(false);
      XYPlotContents contents = plot.getPlotView().getContents();
      contents.remove(timeSyncLinePlot);
      contents.repaint(); // TODO: Only repaint the relevant portion
//      plot.refreshDisplay();
      timeSyncLinePlot = null;
      syncTime = null;
    }
  }
View Full Code Here

Examples of plotter.xy.XYPlotContents

      plot.setXAxis(xAxis);
      plot.setYAxis(yAxis);
      plot.setBackground(Color.darkGray);
      XYGrid grid = new XYGrid(xAxis, yAxis);
      grid.setForeground(Color.lightGray);
      XYPlotContents contents = new XYPlotContents();
      contents.setBackground(Color.black);
      plot.add(contents);
      contents.add(grid);
      plot.setPreferredSize(new Dimension(150, 100));

      new DefaultXYLayoutGenerator().generateLayout(plot);

      for(int j = 0; j < linesPerPlot; j++) {
        final LinearXYPlotLine line = new LinearXYPlotLine(xAxis, yAxis, XYDimension.X);
        line.setForeground(Color.white);
        final SimpleXYDataset d = new SimpleXYDataset(line);
        d.setMaxCapacity(1000);
        d.setXData(line.getXData());
        d.setYData(line.getYData());
        contents.add(line);

        for(int x = 0; x < 900; x++) {
          double x2 = x / 10.0;
          double y2 = Math.sin(x2 / 10.0 + Math.PI * j / (double) linesPerPlot);
          d.add(x2, y2);
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.