Package org.joshy.sketch.canvas

Examples of org.joshy.sketch.canvas.Selection


        propsPanel.add(new HFlexBox()
            .add(new Label("name"))
            .add(all_name));
        EventBus.getSystem().addListener(all_name, ActionEvent.Action, new Callback<Event>() {
             public void call(Event event) throws Exception {
                 Selection sel = ctx.getSelection();
                 if (sel.size() == 1) {
                     SNode n = sel.firstItem();
                     n.setId(all_name.getText());
                 }
             }
         });

        //cache
        //name
        all_cache = new Checkbox("cache");
        EventBus.getSystem().addListener(all_cache, ActionEvent.Action, new Callback<Event>() {
            public void call(Event event) throws Exception {
                Selection sel = ctx.getSelection();
                if (sel.size() == 1) {
                    SNode n = sel.firstItem();
                    n.setBooleanProperty("com.joshondesign.amino.nodecache",all_cache.isSelected());
                }
            }
        });
        propsPanel.add(all_cache);


        //cache as png image
        all_cache_image = new Checkbox("cache as image");
        EventBus.getSystem().addListener(all_cache_image, ActionEvent.Action, new Callback<Event>() {
            public void call(Event event) throws Exception {
                Selection sel = ctx.getSelection();
                if (sel.size() == 1) {
                    SNode n = sel.firstItem();
                    n.setBooleanProperty("com.joshondesign.amino.nodecacheimage",all_cache_image.isSelected());
                }
            }
        });
        propsPanel.add(all_cache_image);

        //text
        //cache as dynamic bitmap text
        bitmap_text = new Checkbox("use bitmap text");
        EventBus.getSystem().addListener(bitmap_text, ActionEvent.Action, new Callback<Event>() {
            public void call(Event event) throws Exception {
                Selection sel = ctx.getSelection();
                if (sel.size() == 1) {
                    SNode n = sel.firstItem();
                    n.setBooleanProperty("com.joshondesign.amino.bitmaptext",bitmap_text.isSelected());
                }
            }
        });
        propsPanel.add(bitmap_text);
View Full Code Here


    }

    @Override
    public void execute() throws Exception {
        Selection sel = context.getSelection();
        if(sel.isEmpty()) return;
        if(sel.size() > 1) return;
        SNode node = sel.firstItem();

        context.getDocument().getCurrentPage().remove(node);
        STransformNode trans = new STransformNode(node,context);
        context.getDocument().getCurrentPage().add(trans);

        sel.setSelectedNode(trans);
        context.redraw();
    }
View Full Code Here

TOP

Related Classes of org.joshy.sketch.canvas.Selection

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.