/** * Creates a new Drawing for this view. */ protected Drawing createDrawing() { Drawing drawing = new QuadTreeDrawing(); DOMStorableInputOutputFormat ioFormat = new DOMStorableInputOutputFormat(new DrawFigureFactory()); drawing.addInputFormat(ioFormat); ImageFigure prototype = new ImageFigure(); drawing.addInputFormat(new ImageInputFormat(prototype)); drawing.addInputFormat(new TextInputFormat(new TextFigure())); TextAreaFigure taf = new TextAreaFigure(); taf.setBounds(new Point2D.Double(10,10), new Point2D.Double(60,40)); drawing.addInputFormat(new TextInputFormat(taf)); drawing.addOutputFormat(ioFormat); drawing.addOutputFormat(new ImageOutputFormat()); return drawing; }
/** * Configure Drawing object to support copy and paste. */ @SuppressWarnings("unchecked") private void initDrawing(Drawing d) { d.setInputFormats((java.util.List<InputFormat>) Collections.EMPTY_LIST); d.setOutputFormats((java.util.List<OutputFormat>) Collections.EMPTY_LIST); DOMStorableInputOutputFormat ioFormat = new DOMStorableInputOutputFormat( new DrawFigureFactory()); d.addInputFormat(ioFormat); d.addInputFormat(new ImageInputFormat(new ImageFigure())); d.addInputFormat(new TextInputFormat(new TextFigure())); d.addOutputFormat(ioFormat); d.addOutputFormat(new ImageOutputFormat()); }
/** * Configure Drawing object to support copy and paste. */ @SuppressWarnings("unchecked") private void initDrawing(Drawing d) { d.setInputFormats((java.util.List<InputFormat>) Collections.EMPTY_LIST); d.setOutputFormats((java.util.List<OutputFormat>) Collections.EMPTY_LIST); DOMStorableInputOutputFormat ioFormat = new DOMStorableInputOutputFormat( new NetFactory()); d.addInputFormat(ioFormat); d.addInputFormat(new ImageInputFormat(new ImageFigure())); d.addInputFormat(new TextInputFormat(new TextFigure())); d.addOutputFormat(ioFormat); d.addOutputFormat(new ImageOutputFormat()); }