
net.vectorpublish.desktop.vp.api.DrawParticipant Maven / Gradle / Ivy
/*
* Copyright (c) 2016, Peter Rader. All rights reserved.
* ___ ___ __ ______ __ __ __ __
* | | |.-----..----.| |_ .-----..----.| __ \.--.--.| |--.| ||__|.-----.| |--.
* | | || -__|| __|| _|| _ || _|| __/| | || _ || || ||__ --|| |
* \_____/ |_____||____||____||_____||__| |___| |_____||_____||__||__||_____||__|__|
*
* http://www.gnu.org/licenses/gpl-3.0.html
*/
package net.vectorpublish.desktop.vp.api;
import java.awt.Dimension;
import net.vectorpublish.desktop.vp.api.ui.MouseParticipant;
import net.vectorpublish.desktop.vp.pd.official.RelativeKeyframeRecalculator;
import net.vectorpublish.desktop.vp.pd.official.VectorPublishGraphics;
/**
* The draw-participant.
*
* A radical element who gives ui-contributions to the Document.
*/
public interface DrawParticipant extends MouseParticipant {
/**
* Returns the size of the participant.
*
* Usually used for performance-tuning only. Note: This value always returns a new instance.
*
* @return The Size of the participant.
*/
Dimension getDimensions();
/**
* Returns true if this participant is transparent.
*
* This is important for png-files to export in example, also you can
* shine-throu to the parent nodes.
*
* @return true
if the transparency is supported,
* false
if not.
*/
boolean opacity();
/**
* Paints inside the Document.
*
* We are limited to the width and height of the document.
*
* @param graphics
* The graphics we write to.
* @param documentWidth
* The virtual-document-width of the document.
* @param documentHeight
* The virtual-document-height of the document.
*/
void paint(VectorPublishGraphics graphics, int documentWidth, int documentHeight);
/**
* Paint outside of the pixel-true document.
*
* The "outside" means that you can paint outside of the document you see in
* the UI. You can paint rulers for example or other elements that are not
* part of the document. If you export the document to an image, the outside
* is nither painted to the Image nor physically printed to the Printer by
* default.
*
* The document-width and document-height will not specify the range of
* painting.
*
* This method is only called on elements that has a Panel who is connected
* to a Document.
*
* We need a recalculator to recalculate from virtual-pixel to
* technical-pixel because only if we have a zoom at 100% a virtual-pixel is
* as large as the technical pixel.
*
* @param graphics
* The outer graphics to use.
* @param relativeRecalculator
* The recalculator to recalculate from virtual sizes we
* translate from the Document to technical graphic-card pixel
* values.
* @param documentWidth
* The virtual-pixel width of the document.
* @param documentHeight
* The virtual-pixel height of the document.
*/
void paintOutside(VectorPublishGraphics graphics, RelativeKeyframeRecalculator relativeRecalculator,
int documentWidth, int documentHeight);
}