コード例 #1
0
 @Override
 public void propertyChanged(Property property) {
   if (property == min || property == max) {
     m_plotRange = new Range(min.getValue(), max.getValue());
     m_meter.setRange(m_plotRange);
   } else if (property == tickInterval) {
     m_meter.setTickSize(tickInterval.getValue());
   }
 }
コード例 #2
0
  @Override
  public void init() {
    setLayout(new BorderLayout());

    m_meter = new MeterPlot(data);
    m_plotRange = new Range(min.getValue(), max.getValue());
    m_meter.setRange(m_plotRange);
    // plot.addInterval(new MeterInterval("High", new Range(80.0, 100.0)));
    JFreeChart chart =
        new JFreeChart(getFieldName(), JFreeChart.DEFAULT_TITLE_FONT, m_meter, false);
    chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new Dimension(250, 150));

    propertyChanged(tickInterval);

    add(chartPanel, BorderLayout.CENTER);
    revalidate();
    repaint();
  }