本文整理汇总了Java中org.jfree.ui.RectangleInsets.trim方法的典型用法代码示例。如果您正苦于以下问题:Java RectangleInsets.trim方法的具体用法?Java RectangleInsets.trim怎么用?Java RectangleInsets.trim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.ui.RectangleInsets
的用法示例。
在下文中一共展示了RectangleInsets.trim方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: draw
import org.jfree.ui.RectangleInsets; //导入方法依赖的package包/类
/**
* Draws the wafermap view.
*
* @param g2 the graphics device.
* @param area the plot area.
* @param anchor the anchor point (<code>null</code> permitted).
* @param state the plot state.
* @param info the plot rendering info.
*/
public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
PlotState state,
PlotRenderingInfo info) {
// if the plot area is too small, just return...
boolean b1 = (area.getWidth() <= MINIMUM_WIDTH_TO_DRAW);
boolean b2 = (area.getHeight() <= MINIMUM_HEIGHT_TO_DRAW);
if (b1 || b2) {
return;
}
// record the plot area...
if (info != null) {
info.setPlotArea(area);
}
// adjust the drawing area for the plot insets (if any)...
RectangleInsets insets = getInsets();
insets.trim(area);
drawChipGrid(g2, area);
drawWaferEdge(g2, area);
}
示例2: draw
import org.jfree.ui.RectangleInsets; //导入方法依赖的package包/类
/**
* Draws the plot on a Java 2D graphics device (such as the screen or a
* printer).
*
* @param g2 the graphics device.
* @param area the area within which the plot should be drawn.
* @param anchor the anchor point (<code>null</code> permitted).
* @param parentState the state from the parent plot, if there is one.
* @param info collects info about the drawing
* (<code>null</code> permitted).
*/
public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
PlotState parentState, PlotRenderingInfo info) {
// adjust for insets...
RectangleInsets insets = getInsets();
insets.trim(area);
if (info != null) {
info.setPlotArea(area);
info.setDataArea(area);
}
drawBackground(g2, area);
drawOutline(g2, area);
Shape savedClip = g2.getClip();
g2.clip(area);
Composite originalComposite = g2.getComposite();
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
getForegroundAlpha()));
if (!DatasetUtilities.isEmptyOrNull(this.dataset)) {
drawPie(g2, area, info);
}
else {
drawNoDataMessage(g2, area);
}
g2.setClip(savedClip);
g2.setComposite(originalComposite);
drawOutline(g2, area);
}
示例3: draw
import org.jfree.ui.RectangleInsets; //导入方法依赖的package包/类
/**
* Draws the plot on a Java 2D graphics device (such as the screen or a
* printer).
* <P>
* This plot relies on a {@link PolarItemRenderer} to draw each
* item in the plot. This allows the visual representation of the data to
* be changed easily.
* <P>
* The optional info argument collects information about the rendering of
* the plot (dimensions, tooltip information etc). Just pass in
* <code>null</code> if you do not need this information.
*
* @param g2 the graphics device.
* @param area the area within which the plot (including axes and
* labels) should be drawn.
* @param anchor the anchor point (<code>null</code> permitted).
* @param parentState ignored.
* @param info collects chart drawing information (<code>null</code>
* permitted).
*/
public void draw(Graphics2D g2,
Rectangle2D area,
Point2D anchor,
PlotState parentState,
PlotRenderingInfo info) {
// if the plot area is too small, just return...
boolean b1 = (area.getWidth() <= MINIMUM_WIDTH_TO_DRAW);
boolean b2 = (area.getHeight() <= MINIMUM_HEIGHT_TO_DRAW);
if (b1 || b2) {
return;
}
// record the plot area...
if (info != null) {
info.setPlotArea(area);
}
// adjust the drawing area for the plot insets (if any)...
RectangleInsets insets = getInsets();
insets.trim(area);
Rectangle2D dataArea = area;
if (info != null) {
info.setDataArea(dataArea);
}
// draw the plot background and axes...
drawBackground(g2, dataArea);
double h = Math.min(dataArea.getWidth() / 2.0,
dataArea.getHeight() / 2.0) - MARGIN;
Rectangle2D quadrant = new Rectangle2D.Double(dataArea.getCenterX(),
dataArea.getCenterY(), h, h);
AxisState state = drawAxis(g2, area, quadrant);
if (this.renderer != null) {
Shape originalClip = g2.getClip();
Composite originalComposite = g2.getComposite();
g2.clip(dataArea);
g2.setComposite(AlphaComposite.getInstance(
AlphaComposite.SRC_OVER, getForegroundAlpha()));
drawGridlines(g2, dataArea, this.angleTicks, state.getTicks());
// draw...
render(g2, dataArea, info);
g2.setClip(originalClip);
g2.setComposite(originalComposite);
}
drawOutline(g2, dataArea);
drawCornerTextItems(g2, dataArea);
}
示例4: draw
import org.jfree.ui.RectangleInsets; //导入方法依赖的package包/类
/**
* Draws the plot within the specified area on a graphics device.
*
* @param g2 the graphics device.
* @param area the plot area (in Java2D space).
* @param anchor an anchor point in Java2D space (<code>null</code>
* permitted).
* @param parentState the state from the parent plot, if there is one
* (<code>null</code> permitted).
* @param info collects chart drawing information (<code>null</code>
* permitted).
*/
public void draw(Graphics2D g2,
Rectangle2D area,
Point2D anchor,
PlotState parentState,
PlotRenderingInfo info) {
// set up info collection...
if (info != null) {
info.setPlotArea(area);
}
// adjust the drawing area for plot insets (if any)...
RectangleInsets insets = getInsets();
insets.trim(area);
AxisSpace space = calculateAxisSpace(g2, area);
Rectangle2D dataArea = space.shrink(area, null);
// set the width and height of non-shared axis of all sub-plots
setFixedRangeAxisSpaceForSubplots(space);
// draw the shared axis
ValueAxis axis = getDomainAxis();
RectangleEdge edge = getDomainAxisEdge();
double cursor = RectangleEdge.coordinate(dataArea, edge);
AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info);
if (parentState == null) {
parentState = new PlotState();
}
parentState.getSharedAxisStates().put(axis, axisState);
// draw all the subplots
for (int i = 0; i < this.subplots.size(); i++) {
XYPlot plot = (XYPlot) this.subplots.get(i);
PlotRenderingInfo subplotInfo = null;
if (info != null) {
subplotInfo = new PlotRenderingInfo(info.getOwner());
info.addSubplotInfo(subplotInfo);
}
plot.draw(g2, this.subplotAreas[i], anchor, parentState,
subplotInfo);
}
if (info != null) {
info.setDataArea(dataArea);
}
}
示例5: draw
import org.jfree.ui.RectangleInsets; //导入方法依赖的package包/类
/**
* Draws the plot on a Java 2D graphics device (such as the screen or a
* printer). Will perform all the placement calculations for each
* sub-plots and then tell these to draw themselves.
*
* @param g2 the graphics device.
* @param area the area within which the plot (including axis labels)
* should be drawn.
* @param anchor the anchor point (<code>null</code> permitted).
* @param parentState the parent state.
* @param info collects information about the drawing (<code>null</code>
* permitted).
*/
public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
PlotState parentState,
PlotRenderingInfo info) {
// set up info collection...
if (info != null) {
info.setPlotArea(area);
}
// adjust the drawing area for plot insets (if any)...
RectangleInsets insets = getInsets();
insets.trim(area);
// calculate the data area...
AxisSpace space = calculateAxisSpace(g2, area);
Rectangle2D dataArea = space.shrink(area, null);
// set the width and height of non-shared axis of all sub-plots
setFixedDomainAxisSpaceForSubplots(space);
// draw the shared axis
ValueAxis axis = getRangeAxis();
RectangleEdge rangeEdge = getRangeAxisEdge();
double cursor = RectangleEdge.coordinate(dataArea, rangeEdge);
AxisState state = axis.draw(g2, cursor, area, dataArea, rangeEdge,
info);
if (parentState == null) {
parentState = new PlotState();
}
parentState.getSharedAxisStates().put(axis, state);
// draw all the charts
for (int i = 0; i < this.subplots.size(); i++) {
CategoryPlot plot = (CategoryPlot) this.subplots.get(i);
PlotRenderingInfo subplotInfo = null;
if (info != null) {
subplotInfo = new PlotRenderingInfo(info.getOwner());
info.addSubplotInfo(subplotInfo);
}
plot.draw(g2, this.subplotArea[i], null, parentState, subplotInfo);
}
if (info != null) {
info.setDataArea(dataArea);
}
}
示例6: draw
import org.jfree.ui.RectangleInsets; //导入方法依赖的package包/类
/**
* Draws the fast scatter plot on a Java 2D graphics device (such as the
* screen or a printer).
*
* @param g2 the graphics device.
* @param area the area within which the plot (including axis labels)
* should be drawn.
* @param anchor the anchor point (<code>null</code> permitted).
* @param parentState the state from the parent plot (ignored).
* @param info collects chart drawing information (<code>null</code>
* permitted).
*/
public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
PlotState parentState,
PlotRenderingInfo info) {
// set up info collection...
if (info != null) {
info.setPlotArea(area);
}
// adjust the drawing area for plot insets (if any)...
RectangleInsets insets = getInsets();
insets.trim(area);
AxisSpace space = new AxisSpace();
space = this.domainAxis.reserveSpace(g2, this, area,
RectangleEdge.BOTTOM, space);
space = this.rangeAxis.reserveSpace(g2, this, area, RectangleEdge.LEFT,
space);
Rectangle2D dataArea = space.shrink(area, null);
if (info != null) {
info.setDataArea(dataArea);
}
// draw the plot background and axes...
drawBackground(g2, dataArea);
AxisState domainAxisState = this.domainAxis.draw(g2,
dataArea.getMaxY(), area, dataArea, RectangleEdge.BOTTOM, info);
AxisState rangeAxisState = this.rangeAxis.draw(g2, dataArea.getMinX(),
area, dataArea, RectangleEdge.LEFT, info);
drawDomainGridlines(g2, dataArea, domainAxisState.getTicks());
drawRangeGridlines(g2, dataArea, rangeAxisState.getTicks());
Shape originalClip = g2.getClip();
Composite originalComposite = g2.getComposite();
g2.clip(dataArea);
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
getForegroundAlpha()));
render(g2, dataArea, info, null);
g2.setClip(originalClip);
g2.setComposite(originalComposite);
drawOutline(g2, dataArea);
}
示例7: draw
import org.jfree.ui.RectangleInsets; //导入方法依赖的package包/类
/**
* Draws the plot within the specified area on a graphics device.
*
* @param g2 the graphics device.
* @param area the plot area (in Java2D space).
* @param anchor an anchor point in Java2D space (<code>null</code>
* permitted).
* @param parentState the state from the parent plot, if there is one
* (<code>null</code> permitted).
* @param info collects chart drawing information (<code>null</code>
* permitted).
*/
public void draw(Graphics2D g2,
Rectangle2D area,
Point2D anchor,
PlotState parentState,
PlotRenderingInfo info) {
// set up info collection...
if (info != null) {
info.setPlotArea(area);
}
// adjust the drawing area for plot insets (if any)...
RectangleInsets insets = getInsets();
insets.trim(area);
AxisSpace space = calculateAxisSpace(g2, area);
Rectangle2D dataArea = space.shrink(area, null);
//this.axisOffset.trim(dataArea);
// set the width and height of non-shared axis of all sub-plots
setFixedDomainAxisSpaceForSubplots(space);
// draw the shared axis
ValueAxis axis = getRangeAxis();
RectangleEdge edge = getRangeAxisEdge();
double cursor = RectangleEdge.coordinate(dataArea, edge);
AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info);
if (parentState == null) {
parentState = new PlotState();
}
parentState.getSharedAxisStates().put(axis, axisState);
// draw all the charts
for (int i = 0; i < this.subplots.size(); i++) {
XYPlot plot = (XYPlot) this.subplots.get(i);
PlotRenderingInfo subplotInfo = null;
if (info != null) {
subplotInfo = new PlotRenderingInfo(info.getOwner());
info.addSubplotInfo(subplotInfo);
}
plot.draw(g2, this.subplotAreas[i], anchor, parentState,
subplotInfo);
}
if (info != null) {
info.setDataArea(dataArea);
}
}