001package jmri.jmrit.display.layoutEditor;
002
003import javax.annotation.Nonnull;
004
005/**
006 * A specialization of {@link LayoutTurnout}
007 * corresponding to a wye turnout on the layout. 
008 * <p>
009 * A LayoutTurnout has three or four connection points, designated A, B, C, and
010 * D. For right-handed or left-handed turnouts, A corresponds to the throat. At
011 * the crossing, A-B (and C-D for crossovers) is a straight segment (continuing
012 * route). A-C (and B-D for crossovers) is the diverging route. B-C (and A-D for
013 * crossovers) is an illegal condition.
014 * <br>
015 * <pre>
016 *    Wye           Three-way
017 *
018 *       B   
019 *      //  
020 * A ==**   
021 *      \\    
022 *       C  
023 *
024 * </pre>
025 * <p>
026 * A LayoutWye carries Block information. For
027 * wye turnouts, the entire turnout is in one block, however, a block border may
028 * occur at any connection (A,B,C,D). 
029 * <p>
030 * When LayoutWyes are first created, a rotation (degrees) is provided. For
031 * 0.0 rotation, the turnout lies on the east-west line with A facing east.
032 * Rotations are performed in a clockwise direction.
033 * <p>
034 * When LayoutWyes are first created, there are no connections. Block
035 * information and connections may be added when available.
036 * <p>
037 * When a LayoutWyes is first created, it is enabled for control of an
038 * assigned actual turnout. Clicking on the turnout center point will toggle the
039 * turnout. This can be disabled via the popup menu.
040 * <p>
041 * Signal Head names are saved here to keep track of where signals are.
042 * LayoutTurnout only serves as a storage place for signal head names. The names
043 * are placed here by tools, e.g., Set Signals at Turnout, and Set Signals at
044 * Double Crossover. Each connection point can have up to three SignalHeads and one SignalMast.
045 * <p>
046 * A LayoutWye may be linked to another LayoutTurnout to form a turnout
047 * pair. 
048 *<br>
049 * Throat-To-Throat Turnouts - Two turnouts connected closely at their
050 * throats, so closely that signals are not appropriate at the their throats.
051 * This is the situation when two RH, LH, or WYE turnouts are used to model a
052 * double slip. 
053 *<br>
054 * 3-Way Turnout - Two turnouts modeling a 3-way turnout, where the
055 * throat of the second turnout is closely connected to the continuing track of
056 * the first turnout. The throat will have three heads, or one head. A link is
057 * required to be able to correctly interpret the use of signal heads.
058 *
059 * @author Dave Duchamp Copyright (c) 2004-2007
060 * @author George Warner Copyright (c) 2017-2019
061 */
062public class LayoutWye extends LayoutTurnout {
063
064    public LayoutWye(@Nonnull String id,
065            @Nonnull LayoutEditor layoutEditor) {
066        this(id, layoutEditor, 1);
067    }
068
069    /**
070     * Main constructor method.
071     * @param id wye id string.
072     * @param layoutEditor what layout editor panel to put it in
073     * @param v unused.
074     */
075    public LayoutWye(@Nonnull String id,
076            @Nonnull LayoutEditor layoutEditor, 
077            int v) {
078        super(id, TurnoutType.WYE_TURNOUT, layoutEditor, 1);
079    }
080    
081    // private final static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LayoutWye.class);
082}