Tabnine Logo
CombinedRangeXYPlot
Code IndexAdd Tabnine to your IDE (free)

How to use
CombinedRangeXYPlot
in
org.jfree.chart.plot

Best Java code snippets using org.jfree.chart.plot.CombinedRangeXYPlot (Showing top 20 results out of 315)

origin: kiegroup/optaplanner

private JFreeChart createChart(CheapTimeSolution solution) {
  TangoColorFactory tangoColorFactory = new TangoColorFactory();
  NumberAxis rangeAxis = new NumberAxis("Period");
  rangeAxis.setRange(-0.5, solution.getGlobalPeriodRangeTo() + 0.5);
  XYPlot taskAssignmentPlot = createTaskAssignmentPlot(tangoColorFactory, solution);
  XYPlot periodCostPlot = createPeriodCostPlot(tangoColorFactory, solution);
  XYPlot capacityPlot = createAvailableCapacityPlot(tangoColorFactory, solution);
  CombinedRangeXYPlot combinedPlot = new CombinedRangeXYPlot(rangeAxis);
  combinedPlot.add(taskAssignmentPlot, 5);
  combinedPlot.add(periodCostPlot, 1);
  combinedPlot.add(capacityPlot, 1);
  combinedPlot.setOrientation(PlotOrientation.HORIZONTAL);
  return new JFreeChart("Cheap Power Time Scheduling", JFreeChart.DEFAULT_TITLE_FONT,
      combinedPlot, true);
}
origin: jfree/jfreechart

RectangleInsets insets = getInsets();
insets.trim(area);
AxisSpace space = calculateAxisSpace(g2, area);
Rectangle2D dataArea = space.shrink(area, null);
setFixedDomainAxisSpaceForSubplots(space);
ValueAxis axis = getRangeAxis();
RectangleEdge edge = getRangeAxisEdge();
double cursor = RectangleEdge.coordinate(dataArea, edge);
AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info);
origin: jfree/jfreechart

PlotOrientation orientation = getOrientation();
AxisSpace fixed = getFixedRangeAxisSpace();
if (fixed != null) {
  if (orientation == PlotOrientation.VERTICAL) {
  ValueAxis valueAxis = getRangeAxis();
  RectangleEdge valueEdge = Plot.resolveRangeAxisLocation(
    getRangeAxisLocation(), orientation
  );
  if (valueAxis != null) {
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Removes a subplot from the combined chart.
 *
 * @param subplot  the subplot (<code>null</code> not permitted).
 */
public void remove(XYPlot subplot) {
  if (subplot == null) {
    throw new IllegalArgumentException(" Null 'subplot' argument.");
  }
  int position = -1;
  int size = this.subplots.size();
  int i = 0;
  while (position == -1 && i < size) {
    if (this.subplots.get(i) == subplot) {
      position = i;
    }
    i++;
  }
  if (position != -1) {
    this.subplots.remove(position);
    subplot.setParent(null);
    subplot.removeChangeListener(this);
    configureRangeAxes();
    fireChangeEvent();
  }
}
origin: jfree/jfreechart

/**
 * Zooms in on the domain axes.
 *
 * @param lowerPercent  the lower bound.
 * @param upperPercent  the upper bound.
 * @param info  the plot rendering info ({@code null} not permitted).
 * @param source  the source point ({@code null} not permitted).
 */
@Override
public void zoomDomainAxes(double lowerPercent, double upperPercent,
              PlotRenderingInfo info, Point2D source) {
  // delegate 'info' and 'source' argument checks...
  XYPlot subplot = findSubplot(info, source);
  if (subplot != null) {
    subplot.zoomDomainAxes(lowerPercent, upperPercent, info, source);
  }
  else {
    // if the source point doesn't fall within a subplot, we do the
    // zoom on all subplots...
    Iterator iterator = getSubplots().iterator();
    while (iterator.hasNext()) {
      subplot = (XYPlot) iterator.next();
      subplot.zoomDomainAxes(lowerPercent, upperPercent, info,
          source);
    }
  }
}
origin: jfree/jfreechart

/**
 * Adds a subplot, with a default 'weight' of 1.
 * <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.
 */
public void add(XYPlot subplot) {
  add(subplot, 1);
}
origin: jfree/jfreechart

/**
 * Returns a collection of legend items for the plot.
 *
 * @return The legend items.
 */
@Override
public LegendItemCollection getLegendItems() {
  LegendItemCollection result = getFixedLegendItems();
  if (result == null) {
    result = new LegendItemCollection();
    if (this.subplots != null) {
      Iterator iterator = this.subplots.iterator();
      while (iterator.hasNext()) {
        XYPlot plot = (XYPlot) iterator.next();
        LegendItemCollection more = plot.getLegendItems();
        result.addAll(more);
      }
    }
  }
  return result;
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns a clone of the plot.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException  this class will not throw this
 *         exception, but subclasses (if any) might.
 */
public Object clone() throws CloneNotSupportedException {
  CombinedRangeXYPlot result = (CombinedRangeXYPlot) super.clone();
  result.subplots = (List) ObjectUtilities.deepClone(this.subplots);
  for (Iterator it = result.subplots.iterator(); it.hasNext();) {
    Plot child = (Plot) it.next();
    child.setParent(result);
  }
  // after setting up all the subplots, the shared range axis may need
  // reconfiguring
  ValueAxis rangeAxis = result.getRangeAxis();
  if (rangeAxis != null) {
    rangeAxis.configure();
  }
  return result;
}
origin: jfree/jfreechart

  Point2D source) {
XYPlot subplot = findSubplot(info, source);
if (subplot == null) {
  return;
origin: org.codehaus.jtstand/jtstand-chart

RectangleInsets insets = getInsets();
insets.trim(area);
AxisSpace space = calculateAxisSpace(g2, area);
Rectangle2D dataArea = space.shrink(area, null);
setFixedDomainAxisSpaceForSubplots(space);
ValueAxis axis = getRangeAxis();
RectangleEdge edge = getRangeAxisEdge();
double cursor = RectangleEdge.coordinate(dataArea, edge);
AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info);
origin: org.codehaus.jtstand/jtstand-chart

PlotOrientation orientation = getOrientation();
AxisSpace fixed = getFixedRangeAxisSpace();
if (fixed != null) {
  if (orientation == PlotOrientation.VERTICAL) {
  ValueAxis valueAxis = getRangeAxis();
  RectangleEdge valueEdge = Plot.resolveRangeAxisLocation(
    getRangeAxisLocation(), orientation
  );
  if (valueAxis != null) {
origin: jfree/jfreechart

/**
 * Removes a subplot from the combined chart.
 *
 * @param subplot  the subplot ({@code null} not permitted).
 */
public void remove(XYPlot subplot) {
  Args.nullNotPermitted(subplot, "subplot");
  int position = -1;
  int size = this.subplots.size();
  int i = 0;
  while (position == -1 && i < size) {
    if (this.subplots.get(i) == subplot) {
      position = i;
    }
    i++;
  }
  if (position != -1) {
    this.subplots.remove(position);
    subplot.setParent(null);
    subplot.removeChangeListener(this);
    configureRangeAxes();
    fireChangeEvent();
  }
}
origin: jfree/jfreechart

/**
 * Multiplies the range on the domain axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info ({@code null} not permitted).
 * @param source  the source point ({@code null} not permitted).
 * @param useAnchor  zoom about the anchor point?
 */
@Override
public void zoomDomainAxes(double factor, PlotRenderingInfo info,
              Point2D source, boolean useAnchor) {
  // delegate 'info' and 'source' argument checks...
  XYPlot subplot = findSubplot(info, source);
  if (subplot != null) {
    subplot.zoomDomainAxes(factor, info, source, useAnchor);
  }
  else {
    // if the source point doesn't fall within a subplot, we do the
    // zoom on all subplots...
    Iterator iterator = getSubplots().iterator();
    while (iterator.hasNext()) {
      subplot = (XYPlot) iterator.next();
      subplot.zoomDomainAxes(factor, info, source, useAnchor);
    }
  }
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Adds a subplot, with a default 'weight' of 1.
 * <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.
 */
public void add(XYPlot subplot) {
  add(subplot, 1);
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns a collection of legend items for the plot.
 *
 * @return The legend items.
 */
public LegendItemCollection getLegendItems() {
  LegendItemCollection result = getFixedLegendItems();
  if (result == null) {
    result = new LegendItemCollection();
    if (this.subplots != null) {
      Iterator iterator = this.subplots.iterator();
      while (iterator.hasNext()) {
        XYPlot plot = (XYPlot) iterator.next();
        LegendItemCollection more = plot.getLegendItems();
        result.addAll(more);
      }
    }
  }
  return result;
}
origin: jfree/jfreechart

/**
 * Returns a clone of the plot.
 *
 * @return A clone.
 *
 * @throws CloneNotSupportedException  this class will not throw this
 *         exception, but subclasses (if any) might.
 */
@Override
public Object clone() throws CloneNotSupportedException {
  CombinedRangeXYPlot result = (CombinedRangeXYPlot) super.clone();
  result.subplots = (List) ObjectUtils.deepClone(this.subplots);
  for (Iterator it = result.subplots.iterator(); it.hasNext();) {
    Plot child = (Plot) it.next();
    child.setParent(result);
  }
  // after setting up all the subplots, the shared range axis may need
  // reconfiguring
  ValueAxis rangeAxis = result.getRangeAxis();
  if (rangeAxis != null) {
    rangeAxis.configure();
  }
  return result;
}
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

/**
 * Multiplies the range on the domain axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info (<code>null</code> not permitted).
 * @param source  the source point (<code>null</code> not permitted).
 * @param useAnchor  zoom about the anchor point?
 */
public void zoomDomainAxes(double factor, PlotRenderingInfo info,
              Point2D source, boolean useAnchor) {
  // delegate 'info' and 'source' argument checks...
  XYPlot subplot = findSubplot(info, source);
  if (subplot != null) {
    subplot.zoomDomainAxes(factor, info, source, useAnchor);
  }
  else {
    // if the source point doesn't fall within a subplot, we do the
    // zoom on all subplots...
    Iterator iterator = getSubplots().iterator();
    while (iterator.hasNext()) {
      subplot = (XYPlot) iterator.next();
      subplot.zoomDomainAxes(factor, info, source, useAnchor);
    }
  }
}
origin: org.optaplanner/optaplanner-examples

private JFreeChart createChart(CheapTimeSolution solution) {
  TangoColorFactory tangoColorFactory = new TangoColorFactory();
  NumberAxis rangeAxis = new NumberAxis("Period");
  rangeAxis.setRange(-0.5, solution.getGlobalPeriodRangeTo() + 0.5);
  XYPlot taskAssignmentPlot = createTaskAssignmentPlot(tangoColorFactory, solution);
  XYPlot periodCostPlot = createPeriodCostPlot(tangoColorFactory, solution);
  XYPlot capacityPlot = createAvailableCapacityPlot(tangoColorFactory, solution);
  CombinedRangeXYPlot combinedPlot = new CombinedRangeXYPlot(rangeAxis);
  combinedPlot.add(taskAssignmentPlot, 5);
  combinedPlot.add(periodCostPlot, 1);
  combinedPlot.add(capacityPlot, 1);
  combinedPlot.setOrientation(PlotOrientation.HORIZONTAL);
  return new JFreeChart("Cheap Power Time Scheduling", JFreeChart.DEFAULT_TITLE_FONT,
      combinedPlot, true);
}
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();
}
org.jfree.chart.plotCombinedRangeXYPlot

Javadoc

An extension of XYPlot that contains multiple subplots that share a common range axis.

Most used methods

  • add
    Adds a subplot with a particular weight (greater than or equal to one). The weight determines how mu
  • calculateAxisSpace
    Calculates the space required for the axes.
  • configureRangeAxes
  • findSubplot
    Returns the subplot (if any) that contains the (x, y) point (specified in Java2D space).
  • fireChangeEvent
  • getFixedLegendItems
  • getFixedRangeAxisSpace
  • getInsets
  • getOrientation
  • getRangeAxis
  • getRangeAxisEdge
  • getRangeAxisLocation
  • getRangeAxisEdge,
  • getRangeAxisLocation,
  • getSubplots,
  • notifyListeners,
  • setFixedDomainAxisSpaceForSubplots,
  • zoomDomainAxes,
  • <init>,
  • setNotify,
  • setOrientation

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now