Tabnine Logo
ImageFigure
Code IndexAdd Tabnine to your IDE (free)

How to use
ImageFigure
in
org.jhotdraw.draw

Best Java code snippets using org.jhotdraw.draw.ImageFigure (Showing top 18 results out of 315)

origin: net.imagej/imagej-ui-swing

@Override
public Figure createDefaultFigure() {
  final ImageFigure figure = new ImageFigure();
  figure.setTransformable(false);
  initDefaultSettings(figure);
  return figure;
}
origin: net.imagej/imagej-ui-swing

@Override
public void update() {
  log.debug("Updating image figure: " + this);
  final Image image = datasetView.getScreenImage().image();
  final BufferedImage bufImage = AWTImageTools.makeBuffered(image);
  figure.setBounds(new Rectangle2D.Double(0, 0, bufImage.getWidth(),
    bufImage.getHeight()));
  figure.setBufferedImage(bufImage);
}
origin: net.imagej/imagej-ui-swing

@Override
public void dispose() {
  getFigure().requestRemove();
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Sets the buffered image.
 * This clears the image data.
 */
@Override
public void setBufferedImage(BufferedImage image) {
  willChange();
  this.imageData = null;
  this.bufferedImage = image;
  changed();
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Transforms the figure.
 * @param tx The transformation.
 */
@Override
public void transform(AffineTransform tx) {
  Point2D.Double anchor = getStartPoint();
  Point2D.Double lead = getEndPoint();
  setBounds(
      (Point2D.Double) tx.transform(anchor, anchor),
      (Point2D.Double) tx.transform(lead, lead));
}
// ATTRIBUTES
origin: net.imagej/imagej-ui-swing

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);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

icon.paintIcon(null, g, 0, 0);
g.dispose();
ImageFigure imf = new ImageFigure();
imf.setBufferedImage(bimg);
imf.set(STROKE_COLOR, null);
imf.setBounds(new Point2D.Double(0, 0), new Point2D.Double(icon.getIconWidth(), icon.getIconHeight()));
origin: net.imagej/imagej-ui-swing

figure.set(AttributeKeys.FILL_COLOR, new Color(0, 0, 0, 0));
final RegionOfInterest roi = overlay.getData().getRegionOfInterest();
if (roi != null) {
    Raster.createRaster(sm, db, new java.awt.Point(0, 0));
  img.setData(raster);
  figure.setBounds(new Rectangle2D.Double(minX, minY, w, h));
  figure.setBufferedImage(img);
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
protected void drawFigure(Graphics2D g) {
  if (get(FILL_COLOR) != null) {
    g.setColor(get(FILL_COLOR));
    drawFill(g);
  }
  drawImage(g);
  if (get(STROKE_COLOR) != null && get(STROKE_WIDTH) > 0d) {
    g.setStroke(AttributeKeys.getStroke(this));
    g.setColor(get(STROKE_COLOR));
    drawStroke(g);
  }
  if (get(TEXT_COLOR) != null) {
    if (get(TEXT_SHADOW_COLOR) != null
        && get(TEXT_SHADOW_OFFSET) != null) {
      Dimension2DDouble d = get(TEXT_SHADOW_OFFSET);
      g.translate(d.width, d.height);
      g.setColor(get(TEXT_SHADOW_COLOR));
      drawText(g);
      g.translate(-d.width, -d.height);
    }
    g.setColor(get(TEXT_COLOR));
    drawText(g);
  }
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * 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());
}
origin: net.imagej/ij-ui-swing

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);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * 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());
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Sets the image data.
 * This clears the buffered image.
 * <p>
 * Note: For performance reasons this method stores a reference to the
 * imageData array instead of cloning it. Do not modify the image data array
 * after invoking this method.
 */
public void setImageData(byte[] imageData) {
  willChange();
  this.imageData = imageData;
  this.bufferedImage = null;
  changed();
}
origin: net.imagej/ij-ui-swing

@Override
public void update() {
  final LogService log =
    datasetView.getData().getContext().getService(LogService.class);
  log.debug("Updating image figure: " + this);
  final Image image = datasetView.getScreenImage().image();
  final BufferedImage bufImage = AWTImageTools.makeBuffered(image);
  figure.setBounds(new Rectangle2D.Double(0, 0, bufImage.getWidth(),
    bufImage.getHeight()));
  figure.setBufferedImage(bufImage);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * 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;
}

origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Sets the image.
 *
 * @param imageData The image data. If this is null, a buffered image must
 * be provided.
 * @param bufferedImage An image constructed from the imageData. If this
 * is null, imageData must be provided.
 */
@Override
public void setImage(byte[] imageData, BufferedImage bufferedImage) {
  willChange();
  this.imageData = imageData;
  this.bufferedImage = bufferedImage;
  changed();
}
origin: net.imagej/ij-ui-swing

@Override
public void dispose() {
  getFigure().requestRemove();
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

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);
org.jhotdraw.drawImageFigure

Javadoc

A default implementation of ImageHolderFigure which can hold a buffered image.

Most used methods

  • <init>
  • setBounds
  • setBufferedImage
    Sets the buffered image. This clears the image data.
  • requestRemove
  • set
  • setSelectable
  • setTransformable
  • changed
  • drawFill
  • drawImage
  • drawStroke
  • drawText
  • drawStroke,
  • drawText,
  • get,
  • getBufferedImage,
  • getEndPoint,
  • getImageData,
  • getStartPoint,
  • loadImage,
  • setImageData,
  • willChange

Popular in Java

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • notifyDataSetChanged (ArrayAdapter)
  • getExternalFilesDir (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now