Examples of ImageFigure


Examples of diva.canvas.toolbox.ImageFigure

                tracker.waitForID(0);
            } catch (InterruptedException e) {
                System.err.println(e + "... in LayerImageFigure");
            }

            ImageFigure imgFig = new ImageFigure(img);
            imgFig.translate(300, 100);
            return imgFig;
        }
View Full Code Here

Examples of diva.canvas.toolbox.ImageFigure

    protected ImageFigure _createFigure() throws IllegalActionException {
        URL url = fileOrURL.asURL();

        Image image = Toolkit.getDefaultToolkit().createImage(url);

        ImageFigure figure = new ImageFigure(image);

        return figure;
    }
View Full Code Here

Examples of diva.canvas.toolbox.ImageFigure

            } catch (IOException ex) {
                // Ignore, we can't find the icon.
            }
        }

        Figure newFigure = new ImageFigure(_scaledImage);
        _addLiveFigure(newFigure);

        return newFigure;
    }
View Full Code Here

Examples of diva.canvas.toolbox.ImageFigure

            tracker.waitForID(0);
        } catch (InterruptedException e) {
            System.err.println(e + "... in FigureTutorial");
        }

        ImageFigure imgFig = new ImageFigure(img);
        imgFig.translate(300, 100);
        layer.add(imgFig);
        imgFig.setInteractor(defaultInteractor);
        imgFig.setToolTipText("Image figure");
    }
View Full Code Here

Examples of diva.canvas.toolbox.ImageFigure

     */
    public FigureIcon(Figure figure, boolean antialias) {
        super();

        if (figure instanceof ImageFigure) {
            ImageFigure imageFigure = (ImageFigure) figure;
            setImage(imageFigure.getImage());
        } else {
            Rectangle2D bounds = figure.getBounds();
            BufferedImage image = new BufferedImage((int) bounds.getWidth(),
                    (int) bounds.getHeight(), BufferedImage.TYPE_INT_RGB);
            Graphics2D graphics = image.createGraphics();
View Full Code Here

Examples of diva.canvas.toolbox.ImageFigure

     */
    public FigureIcon(Figure figure, int x, int y, int border, boolean antialias) {
        super();

        if (figure instanceof ImageFigure && (border == 0)) {
            ImageFigure imageFigure = (ImageFigure) figure;
            Image image = imageFigure.getImage();
            if (image != null) {
                image = image.getScaledInstance(x, y, Image.SCALE_DEFAULT);
                setImage(image);
            } else {
                throw new NullPointerException("Failed to get an image from "
View Full Code Here

Examples of jsky.image.graphics.ImageFigure

        ListIterator it = figureList.listIterator(0);
        int i = 0;
        while (it.hasNext()) {
            CanvasFigure cfig = (CanvasFigure) it.next();
            if (cfig instanceof ImageFigure) {
                ImageFigure fig = (ImageFigure) cfig;
                Shape shape = fig.getShape();
                Paint fill = fig.getFillPaint();
                Paint outline = fig.getStrokePaint();
                float lineWidth = fig.getLineWidth();
                Composite composite = fig.getComposite();
                try {
                    String type = getType(shape);
                    String coords = getCoords(shape);
                    String config = getConfig(fill, outline, (int) lineWidth, composite);
                    typeList.add(type);
                    coordList.add(coords);
                    configList.add(config);
                } catch (Exception e) {
                    continue; // ignore unsupported figures
                }
            } else if (cfig instanceof ImageLabel) {
                ImageLabel fig = (ImageLabel) cfig;
                Font font = fig.getFont();
                String text = fig.getString();
                Paint fill = fig.getFillPaint();
                typeList.add("text");
                coordList.add(getCoords((Point2D.Double) fig.getAnchorPoint()));
                configList.add(getConfig(text, font, fill));
            }
            i++;
        }
View Full Code Here

Examples of org.eclipse.draw2d.ImageFigure

    }
   
    private IFigure feedbackFigure = null;
    private IFigure getFeedbackFigure() {
        if (feedbackFigure == null) {
            feedbackFigure = new ImageFigure(SharedImages.getImage("icons/insertion_cursor.gif"));
            feedbackFigure.setSize(ActionGraphUtils.ACTION_SIZE, ActionGraphUtils.ACTION_SIZE);
        }
        return feedbackFigure;
    }
View Full Code Here

Examples of org.eclipse.draw2d.ImageFigure

*/
public class NonVisualComponentEditPart extends NodeEditPart
{
    protected IFigure createFigure()
    {
        IFigure figure_ = new ImageFigure(getTagConverter().getVisualImage())
        {

            protected void paintFigure(Graphics graphics) {
                super.paintFigure(graphics);
               
                if (getImage() == null)
                    return;

                Rectangle srcRect = new Rectangle(getImage().getBounds());
                graphics.drawImage(getImage(), srcRect, getClientArea());
            }
           
        };
       
        figure_.setMinimumSize(new Dimension(0,0));
        return figure_;
    }
View Full Code Here

Examples of org.eclipse.draw2d.ImageFigure

    }
    final Image img = new Image(display, id);

    image.dispose();

    final ImageFigure fig = new ImageFigure(img);
    final Rectangle bounds = img.getBounds();
    fig.setBounds(new org.eclipse.draw2d.geometry.Rectangle(bounds));
    fig.setLayoutManager(new XYLayout());
    fig.setAlignment(PositionConstants.NORTH | PositionConstants.WEST);
    return fig;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.