001/*
002
003Copyright (c) 2015-2018 The Regents of the University of California.
004All rights reserved.
005
006Permission is hereby granted, without written agreement and without
007license or royalty fees, to use, copy, modify, and distribute this
008software and its documentation for any purpose, provided that the above
009copyright notice and the following two paragraphs appear in all copies
010of this software.
011
012IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA LIABLE TO ANY PARTY
013FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
014ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
015THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
016SUCH DAMAGE.
017
018THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
019INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
020MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
021PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
022CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
023ENHANCEMENTS, OR MODIFICATIONS.
024
025PT_COPYRIGHT_VERSION_2
026COPYRIGHTENDKEY
027 */
028package ptolemy.vergil.basic.layout;
029
030import ptolemy.data.expr.Parameter;
031import ptolemy.data.type.BaseType;
032import ptolemy.kernel.util.IllegalActionException;
033import ptolemy.kernel.util.NameDuplicationException;
034import ptolemy.kernel.util.NamedObj;
035import ptolemy.kernel.util.Settable;
036
037/**
038 * Specialized layout configuration dialog for
039 * {@link ptolemy.vergil.actor.ActorGraphModel ActorGraphModel}s.
040 *
041 * @version $Id$
042 * @author Ulf Rueegg
043 * @since Ptolemy II 11.0
044 */
045public class ActorLayoutConfiguration extends AbstractLayoutConfiguration {
046
047    ///////////////////////////////////////////////////////////////////
048    ////                       public parameters                   ////
049
050    /** Whether bends are minimized.  The default value is true. */
051    public Parameter minimizeBends;
052
053    /** Default value for minimizeBends. */
054    public static final boolean DEF_MINIMIZE_BENDS = true;
055
056    /**
057     * Creates an initializes a layout configuration specifically tailored
058     * for {@link ptolemy.vergil.actor.ActorGraphModel ActorGraphModel}s.
059     *
060     * @param container The container.
061     * @param name The name of this attribute.
062     * @exception IllegalActionException If the attribute is not of an
063     *   acceptable class for the container, or if the name contains a period.
064     * @exception NameDuplicationException If the name coincides with
065     *   an attribute already in the container.
066     */
067    public ActorLayoutConfiguration(NamedObj container, String name)
068            throws IllegalActionException, NameDuplicationException {
069        super(container, name);
070
071        minimizeBends = new Parameter(this, "minimizeBends");
072        minimizeBends.setDisplayName("Minimize edge bends");
073        minimizeBends.setTypeEquals(BaseType.BOOLEAN);
074        minimizeBends.setExpression(Boolean.toString(DEF_MINIMIZE_BENDS));
075        minimizeBends.setVisibility(Settable.EXPERT);
076
077    }
078}