/* BlinkenLightsInteractiveMovieProgram
* version 1.0 date 2005-03-24
* Copyright (C) 2004-2005: Stefan Schuermans <1stein@schuermans.info>
* Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
* a blinkenarea.org project
* powered by eventphone.de
*/
import java.awt.*;
import java.awt.image.*;
public class BlinkenFrameEditor extends BlinkenFrameDisplay
implements BlinkenFrameDisplayListener, BlinkenFrameDisplayInterceptor
{
//tool constants
public static final int toolNone = 0,
toolColorPicker = 1,
toolDot = 2,
toolLine = 3,
toolRect = 4,
toolFilledRect = 5,
toolCircle = 6,
toolFilledCircle = 7,
toolCopy = 8,
toolPaste = 9;
//configuration variables
BlinkenFrameDisplayListener displayListener = null;
BlinkenFrameDisplayInterceptor displayInterceptor = null;
BlinkenFrameEditorListener editorListener = null;
int tool = toolNone;
Color color = Color.white;
//internal state variables
int pressX = 0, pressY = 0; //position of mouse where mouse button was pressed
boolean press = false; //if this position is available
int curX = 0, curY = 0; //current position of mouse
boolean cur = false; //if this position is available
//clipboard for copy & paste
BlinkenFrame clipboard = null; //contents
int clipboardRefX = 0, clipboardRefY = 0; //reference position
//undo / redo buffers
static final int maxUndo = 16; //maximum depth of undo / redo buffer
BlinkenFrame buffersUndo[], buffersRedo[]; //the buffers
int cntUndo, cntRedo; //number of entries in buffers
public BlinkenFrameEditor( )
{
int i;