Package diva.canvas

Examples of diva.canvas.FigureDecorator


    /**
     * Return a new decorator, according to the type of the figure.
     */
    public FigureDecorator newInstance(Figure f) {
        FigureDecorator d = (FigureDecorator) _typedDecorators
                .get(f.getClass());

        if (d != null) {
            return d.newInstance(f);
        }

        return _defaultDecorator.newInstance(/* d */null);
    }
View Full Code Here


            _controller.setFigure(node, null);

            // If the figure is decorated, then we have to undecorate
            // it before proceeding, or the figure remains as a ghost!
            while (container instanceof FigureDecorator) {
                FigureDecorator decorator = (FigureDecorator) container;
                container = container.getParent();
                ((FigureContainer) container).undecorate(decorator);
            }

            if (container instanceof FigureLayer) {
View Full Code Here

                    // Rather than just get the parent of the
                    // figure, we must get the decorator out of
                    // the hashtable, since other wrappers may
                    // have been inserted between the figure and
                    // its decorator
                    FigureDecorator d = (FigureDecorator) _decorators
                            .get(figure);

                    if (d.getParent() != null) {
                        figure.repaint();
                        ((FigureContainer) d.getParent()).undecorate(d);
                    }

                    _decorators.remove(figure);
                }
            }
View Full Code Here

                    } else {
                        FigureContainer parent = (FigureContainer) figure
                                .getParent();

                        if (parent != null) {
                            FigureDecorator d = _prototypeDecorator
                                    .newInstance(figure);
                            parent.decorate(figure, d);
                            _decorators.put(figure, d);
                        }
                    }
View Full Code Here

        // Rather than just get the parent of the figure, we must get
        // the decorator out of the hashtable, since other wrappers
        // may have been inserted between the figure and its
        // decorator
        FigureDecorator d = (FigureDecorator) _decorators.get(figure);

        if (d.getParent() != null) {
            figure.repaint();
            ((FigureContainer) d.getParent()).undecorate(d);
        }

        _decorators.remove(figure);
    }
View Full Code Here

            ((Figure) _decorators.get(figure)).repaint();
        } else {
            FigureContainer parent = (FigureContainer) figure.getParent();

            if (parent != null) {
                FigureDecorator d = _prototypeDecorator.newInstance(figure);
                parent.decorate(figure, d);
                _decorators.put(figure, d);
            }
        }
    }
View Full Code Here

TOP

Related Classes of diva.canvas.FigureDecorator

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.