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


Java PageSetting类代码示例

本文整理汇总了Java中org.insightech.er.editor.model.settings.PageSetting的典型用法代码示例。如果您正苦于以下问题:Java PageSetting类的具体用法?Java PageSetting怎么用?Java PageSetting使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PageSetting类属于org.insightech.er.editor.model.settings包,在下文中一共展示了PageSetting类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPrintRegion

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Rectangle getPrintRegion() {
    final ERDiagram diagram = getDiagram();
    final PageSetting pageSetting = diagram.getPageSetting();

    final org.eclipse.swt.graphics.Rectangle trim = getPrinter().computeTrim(0, 0, 0, 0);
    final org.eclipse.swt.graphics.Point printerDPI = getPrinter().getDPI();

    final Insets notAvailable = new Insets(-trim.y, -trim.x, trim.height + trim.y, trim.width + trim.x);

    final Insets userPreferred = new Insets((pageSetting.getTopMargin() * printerDPI.x) / 72, (pageSetting.getLeftMargin() * printerDPI.x) / 72, (pageSetting.getBottomMargin() * printerDPI.x) / 72, (pageSetting.getRightMargin() * printerDPI.x) / 72);

    final Rectangle paperBounds = new Rectangle(getPrinter().getBounds());
    final Rectangle printRegion = shrink(paperBounds, notAvailable);
    printRegion.intersect(shrink(paperBounds, userPreferred));
    printRegion.translate(trim.x, trim.y);

    return printRegion;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:23,代码来源:PrintERDiagramOperation.java

示例2: loadPageSetting

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
private void loadPageSetting(final ERDiagram diagram, final Element element) {
    final Element dbSettingElement = getElement(element, "page_setting");

    if (dbSettingElement != null) {
        final boolean directionHorizontal = this.getBooleanValue(element, "direction_horizontal");
        final int scale = this.getIntValue(element, "scale");
        final String paperSize = getStringValue(element, "paper_size");
        final int topMargin = this.getIntValue(element, "top_margin");
        final int leftMargin = this.getIntValue(element, "left_margin");
        final int bottomMargin = this.getIntValue(element, "bottom_margin");
        final int rightMargin = this.getIntValue(element, "right_margin");

        final PageSetting pageSetting = new PageSetting(directionHorizontal, scale, paperSize, topMargin, rightMargin, bottomMargin, leftMargin);
        diagram.setPageSetting(pageSetting);
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:17,代码来源:XMLLoader.java

示例3: getPrintRegion

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Rectangle getPrintRegion() {
	ERDiagram diagram = this.getDiagram();
	PageSetting pageSetting = diagram.getPageSetting();

	org.eclipse.swt.graphics.Rectangle trim = this.getPrinter()
			.computeTrim(0, 0, 0, 0);
	org.eclipse.swt.graphics.Point printerDPI = this.getPrinter().getDPI();

	Insets notAvailable = new Insets(-trim.y, -trim.x,
			trim.height + trim.y, trim.width + trim.x);

	Insets userPreferred = new Insets(
			(pageSetting.getTopMargin() * printerDPI.x) / 72,
			(pageSetting.getLeftMargin() * printerDPI.x) / 72,
			(pageSetting.getBottomMargin() * printerDPI.x) / 72,
			(pageSetting.getRightMargin() * printerDPI.x) / 72);

	Rectangle paperBounds = new Rectangle(this.getPrinter().getBounds());
	Rectangle printRegion = shrink(paperBounds, notAvailable);
	printRegion.intersect(shrink(paperBounds, userPreferred));
	printRegion.translate(trim.x, trim.y);
	
	return printRegion;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:29,代码来源:PrintERDiagramOperation.java

示例4: createXML

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
private String createXML(PageSetting pageSetting) {
	StringBuilder xml = new StringBuilder();

	xml.append("<direction_horizontal>")
			.append(pageSetting.isDirectionHorizontal())
			.append("</direction_horizontal>\n");
	xml.append("<scale>").append(pageSetting.getScale())
			.append("</scale>\n");
	xml.append("<paper_size>").append(escape(pageSetting.getPaperSize()))
			.append("</paper_size>\n");
	xml.append("<top_margin>").append(pageSetting.getTopMargin())
			.append("</top_margin>\n");
	xml.append("<left_margin>").append(pageSetting.getLeftMargin())
			.append("</left_margin>\n");
	xml.append("<bottom_margin>").append(pageSetting.getBottomMargin())
			.append("</bottom_margin>\n");
	xml.append("<right_margin>").append(pageSetting.getRightMargin())
			.append("</right_margin>\n");

	return xml.toString();
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:22,代码来源:PersistentXmlImpl.java

示例5: loadPageSetting

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
private void loadPageSetting(ERDiagram diagram, Element element) {
	Element dbSettingElement = this.getElement(element, "page_setting");

	if (dbSettingElement != null) {
		boolean directionHorizontal = this.getBooleanValue(element,
				"direction_horizontal");
		int scale = this.getIntValue(element, "scale");
		String paperSize = this.getStringValue(element, "paper_size");
		int topMargin = this.getIntValue(element, "top_margin");
		int leftMargin = this.getIntValue(element, "left_margin");
		int bottomMargin = this.getIntValue(element, "bottom_margin");
		int rightMargin = this.getIntValue(element, "right_margin");

		PageSetting pageSetting = new PageSetting(directionHorizontal,
				scale, paperSize, topMargin, rightMargin, bottomMargin,
				leftMargin);
		diagram.setPageSetting(pageSetting);
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:20,代码来源:XMLLoader.java

示例6: setPaperSize

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
private void setPaperSize(final Combo combo) {
    for (final String paperSize : PageSetting.getAllPaperSize()) {
        combo.add(paperSize);
    }

    combo.select(0);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:8,代码来源:PageSettingDialog.java

示例7: setupPrinterGraphicsFor

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void setupPrinterGraphicsFor(final Graphics graphics, final IFigure figure) {
    final ERDiagram diagram = getDiagram();
    final PageSetting pageSetting = diagram.getPageSetting();

    final double dpiScale = (double) getPrinter().getDPI().x / Display.getCurrent().getDPI().x * pageSetting.getScale() / 100;

    final Rectangle printRegion = getPrintRegion();
    // put the print region in display coordinates
    printRegion.width /= dpiScale;
    printRegion.height /= dpiScale;

    final Rectangle bounds = figure.getBounds();
    final double xScale = (double) printRegion.width / bounds.width;
    final double yScale = (double) printRegion.height / bounds.height;
    switch (getPrintMode()) {
        case FIT_PAGE:
            graphics.scale(Math.min(xScale, yScale) * dpiScale);
            break;
        case FIT_WIDTH:
            graphics.scale(xScale * dpiScale);
            break;
        case FIT_HEIGHT:
            graphics.scale(yScale * dpiScale);
            break;
        default:
            graphics.scale(dpiScale);
    }
    graphics.setForegroundColor(figure.getForegroundColor());
    graphics.setBackgroundColor(figure.getBackgroundColor());
    graphics.setFont(figure.getFont());
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:36,代码来源:PrintERDiagramOperation.java

示例8: ERDiagram

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
public ERDiagram(final String database) {
    diagramContents = new DiagramContents();
    diagramContents.getSettings().setDatabase(database);
    pageSetting = new PageSetting();

    setDefaultColor(128, 128, 192);
    setColor(255, 255, 255);

    if (Display.getCurrent() != null) {
        final FontData fontData = Display.getCurrent().getSystemFont().getFontData()[0];
        setFontName(fontData.getName());
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:14,代码来源:ERDiagram.java

示例9: createXML

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
private String createXML(final PageSetting pageSetting) {
    final StringBuilder xml = new StringBuilder();

    xml.append("<direction_horizontal>").append(pageSetting.isDirectionHorizontal()).append("</direction_horizontal>\n");
    xml.append("<scale>").append(pageSetting.getScale()).append("</scale>\n");
    xml.append("<paper_size>").append(escape(pageSetting.getPaperSize())).append("</paper_size>\n");
    xml.append("<top_margin>").append(pageSetting.getTopMargin()).append("</top_margin>\n");
    xml.append("<left_margin>").append(pageSetting.getLeftMargin()).append("</left_margin>\n");
    xml.append("<bottom_margin>").append(pageSetting.getBottomMargin()).append("</bottom_margin>\n");
    xml.append("<right_margin>").append(pageSetting.getRightMargin()).append("</right_margin>\n");

    return xml.toString();
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:14,代码来源:PersistentXmlImpl.java

示例10: setPaperSize

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
private void setPaperSize(Combo combo) {
	for (String paperSize : PageSetting.getAllPaperSize()) {
		combo.add(paperSize);
	}

	combo.select(0);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:8,代码来源:PageSettingDialog.java

示例11: perfomeOK

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
@Override
protected void perfomeOK() throws InputException {
	this.pageSetting = new PageSetting(this.hButton.getSelection(),
			this.scaleSpinner.getSelection(), this.sizeCombo.getText(),
			this.topMarginSpinner.getSelection(),
			this.rightMarginSpinner.getSelection(),
			this.bottomMarginSpinner.getSelection(),
			this.leftMarginSpinner.getSelection());
	this.diagram.setPageSetting(this.pageSetting);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:11,代码来源:PageSettingDialog.java

示例12: setupPrinterGraphicsFor

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void setupPrinterGraphicsFor(Graphics graphics, IFigure figure) {
	ERDiagram diagram = this.getDiagram();
	PageSetting pageSetting = diagram.getPageSetting();

	double dpiScale = (double) getPrinter().getDPI().x
			/ Display.getCurrent().getDPI().x * pageSetting.getScale()
			/ 100;

	Rectangle printRegion = getPrintRegion();
	// put the print region in display coordinates
	printRegion.width /= dpiScale;
	printRegion.height /= dpiScale;

	Rectangle bounds = figure.getBounds();
	double xScale = (double) printRegion.width / bounds.width;
	double yScale = (double) printRegion.height / bounds.height;
	switch (getPrintMode()) {
	case FIT_PAGE:
		graphics.scale(Math.min(xScale, yScale) * dpiScale);
		break;
	case FIT_WIDTH:
		graphics.scale(xScale * dpiScale);
		break;
	case FIT_HEIGHT:
		graphics.scale(yScale * dpiScale);
		break;
	default:
		graphics.scale(dpiScale);
	}
	graphics.setForegroundColor(figure.getForegroundColor());
	graphics.setBackgroundColor(figure.getBackgroundColor());
	graphics.setFont(figure.getFont());
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:38,代码来源:PrintERDiagramOperation.java

示例13: ERDiagram

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
public ERDiagram(String database) {
	this.diagramContents = new DiagramContents();
	this.diagramContents.getSettings().setDatabase(database);
	this.pageSetting = new PageSetting();

	this.setDefaultColor(128, 128, 192);
	this.setColor(255, 255, 255);

	if (Display.getCurrent() != null) {
		FontData fontData = Display.getCurrent().getSystemFont()
				.getFontData()[0];
		this.setFontName(fontData.getName());
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:15,代码来源:ERDiagram.java

示例14: perfomeOK

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的package包/类
@Override
protected void perfomeOK() throws InputException {
    pageSetting = new PageSetting(hButton.getSelection(), scaleSpinner.getSelection(), sizeCombo.getText(), topMarginSpinner.getSelection(), rightMarginSpinner.getSelection(), bottomMarginSpinner.getSelection(), leftMarginSpinner.getSelection());
    diagram.setPageSetting(pageSetting);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:6,代码来源:PageSettingDialog.java

示例15: paintGrid

import org.insightech.er.editor.model.settings.PageSetting; //导入依赖的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


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