Search in sources :

Example 6 with Source

use of jmri.jmrit.signalling.entryexit.Source in project JMRI by JMRI.

the class EntryExitPairs method processRoutesToSet.

/**
     * Activate each SourceToDest set in routesToSet
     */
synchronized void processRoutesToSet() {
    if (routesToSet.isEmpty()) {
        return;
    }
    Source s = routesToSet.get(0).s;
    DestinationPoints dp = routesToSet.get(0).dp;
    boolean dir = routesToSet.get(0).direction;
    currentDealing = routesToSet.get(0).ref;
    routesToSet.remove(0);
    dp.addPropertyChangeListener(propertyDestinationListener);
    s.activeBean(dp, dir);
}
Also used : DestinationPoints(jmri.jmrit.signalling.entryexit.DestinationPoints) Source(jmri.jmrit.signalling.entryexit.Source)

Example 7 with Source

use of jmri.jmrit.signalling.entryexit.Source in project JMRI by JMRI.

the class EntryExitPairs method addNXDestination.

public void addNXDestination(NamedBean source, NamedBean destination, LayoutEditor panel, String id) {
    if (source == null) {
        log.error("no source Object provided");
        return;
    }
    if (destination == null) {
        log.error("no destination Object provided");
        return;
    }
    PointDetails sourcePoint = providePoint(source, panel);
    if (sourcePoint == null) {
        log.error("source point for " + source.getDisplayName() + " not created addNXDes");
        return;
    }
    sourcePoint.setPanel(panel);
    sourcePoint.setRefObject(source);
    PointDetails destPoint = providePoint(destination, panel);
    if (destPoint != null) {
        destPoint.setPanel(panel);
        destPoint.setRefObject(destination);
        if (!nxpair.containsKey(sourcePoint)) {
            nxpair.put(sourcePoint, new Source(sourcePoint));
        }
        nxpair.get(sourcePoint).addDestination(destPoint, id);
    }
    firePropertyChange("length", null, null);
}
Also used : PointDetails(jmri.jmrit.signalling.entryexit.PointDetails) Source(jmri.jmrit.signalling.entryexit.Source)

Aggregations

Source (jmri.jmrit.signalling.entryexit.Source)7 PointDetails (jmri.jmrit.signalling.entryexit.PointDetails)6 LayoutEditor (jmri.jmrit.display.layoutEditor.LayoutEditor)4 ArrayList (java.util.ArrayList)3 JmriException (jmri.JmriException)1 NamedBean (jmri.NamedBean)1 LayoutBlock (jmri.jmrit.display.layoutEditor.LayoutBlock)1 DestinationPoints (jmri.jmrit.signalling.entryexit.DestinationPoints)1