/** * 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(); } }
/** * 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(); } }
/** * 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(); }
/** * 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(); }