Examples of XYAxis


Examples of plotter.xy.XYAxis

  public static void main(String[] args) {
    XYPlotFrame frame = new XYPlotFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setup();

    XYAxis xAxis = frame.getXAxis();
    XYAxis yAxis = frame.getYAxis();
    final ScatterXYPlotLine line = new ScatterXYPlotLine(xAxis, yAxis);
    line.setForeground(Color.white);
    final SimpleXYDataset d = new SimpleXYDataset(line);
    d.setXData(line.getXData());
    d.setYData(line.getYData());
    frame.addPlotLine(line);

    yAxis.setStart(-1.2);
    yAxis.setEnd(1.2);
    xAxis.setStart(-1.2);
    xAxis.setEnd(1.2);

    int n = 2000;
    for(int x = 0; x <= n; x++) {
View Full Code Here

Examples of plotter.xy.XYAxis

  public static void main(String[] args) {
    XYPlotFrame frame = new XYPlotFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setup();

    XYAxis xAxis = frame.getXAxis();
    XYAxis yAxis = frame.getYAxis();
    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());
    frame.addPlotLine(line);

    yAxis.setStart(-1.2);
    yAxis.setEnd(1.2);
    xAxis.setStart(0);
    xAxis.setEnd(2 * Math.PI);
    ((LinearXYAxis)xAxis).setFormat(new DecimalFormat("0.0000000"));
    ((LinearXYAxis)yAxis).setFormat(new DecimalFormat("0.0000000"));
    ((LinearXYAxis)yAxis).setLabelRotation(Rotation.CCW);
View Full Code Here

Examples of plotter.xy.XYAxis

  public static void main(String[] args) {
    XYPlotFrame frame = new XYPlotFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setup();

    XYAxis xAxis = frame.getXAxis();
    XYAxis yAxis = frame.getYAxis();
    final long[] paintTime=new long[1];
    final long[] paints=new long[1];
    final ScatterXYPlotLine line = new ScatterXYPlotLine(xAxis, yAxis) {
      int skip;
      @Override
      protected void paintComponent(Graphics g) {
        long start = System.nanoTime();
        super.paintComponent(g);
        if(skip++>1000) {
        paintTime[0] += System.nanoTime() - start;
        paints[0]++;
        }
      }
    };
    line.setForeground(Color.white);
    final SimpleXYDataset d = new SimpleXYDataset(line);
    d.setMaxCapacity(1000);
    d.setXData(line.getXData());
    d.setYData(line.getYData());
    frame.addPlotLine(line);

    yAxis.setStart(-1.2);
    yAxis.setEnd(1.2);
    xAxis.setStart(-1.2);
    xAxis.setEnd(1.2);

    final int n = 2000;
    for(int x = 0; x <= n; x++) {
View Full Code Here

Examples of plotter.xy.XYAxis

  public static void main(String[] args) {
    XYPlotFrame frame = new XYPlotFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setup();

    XYAxis xAxis = frame.getXAxis();
    XYAxis yAxis = frame.getYAxis();
    LinearXYPlotLine[] lines = new LinearXYPlotLine[8];
    SimpleXYDataset[] datasets = new SimpleXYDataset[lines.length];
    for(int i = 0; i < lines.length; i++) {
      LinearXYPlotLine line = new LinearXYPlotLine(xAxis, yAxis, XYDimension.X);
      SimpleXYDataset d = new SimpleXYDataset(line);
      d.setMaxCapacity(1000);
      d.setXData(line.getXData());
      d.setYData(line.getYData());
      frame.addPlotLine(line);
      lines[i] = line;
      datasets[i] = d;
    }

    yAxis.setStart(0);
    yAxis.setEnd(11);
    xAxis.setStart(0);
    xAxis.setEnd(2 * Math.PI);

    lines[0].setMissingPointMode(MissingPointMode.NONE);
    lines[1].setMissingPointMode(MissingPointMode.LEFT);
 
View Full Code Here

Examples of plotter.xy.XYAxis

    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setup();
    Timer timer = new Timer();

    final LinearXYAxis xAxis = (LinearXYAxis) frame.getXAxis();
    final XYAxis yAxis = frame.getYAxis();
    xAxis.setTickMarkCalculator(new TimeTickMarkCalculator());
    xAxis.setFormat(new DateNumberFormat(new SimpleDateFormat("yyyy-MM-dd\nHH:mm:ss.SSS")));

    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());
    final XYMarkerLine marker = new XYMarkerLine(xAxis, 60);
    marker.setForeground(Color.yellow);
    XYPlotContents contents = frame.getContents();
    contents.add(marker);
    final XYMarkerLine marker2 = new XYMarkerLine(yAxis, .5);
    marker2.setForeground(Color.red);
    contents.add(marker2);
    frame.addPlotLine(line);

    yAxis.setStart(-1.2);
    yAxis.setEnd(1.2);
    xAxis.setStart(0);
    xAxis.setEnd(10);

    frame.getLocationDisplay().setFormat(new MessageFormat("<html><b>X:</b> {0,date,HH:mm:ss} &nbsp; <b>Y:</b> {1}</html>"));
    frame.getSlopeLineDisplay().setFormat(new MessageFormat("<html><b>&Delta;x:</b> {0,date,HH:mm:ss}  <b>&Delta;y:</b> {1}</html>"));
View Full Code Here

Examples of plotter.xy.XYAxis

  }


  private static SimpleXYDataset createPlot(Container contentPane) {
    final XYPlot plot = new XYPlot();
    XYAxis xAxis = new LinearXYAxis(XYDimension.X);
    XYAxis yAxis = new LinearXYAxis(XYDimension.Y);
    xAxis.setPreferredSize(new Dimension(1, 40));
    yAxis.setPreferredSize(new Dimension(40, 1));
    xAxis.setForeground(Color.white);
    yAxis.setForeground(Color.white);
    xAxis.setTextMargin(10);
    yAxis.setTextMargin(10);
    plot.add(xAxis);
    plot.add(yAxis);
    plot.setXAxis(xAxis);
    plot.setYAxis(yAxis);
    plot.setBackground(Color.darkGray);
    XYPlotContents contents = new XYPlotContents();
    contents.setBackground(Color.black);
    plot.setBackground(Color.darkGray);
    XYGrid grid = new XYGrid(xAxis, yAxis);
    grid.setForeground(Color.lightGray);
    contents.add(grid);
    plot.add(contents);
    plot.setPreferredSize(new Dimension(150, 100));
   
    contentPane.setBackground(Color.darkGray);
   
    XYLocationDisplay locationDisplay = new XYLocationDisplay();
    // This is a hack to set the preferred height to the normal height so the component doesn't collapse to height 0 when the text is empty.
    // Note that mimimumSize does not work for some reason.
    locationDisplay.setText("Ag");
    Dimension size = locationDisplay.getPreferredSize();
    size.width = 100;
    locationDisplay.setText("");
    locationDisplay.setPreferredSize(size);
    // End hack
    locationDisplay.setForeground(Color.white);
    locationDisplay.setFont(new Font("Arial", 0, 12));
    locationDisplay.setFormat(new MessageFormat("<html><b>X:</b> {0} &nbsp; <b>Y:</b> {1}</html>"));
    locationDisplay.attach(plot);
    plot.add(locationDisplay);

    SlopeLine slopeLine = new SlopeLine();
    slopeLine.setForeground(Color.white);
    slopeLine.attach(plot);

    SlopeLineDisplay slopeLineDisplay = new SlopeLineDisplay();
    slopeLine.addListenerForPlot(plot, slopeLineDisplay);
    slopeLineDisplay.setFont(new Font("Arial", 0, 12));
    slopeLineDisplay.setForeground(Color.white);
    slopeLineDisplay.setFormat(new MessageFormat("<html><b>&Delta;x:</b> {0}  <b>&Delta;y:</b> {1}</html>"));
    plot.add(slopeLineDisplay);

    contentPane.add(plot);
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.X_AXIS));

    new DefaultXYLayoutGenerator().generateLayout(plot);

    final LinearXYPlotLine line = new LinearXYPlotLine(xAxis, yAxis, XYDimension.X);
    line.setForeground(Color.white);
    final SimpleXYDataset d = new SimpleXYDataset(line);
    d.setMaxCapacity(10000);
    d.setXData(line.getXData());
    d.setYData(line.getYData());
    contents.add(line);
    contents.setComponentZOrder(grid, contents.getComponentCount() - 1);

    yAxis.setStart(-20);
    yAxis.setEnd(20);
    xAxis.setStart(0);
    xAxis.setEnd(10000);
    return d;
  }
View Full Code Here

Examples of plotter.xy.XYAxis

  public static void main(String[] args) {
    XYPlotFrame frame = new XYPlotFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setup();

    XYAxis xAxis = frame.getXAxis();
    XYAxis yAxis = frame.getYAxis();
    final ScatterXYPlotLine line = new ScatterXYPlotLine(xAxis, yAxis);
    GeneralPath pointShape = new GeneralPath();
    pointShape.moveTo(-5, -5);
    pointShape.lineTo(-5, 5);
    pointShape.lineTo(5, 5);
    pointShape.lineTo(5, -5);
    pointShape.lineTo(-5, -5);
    line.setPointFill(pointShape);
    line.setForeground(Color.white);
    final SimpleXYDataset d = new SimpleXYDataset(line);
    d.setMaxCapacity(1000);
    d.setXData(line.getXData());
    d.setYData(line.getYData());
    frame.addPlotLine(line);

    yAxis.setStart(-10);
    yAxis.setEnd(10);
    xAxis.setStart(-10);
    xAxis.setEnd(10);

    for(int p = 0; p <= 10; p++) {
      double r = p;
View Full Code Here

Examples of plotter.xy.XYAxis

  }


  private static SimpleXYDataset createPlot(Container contentPane, boolean invertX, boolean invertY) {
    final XYPlot plot = new XYPlot();
    XYAxis xAxis = new LinearXYAxis(XYDimension.X);
    XYAxis yAxis = new LinearXYAxis(XYDimension.Y);
    xAxis.setPreferredSize(new Dimension(1, 40));
    yAxis.setPreferredSize(new Dimension(40, 1));
    xAxis.setForeground(Color.white);
    yAxis.setForeground(Color.white);
    xAxis.setTextMargin(10);
    yAxis.setTextMargin(10);
    plot.add(xAxis);
    plot.add(yAxis);
    plot.setXAxis(xAxis);
    plot.setYAxis(yAxis);
    plot.setBackground(Color.darkGray);
    XYPlotContents contents = new XYPlotContents();
    contents.setBackground(Color.black);
    plot.setBackground(Color.darkGray);
    XYGrid grid = new XYGrid(xAxis, yAxis);
    grid.setForeground(Color.lightGray);
    contents.add(grid);
    plot.add(contents);
    plot.setPreferredSize(new Dimension(150, 100));
   
    contentPane.setBackground(Color.darkGray);
   
    XYLocationDisplay locationDisplay = new XYLocationDisplay();
    // This is a hack to set the preferred height to the normal height so the component doesn't collapse to height 0 when the text is empty.
    // Note that mimimumSize does not work for some reason.
    locationDisplay.setText("Ag");
    Dimension size = locationDisplay.getPreferredSize();
    size.width = 100;
    locationDisplay.setText("");
    locationDisplay.setPreferredSize(size);
    // End hack
    locationDisplay.setForeground(Color.white);
    locationDisplay.setFont(new Font("Arial", 0, 12));
    locationDisplay.setFormat(new MessageFormat("<html><b>X:</b> {0} &nbsp; <b>Y:</b> {1}</html>"));
    locationDisplay.attach(plot);
    plot.add(locationDisplay);

    SlopeLine slopeLine = new SlopeLine();
    slopeLine.setForeground(Color.white);
    slopeLine.attach(plot);
   
    SlopeLineDisplay slopeLineDisplay = new SlopeLineDisplay();
    slopeLine.addListenerForPlot(plot, slopeLineDisplay);
    slopeLineDisplay.setFont(new Font("Arial", 0, 12));
    slopeLineDisplay.setForeground(Color.white);
    slopeLineDisplay.setFormat(new MessageFormat("<html><b>&Delta;x:</b> {0}  <b>&Delta;y:</b> {1}</html>"));
    plot.add(slopeLineDisplay);

    new DefaultXYLayoutGenerator().generateLayout(plot);

    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.X_AXIS));
    contentPane.add(plot);

    final LinearXYPlotLine line = new LinearXYPlotLine(xAxis, yAxis, XYDimension.X);
    line.setForeground(Color.white);
    final SimpleXYDataset d = new SimpleXYDataset(line);
    d.setMaxCapacity(10000);
    d.setXData(line.getXData());
    d.setYData(line.getYData());
    contents.add(line);
    contents.setComponentZOrder(grid, contents.getComponentCount() - 1);

    if(invertY) {
      yAxis.setStart(200);
      yAxis.setEnd(0);
    } else {
      yAxis.setStart(0);
      yAxis.setEnd(200);
    }
    if(invertX) {
      xAxis.setStart(5);
      xAxis.setEnd(0);
    } else {
View Full Code Here

Examples of plotter.xy.XYAxis

   
    testPlot.setCompressionEnabled(false);
    Assert.assertFalse(testPlot.isCompressionEnabled());
   
   
    XYAxis xAxis = plotView.getXAxis();
    XYAxis yAxis = plotView.getYAxis();
    LinearXYPlotLine plot = new LinearXYPlotLine(xAxis, yAxis, XYDimension.X);
    Font font = new Font("Arial", Font.PLAIN, 10);
    LegendEntry legend = new LegendEntry(Color.white,  Color.white, font, new AbbreviatingPlotLabelingAlgorithm());
    legend.setPlot(plot);
    PlotDataSeries data = new PlotDataSeries(testPlot, "test", Color.white);
View Full Code Here

Examples of plotter.xy.XYAxis

   
    setupLayout();
  }
 
  public void setXBounds(double minimum, double maximum) {   
    XYAxis axis = getXAxis();
    if (axis == null) {
      axis = new LinearXYAxis(XYDimension.X);
      setXAxis(axis);
      colorize(axis);
    }
    axis.setStart(minimum);
    axis.setEnd(maximum);
  }
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.