jmri.jmrit.display.layoutEditor
Class LayoutEditorTools

java.lang.Object
  extended by jmri.jmrit.display.layoutEditor.LayoutEditorTools

public class LayoutEditorTools
extends Object

Layout Editor Tools provides tools making use of layout connectivity available in Layout Editor panels.

The tools in this module are accessed via the Tools menu in Layout Editor.

Author:
Dave Duchamp Copyright (c) 2007

Constructor Summary
LayoutEditorTools(LayoutEditor thePanel)
           
 
Method Summary
 void finalizeBlockBossLogic()
           
 SignalHead getHeadFromName(String str)
          Returns a SignalHead given a name
 LayoutTurnout getLayoutTurnoutFromTurnout(Turnout turnout, boolean requireDoubleXover, String str, JFrame theFrame)
          Returns the layout turnout corresponding to a given turnout.
 SignalHead getNextSignalFromObject(TrackSegment track, Object object, String headName, JmriJFrame frame)
           
 Sensor getSensorFromEntry(JTextField sensorName, boolean requireEntry, JmriJFrame frame)
          Returns the Sensor corresponding to an entry field in the specified dialog.
 Sensor getSensorFromName(String str)
          Returns a Sensor given a name
 SensorIcon getSensorIcon(String sensorName)
           
 SignalHead getSignalHeadFromEntry(JTextField signalName, boolean requireEntry, JmriJFrame frame)
          Returns the SignalHead corresponding to an entry field in the specified dialog.
 SignalMast getSignalMastFromEntry(JTextField signalMastName, boolean requireEntry, JmriJFrame frame)
          Returns the SignalMast corresponding to an entry field in the specified dialog.
 SignalMast getSignalMastFromName(String str)
          Returns a SignalMast given a name
 boolean initializeBlockBossLogic(String signalHeadName)
           
 boolean isAtWestEndOfAnchor(TrackSegment t, PositionablePoint p)
           
 boolean isHeadAssignedAnywhere(SignalHead head)
          Returns true if the specified Signal Head is assigned to an object on the panel, regardless of whether an icon is displayed or not
 boolean isHeadOnPanel(SignalHead head)
          Returns true if an icon for the specified SignalHead is on the panel
 boolean isSensorAssignedAnywhere(Sensor sensor)
          Returns true if the specified Sensor is assigned to an object on the panel, regardless of whether an icon is displayed or not With sensors we do allow the same sensor to be allocated in both directions.
 boolean isSensorOnPanel(Sensor sensor)
           
 boolean isSignalMastAssignedAnywhere(SignalMast signalMast)
          Returns true if the specified SignalMast is assigned to an object on the panel, regardless of whether an icon is displayed or not
 boolean isSignalMastOnPanel(SignalMast signalMast)
           
 boolean reachedEndBumper()
           
 void removeAssignment(Sensor sensor)
           
 void removeAssignment(SignalHead head)
          Removes the assignment of the specified SignalHead to either a turnout, a positionable point, or a level crossing wherever it is assigned
 void removeAssignment(SignalMast mast)
           
 void removeSensorAssignment(Sensor sensor)
          Removes the assignment of the specified Sensor to either a turnout, a positionable point, or a level crossing wherever it is assigned
 void removeSensorFromPanel(String sensorName)
          Removes the Sensor with the specified name from the panel and from assignment to any turnout, positionable point, or level crossing
 void removeSignalHeadFromPanel(String signalName)
          Removes the SignalHead with the specified name from the panel and from assignment to any turnout, positionable point, or level crossing
 void removeSignalMastAssignment(SignalMast signalMast)
          Removes the assignment of the specified SignalMast to either a turnout, a positionable point, or a level crossing wherever it is assigned
 void removeSignalMastFromPanel(String signalMastName)
          Removes the SignalMast with the specified name from the panel and from assignment to any turnout, positionable point, or level crossing
 void set3WayFromMenu(String aName, String bName, MultiIconEditor theEditor, JFrame theFrame)
           
 void setIconOnPanel(PositionableIcon l, int rotation, int xLoc, int yLoc)
           
 void setIconOnPanel(PositionableIcon l, int rotation, Point p)
           
 void setSensorsAtBlockBoundary(MultiIconEditor theEditor, JFrame theFrame)
           
 void setSensorsAtBlockBoundaryFromMenu(PositionablePoint p, MultiIconEditor theEditor, JFrame theFrame)
           
 void setSensorsAtLevelXing(MultiIconEditor theEditor, JFrame theFrame)
           
 void setSensorsAtLevelXingFromMenu(LevelXing xing, String[] blocks, MultiIconEditor theEditor, JFrame theFrame)
           
 void setSensorsAtTurnoutFromMenu(LayoutTurnout to, String[] blocks, MultiIconEditor theEditor, JFrame frame)
           
 void setSensorsAtTurnouts(JFrame frame)
           
 void setSignalHeadOnPanel(int rotation, String headName, int xLoc, int yLoc)
          Places a signal head icon on the panel after rotation at the designated place, with all with all icons taken care of.
 void setSignalMastsAtBlockBoundary()
           
 void setSignalMastsAtBlockBoundaryFromMenu(PositionablePoint p)
           
 void setSignalMastsAtLevelXing(JFrame theFrame)
           
 void setSignalMastsAtLevelXingFromMenu(LevelXing xing, String[] blocks, JFrame theFrame)
           
 void setSignalMastsAtTurnoutFromMenu(LayoutTurnout to, String[] blocks)
           
 void setSignalMastsAtTurnouts()
           
 void setSignalsAt3WayTurnout(MultiIconEditor theEditor, JFrame theFrame)
           
 void setSignalsAtBlockBoundary(MultiIconEditor theEditor, JFrame theFrame)
           
 void setSignalsAtBlockBoundaryFromMenu(PositionablePoint p, MultiIconEditor theEditor, JFrame theFrame)
           
 void setSignalsAtLevelXing(MultiIconEditor theEditor, JFrame theFrame)
           
 void setSignalsAtLevelXingFromMenu(LevelXing xing, MultiIconEditor theEditor, JFrame theFrame)
           
 void setSignalsAtTToTTurnouts(MultiIconEditor theEditor, JFrame theFrame)
           
 void setSignalsAtTurnout(MultiIconEditor theEditor, JFrame theFrame)
           
 void setSignalsAtTurnoutFromMenu(LayoutTurnout to, MultiIconEditor theEditor, JFrame theFrame)
           
 void setSignalsAtXoverTurnout(MultiIconEditor theEditor, JFrame theFrame)
           
 void setSignalsAtXoverTurnoutFromMenu(LayoutTurnout to, MultiIconEditor theEditor, JFrame theFrame)
           
 void setThroatToThroatFromMenu(LayoutTurnout to, String linkedTurnoutName, MultiIconEditor theEditor, JFrame theFrame)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayoutEditorTools

public LayoutEditorTools(LayoutEditor thePanel)
Method Detail

setSignalsAtTurnoutFromMenu

public void setSignalsAtTurnoutFromMenu(LayoutTurnout to,
                                        MultiIconEditor theEditor,
                                        JFrame theFrame)

setSignalsAtTurnout

public void setSignalsAtTurnout(MultiIconEditor theEditor,
                                JFrame theFrame)

getLayoutTurnoutFromTurnout

public LayoutTurnout getLayoutTurnoutFromTurnout(Turnout turnout,
                                                 boolean requireDoubleXover,
                                                 String str,
                                                 JFrame theFrame)
Returns the layout turnout corresponding to a given turnout. If require double crossover is requested, and error message is sent to the user if the layout turnout is not a double crossover, and null is returned. If a layout turnout corresponding to the turnout is not found, an error message is sent to the user and null is returned.


getSignalHeadFromEntry

public SignalHead getSignalHeadFromEntry(JTextField signalName,
                                         boolean requireEntry,
                                         JmriJFrame frame)
Returns the SignalHead corresponding to an entry field in the specified dialog. This also takes care of UpperCase and trimming of leading and trailing blanks. If entry is required, and no entry is present, and error message is sent. An error message also results if a signal head with the entered name is not found in the SignalTable.


getHeadFromName

public SignalHead getHeadFromName(String str)
Returns a SignalHead given a name


setSignalHeadOnPanel

public void setSignalHeadOnPanel(int rotation,
                                 String headName,
                                 int xLoc,
                                 int yLoc)
Places a signal head icon on the panel after rotation at the designated place, with all with all icons taken care of.


isHeadOnPanel

public boolean isHeadOnPanel(SignalHead head)
Returns true if an icon for the specified SignalHead is on the panel


isHeadAssignedAnywhere

public boolean isHeadAssignedAnywhere(SignalHead head)
Returns true if the specified Signal Head is assigned to an object on the panel, regardless of whether an icon is displayed or not


removeAssignment

public void removeAssignment(SignalHead head)
Removes the assignment of the specified SignalHead to either a turnout, a positionable point, or a level crossing wherever it is assigned


removeSignalHeadFromPanel

public void removeSignalHeadFromPanel(String signalName)
Removes the SignalHead with the specified name from the panel and from assignment to any turnout, positionable point, or level crossing


initializeBlockBossLogic

public boolean initializeBlockBossLogic(String signalHeadName)

finalizeBlockBossLogic

public void finalizeBlockBossLogic()

getNextSignalFromObject

public SignalHead getNextSignalFromObject(TrackSegment track,
                                          Object object,
                                          String headName,
                                          JmriJFrame frame)

reachedEndBumper

public boolean reachedEndBumper()

isAtWestEndOfAnchor

public boolean isAtWestEndOfAnchor(TrackSegment t,
                                   PositionablePoint p)

setSignalsAtBlockBoundaryFromMenu

public void setSignalsAtBlockBoundaryFromMenu(PositionablePoint p,
                                              MultiIconEditor theEditor,
                                              JFrame theFrame)

setSignalsAtBlockBoundary

public void setSignalsAtBlockBoundary(MultiIconEditor theEditor,
                                      JFrame theFrame)

setSignalsAtXoverTurnoutFromMenu

public void setSignalsAtXoverTurnoutFromMenu(LayoutTurnout to,
                                             MultiIconEditor theEditor,
                                             JFrame theFrame)

setSignalsAtXoverTurnout

public void setSignalsAtXoverTurnout(MultiIconEditor theEditor,
                                     JFrame theFrame)

setSignalsAtLevelXingFromMenu

public void setSignalsAtLevelXingFromMenu(LevelXing xing,
                                          MultiIconEditor theEditor,
                                          JFrame theFrame)

setSignalsAtLevelXing

public void setSignalsAtLevelXing(MultiIconEditor theEditor,
                                  JFrame theFrame)

setThroatToThroatFromMenu

public void setThroatToThroatFromMenu(LayoutTurnout to,
                                      String linkedTurnoutName,
                                      MultiIconEditor theEditor,
                                      JFrame theFrame)

setSignalsAtTToTTurnouts

public void setSignalsAtTToTTurnouts(MultiIconEditor theEditor,
                                     JFrame theFrame)

set3WayFromMenu

public void set3WayFromMenu(String aName,
                            String bName,
                            MultiIconEditor theEditor,
                            JFrame theFrame)

setSignalsAt3WayTurnout

public void setSignalsAt3WayTurnout(MultiIconEditor theEditor,
                                    JFrame theFrame)

setSensorsAtBlockBoundaryFromMenu

public void setSensorsAtBlockBoundaryFromMenu(PositionablePoint p,
                                              MultiIconEditor theEditor,
                                              JFrame theFrame)

setSensorsAtBlockBoundary

public void setSensorsAtBlockBoundary(MultiIconEditor theEditor,
                                      JFrame theFrame)

getSensorFromEntry

public Sensor getSensorFromEntry(JTextField sensorName,
                                 boolean requireEntry,
                                 JmriJFrame frame)
Returns the Sensor corresponding to an entry field in the specified dialog. This also takes care of UpperCase and trimming of leading and trailing blanks. If entry is required, and no entry is present, and error message is sent. An error message also results if a sensor head with the entered name is not found in the SensorTable.


getSensorFromName

public Sensor getSensorFromName(String str)
Returns a Sensor given a name


getSensorIcon

public SensorIcon getSensorIcon(String sensorName)

isSensorAssignedAnywhere

public boolean isSensorAssignedAnywhere(Sensor sensor)
Returns true if the specified Sensor is assigned to an object on the panel, regardless of whether an icon is displayed or not With sensors we do allow the same sensor to be allocated in both directions.


removeSensorAssignment

public void removeSensorAssignment(Sensor sensor)
Removes the assignment of the specified Sensor to either a turnout, a positionable point, or a level crossing wherever it is assigned


removeSensorFromPanel

public void removeSensorFromPanel(String sensorName)
Removes the Sensor with the specified name from the panel and from assignment to any turnout, positionable point, or level crossing


isSensorOnPanel

public boolean isSensorOnPanel(Sensor sensor)

setSignalMastsAtBlockBoundaryFromMenu

public void setSignalMastsAtBlockBoundaryFromMenu(PositionablePoint p)

setSignalMastsAtBlockBoundary

public void setSignalMastsAtBlockBoundary()

getSignalMastFromEntry

public SignalMast getSignalMastFromEntry(JTextField signalMastName,
                                         boolean requireEntry,
                                         JmriJFrame frame)
Returns the SignalMast corresponding to an entry field in the specified dialog. This also takes care of UpperCase and trimming of leading and trailing blanks. If entry is required, and no entry is present, and error message is sent. An error message also results if a signalMast head with the entered name is not found in the SignalMastTable.


getSignalMastFromName

public SignalMast getSignalMastFromName(String str)
Returns a SignalMast given a name


isSignalMastAssignedAnywhere

public boolean isSignalMastAssignedAnywhere(SignalMast signalMast)
Returns true if the specified SignalMast is assigned to an object on the panel, regardless of whether an icon is displayed or not


removeSignalMastAssignment

public void removeSignalMastAssignment(SignalMast signalMast)
Removes the assignment of the specified SignalMast to either a turnout, a positionable point, or a level crossing wherever it is assigned


removeSignalMastFromPanel

public void removeSignalMastFromPanel(String signalMastName)
Removes the SignalMast with the specified name from the panel and from assignment to any turnout, positionable point, or level crossing


setIconOnPanel

public void setIconOnPanel(PositionableIcon l,
                           int rotation,
                           Point p)

setIconOnPanel

public void setIconOnPanel(PositionableIcon l,
                           int rotation,
                           int xLoc,
                           int yLoc)

isSignalMastOnPanel

public boolean isSignalMastOnPanel(SignalMast signalMast)

setSignalMastsAtTurnoutFromMenu

public void setSignalMastsAtTurnoutFromMenu(LayoutTurnout to,
                                            String[] blocks)

setSignalMastsAtTurnouts

public void setSignalMastsAtTurnouts()

removeAssignment

public void removeAssignment(SignalMast mast)

setSignalMastsAtLevelXingFromMenu

public void setSignalMastsAtLevelXingFromMenu(LevelXing xing,
                                              String[] blocks,
                                              JFrame theFrame)

setSignalMastsAtLevelXing

public void setSignalMastsAtLevelXing(JFrame theFrame)

setSensorsAtTurnoutFromMenu

public void setSensorsAtTurnoutFromMenu(LayoutTurnout to,
                                        String[] blocks,
                                        MultiIconEditor theEditor,
                                        JFrame frame)

setSensorsAtTurnouts

public void setSensorsAtTurnouts(JFrame frame)

removeAssignment

public void removeAssignment(Sensor sensor)

setSensorsAtLevelXingFromMenu

public void setSensorsAtLevelXingFromMenu(LevelXing xing,
                                          String[] blocks,
                                          MultiIconEditor theEditor,
                                          JFrame theFrame)

setSensorsAtLevelXing

public void setSensorsAtLevelXing(MultiIconEditor theEditor,
                                  JFrame theFrame)


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads