本文整理汇总了Java中info.monitorenter.gui.chart.Chart2D.setPaintLabels方法的典型用法代码示例。如果您正苦于以下问题:Java Chart2D.setPaintLabels方法的具体用法?Java Chart2D.setPaintLabels怎么用?Java Chart2D.setPaintLabels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类info.monitorenter.gui.chart.Chart2D
的用法示例。
在下文中一共展示了Chart2D.setPaintLabels方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ChartPanel
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
/**
* Creates an instance that decorates the given chart with controls in form of
* popup menus.
* <p>
*
* @param chart
* A configured Chart2D instance that will be displayed and
* controlled by this panel.
*
* @param adaptUI2Chart
* if true the menu will adapt it's basic UI properties (font,
* foreground and background color) to the given chart.
*/
public ChartPanel(final Chart2D chart, final boolean adaptUI2Chart) {
super();
this.m_chart = chart;
this.setBackground(chart.getBackground());
// we paint our own labels
chart.setPaintLabels(false);
// get the layout factory for popup menus:
final LayoutFactory factory = LayoutFactory.getInstance();
factory.createChartPopupMenu(this, adaptUI2Chart);
// layout
this.setLayout(new BorderLayout());
this.add(chart, BorderLayout.CENTER);
// initial Labels
// put to a flow layout panel
this.m_labelPanel = new JPanel();
this.m_labelPanel.setFont(chart.getFont());
this.m_labelPanel.setLayout(new FlowLayoutCorrectMinimumSize(FlowLayout.LEFT));
this.m_labelPanel.setBackground(chart.getBackground());
JLabel label;
for (final ITrace2D trace : chart) {
label = factory.createTraceContextMenuLabel(chart, trace, true);
if (label != null) {
this.m_labelPanel.add(label);
}
// In case trace.getLabel() becomes empty hide the corresponding
// menu label via listeners!
trace.addPropertyChangeListener(ITrace2D.PROPERTY_PHYSICALUNITS, this);
trace.addPropertyChangeListener(ITrace2D.PROPERTY_NAME, this);
}
this.add(this.m_labelPanel, BorderLayout.SOUTH);
chart.addPropertyChangeListener("background", this);
// listen to new traces and deleted ones:
chart.addPropertyChangeListener(Chart2D.PROPERTY_ADD_REMOVE_TRACE, this);
}
示例2: createChart
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
private Chart2D createChart() {
Chart2D chart = new Chart2D();
chart.setPaintLabels(true);
chart.setUseAntialiasing(true);
chart.setToolTipType(Chart2D.ToolTipType.VALUE_SNAP_TO_TRACEPOINTS);
x_achse = chart.getAxisX();
x_achse.getAxisTitle().setTitle("Minuten");
x_achse.setPaintScale(true);
x_achse.setVisible(true);
x_achse.setPaintGrid(false);
x_achse.setMajorTickSpacing(10);
x_achse.setMinorTickSpacing(1);
IAxis<?> y_achse = chart.getAxisY();
y_achse.getAxisTitle().setTitle("");
y_achse.setPaintScale(true);
y_achse.setVisible(true);
y_achse.setPaintGrid(true);
y_achse.setMajorTickSpacing(5);
y_achse.setMinorTickSpacing(1);
y_achse.setFormatter(new LabelFormatterAutoUnits());
y_achse.setRangePolicy(new RangePolicyForcedPoint());
m_trace.setName("");
m_trace.setColor(Color.RED);
chart.addTrace(m_trace);
return chart;
}