001/*
002 * Copyright (c) 2004-2010 The Regents of the University of California.
003 * All rights reserved.
004 *
005 * '$Author: welker $'
006 * '$Date: 2010-05-06 05:21:26 +0000 (Thu, 06 May 2010) $' 
007 * '$Revision: 24234 $'
008 * 
009 * Permission is hereby granted, without written agreement and without
010 * license or royalty fees, to use, copy, modify, and distribute this
011 * software and its documentation for any purpose, provided that the above
012 * copyright notice and the following two paragraphs appear in all copies
013 * of this software.
014 *
015 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
016 * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
017 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
018 * THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
019 * SUCH DAMAGE.
020 *
021 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
022 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
023 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
024 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
025 * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
026 * ENHANCEMENTS, OR MODIFICATIONS.
027 *
028 */
029
030package org.kepler.gui;
031
032import ptolemy.kernel.util.IllegalActionException;
033import ptolemy.kernel.util.NameDuplicationException;
034import ptolemy.kernel.util.NamedObj;
035
036/**
037 * class to tell vergil whether scrollbars should be included in the canvas
038 * pane. The property canvasNavigationModifier in the configuration can be used
039 * to turn on the scrollbars.
040 */
041public class ScrollBarModifier {
042        /** flag telling whether to show the scrollbars or not. */
043        private boolean scrollbars = true;
044
045        /**
046         * returns true if the scrollbars should be enabled
047         */
048        public boolean getScrollBarModifier() {
049                return scrollbars;
050        }
051
052        /**
053         * A factory that creates the library panel for the editors.
054         */
055        public static class Factory extends CanvasNavigationModifierFactory {
056                /**
057                 * Create an factory with the given name and container.
058                 * 
059                 * @param container
060                 *            The container.
061                 * @param name
062                 *            The name of the entity.
063                 * @exception IllegalActionException
064                 *                If the container is incompatible with this attribute.
065                 * @exception NameDuplicationException
066                 *                If the name coincides with an attribute already in the
067                 *                container.
068                 */
069                public Factory(NamedObj container, String name)
070                                throws IllegalActionException, NameDuplicationException {
071                        super(container, name);
072                }
073
074                /**
075                 * creates a ScrollBarModifier and returns it.
076                 * 
077                 * @param _libraryModel
078                 *            the model containing the actor library
079                 * @return A new LibraryPane that displays the library
080                 */
081                public ScrollBarModifier createScrollBarModifier() {
082                        return new ScrollBarModifier();
083                }
084        }
085}