Package org.joshy.gfx.draw

Examples of org.joshy.gfx.draw.FlatColor


        context.mainPanel.add(context.stackPanel);
        context.mainPanel.add(context.getToolbar());
        context.sidebarContainer = new DisclosurePanel()
                .setTitle(new Label(getString("menus.viewSidebar"))
                        .setFont(Font.name(DEFAULT_FONT_NAME).size(18).resolve())
                        .setColor(new FlatColor(0x404040))
                )
                .setPosition(DisclosurePanel.Position.Right)
                .setOpen(false);
        context.mainPanel.add(context.sidebarContainer);
        if(context.getSidebar() != null) {
View Full Code Here


        //draw a translucent green rect to layer 2
        PixelLayer layer2 = new PixelLayer(doc);
        doc.add(layer2);
        g = layer2.getGraphics();
        g.setFill(new FlatColor(0,1,0,0.5));
        g.fillRect(150,150,200,200);


        //draw an oval filled with blue
        PixelLayer layer3 = new PixelLayer(doc);
View Full Code Here

                        gfx.scale(1 / s, 1 / s);
                    }
                    gfx.translate(-x, -y);
                }
                if (context.getDocument().getCurrentPage() == item) {
                    gfx.setPaint(new FlatColor(0, 0, 0, 0.1));
                    gfx.fillRect(x, y, width, height);
                    gfx.setPaint(FlatColor.GRAY);
                    gfx.drawRect(x, y, width - 1, height - 1);
                } else {
                    gfx.setPaint(FlatColor.BLACK);
View Full Code Here

    public void draw(GFX g) {
        super.draw(g);
        if(dragItem != null) {
            g.setPaint(FlatColor.BLUE);
            g.drawRect(dragX,0,100,100);
            g.setPaint(new FlatColor(0,0,1.0,0.3));
            g.fillRect(dragX,0,100,100);
        }
        if(doDuplicate) {
            g.setPaint(FlatColor.PURPLE);
            g.fillRect(dragX-10,dragY-5,20,10);
View Full Code Here

        }

        @Override
        public void execute() throws Exception {
            PixelGraphics g = context.getDocument().getCurrentLayer().getGraphics();
            FlatColor color = context.getDocument().getForegroundColor();
            g.setFill(color);
            g.fillSelection(context.getCanvas().getSelection());
            context.getCanvas().getSelection().clear();
            context.getCanvas().redraw();
        }
View Full Code Here

        }
    }

    private void call(KeyEvent event) {
        if(event.getType() == KeyEvent.KeyReleased && event.getKeyCode() == KeyEvent.KeyCode.KEY_SPACE) {
            FlatColor fg = context.getDocument().getForegroundColor();
            FlatColor bg = context.getDocument().getBackgroundColor();
            context.getDocument().setForegroundColor(bg);
            context.getDocument().setBackgroundColor(fg);
        }
    }
View Full Code Here

        //swap fg and bg
        EventBus.getSystem().addListener(getCanvas(), KeyEvent.KeyTyped, new Callback<KeyEvent>() {
            public void call(KeyEvent keyEvent) throws Exception {
                if('x' == keyEvent.getKeyChar()) {
                    FlatColor c1 = fg.getSelectedColor();
                    FlatColor c2 = bg.getSelectedColor();
                    fg.setSelectedColor(c2);
                    bg.setSelectedColor(c1);
                }
            }
        });
View Full Code Here

        g.translate(context.getSketchCanvas().getPanX(),context.getSketchCanvas().getPanY());
        g.scale(context.getSketchCanvas().getScale(),context.getSketchCanvas().getScale());
        g.setPaint(FlatColor.RED);
        Bounds bounds = shape.getBounds();
        g.drawRect(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
        FlatColor color = new FlatColor(0xff097d);
        for(VHandle handle : handles) {
            switch(handle.getPosition()) {
                case Top:
                case Bottom:
                    g.setPaint(color);
View Full Code Here

        }
        if(sizeHandle != null) {
            Point2D.Double center = context.getSketchCanvas().transformToDrawing(node.getTranslateX(),node.getTranslateY());
            Point2D.Double pt = context.getSketchCanvas().transformToDrawing(sizeHandle.getX(),sizeHandle.getY());

            g.setPaint(new FlatColor(0x404040));
            g.drawLine(center.getX(),center.getY(),pt.getX(),pt.getY());
            if(isStar) {
                pt = context.getSketchCanvas().transformToDrawing(starHandle.getX(),starHandle.getY());
                g.drawLine(center.getX(),center.getY(),pt.getX(),pt.getY());
            }
View Full Code Here

    }

    private void generateNESPalette(Palette pal2) {
        try {
            for(String line : toLines(this.getClass().getResourceAsStream("nes.txt"))){
                pal2.add(new FlatColor(line));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

TOP

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

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.