
net.vectorpublish.desktop.vp.api.vpd.DocumentNode 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.vpd;
import java.awt.Dimension;
import java.io.File;
import java.util.List;
import java.util.Set;
import javax.swing.JComponent;
import net.vectorpublish.desktop.vp.History.HistoryStep;
import net.vectorpublish.desktop.vp.api.DrawParticipant;
import net.vectorpublish.desktop.vp.api.ui.MouseParticipant;
import net.vectorpublish.desktop.vp.api.ui.kf.Keyframe;
import net.vectorpublish.desktop.vp.api.vpd.ModificationContext.LayerNodeImpl;
import net.vectorpublish.desktop.vp.pd.official.DrawPanel;
import net.vectorpublish.desktop.vp.pd.official.RelativeKeyframeRecalculator;
import net.vectorpublish.desktop.vp.pd.official.VectorPublishGraphics;
public interface DocumentNode extends VectorPublishNode, LayerName, StatusName {
/**
* Adds a new Keyframe and move the slider to the time.
*
* @param kf
* The Keyframe.
* @param ctx
* The ModificationContext to notify about modifications. We may
* use it to repaint some components.
*/
void addKeyframe(Keyframe kf, ModificationContext ctx);
void addTrunk(LayerNodeImpl layerNodeImpl);
/**
* Find a {@link VectorPublishNode} by indexes from root.
*
* If the list has two indexes(3
and 0
) from the
* {@link DocumentNode documents} 4th child his 1st {@link VectorPublishNode
* child} will be returned.
*
* @param list
* The list of indexes from root or empty for root itself, never
* null
.
* @return The Node found along the path or null
if the node
* has not been found.
*/
VectorPublishNode findByIndex(List list);
/**
* Returns a set of {@link MouseParticipant} currently on the
* {@link DrawPanel}, no matter if they are visible or not. The set can not
* contain null
elements.
*
* @return A set of {@link MouseParticipant}.
*/
Set getAllPaintParticipants();
JComponent getComponent();
/**
* Returns a immutable Set of Keyframes. This Set is not modifyable and not
* sorted.
*
* @return The immutable {@link Set} of Keyframes, never null
.
*/
Set getKeyframes();
/**
* The {@link HistoryStep} actually executed.
*
* @return The last {@link HistoryStep} that is executed, never
* null
.
*/
HistoryStep> getLastExecutedHistoryStep();
@Override
@Deprecated
VectorPublishNode getParent();
String getTitle();
void notify(Set updateList);
void paintChildren(DrawParticipant relative, VectorPublishGraphics graphics, int documentWidth, int documentHeight);
void paintChildrenOuter(DrawParticipant relative, VectorPublishGraphics graphics,
RelativeKeyframeRecalculator relativeRecalculator, int documentWidth, int documentHeight);
/**
* Removes the {@link LayerNodeImpl trunk} from the {@link DocumentNode
* document}.
*
* @param layerNodeImpl
* The trunk to remove, never null
.
*/
void removeTrunk(LayerNodeImpl layerNodeImpl);
void setFile(File f);
void setLastExecutedHistoryStep(HistoryStep> newStep);
/**
* The participant.
*/
DrawParticipant getParticipant();
/**
* Calculates what font boundarys must exists to display the given Text
* using the default font size.
*
*
* If the size is a fraction its rounded up to an integer.
*
* @param text
* The text to calculate boundary for.
* @return The boundary of the text, never null
.
*/
Dimension calculateTextBoundary(String text);
}