當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。