Package org.joshy.gfx.draw

Examples of org.joshy.gfx.draw.PatternPaint


    @Override
    public void setX(double x, boolean constrain) {
        x -= shape.getBounds().getX();
        x -= getFill().getStart().getX();
        PatternPaint pat = getFill().deriveNewEnd(new Point2D.Double(x*10, getFill().getEnd().getY()));
        shape.setFillPaint(pat);
    }
View Full Code Here


    @Override
    public void setY(double y, boolean constrain) {
        y -= shape.getBounds().getY();
        y -= getFill().getStart().getY();
        PatternPaint pat = getFill().deriveNewEnd(new Point2D.Double(getFill().getEnd().getX(), y*10));
        shape.setFillPaint(pat);
    }
View Full Code Here

            gfx.setPaint(FlatColor.RED);
            int size = document.getRepeatSize();
            PixelTile tile = layer.getTile(0, 0);
            if(tile != null) {
                try {
                    PatternPaint pat = PatternPaint.create(tile.getBuffer().getSubimage(0,0,size,size),null);
                    gfx.setPaint(pat);
                    gfx.fillRect(0, 0, 600, 600);
                } catch (IOException e) {
                    e.printStackTrace();
                }
View Full Code Here

                    out.closeEntry();
                    writtenImages.put(image.getRelativeURL(),image.getBufferedImage());
                }
            }
            if(i instanceof PatternPaint) {
                PatternPaint paint = (PatternPaint) i;
                if(!writtenImages.containsKey(paint.getRelativeURL())) {
                    u.p("saving the real pattern paint  with relative url " + paint.getRelativeURL());
                    ZipEntry ie = new ZipEntry(dir+"/resources/"+ paint.getRelativeURL());
                    out.putNextEntry(ie);
                    ImageIO.write(paint.getImage(),"png",out);
                    out.flush();
                    out.closeEntry();
                    writtenImages.put(paint.getRelativeURL(),paint.getImage());
                }
            }
        }
        out.close();
    }
View Full Code Here

    @Override
    public void draw(GFX g, SketchCanvas canvas) {
        Point2D pt = new Point2D.Double(getX(),getY());
        pt = canvas.transformToDrawing(pt);
        PatternPaint pat = getFill();

        double x = pt.getX();
        double y = pt.getY();
        DrawUtils.drawStandardHandle(g, x, y, FlatColor.PURPLE);
    }
View Full Code Here

TOP

Related Classes of org.joshy.gfx.draw.PatternPaint

Copyright © 2018 www.massapicom. 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.