@Override public Figure createDefaultFigure() { final ImageFigure figure = new ImageFigure(); figure.setTransformable(false); initDefaultSettings(figure); return figure; }
icon.paintIcon(null, g, 0, 0); g.dispose(); ImageFigure imf = new ImageFigure(); imf.setBufferedImage(bimg); imf.set(STROKE_COLOR, null);
/** * 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()); }
public DatasetFigureView(final SwingImageDisplayViewer displayViewer, final DatasetView datasetView) { setContext(datasetView.getContext()); this.datasetView = datasetView; final JHotDrawImageCanvas canvas = displayViewer.getCanvas(); final Drawing drawing = canvas.getDrawing(); figure = new ImageFigure(); figure.setSelectable(false); figure.setTransformable(false); final Dataset dataset = datasetView.getData(); final double minX = dataset.getImgPlus().realMin(0); final double minY = dataset.getImgPlus().realMin(1); final double maxX = dataset.getImgPlus().realMax(0); final double maxY = dataset.getImgPlus().realMax(1); figure.setBounds(new Point2D.Double(minX, minY), new Point2D.Double(maxX, maxY)); drawing.add(figure); }
/** * 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; }
public DatasetFigureView(final SwingImageDisplayViewer displayViewer, final DatasetView datasetView) { this.datasetView = datasetView; final JHotDrawImageCanvas canvas = displayViewer.getCanvas(); final Drawing drawing = canvas.getDrawing(); figure = new ImageFigure(); figure.setSelectable(false); figure.setTransformable(false); final Dataset dataset = datasetView.getData(); final double minX = dataset.getImgPlus().realMin(0); final double minY = dataset.getImgPlus().realMin(1); final double maxX = dataset.getImgPlus().realMax(0); final double maxY = dataset.getImgPlus().realMax(1); figure.setBounds(new Point2D.Double(minX, minY), new Point2D.Double(maxX, maxY)); drawing.add(figure); final ImageJ context = dataset.getContext(); final EventService eventService = context.getService(EventService.class); subscribers = eventService.subscribe(this); }
ButtonFactory.addToolTo(tb, editor, new TextCreationTool(new TextFigure()), "edit.createText", labels); ButtonFactory.addToolTo(tb, editor, new TextAreaCreationTool(new TextAreaFigure()), "edit.createTextArea", labels); ButtonFactory.addToolTo(tb, editor, new ImageTool(new ImageFigure()), "edit.createImage", labels);