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


Java Graphics.getClip方法代码示例

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


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

示例1: printPages

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void printPages() {
    final Graphics graphics = getFreshPrinterGraphics();
    final IFigure figure = getPrintSource();
    setupPrinterGraphicsFor(graphics, figure);
    final Rectangle bounds = figure.getBounds();
    int x = bounds.x, y = bounds.y;
    final Rectangle clipRect = new Rectangle();
    while (y < bounds.y + bounds.height) {
        while (x < bounds.x + bounds.width) {
            graphics.pushState();
            getPrinter().startPage();
            graphics.translate(-x, -y);
            graphics.getClip(clipRect);
            clipRect.setLocation(x, y);
            graphics.clipRect(clipRect);
            figure.paint(graphics);
            getPrinter().endPage();
            graphics.popState();
            x += clipRect.width;
        }
        x = bounds.x;
        y += clipRect.height;
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:29,代码来源:PrintERDiagramOperation.java

示例2: printPages

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void printPages() {
	Graphics graphics = getFreshPrinterGraphics();
	IFigure figure = getPrintSource();
	setupPrinterGraphicsFor(graphics, figure);
	Rectangle bounds = figure.getBounds();
	int x = bounds.x, y = bounds.y;
	Rectangle clipRect = new Rectangle();
	while (y < bounds.y + bounds.height) {
		while (x < bounds.x + bounds.width) {
			graphics.pushState();
			getPrinter().startPage();
			graphics.translate(-x, -y);
			graphics.getClip(clipRect);
			clipRect.setLocation(x, y);
			graphics.clipRect(clipRect);
			figure.paint(graphics);
			getPrinter().endPage();
			graphics.popState();
			x += clipRect.width;
		}
		x = bounds.x;
		y += clipRect.height;
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:29,代码来源:PrintERDiagramOperation.java

示例3: printPages

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
protected void printPages() {
    final Graphics graphics = getFreshPrinterGraphics();
    final IFigure figure = getPrintSource();
    setupPrinterGraphicsFor(graphics, figure);
    final Rectangle bounds = figure.getBounds();
    int x = bounds.x, y = bounds.y;
    final Rectangle clipRect = new Rectangle();
    while (y < bounds.y + bounds.height) {
        while (x < bounds.x + bounds.width) {
            graphics.pushState();
            getPrinter().startPage();
            graphics.translate(-x, -y);
            graphics.getClip(clipRect);
            clipRect.setLocation(x, y);
            graphics.clipRect(clipRect);
            figure.paint(graphics);
            getPrinter().endPage();
            graphics.popState();
            x += clipRect.width;
        }
        x = bounds.x;
        y += clipRect.height;
    }
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:26,代码来源:PrintERDiagramOperation.java

示例4: paintGrid

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void paintGrid(final Graphics g) {
    super.paintGrid(g);

    final Rectangle clip = g.getClip(Rectangle.SINGLETON);

    final PageSetting pageSetting = diagram.getPageSetting();

    final int width = pageSetting.getWidth();
    final int height = pageSetting.getHeight();

    final Rectangle rect = clip;

    final Color color = g.getForegroundColor();
    g.setForegroundColor(ColorConstants.lightGray);

    int startX = rect.x;
    if (startX > 0) {
        startX = 0;
    }
    int startY = rect.y;
    if (startY > 0) {
        startY = 0;
    }

    for (int i = startX; i < rect.x + rect.width; i += width) {
        g.drawLine(i, rect.y, i, rect.y + rect.height);
    }

    for (int i = startY; i < rect.y + rect.height; i += height) {
        g.drawLine(rect.x, i, rect.x + rect.width, i);
    }

    g.setForegroundColor(color);

    i++;
    if (i > 0) {
        i = -1;
        repaint();
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:45,代码来源:PagableFreeformRootEditPart.java

示例5: paintGrid

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void paintGrid(Graphics g) {
	super.paintGrid(g);

	Rectangle clip = g.getClip(Rectangle.SINGLETON);

	PageSetting pageSetting = diagram.getPageSetting();

	int width = pageSetting.getWidth();
	int height = pageSetting.getHeight();

	Rectangle rect = clip;

	Color color = g.getForegroundColor();
	g.setForegroundColor(ColorConstants.lightGray);

	int startX = rect.x;
	if (startX > 0) {
		startX = 0;
	}
	int startY = rect.y;
	if (startY > 0) {
		startY = 0;
	}

	for (int i = startX; i < rect.x + rect.width; i += width) {
		g.drawLine(i, rect.y, i, rect.y + rect.height);
	}

	for (int i = startY; i < rect.y + rect.height; i += height) {
		g.drawLine(rect.x, i, rect.x + rect.width, i);
	}

	g.setForegroundColor(color);

	i++;
	if (i > 0) {
		i = -1;
		repaint();
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:45,代码来源:PagableFreeformRootEditPart.java

示例6: paintGrid

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
protected void paintGrid(Graphics g) {
    super.paintGrid(g);

    Rectangle clip = g.getClip(Rectangle.SINGLETON);

    PageSettings pageSetting = diagram.getPageSetting();

    int width = pageSetting.getWidth();
    int height = pageSetting.getHeight();

    Rectangle rect = clip;

    Color color = g.getForegroundColor();
    g.setForegroundColor(ColorConstants.lightGray);

    int startX = rect.x;
    if (startX > 0) {
        startX = 0;
    }
    int startY = rect.y;
    if (startY > 0) {
        startY = 0;
    }

    for (int i = startX; i < rect.x + rect.width; i += width) {
        g.drawLine(i, rect.y, i, rect.y + rect.height);
    }

    for (int i = startY; i < rect.y + rect.height; i += height) {
        g.drawLine(rect.x, i, rect.x + rect.width, i);
    }

    g.setForegroundColor(color);

    i++;
    if (i > 0) {
        i = -1;
        repaint();
    }
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:42,代码来源:PagableFreeformRootEditPart.java


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