public final class LayoutEditorAuxTools extends Object
This module manages block connectivity for its associated LayoutEditor.
The tools in this module are accessed via the Tools menu in Layout Editor, or directly from LayoutEditor or LayoutEditor specific modules.
Modifier and Type Method Description
addBeanSettings(Path p, LayoutConnectivity lc, LayoutBlock layoutBlock)Searches for and adds BeanSetting's to a Path as needed.
getConnectivityList(LayoutBlock blk)Get Connectivity involving a specific Layout Block.
initializeBlockConnectivity()Initializes the block connectivity (block boundaries) for a Layout Editor panel.
public void setBlockConnectivityChanged()
Get Connectivity involving a specific Layout Block.
This routine returns an ArrayList of BlockConnectivity objects involving the specified LayoutBlock.
blk- the layout block.
- the layout connectivity list, not null.
public void initializeBlockConnectivity()Initializes the block connectivity (block boundaries) for a Layout Editor panel.
This routine sets up the LayoutConnectivity objects needed to show the current connectivity. It gets its information from arrays contained in LayoutEditor.
One LayoutConnectivity object is created for each block boundary -- connection points where two blocks join. Block boundaries can occur where ever a track segment in one block joins with: 1) a track segment in another block -OR- 2) a connection point in a layout turnout in another block -OR- 3) a connection point in a level crossing in another block.
The first block is always a track segment. The direction set in the LayoutConnectivity is the direction of the track segment alone for cases 2) and 3) above. For case 1), two track segments, the direction reflects an "average" over the two track segments. See LayoutConnectivity for the allowed values of direction.
Searches for and adds BeanSetting's to a Path as needed.
This method starts at the entry point to the LayoutBlock given in the Path at the block boundary specified in the LayoutConnectivity. It follows the track looking for turnout settings that are required for a train entering on this block boundary point to exit the block. If a required turnout setting is found, the turnout and its required state are used to create a BeanSetting, which is added to the Path. Such a setting can occur, for example, if a track enters a right-handed turnout from either the diverging track or the continuing track.
If the track branches into two tracks (for example, by entering a right-handed turnout via the throat track), the search is stopped. The search is also stopped when the track reaches a different block (or an undefined block), or reaches an end bumper.
p- path to follow until branch.
lc- layout connectivity.
layoutBlock- the layout block.