本文整理汇总了Java中info.monitorenter.gui.chart.Chart2D.setUseAntialiasing方法的典型用法代码示例。如果您正苦于以下问题:Java Chart2D.setUseAntialiasing方法的具体用法?Java Chart2D.setUseAntialiasing怎么用?Java Chart2D.setUseAntialiasing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类info.monitorenter.gui.chart.Chart2D
的用法示例。
在下文中一共展示了Chart2D.setUseAntialiasing方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: main
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的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);
}
示例3: 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;
}
示例4: main
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
/**
* Main entry.
* <p>
*
* @param args
* ignored.
*/
public static void main(final String[] args) {
// Create a chart:
Chart2D chart = new Chart2D();
chart.setUseAntialiasing(true);
// set a special axis:
AAxis<?> axisy = new AxisLog10<AxisScalePolicyTransformation>();
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(100);
chart.setAxisYLeft(axisy, 0);
axisy.setFormatter(new LabelFormatterAutoUnits(new LabelFormatterNumber(df)));
// Create an ITrace:
ITrace2D trace = new Trace2DSimple();
// Add the trace to the chart:
chart.addTrace(trace);
trace.setTracePainter(new TracePainterDisc(4));
trace.setColor(Color.BLUE);
trace.setStroke(new BasicStroke(1));
// Add the function 1/x + random
for (double i = 1; i < 10; i += 0.1) {
trace.addPoint(i, Math.pow(10, i));
}
// Make it visible:
// Create a frame.
JFrame frame = new JFrame(Log10AxisChart.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);
}
示例5: main
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
/**
* Creates a zoomable chart with y axis log 10, simple label formatter, gridlines, acitvated highlighting and activated tooltips.
* <p>
*
* @param args
* ignored.
*/
public static void main(final String[] args) {
// Create a chart:
Chart2D chart = new ZoomableChart();
chart.setUseAntialiasing(true);
chart.setToolTipType(Chart2D.ToolTipType.VALUE_SNAP_TO_TRACEPOINTS);
chart.enablePointHighlighting(true);
// set a special axis:
AxisLog10<AxisScalePolicyTransformation> axisy = new AxisLog10<AxisScalePolicyTransformation>();
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(100);
chart.setAxisYLeft(axisy, 0);
axisy.setFormatter(new LabelFormatterSimple());
axisy.setPaintGrid(true);
chart.getAxisX().setPaintGrid(true);
// Create an ITrace:
ITrace2D trace = new Trace2DSimple();
// Add the trace to the chart:
chart.addTrace(trace);
trace.addPointHighlighter(new PointPainterDisc(10));
trace.setTracePainter(new TracePainterDisc(4));
trace.setColor(Color.BLUE);
trace.setStroke(new BasicStroke(1));
// Add the function 1/x + random
for (double i = 1; i <= 10; i += 0.1) {
trace.addPoint(i, Math.pow(10, i));
}
// Make it visible:
// Create a frame.
JFrame frame = new JFrame(Log10AxisChartZoomable.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);
}