Package org.apache.batik.gvt.event

Examples of org.apache.batik.gvt.event.SelectionEvent


            p = t.transform(p, null);

            if (isDeselectGesture(evt)) {

                dispatchSelectionEvent(
                        new SelectionEvent(null,
                                SelectionEvent.SELECTION_CLEARED,
                                null));
                copyToClipboard(null);

            } else if (isSelectStartGesture(evt)) {

                selectionNode = source;
                ((Selectable) source).selectAt(p.getX(), p.getY(),
                                                          renderContext);
                dispatchSelectionEvent(
                        new SelectionEvent(null,
                                SelectionEvent.SELECTION_STARTED,
                                null));

            } else if (isSelectEndGesture(evt)) {

                selectionNode = source;

                ((Selectable) source).selectTo(p.getX(), p.getY(),
                                                          renderContext);

                Object oldSelection = getSelection();
                Shape newShape =
                    ((Selectable) source).getHighlightShape(renderContext);
                dispatchSelectionEvent(
                        new SelectionEvent(oldSelection,
                                SelectionEvent.SELECTION_DONE,
                                newShape));
                copyToClipboard(oldSelection);

            } else

            if (isSelectContinueGesture(evt)) {

                if (selectionNode == source) {
                    boolean result = ((Selectable) source).selectTo(p.getX(), p.getY(),
                                                        renderContext);
                    if (result) {
                        Shape newShape =
                        ((Selectable) source).getHighlightShape(renderContext);

                        dispatchSelectionEvent(
                            new SelectionEvent(null,
                                SelectionEvent.SELECTION_CHANGED,
                                newShape));
                    }
                }

            } else if (isSelectAllGesture(evt)) {

                selectionNode = source;

                ((Selectable) source).selectAll(p.getX(), p.getY(),
                                                        renderContext);
                Object oldSelection = getSelection();
                Shape newShape =
                    ((Selectable) source).getHighlightShape(renderContext);
                dispatchSelectionEvent(
                        new SelectionEvent(oldSelection,
                                SelectionEvent.SELECTION_DONE,
                                newShape));
                copyToClipboard(oldSelection);

            }
View Full Code Here

TOP

Related Classes of org.apache.batik.gvt.event.SelectionEvent

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.