org.jfree.chart.plot.XYPlot.setWeight()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中org.jfree.chart.plot.XYPlot.setWeight()方法的一些代码示例,展示了XYPlot.setWeight()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XYPlot.setWeight()方法的具体详情如下:
包路径:org.jfree.chart.plot.XYPlot
类名称:XYPlot
方法名:setWeight

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 &gt;= 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());
}

相关文章

微信公众号

最新文章

更多

XYPlot类方法