本文整理了Java中org.jfree.chart.plot.XYPlot.setWeight()
方法的一些代码示例,展示了XYPlot.setWeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XYPlot.setWeight()
方法的具体详情如下:
包路径:org.jfree.chart.plot.XYPlot
类名称:XYPlot
方法名:setWeight
[英]Sets the weight for the plot and sends a PlotChangeEvent to all registered listeners.
[中]设置绘图的权重,并向所有注册的侦听器发送PlotChangeEvent。
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* Adds a subplot with a particular weight (greater than or equal to one).
* The weight determines how much space is allocated to the subplot
* relative to all the other subplots.
* <br><br>
* You must ensure that the subplot has a non-null domain axis. The range
* axis for the subplot will be set to <code>null</code>.
*
* @param subplot the subplot.
* @param weight the weight (must be 1 or greater).
*/
public void add(XYPlot subplot, int weight) {
// verify valid weight
if (weight <= 0) {
String msg = "The 'weight' must be positive.";
throw new IllegalArgumentException(msg);
}
// store the plot and its weight
subplot.setParent(this);
subplot.setWeight(weight);
subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
subplot.setRangeAxis(null);
subplot.addChangeListener(this);
this.subplots.add(subplot);
configureRangeAxes();
fireChangeEvent();
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
subplot.setWeight(weight);
subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0), false);
subplot.setDomainAxis(null);
代码示例来源:origin: jfree/jfreechart
/**
* Adds a subplot with a particular weight (greater than or equal to one).
* The weight determines how much space is allocated to the subplot
* relative to all the other subplots.
* <br><br>
* You must ensure that the subplot has a non-null domain axis. The range
* axis for the subplot will be set to {@code null}.
*
* @param subplot the subplot ({@code null} not permitted).
* @param weight the weight (must be 1 or greater).
*/
public void add(XYPlot subplot, int weight) {
Args.nullNotPermitted(subplot, "subplot");
if (weight <= 0) {
String msg = "The 'weight' must be positive.";
throw new IllegalArgumentException(msg);
}
// store the plot and its weight
subplot.setParent(this);
subplot.setWeight(weight);
subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
subplot.setRangeAxis(null);
subplot.addChangeListener(this);
this.subplots.add(subplot);
configureRangeAxes();
fireChangeEvent();
}
代码示例来源:origin: jfree/jfreechart
/**
* Adds a subplot with the specified weight and sends a
* {@link PlotChangeEvent} to all registered listeners. The weight
* determines how much space is allocated to the subplot relative to all
* the other subplots.
* <P>
* The domain axis for the subplot will be set to {@code null}. You
* must ensure that the subplot has a non-null range axis.
*
* @param subplot the subplot ({@code null} not permitted).
* @param weight the weight (must be >= 1).
*/
public void add(XYPlot subplot, int weight) {
Args.nullNotPermitted(subplot, "subplot");
if (weight <= 0) {
throw new IllegalArgumentException("Require weight >= 1.");
}
// store the plot and its weight
subplot.setParent(this);
subplot.setWeight(weight);
subplot.setInsets(RectangleInsets.ZERO_INSETS, false);
subplot.setDomainAxis(null);
subplot.addChangeListener(this);
this.subplots.add(subplot);
ValueAxis axis = getDomainAxis();
if (axis != null) {
axis.configure();
}
fireChangeEvent();
}
代码示例来源:origin: cpesch/RouteConverter
public synchronized void setSelectedPositions(int[] selectPositions, boolean replaceSelection) {
if (replaceSelection)
plot.clearDomainMarkers();
if (profileModel.getXAxisMode().equals(Distance)) {
double[] distances = positionsModel.getRoute().getDistancesFromStart(selectPositions);
for (double distance : distances) {
plot.addDomainMarker(0, new ValueMarker(profileModel.formatDistance(distance)), FOREGROUND, false);
}
} else {
long[] times = positionsModel.getRoute().getTimesFromStart(selectPositions);
for (long time : times) {
plot.addDomainMarker(0, new ValueMarker(profileModel.formatTime(time)), FOREGROUND, false);
}
}
// make sure the protected fireChangeEvent() is called without any side effects
plot.setWeight(plot.getWeight());
}
内容来源于网络,如有侵权,请联系作者删除!