当前位置: 首页>>代码示例>>Java>>正文


Java Graphics.restoreState方法代码示例

本文整理汇总了Java中org.eclipse.draw2d.Graphics.restoreState方法的典型用法代码示例。如果您正苦于以下问题:Java Graphics.restoreState方法的具体用法?Java Graphics.restoreState怎么用?Java Graphics.restoreState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.draw2d.Graphics的用法示例。


在下文中一共展示了Graphics.restoreState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: paintChildren

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * Override the original paintChildren to avoid to pain elements 
 * that are marked as not visible inside the model
 */
protected void paintChildren(Graphics graphics) {
	for (int i = 0; i < getChildren().size(); i++) {
		IFigure child = (IFigure) getChildren().get(i);
		if (child.isVisible() && isFigurevisible(child)) {
			// determine clipping areas for child
			Rectangle[] clipping = null;
			if (getClippingStrategy() != null) {
				clipping = getClippingStrategy().getClip(child);
			} else {
				// default clipping behavior is to clip at bounds
				clipping = new Rectangle[] { child.getBounds() };
			}
			// child may now paint inside the clipping areas
			for (int j = 0; j < clipping.length; j++) {
				if (clipping[j].intersects(graphics.getClip(Rectangle.SINGLETON))) {
					graphics.clipRect(clipping[j]);
					child.paint(graphics);
					graphics.restoreState();
				}
			}
		}
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:28,代码来源:ContainerPageFigure.java

示例2: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
protected void paintFigure(Graphics graphics) {
	super.paintFigure(graphics);
	Rectangle bounds = getBounds();
	graphics.setBackgroundColor(headerColor);
	float bw =  getBorder().getBorderWidth();
	if (hasHeader()){
		PrecisionRectangle top = new PrecisionRectangle();
		top.setX(bounds.x + bw);
		top.setY(bounds.y + bw);
		top.setWidth(bounds.width - 2*bw);
		top.setHeight(getTitleHeight());
		//Path topPath = Drawer.getPartlyRoundedRectangle(top, getBorder().getBorderRadius() - bw, true, true, false, false);
		Path topPath = Drawer.getTopRoundedRectangle(top, getBorder().getActualBorderRadius(getBounds()) - bw);
		graphics.fillPath(topPath);
	}
	if (footerTitle != null || hasFooterView){
		PrecisionRectangle bottom = new PrecisionRectangle();
		bottom.setX(bounds.x + bw);
		bottom.setY(bounds.bottom() - bw - getTitleHeight());
		bottom.setWidth(bounds.width - 2*bw);
		bottom.setHeight(getTitleHeight());
		//Path bottomPath = Drawer.getPartlyRoundedRectangle(bottom, getBorder().getBorderRadius() - bw, false, false, true, true);
		Path bottomPath = Drawer.getBottomRoundedRectangle(bottom, getBorder().getActualBorderRadius(getBounds()) - bw);
		graphics.fillPath(bottomPath);
	}
	graphics.restoreState();
	this.paintString(graphics, headerTitle, true);
	this.paintString(graphics, footerTitle, false);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:31,代码来源:TableViewFigure.java

示例3: paintClientArea

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
protected void paintClientArea(Graphics graphics) {
	if (getChildren().isEmpty())
		return;

	graphics.translate(getBounds().x + getInsets().left, getBounds().y
			+ getInsets().top);

	graphics.clipRect(getFullArea());
	graphics.pushState();
	paintChildren(graphics);
	graphics.popState();
	graphics.restoreState();
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:14,代码来源:TableViewFigure.java

示例4: paintChildren

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * Override the original paintChildren to avoid to pain elements 
 * that are marked as not visible inside the model
 */
protected void paintChildren(Graphics graphics) {
	//if (!isMainEditor()) return;
		
	for (int i = 0; i < getChildren().size(); i++) {
		IFigure child = (IFigure) getChildren().get(i);
		boolean modelVisible = true;
		if (child instanceof FrameFigure){
			ANode model = ((FrameFigure)child).getModel();
			if (model != null) {
				modelVisible = model.isVisible();
				child.setVisible(modelVisible);
			}
		}
		if (child.isVisible() && modelVisible && isFigurevisible(child)) {
			// determine clipping areas for child
			Rectangle[] clipping = null;
			if (getClippingStrategy() != null) {
				clipping = getClippingStrategy().getClip(child);
			} else {
				// default clipping behavior is to clip at bounds
				clipping = new Rectangle[] { child.getBounds() };
			}
			// child may now paint inside the clipping areas
			for (int j = 0; j < clipping.length; j++) {
				if (clipping[j].intersects(graphics.getClip(Rectangle.SINGLETON))) {
					graphics.clipRect(clipping[j]);
					child.paint(graphics);
					graphics.restoreState();
				}
			}
		}
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:38,代码来源:ReportPageFigure.java


注:本文中的org.eclipse.draw2d.Graphics.restoreState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。