当前位置: 首页>>代码示例>>Java>>正文


Java Trace2DLtd类代码示例

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


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


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