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


Java Chart2D.setGridColor方法代码示例

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


在下文中一共展示了Chart2D.setGridColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ChartPanel

import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的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

示例2: init

import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的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


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