Package org.apache.flex.forks.batik.gvt.event

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


    public void changeCompleted (GraphicsNodeChangeEvent gnce) {
        if (selectionNode == null) return;
        Shape newShape =
            ((Selectable)selectionNode).getHighlightShape();
        dispatchSelectionEvent
            (new SelectionEvent(getSelection(),
                                SelectionEvent.SELECTION_CHANGED,
                                newShape));
    }
View Full Code Here


            throw new Error("Markers not from same TextNode");
        node.setSelection(begin, end);
        selectionNode = node;
        Object selection = getSelection();
        Shape  shape     = node.getHighlightShape();
        dispatchSelectionEvent(new SelectionEvent
            (selection, SelectionEvent.SELECTION_DONE, shape));
    }
View Full Code Here

    }

    public void clearSelection() {
        if (selectionNode == null)
            return;
        dispatchSelectionEvent(new SelectionEvent
            (null, SelectionEvent.SELECTION_CLEARED, null));
        selectionNode = null;
    }
View Full Code Here

                }

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

            } else if (isSelectEndGesture(evt)) {
                if (selectionNode == source)
                    ((Selectable) source).selectTo(p.getX(), p.getY());
                Object oldSelection = getSelection();
                if (selectionNode != null) {
                    Shape newShape;
                    newShape = ((Selectable)selectionNode).getHighlightShape();
                    dispatchSelectionEvent
                        (new SelectionEvent(oldSelection,
                                            SelectionEvent.SELECTION_DONE,
                                            newShape));
                }
            } else if (isSelectContinueGesture(evt)) {

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

                        dispatchSelectionEvent(
                            new SelectionEvent(null,
                                SelectionEvent.SELECTION_CHANGED,
                                newShape));
                    }
                }
            } else if ((source instanceof Selectable) &&
                       (isSelectAllGesture(evt))) {
                if (selectionNode != source) {
                    if (selectionNode != null)
                        selectionNode.getRoot()
                            .removeTreeGraphicsNodeChangeListener(this);
                    if (source != null)
                        source.getRoot()
                            .addTreeGraphicsNodeChangeListener(this);
                }
                selectionNode = source;
                ((Selectable) source).selectAll(p.getX(), p.getY());
                Object oldSelection = getSelection();
                Shape newShape =
                    ((Selectable) source).getHighlightShape();
                dispatchSelectionEvent(
                        new SelectionEvent(oldSelection,
                                SelectionEvent.SELECTION_DONE,
                                newShape));
            }
        }
    }
View Full Code Here

            return;
        }
        Shape newShape =
            ((Selectable)selectionNode).getHighlightShape();
        dispatchSelectionEvent
            (new SelectionEvent(getSelection(),
                                SelectionEvent.SELECTION_CHANGED,
                                newShape));
    }
View Full Code Here

        node.setSelection(begin, end);
        selectionNode = node;
        selectionNodeRoot = node.getRoot();
        Object selection = getSelection();
        Shape  shape     = node.getHighlightShape();
        dispatchSelectionEvent(new SelectionEvent
            (selection, SelectionEvent.SELECTION_DONE, shape));
    }
View Full Code Here

    public void clearSelection() {
        if (selectionNode == null) {
            return;
        }
        dispatchSelectionEvent(new SelectionEvent
            (null, SelectionEvent.SELECTION_CLEARED, null));
        selectionNode = null;
        selectionNodeRoot = null;
    }
View Full Code Here

                    }
                }

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

            } else if (isSelectEndGesture(evt)) {
                if (selectionNode == source)  {
                    ((Selectable) source).selectTo(p.getX(), p.getY());
                }
                Object oldSelection = getSelection();
                if (selectionNode != null) {
                    Shape newShape;
                    newShape = ((Selectable)selectionNode).getHighlightShape();
                    dispatchSelectionEvent
                        (new SelectionEvent(oldSelection,
                                            SelectionEvent.SELECTION_DONE,
                                            newShape));
                }
            } else if (isSelectContinueGesture(evt)) {

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

                        dispatchSelectionEvent(
                            new SelectionEvent(null,
                                SelectionEvent.SELECTION_CHANGED,
                                newShape));
                    }
                }
            } else if ((source instanceof Selectable) &&
                       (isSelectAllGesture(evt))) {
                if (selectionNode != source) {
                    if (selectionNode != null) {
                        selectionNodeRoot
                            .removeTreeGraphicsNodeChangeListener(this);
                    }
                    selectionNode = source;
                    if (source != null) {
                        selectionNodeRoot = source.getRoot();
                        selectionNodeRoot
                            .addTreeGraphicsNodeChangeListener(this);
                    }
                }
                ((Selectable) source).selectAll(p.getX(), p.getY());
                Object oldSelection = getSelection();
                Shape newShape =
                    ((Selectable) source).getHighlightShape();
                dispatchSelectionEvent(
                        new SelectionEvent(oldSelection,
                                SelectionEvent.SELECTION_DONE,
                                newShape));
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.forks.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.