• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Trace2DLtd类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中info.monitorenter.gui.chart.traces.Trace2DLtd的典型用法代码示例。如果您正苦于以下问题:Java Trace2DLtd类的具体用法?Java Trace2DLtd怎么用?Java Trace2DLtd使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Trace2DLtd类属于info.monitorenter.gui.chart.traces包,在下文中一共展示了Trace2DLtd类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: update

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
public void update(NARState state) {
    Map.Entry<Long, HashMap<String, Object>> entry = state.lastEntry();
    long when = entry.getKey();
    HashMap<String, Object> data = entry.getValue();
    
    for (String p : params.keySet()) {
        Object value = data.get(p);
        Trace2DLtd trace = params.get(p);
        if (value!=null) {
            if (value instanceof Double)
               trace.addPoint(when, (Double)value);
            if (value instanceof Float)
               trace.addPoint(when, (Float)value);
            if (value instanceof Integer)
               trace.addPoint(when, (Integer)value);
        }
    }
}
 
开发者ID:automenta,项目名称:opennars,代码行数:19,代码来源:ChartPanel.java


示例2: addIsaTrace

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
public void addIsaTrace(int tid) {
	if (!isaTraces.containsKey(tid)) {
		ITrace2D trace = new Trace2DLtd(100);
		trace.setColor(chartColors[isaTraces.size()%10]);
		if (server.getIsaTracePainter().equalsIgnoreCase("bar")) {
			trace.setTracePainter(new TracePainterVerticalBar(3, isaChart));
		} else {
			trace.setStroke(new BasicStroke(1.5f));
		}
		trace.setName(terminalMap.get(tid).name);

		// Add the trace to the chart:
		synchronized(getTreeLock()) {
			isaChart.addTrace(trace);
		}
		isaTraces.put(tid, trace);
	}
}
 
开发者ID:lfv-mssm,项目名称:yada,代码行数:19,代码来源:WorkspaceView.java


示例3: testAddRemoveTrace

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * Creates an empty chart adds a trace, removes it again and displays it.
 * <p>
 * 
 * @throws InterruptedException
 *           if sleeping is interrupted.
 */
public void testAddRemoveTrace() throws InterruptedException {
  JFrame frame = new JFrame(this.getClass().getName());
  Dimension size = new Dimension(400,400);
  Chart2D chart = new Chart2D();
  chart.setPreferredSize(size);
  ITrace2D trace = new Trace2DLtd();
  chart.addTrace(trace);
  chart.removeTrace(trace);
  frame.getContentPane().add(chart);
  frame.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  frame.pack();
  frame.setVisible(true);
  while (frame.isVisible()) {
    Thread.sleep(1000);
  }
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:24,代码来源:TestAddRemoveTrace.java


示例4: testLabelSpacing

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * Creates a a chart with three traces and different labels and displays it.
 * <p>
 * 
 * @throws InterruptedException
 */
public void testLabelSpacing() throws InterruptedException {
  JFrame frame = new JFrame(this.getName());
  Chart2D chart = new Chart2D();
  ITrace2D trace1 = new Trace2DLtd();
  trace1.setName("lottolotto");
  trace1.setColor(Color.RED);
  chart.addTrace(trace1);

  ITrace2D trace2 = new Trace2DLtd();
  trace2.setName("bbb");
  trace2.setColor(Color.BLUE);
  chart.addTrace(trace2);

  ITrace2D trace3 = new Trace2DLtd();
  trace3.setColor(Color.BLACK);
  trace3.setName("ffollejolle");
  chart.addTrace(trace3);
  frame.getContentPane().add(chart);
  frame.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  frame.setSize(new Dimension(400, 300));
  frame.setVisible(true);
  while (frame.isVisible()) {
    Thread.sleep(1000);
  }
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:32,代码来源:LabelSpacingTestChart.java


示例5: InitChart

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * Initialize a chart.  This should happen before you want to use
 * the chart, either for storing data or displaying data.  It's best
 * to delay the inits until you need them, because making a lot of charts
 * seems to slow down chart interactions.
 *
 * @param name Name of the trace you want to init
 * @return the created chart object
 */
public Chart2D InitChart(String name)
{
    Chart2D chart = new Chart2D();

    ITrace2D trace = new Trace2DLtd(chartData.sparklineChartSize, name);

    chart.addTrace(trace);

    // add marker lines to the trace
    TracePainterDisc markerPainter = new TracePainterDisc();
    markerPainter.setDiscSize(2);
    trace.addTracePainter(markerPainter);

    return chart;
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:25,代码来源:ObjectPanel.java


示例6: onMessage

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
@Override
public void onMessage(MessageInfo info, IMCMessage message) {
	if (message.getAbbrev().equals(messageToDisplay)) {
		int entity = message.getHeader().getInteger("src_ent");
		String name = variableToDisplay;
		if (aliases.containsKey(entity))		
			name = aliases.get(entity);
		else if (entity != 255)
			name = variableToDisplay+"."+entity;
		if (traces.get(name) == null) {
			traces.put(name, new Trace2DLtd(name));
			traces.get(name).setColor(colors[(colorIndex++)%colors.length]);
			chart.addTrace(traces.get(name));				
		}
		traces.get(name).addPoint(System.currentTimeMillis()/1000.0-startTime, message.getDouble(variableToDisplay));			
	}
}
 
开发者ID:LSTS,项目名称:imcjava,代码行数:18,代码来源:ChartPanel.java


示例7: ChartPanel

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
public ChartPanel(String... params) {
    super(new BorderLayout());

    
    int historySize = 200;
    
    chart = new Chart2D();
    chart.setBorder(new EmptyBorder(0,0,0,0));
    //chart.setSize(200,200);
    chart.setUseAntialiasing(true);
    chart.setBackground(Color.BLACK);
    chart.setForeground(Color.WHITE);
    chart.setGridColor(Color.darkGray);
    for (IAxis left : chart.getAxesYLeft()) {
        left.setAxisTitle(new AxisTitle(""));
        left.setPaintGrid(true);
    }
 
    for (IAxis bottom : chart.getAxesXBottom()) {
        bottom.setVisible(false);
    }        

    for (String p : params) {
        Trace2DLtd t = new Trace2DLtd(historySize, p);
        t.setColor(Color.getHSBColor( ((float)(p.hashCode()%1024))/1024.0f, 0.5f, 1.0f));
        chart.addTrace(t);
        this.params.put(p, t);
    }
    
    
    add(chart, BorderLayout.CENTER);        
}
 
开发者ID:automenta,项目名称:opennars,代码行数:33,代码来源:ChartPanel.java


示例8: main

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * Main entry.
 * <p>
 * 
 * @param args
 *          ignored
 */
public static void main(final String[] args) {
  // Create a chart:
  Chart2D chart = new Chart2D();
  // Create an ITrace:
  // Note that dynamic charts need limited amount of values!!!
  ITrace2D trace = new Trace2DLtd(100);
  trace.setColor(Color.RED);

  // Add the trace to the chart:
  chart.addTrace(trace);
  IAxis<?> axisX = chart.getAxisX();
  axisX.setStartMajorTick(false);
  axisX.setMajorTickSpacing(10);
  // Make it visible:
  // Create a frame.
  JFrame frame = new JFrame("MinimalDynamicChart");
  // add the chart to the frame:
  frame.getContentPane().add(chart);
  frame.setSize(400, 300);
  // Enable the termination button [cross on the upper right edge]:
  frame.addWindowListener(new WindowAdapter() {
    /**
     * @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)
     */
    @Override
    public void windowClosing(final WindowEvent e) {
      System.exit(0);
    }
  });
  frame.setVisible(true);
  // Every 20 milliseconds a new value is collected.
  ADataCollector collector = new RandomDataCollectorOffset(trace, 100);
  collector.start();
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:42,代码来源:MinimalDynamicChart.java


示例9: init

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * @see java.applet.Applet#init()
 */
@Override
public void init() {
  super.init();
  Chart2D chart = new Chart2D();
  this.setChart(chart);
  this.setSize(new Dimension(600, 500));
  this.m_chart.getAxisX().setPaintGrid(true);
  this.m_chart.getAxisY().setPaintGrid(true);
  chart.getAxisY().setRangePolicy(new RangePolicyMinimumViewport(new Range(-20, +20)));
  chart.setGridColor(Color.LIGHT_GRAY);
  this.setTrace(new Trace2DLtd(100));
  this.getTrace().setName("random");
  this.getTrace().setPhysicalUnits("Milliseconds", "random value");
  this.getTrace().setColor(Color.RED);
  chart.addTrace(this.getTrace());
  Container content = this.getContentPane();
  content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));
  LayoutFactory factory = LayoutFactory.getInstance();
  ChartPanel chartpanel = new ChartPanel(chart);

  this.setJMenuBar(factory.createChartMenuBar(chartpanel, false));

  content.add(chartpanel);
  content.addPropertyChangeListener(chartpanel);
  this.setCollector(new RandomDataCollectorOffset(this.getTrace(), 50));
  content.add(new ControlPanel());
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:31,代码来源:Showcase.java


示例10: main

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * Demo application startup method.
 * <p>
 * 
 * @param args
 *          ignored.
 * @throws IOException
 *           if loading data for the demo chart fails.
 */
public static void main(final String[] args) throws IOException {
  Chart2D chart = new Chart2D();
  chart.enablePointHighlighting(true);
  chart.setToolTipType(Chart2D.ToolTipType.VALUE_SNAP_TO_TRACEPOINTS);
  ITrace2D trace = new Trace2DLtd(400);

  AStaticDataCollector collector = new PropertyFileStaticDataCollector(trace,
      CoordinateViewChart.class.getResourceAsStream("data.properties"));
  chart.addTrace(trace);
  trace.setPointHighlighter(new PointPainterDisc(10));
  collector.collectData();
  new CoordinateViewChart(chart);

}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:24,代码来源:CoordinateViewChart.java


示例11: main

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * Main entry.
 * <p>
 * 
 * @param args
 *          ignored.
 */
public static void main(final String[] args) {

  Chart2D chart = new Chart2D();
  chart.setUseAntialiasing(true);
  chart.setMinPaintLatency(20);
  ITrace2D data = new Trace2DLtd(300);
  data.setStroke(new BasicStroke(3));
  data.setColor(new Color(255, 0, 0, 255));
  data.setName("random");
  data.setPhysicalUnits("hertz", "ms");

  ITracePainter<?> dotPainter = new TracePainterPolyline();
  data.setTracePainter(dotPainter);
  chart.addTrace(data);

  AntialiasingChart wnd = new AntialiasingChart(chart, "AntialiasingChart");
  chart.getAxisX().setPaintGrid(true);
  chart.getAxisX().setStartMajorTick(false);
  chart.getAxisY().setPaintGrid(true);

  chart.getAxisX().setPaintScale(true);
  chart.getAxisX().setPaintScale(true);

  // force ranges:
  chart.getAxisY().setRangePolicy(new RangePolicyMinimumViewport(new Range(-1e4, +1e4)));
  // chart.setFont(new Font(null,0,12));
  wnd.setLocation(200, 300);
  wnd.setSize(700, 210);
  wnd.setResizable(true);
  wnd.setVisible(true);
  new ObjRecorder2Trace2DAdapter(data, new RandomBumper(0.5, 1000), "m_number", 1000);
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:40,代码来源:AntialiasingChart.java


示例12: TimeseriesChartPanel

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
public TimeseriesChartPanel(String title,
                            String xAxisLabel, String yAxisLabel,
                            ImmutableSortedMap<Integer, String> seriesIDToName,
                            int numVisible,
                            float min, float max) {
    super();
    initComponents();
    
    this.title = title;
    
    for (Map.Entry<Integer, String> e : seriesIDToName.entrySet()) {
        ITrace2D trace = new Trace2DLtd(numVisible);
        trace.setName(e.getValue());
        trace.setColor(ChartsDrawer.colors[e.getKey()]);
        trace.setStroke(ChartsDrawer.strokes[e.getKey()]);
        traces.put(e.getKey(), trace);
        this.addTrace(trace);
    }
    
    IAxis yAxis = this.getAxisY();
    //yAxis.setAxisTitle(new AxisTitle(yAxisLabel));
    yAxis.setRangePolicy(new ChartsDrawer.RangePolicyMaxSeen(min, max));
    yAxis.getAxisTitle().setTitle(null);
    //yAxis.setVisible(false);
    IAxis xAxis = this.getAxisX();
    //xAxis.setAxisTitle(new AxisTitle(xAxisLabel));
    //xAxis.setVisible(false);
    xAxis.getAxisTitle().setTitle(null);
    xAxis.setPaintScale(false);
}
 
开发者ID:heig-iict-ida,项目名称:ardrone_gesture,代码行数:31,代码来源:TimeseriesChartPanel.java


示例13: TraceDescription

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
public TraceDescription(int datapointsToKeep, String name, Color color,
		IAxis<?> xAxis, IAxis<?> yAxis) {
	super();
	this.xAxis = xAxis;
	this.yAxis = yAxis;
	lastArrivalTimeNanos = System.nanoTime();
	trace = new Trace2DLtd(datapointsToKeep, name);
	trace.setColor(color);
}
 
开发者ID:Metaswitch,项目名称:fmj,代码行数:10,代码来源:TraceDescription.java


示例14: SpotsChart

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
public SpotsChart() {
    trace = new Trace2DLtd(200);
    trace.setColor(Color.RED);
    addTrace(trace);
}
 
开发者ID:spotware,项目名称:connect-java-tutorials,代码行数:6,代码来源:SpotsChart.java


示例15: main

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * Main entry.
 * <p>
 * 
 * @param args
 *          ignored
 */
public static void main(final String[] args) {
  // Create a chart:
  Chart2D chart = new Chart2D();
  chart.getAxisX().setFormatter(
      new LabelFormatterDate((SimpleDateFormat) DateFormat.getDateTimeInstance()));

  // Create an ITrace:
  // Note that dynamic charts need limited amount of values!!!
  ITrace2D trace = new Trace2DLtd(600);
  trace.setColor(Color.RED);
  trace.setTracePainter(new TracePainterDisc(4));

  // Create an arithmetic mean trace.
  ITrace2D traceArithmeticMean = new Trace2DArithmeticMean(200);
  // hook it to the initial trace:
  trace.addComputingTrace(traceArithmeticMean);

  // Add the trace to the chart:
  chart.addTrace(trace);

  // Add the arithmetic mean trace to the chart too:
  chart.addTrace(traceArithmeticMean);

  // Make it visible:
  // Create a frame.
  JFrame frame = new JFrame("DynamicChart with arithmetic mean");
  // add the chart to the frame:
  frame.getContentPane().add(new ChartPanel(chart));
  frame.setSize(600, 300);
  // Enable the termination button [cross on the upper right edge]:
  frame.addWindowListener(new WindowAdapter() {
    /**
     * @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)
     */
    @Override
    public void windowClosing(final WindowEvent e) {
      System.exit(0);
    }
  });
  frame.setVisible(true);
  // Every 50 milliseconds a new value is collected.
  ADataCollector collector = new RandomDataCollectorTimeStamped(trace, 100);
  collector.start();
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:52,代码来源:DynamicChartWithArithmeticMeanTrace.java


示例16: main

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * Creates a new JFrame and adds a chart that uses advanced features.
 * <p>
 * 
 * @param args
 *          command line arguments, unused.
 */
public static void main(final String[] args) {
  // Create a chart:
  Chart2D chart = new Chart2D();
  
  // We want to use a date format for the y axis.
  // Currently works only this way:
  AAxis<IAxisScalePolicy> yAxis = new AxisLinear<IAxisScalePolicy>();

  // Number formatter does not work for AxisAutoUnit.
  AAxis<IAxisScalePolicy> xAxis = new AxisLinear<IAxisScalePolicy>();
  
  // Set a date formatter:
  yAxis.setFormatter(new LabelFormatterDate(new SimpleDateFormat("HH:mm:ss")));
  chart.setAxisYLeft(yAxis, 0);

  // set a number formatter to get rid of the unnecessary ".0" prefixes for
  // the X-Axis:
  NumberFormat format = new DecimalFormat("#");
  // Important!
  // Or it will allow more than 100 integer digits and rendering will be
  // confused.
  // See the comment for java.text.DecimalFormat#applyPattern(String)
  format.setMaximumIntegerDigits(3);
  xAxis.setFormatter(new LabelFormatterNumber(format));

  chart.setAxisXBottom(xAxis, 0);
  // Try a range policy:
  // This must not be invoked before the Axis is connected to a Chart2D
  // (chart.setXAxis...)
  xAxis.setRangePolicy(new RangePolicyMinimumViewport(new Range(-10, +10)));

  // Create an ITrace:
  // Note that dynamic charts need limited amount of values!!!

  ITrace2D trace = new Trace2DLtd(400);
  trace.setColor(Color.RED);

  // set a stroke (pattern to render the trace)
  Stroke stroke = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 10.0f,
  // dash pattern, dash limit
      new float[] {15f, 10f }, 5f);
  trace.setStroke(stroke);

  // Add the trace to the chart:
  chart.addTrace(trace);

  // Make it visible:
  // Create a frame.
  JFrame frame = new JFrame("AdvancedDynamicChart");
  // add the chart to the frame:
  frame.getContentPane().add(new ChartPanel(chart));
  frame.setSize(400, 300);
  // Enable the termination button [cross on the upper right edge]:
  frame.addWindowListener(new WindowAdapter() {
    /**
     * @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)
     */
    @Override
    public void windowClosing(final WindowEvent e) {
      System.exit(0);
    }
  });
  frame.setVisible(true);
  // Every 500 milliseconds a new value is collected.
  // The AxisSwap changes x and y data. Just a proof of concept.
  ADataCollector collector = new RandomDataCollectorTimeStamped(new Trace2DAxisSwap(trace), 50);
  collector.start();
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:76,代码来源:AdvancedDynamicChart.java


示例17: main

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * Main entry.
 * <p>
 * 
 * @param args
 *          ignored.
 */
@SuppressWarnings("unchecked")
public static void main(final String[] args) {
  try {
    Class< ? extends ITrace2D>[] traces = new Class[] {Trace2DSimple.class,
        Trace2DBijective.class, Trace2DReplacing.class, Trace2DSorted.class, Trace2DLtd.class,
        Trace2DLtdReplacing.class, Trace2DLtdSorted.class };
    RandomPoints rand = new RandomPoints(0, 3, 0, 3);

    Chart2D test = new Chart2D();
    JFrame frame = new JFrame("TraceTester");
    frame.addWindowListener(new WindowAdapter() {
      /**
       * @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)
       */
      @Override
      public void windowClosing(final WindowEvent e) {
        System.exit(0);
      }
    });

    frame.getContentPane().add(test);
    frame.setSize(600, 500);
    frame.setLocation(200, 200);
    frame.setVisible(true);
    ITrace2D current = null;
    for (int i = 0; i < traces.length; i++) {
      current = traces[i].newInstance();
      test.addTrace(current);
      frame.setTitle("TraceTester: full-random, current: " + traces[i].getName());

      for (int j = 0; j < 200; j++) {
        current.addPoint(rand.nextPoint());
        Thread.sleep(50);
      }
      Thread.sleep(2000);
      test.removeTrace(current);
    }
    rand = new HalfRandomPoints(0, 3, 0, 3);
    for (int i = 0; i < traces.length; i++) {
      current = traces[i].newInstance();
      test.addTrace(current);
      frame.setTitle("TraceTester: repeating x 10 times, current: " + traces[i].getName());

      for (int j = 0; j < 200; j++) {
        current.addPoint(rand.nextPoint());
        Thread.sleep(50);
      }
      Thread.sleep(2000);
      test.removeTrace(current);
    }

    System.exit(0);

  } catch (Throwable f) {
    f.printStackTrace();
    System.exit(0);
  }
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:66,代码来源:TraceTester.java


示例18: main

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * Main entry.
 * <p>
 * 
 * @param args
 *          ignored.
 */
public static void main(final String[] args) {

  // Create a chart:
  Chart2D chart = new Chart2D();
  // set a special axis:
  chart.setAxisYLeft(new AxisLogE<AxisScalePolicyTransformation>(), 0);

  // Create an ITrace:
  ITrace2D trace = new Trace2DSimple("exponential");
  // Add the trace to the chart:
  chart.addTrace(trace);
  // configure trace:
  trace.setTracePainter(new TracePainterDisc());
  trace.setColor(Color.DARK_GRAY);
  // Add the function 1/x + random
  for (int i = 1; i < 50; i++) {
    trace.addPoint(i, Math.exp(i));
  }
  
  ITrace2D trace2 = new Trace2DLtd("linear");
  trace2.setTracePainter(new TracePainterDisc());
  trace2.setColor(Color.BLUE);
  chart.addTrace(trace2);
  for (int i = 1; i < 50; i++) {
    trace2.addPoint(i, i);
  }
  

  // Make it visible:
  // Create a frame.
  JFrame frame = new JFrame(LogAxisChart.class.getName());
  // add the chart to the frame:
  frame.getContentPane().add(new ChartPanel(chart));
  frame.setSize(400, 300);
  // Enable the termination button [cross on the upper right edge]:
  frame.addWindowListener(new WindowAdapter() {
    /**
     * @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)
     */
    @Override
    public void windowClosing(final WindowEvent e) {
      System.exit(0);
    }
  });
  frame.setVisible(true);
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:54,代码来源:LogAxisChart.java


示例19: main

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * Main enbtry for demo app.
 * <p>
 * 
 * @param args
 *          ignored.
 */
public static void main(final String[] args) {
  // some data:
  final double[] data = new double[100];
  for (int i = 0; i < 100; i++) {
    data[i] = Math.random() * i + 1;
  }
  final JFrame frame = new JFrame("ChartPanel demo");
  final Chart2D chart = new Chart2D();
  // trace 1
  final ITrace2D trace1 = new Trace2DLtd(100);
  trace1.setName("Trace 1");

  // AbstractDataCollector collector1 = new
  // RandomDataCollectorOffset(trace1,500);
  // trace2
  final ITrace2D trace2 = new Trace2DLtd(100);
  trace2.setName("Trace 2");
  // add to chart
  chart.addTrace(trace1);
  chart.addTrace(trace2);
  // AbstractDataCollector collector2 = new
  // RandomDataCollectorOffset(trace2,500);
  for (int i = 0; i < 100; i++) {
    trace1.addPoint(i + 2, data[i]);
    trace2.addPoint(i + 2, 100 - data[i]);
  }

  final ChartPanel cPanel = new ChartPanel(chart);
  frame.getContentPane().add(cPanel);
  frame.setSize(new Dimension(400, 600));
  frame.addWindowListener(new WindowAdapter() {
    /**
     * @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)
     */
    @Override
    public void windowClosing(final WindowEvent w) {
      System.exit(0);
    }

  });
  frame.setJMenuBar(LayoutFactory.getInstance().createChartMenuBar(cPanel, false));
  frame.setVisible(true);
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:51,代码来源:ChartPanel.java


示例20: createTraces

import info.monitorenter.gui.chart.traces.Trace2DLtd; //导入依赖的package包/类
/**
 * @see info.monitorenter.gui.chart.test.ATestJChart2D#createTraces()
 */
@Override
protected ITrace2D[] createTraces() {
  return new ITrace2D[] {new Trace2DLtd(200) };
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:8,代码来源:TestTracePoint2D.java



注:本文中的info.monitorenter.gui.chart.traces.Trace2DLtd类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MRAppWithHistory类代码示例发布时间:2022-05-22
下一篇:
Java TransactionAttempt类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap