Examples of SelectionModel


Examples of diva.canvas.interactor.SelectionModel

     *  The resulting topology is the same in the sense
     *  of deep connectivities.
     */
    public void createHierarchy() {
        GraphController controller = _getGraphController();
        SelectionModel model = controller.getSelectionModel();
        AbstractBasicGraphModel graphModel = (AbstractBasicGraphModel) controller
                .getGraphModel();
        Object[] selection = model.getSelectionAsArray();

        // A set, because some objects may represent the same
        // ptolemy object.
        HashSet namedObjSet = new HashSet();
        HashSet nodeSet = new HashSet();
View Full Code Here

Examples of diva.canvas.interactor.SelectionModel

    public void delete() {
        // Note that we previously a delete was handled at the model level.
        // Now a delete is handled by generating MoML to carry out the delete
        // and handing that MoML to the parser
        GraphController controller = _getGraphController();
        SelectionModel model = controller.getSelectionModel();
        AbstractBasicGraphModel graphModel = (AbstractBasicGraphModel) controller
                .getGraphModel();
        Object[] selection = model.getSelectionAsArray();

        // Generate the MoML to carry out the deletion
        StringBuffer moml = _deleteMoML(graphModel, selection, model);

        // Next process the deletion MoML. This should be the large majority
View Full Code Here

Examples of diva.canvas.interactor.SelectionModel

     @return The set of selected objects.
     */
    protected HashSet _getSelectionSet() {
        GraphController controller = _getGraphController();
        GraphModel graphModel = controller.getGraphModel();
        SelectionModel model = controller.getSelectionModel();
        Object[] selection = model.getSelectionAsArray();

        // A set, because some objects may represent the same
        // ptolemy object.
        HashSet namedObjSet = new HashSet();
        HashSet nodeSet = new HashSet();
View Full Code Here

Examples of diva.canvas.interactor.SelectionModel

        BasicGraphController graphController = (BasicGraphController) _controller
                .getController();
        BasicGraphFrame frame = graphController.getFrame();

        SelectionModel model = graphController.getSelectionModel();
        AbstractBasicGraphModel graphModel = (AbstractBasicGraphModel) graphController
                .getGraphModel();
        Object[] selection = model.getSelectionAsArray();
        Object[] userObjects = new Object[selection.length];

        // First get the user objects from the selection.
        for (int i = 0; i < selection.length; i++) {
            userObjects[i] = ((Figure) selection[i]).getUserObject();
View Full Code Here

Examples of diva.canvas.interactor.SelectionModel

        // NOTE: This dance is so that the
        // doubleClickInteractor gets the events before the drag interactor.
        interactor.setDragInteractor(interactor.getDragInteractor());

        // Set the selection model to allow this to be independently selected.
        SelectionModel sm = controller.getSelectionModel();
        interactor.setSelectionModel(sm);
    }
View Full Code Here

Examples of diva.canvas.interactor.SelectionModel

     @param controller The associated graph controller.
     */
    public LinkController(final GraphController controller) {
        super(controller);

        SelectionModel sm = controller.getSelectionModel();
        SelectionInteractor interactor = (SelectionInteractor) getEdgeInteractor();
        interactor.setSelectionModel(sm);

        // Create and set up the manipulator for connectors
        ConnectorManipulator manipulator = new ConnectorManipulator();
View Full Code Here

Examples of diva.canvas.interactor.SelectionModel

     @param controller The associated graph controller.
     */
    public TransitionController(final GraphController controller) {
        super(controller);

        SelectionModel sm = controller.getSelectionModel();
        SelectionInteractor interactor = (SelectionInteractor) getEdgeInteractor();
        interactor.setSelectionModel(sm);

        // Create and set up the manipulator for connectors.
        // This overrides the manipulator created by the base class.
View Full Code Here

Examples of diva.canvas.interactor.SelectionModel

        // don't leave selection decorators around...
        Interactor interactor = getInteractor();
        if (interactor instanceof SelectionInteractor) {
            // remove any selection handles, etc.
            SelectionModel model = ((SelectionInteractor) interactor).getSelectionModel();
            model.removeSelection(this);
        }

        repaint();
    }
View Full Code Here

Examples of diva.canvas.interactor.SelectionModel

        // don't leave selection decorators around...
        if (!flag) {
            Interactor interactor = getInteractor();
            if (interactor instanceof SelectionInteractor) {
                // remove any selection handles, etc.
                SelectionModel model = ((SelectionInteractor) interactor).getSelectionModel();
                if (model.containsSelection(this)) {
                    model.removeSelection(this);
                }
            }
        }

        repaint();
View Full Code Here

Examples of diva.canvas.interactor.SelectionModel

    /**
     * Make the drag interactor, for figures that may be dragged.
     */
    private void _makeFixedSelectionInteractor() {
        // create an fixed position, unresizable interactor
        SelectionModel model = _selectionInteractor.getSelectionModel();
        _fixedSelectionInteractor = new SelectionInteractor(model);
        // highlighting will draw a partially see-through rectangle over the figure
        Composite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.75F);
        BasicHighlighter h = new BasicHighlighter(new Color(204, 204, 255), 1.0F, composite);
        _fixedSelectionInteractor.setPrototypeDecorator(h);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.