Class LayoutEditorTools
- java.lang.Object
-
- jmri.jmrit.display.layoutEditor.LayoutEditorTools
-
public final class LayoutEditorTools extends java.lang.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
LayoutEditorTools.BeanDetails<B extends NamedBean>
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LayoutEditorTools(LayoutEditor thePanel)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Boolean
addBlockBoundarySignalHeadInfoToMenu(PositionablePoint inPositionablePoint, javax.swing.JMenu inMenu)
protected java.lang.Boolean
addLayoutSlipSignalHeadInfoToMenu(LayoutTurnout inLayoutTurnout, javax.swing.JMenu inMenu)
protected java.lang.Boolean
addLayoutTurnoutSignalHeadInfoToMenu(java.lang.String inTurnoutNameA, java.lang.String inTurnoutNameB, javax.swing.JMenu inMenu)
protected java.lang.Boolean
addLevelXingSignalHeadInfoToMenu(LevelXing inLevelXing, javax.swing.JMenu inMenu)
(package private) void
createListUsedSignalMasts()
(package private) java.awt.Point
eastToWest(java.awt.geom.Point2D p, PositionableIcon l, boolean right, double fromPoint)
void
finalizeBlockBossLogic()
SignalHead
getHeadFromName(java.lang.String str)
Returns a SignalHead given a name.LayoutTurnout
getLayoutTurnoutFromTurnout(Turnout turnout, boolean requireDoubleXover, java.lang.String str, javax.swing.JFrame theFrame)
Returns the layout turnout corresponding to a given turnout.SignalHead
getNextSignalFromObject(TrackSegment track, java.lang.Object object, java.lang.String signalHeadName, JmriJFrame frame)
Sensor
getSensorFromEntry(java.lang.String sensorName, boolean requireEntry, JmriJFrame frame)
Returns the Sensor corresponding to an entry field in the specified dialog.SensorIcon
getSensorIcon(java.lang.String sensorName)
SignalHead
getSignalHeadFromEntry(java.lang.String signalName, boolean requireEntry, JmriJFrame frame)
SignalHead
getSignalHeadFromEntry(javax.swing.JTextField signalNameTextField, boolean requireEntry, JmriJFrame frame)
SignalHead
getSignalHeadFromEntry(NamedBeanComboBox<SignalHead> signalNameComboBox, boolean requireEntry, JmriJFrame frame)
Returns the SignalHead corresponding to an entry field in the specified dialog.SignalHeadIcon
getSignalHeadIcon(java.lang.String signalName)
get a signal head icon for the given signal headSignalMast
getSignalMastFromEntry(java.lang.String signalMastName, boolean requireEntry, JmriJFrame frame)
Returns the SignalMast corresponding to an entry field in the specified dialog.boolean
initializeBlockBossLogic(java.lang.String signalHeadName)
static boolean
isAtWestEndOfAnchor(LayoutEditor layoutEditor, TrackSegment t, PositionablePoint p)
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)
Get if signal head 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.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)
(package private) java.awt.Point
northEastToSouthWest(java.awt.geom.Point2D p, PositionableIcon l, int oldWidth, int oldHeight, double angleDEG, boolean right, double fromPoint)
(package private) java.awt.Point
northToSouth(java.awt.geom.Point2D p, PositionableIcon l, boolean right, double fromPoint)
(package private) java.awt.Point
northWestToSouthEast(java.awt.geom.Point2D p, PositionableIcon l, int oldWidth, int oldHeight, double angleDEG, boolean right, double fromPoint)
boolean
reachedEndBumper()
(package private) void
refreshSignalMastAtBoundaryComboBox()
(package private) void
refreshSignalMastAtSlipComboBox()
(package private) void
refreshSignalMastAtTurnoutComboBox()
(package private) void
refreshSignalMastAtXingComboBox()
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)
boolean
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.boolean
removeSensorFromPanel(Sensor sensor)
Removes the Sensor icon from the panel and from assignment to any turnout, positionable point, or level crossing.void
removeSignalHeadFromPanel(java.lang.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(SignalMast signalMast)
Removes the SignalMast with the specified name from the panel and from assignment to any turnout, positionable point, or level crossing.(package private) void
sensorAssignedElseWhere(Sensor sensor)
Display an error dialog.(package private) void
setBoundarySensor(Sensor newSensor, Sensor currSensor, LayoutEditorTools.BeanDetails<Sensor> beanDetail, java.lang.String direction)
Attached a sensor to the block boundary positional point.void
setIconOnPanel(PositionableIcon l, int rotation, int xLoc, int yLoc)
void
setIconOnPanel(PositionableIcon l, int rotation, java.awt.Point p)
(package private) void
setLevelXingSensor(Sensor newSensor, Sensor currSensor, LayoutEditorTools.BeanDetails<? extends NamedBean> beanDetail, LayoutTrack connect, java.awt.geom.Point2D coords, java.lang.String position)
Attached a sensor to a level crossing block boundary.void
setSensorsAtBlockBoundary(MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSensorsAtBlockBoundaryFromMenu(PositionablePoint p, MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSensorsAtLevelXing(MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSensorsAtLevelXingFromMenu(LevelXing xing, java.lang.String[] blocks, MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSensorsAtSlip(MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSensorsAtSlipFromMenu(LayoutSlip slip, java.lang.String[] blocks, MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSensorsAtTurnout(javax.swing.JFrame frame)
void
setSensorsAtTurnoutFromMenu(LayoutTurnout to, java.lang.String[] blocks, MultiIconEditor theEditor, javax.swing.JFrame frame)
void
setSignalHeadOnPanel(double directionDEG, java.lang.String signalHeadName, int xLoc, int yLoc)
Places a signal head icon on the panel after rotation at the designated place, with all icons taken care of.void
setSignalHeadOnPanel(double directionDEG, java.lang.String signalHeadName, java.awt.geom.Point2D where)
Places a signal head icon on the panel after rotation at the designated place, with all icons taken care of.void
setSignalMastsAtBlockBoundary()
void
setSignalMastsAtBlockBoundaryFromMenu(PositionablePoint p)
void
setSignalMastsAtLayoutSlip(javax.swing.JFrame theFrame)
void
setSignalMastsAtLevelXing(javax.swing.JFrame theFrame)
void
setSignalMastsAtLevelXingFromMenu(LevelXing xing, java.lang.String[] blocks, javax.swing.JFrame theFrame)
void
setSignalMastsAtSlipFromMenu(LayoutSlip slip, java.lang.String[] blocks, javax.swing.JFrame theFrame)
void
setSignalMastsAtTurnout()
void
setSignalMastsAtTurnoutFromMenu(LayoutTurnout to, java.lang.String[] blocks)
void
setSignalsAt3WayTurnout(MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAt3WayTurnoutFromMenu(java.lang.String aName, java.lang.String bName, MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAtBlockBoundary(MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAtBlockBoundaryFromMenu(PositionablePoint p, MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAtLevelXing(MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAtLevelXingFromMenu(LevelXing xing, MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAtSlip(MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAtSlipFromMenu(LayoutSlip ls, MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAtThroatToThroatTurnouts(MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAtThroatToThroatTurnoutsFromMenu(LayoutTurnout to, java.lang.String linkedTurnoutName, MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAtTurnout(MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAtTurnoutFromMenu(LayoutTurnout to, MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAtXoverTurnout(MultiIconEditor theEditor, javax.swing.JFrame theFrame)
void
setSignalsAtXoverTurnoutFromMenu(LayoutTurnout to, MultiIconEditor theEditor, javax.swing.JFrame theFrame)
(package private) <T extends LayoutTurnout>
voidsetTurnoutSensor(T trackItem, Sensor newSensor, Sensor currSensor, LayoutEditorTools.BeanDetails<? extends NamedBean> beanDetail, LayoutTrack connect, java.awt.geom.Point2D coords, java.lang.String position)
Attached a sensor to a turnout block boundary.(package private) java.awt.Point
southEastToNorthWest(java.awt.geom.Point2D p, PositionableIcon l, int oldWidth, int oldHeight, double angleDEG, boolean right, double fromPoint)
(package private) java.awt.Point
southToNorth(java.awt.geom.Point2D p, PositionableIcon l, boolean right, double fromPoint)
(package private) java.awt.Point
southWestToNorthEast(java.awt.geom.Point2D p, PositionableIcon l, int oldWidth, int oldHeight, double angleDEG, boolean right, double fromPoint)
void
updateBoundaryBasedSignalMastLogic(SignalMast oldBlock1SignalMast, SignalMast oldBlock2SignalMast, SignalMast block1BoundSignalMast, SignalMast block2BoundSignalMast)
(package private) java.awt.Point
westToEast(java.awt.geom.Point2D p, PositionableIcon l, boolean right, double fromPoint)
-
-
-
Field Detail
-
westBoundSensor
LayoutEditorTools.BeanDetails<Sensor> westBoundSensor
-
eastBoundSensor
LayoutEditorTools.BeanDetails<Sensor> eastBoundSensor
-
sensorBlockPanel
javax.swing.JPanel sensorBlockPanel
-
eastSignalMast
LayoutEditorTools.BeanDetails<SignalMast> eastSignalMast
-
westSignalMast
LayoutEditorTools.BeanDetails<SignalMast> westSignalMast
-
signalMastBlockPanel
javax.swing.JPanel signalMastBlockPanel
-
adjust
double adjust
-
awayright
int awayright
-
turnoutSignalMastA
LayoutEditorTools.BeanDetails<SignalMast> turnoutSignalMastA
-
turnoutSignalMastB
LayoutEditorTools.BeanDetails<SignalMast> turnoutSignalMastB
-
turnoutSignalMastC
LayoutEditorTools.BeanDetails<SignalMast> turnoutSignalMastC
-
turnoutSignalMastD
LayoutEditorTools.BeanDetails<SignalMast> turnoutSignalMastD
-
signalMastTurnoutPanel
javax.swing.JPanel signalMastTurnoutPanel
-
usedMasts
java.util.Set<SignalMast> usedMasts
-
slipSignalMastA
LayoutEditorTools.BeanDetails<SignalMast> slipSignalMastA
-
slipSignalMastB
LayoutEditorTools.BeanDetails<SignalMast> slipSignalMastB
-
slipSignalMastC
LayoutEditorTools.BeanDetails<SignalMast> slipSignalMastC
-
slipSignalMastD
LayoutEditorTools.BeanDetails<SignalMast> slipSignalMastD
-
signalMastLayoutSlipPanel
javax.swing.JPanel signalMastLayoutSlipPanel
-
xingSignalMastA
LayoutEditorTools.BeanDetails<SignalMast> xingSignalMastA
-
xingSignalMastB
LayoutEditorTools.BeanDetails<SignalMast> xingSignalMastB
-
xingSignalMastC
LayoutEditorTools.BeanDetails<SignalMast> xingSignalMastC
-
xingSignalMastD
LayoutEditorTools.BeanDetails<SignalMast> xingSignalMastD
-
signalMastLevelXingPanel
javax.swing.JPanel signalMastLevelXingPanel
-
blackline
javax.swing.border.Border blackline
-
turnoutSensorA
LayoutEditorTools.BeanDetails<Sensor> turnoutSensorA
-
turnoutSensorB
LayoutEditorTools.BeanDetails<Sensor> turnoutSensorB
-
turnoutSensorC
LayoutEditorTools.BeanDetails<Sensor> turnoutSensorC
-
turnoutSensorD
LayoutEditorTools.BeanDetails<Sensor> turnoutSensorD
-
sensorTurnoutPanel
javax.swing.JPanel sensorTurnoutPanel
-
turnoutSensorBlockIcon
SensorIcon turnoutSensorBlockIcon
-
sensorXingFrame
javax.swing.JFrame sensorXingFrame
-
xingSensorA
LayoutEditorTools.BeanDetails<Sensor> xingSensorA
-
xingSensorB
LayoutEditorTools.BeanDetails<Sensor> xingSensorB
-
xingSensorC
LayoutEditorTools.BeanDetails<Sensor> xingSensorC
-
xingSensorD
LayoutEditorTools.BeanDetails<Sensor> xingSensorD
-
sensorXingPanel
javax.swing.JPanel sensorXingPanel
-
sensorSlipFrame
javax.swing.JFrame sensorSlipFrame
-
slipSensorA
LayoutEditorTools.BeanDetails<Sensor> slipSensorA
-
slipSensorB
LayoutEditorTools.BeanDetails<Sensor> slipSensorB
-
slipSensorC
LayoutEditorTools.BeanDetails<Sensor> slipSensorC
-
slipSensorD
LayoutEditorTools.BeanDetails<Sensor> slipSensorD
-
sensorSlipPanel
javax.swing.JPanel sensorSlipPanel
-
-
Constructor Detail
-
LayoutEditorTools
public LayoutEditorTools(@Nonnull LayoutEditor thePanel)
-
-
Method Detail
-
setSignalsAtTurnoutFromMenu
public void setSignalsAtTurnoutFromMenu(@Nonnull LayoutTurnout to, @Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSignalsAtTurnout
public void setSignalsAtTurnout(@Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
getLayoutTurnoutFromTurnout
@CheckReturnValue public LayoutTurnout getLayoutTurnoutFromTurnout(@Nonnull Turnout turnout, boolean requireDoubleXover, @Nonnull java.lang.String str, @CheckForNull javax.swing.JFrame theFrame)
Returns the layout turnout corresponding to a given turnout.If require double crossover is requested, an 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.
- Parameters:
turnout
- the base turnout.requireDoubleXover
- true to force checking of turnout type.str
- error message string.theFrame
- main frame.- Returns:
- layout turnout, may be null.
-
getSignalHeadFromEntry
@CheckReturnValue public SignalHead getSignalHeadFromEntry(@Nonnull NamedBeanComboBox<SignalHead> signalNameComboBox, boolean requireEntry, @Nonnull 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.- Parameters:
signalNameComboBox
- the combo box with signal name selected.requireEntry
- true if mandatory field, else false.frame
- the main frame.- Returns:
- signal head, may be null.
-
getSignalHeadFromEntry
@CheckReturnValue public SignalHead getSignalHeadFromEntry(@Nonnull javax.swing.JTextField signalNameTextField, boolean requireEntry, @Nonnull JmriJFrame frame)
-
getSignalHeadFromEntry
@CheckReturnValue public SignalHead getSignalHeadFromEntry(@CheckForNull java.lang.String signalName, boolean requireEntry, @Nonnull JmriJFrame frame)
-
getHeadFromName
@CheckReturnValue public SignalHead getHeadFromName(@CheckForNull java.lang.String str)
Returns a SignalHead given a name.- Parameters:
str
- signal head name.- Returns:
- signal head, may be null.
-
setSignalHeadOnPanel
public void setSignalHeadOnPanel(double directionDEG, @Nonnull java.lang.String signalHeadName, @Nonnull java.awt.geom.Point2D where)
Places a signal head icon on the panel after rotation at the designated place, with all icons taken care of.- Parameters:
directionDEG
- rotation in degrees.signalHeadName
- name of a signal head.where
- coordinates for placing signal head on panel.
-
setSignalHeadOnPanel
public void setSignalHeadOnPanel(double directionDEG, @Nonnull java.lang.String signalHeadName, int xLoc, int yLoc)
Places a signal head icon on the panel after rotation at the designated place, with all icons taken care of.- Parameters:
directionDEG
- rotation in degrees.signalHeadName
- name of a signal head.xLoc
- x coordinate for placing signal head on panel.yLoc
- y coordinate for placing signal head on panel.
-
isHeadOnPanel
public boolean isHeadOnPanel(@Nonnull SignalHead head)
Get if signal head is on the panel.- Parameters:
head
- the signal head to locate.- Returns:
- true if an icon for the specified SignalHead is on the panel.
-
isHeadAssignedAnywhere
public boolean isHeadAssignedAnywhere(@Nonnull 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.- Parameters:
head
- the signal head to locate.- Returns:
- true if the signal head is attached to a panel object.
-
removeAssignment
public void removeAssignment(@Nonnull SignalHead head)
Removes the assignment of the specified SignalHead to either a turnout, a positionable point, or a level crossing wherever it is assigned.- Parameters:
head
- the signal head to be removed.
-
removeSignalHeadFromPanel
public void removeSignalHeadFromPanel(@CheckForNull java.lang.String signalName)
Removes the SignalHead with the specified name from the panel and from assignment to any turnout, positionable point, or level crossing.- Parameters:
signalName
- name of signal head to be removed.
-
initializeBlockBossLogic
public boolean initializeBlockBossLogic(@Nonnull java.lang.String signalHeadName)
-
finalizeBlockBossLogic
public void finalizeBlockBossLogic()
-
getNextSignalFromObject
@CheckReturnValue public SignalHead getNextSignalFromObject(@Nonnull TrackSegment track, @Nonnull java.lang.Object object, @Nonnull java.lang.String signalHeadName, @Nonnull JmriJFrame frame)
-
reachedEndBumper
public boolean reachedEndBumper()
-
isAtWestEndOfAnchor
public boolean isAtWestEndOfAnchor(TrackSegment t, PositionablePoint p)
-
isAtWestEndOfAnchor
public static boolean isAtWestEndOfAnchor(LayoutEditor layoutEditor, TrackSegment t, PositionablePoint p)
-
setSignalsAtBlockBoundaryFromMenu
public void setSignalsAtBlockBoundaryFromMenu(PositionablePoint p, MultiIconEditor theEditor, javax.swing.JFrame theFrame)
-
setSignalsAtBlockBoundary
public void setSignalsAtBlockBoundary(MultiIconEditor theEditor, javax.swing.JFrame theFrame)
-
setSignalsAtXoverTurnoutFromMenu
public void setSignalsAtXoverTurnoutFromMenu(@Nonnull LayoutTurnout to, @Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSignalsAtXoverTurnout
public void setSignalsAtXoverTurnout(@Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSignalsAtLevelXingFromMenu
public void setSignalsAtLevelXingFromMenu(@Nonnull LevelXing xing, @Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSignalsAtLevelXing
public void setSignalsAtLevelXing(@Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSignalsAtThroatToThroatTurnoutsFromMenu
public void setSignalsAtThroatToThroatTurnoutsFromMenu(@Nonnull LayoutTurnout to, @Nonnull java.lang.String linkedTurnoutName, @Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSignalsAtThroatToThroatTurnouts
public void setSignalsAtThroatToThroatTurnouts(@Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSignalsAt3WayTurnoutFromMenu
public void setSignalsAt3WayTurnoutFromMenu(@Nonnull java.lang.String aName, @Nonnull java.lang.String bName, @Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSignalsAt3WayTurnout
public void setSignalsAt3WayTurnout(@Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSensorsAtBlockBoundaryFromMenu
public void setSensorsAtBlockBoundaryFromMenu(@Nonnull PositionablePoint p, @Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSensorsAtBlockBoundary
public void setSensorsAtBlockBoundary(@Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
getSensorFromEntry
@CheckReturnValue public Sensor getSensorFromEntry(@CheckForNull java.lang.String sensorName, boolean requireEntry, @Nonnull 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, an error message is sent. An error message also results if a sensor head with the entered name is not found in the SensorTable.
- Parameters:
sensorName
- sensor name.requireEntry
- true if mandatory field, else false.frame
- the main frame.- Returns:
- sensor, may be null.
-
getSensorIcon
@CheckReturnValue public SensorIcon getSensorIcon(@Nonnull java.lang.String sensorName)
-
isSensorAssignedAnywhere
public boolean isSensorAssignedAnywhere(@Nonnull 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 NO LONGER (4.11.2) allow the same sensor to be allocated in both directions.- Parameters:
sensor
- The sensor to be checked.- Returns:
- true if the sensor is currently assigned someplace.
-
sensorAssignedElseWhere
void sensorAssignedElseWhere(@Nonnull Sensor sensor)
Display an error dialog.- Parameters:
sensor
- The sensor that is already assigned.
-
removeSensorAssignment
public boolean removeSensorAssignment(@Nonnull Sensor sensor)
Removes the assignment of the specified Sensor to either a turnout, a positionable point, or a level crossing wherever it is assigned. Removes any NX Pairs that use the sensor.If the NX deletes fail due to Conditional references or user deny, the assignment is not deleted. No additional notification is necessary since they have already been notified or made a choice to not continue.
- Parameters:
sensor
- The sensor to be removed.- Returns:
- true if the sensor has been removed.
-
removeSensorFromPanel
public boolean removeSensorFromPanel(@Nonnull Sensor sensor)
Removes the Sensor icon from the panel and from assignment to any turnout, positionable point, or level crossing.- Parameters:
sensor
- The sensor whose icon and references are to be removed.- Returns:
- true if the removal was successful.
-
setBoundarySensor
void setBoundarySensor(Sensor newSensor, Sensor currSensor, LayoutEditorTools.BeanDetails<Sensor> beanDetail, java.lang.String direction)
Attached a sensor to the block boundary positional point.- Parameters:
newSensor
- The sensor that is being added.currSensor
- The sensor that might already be there, otherwise null.beanDetail
- The BeanDetails object that contains the supporting data.direction
- The direction, East or West.- Since:
- 4.11.2
-
isSensorOnPanel
public boolean isSensorOnPanel(@Nonnull Sensor sensor)
-
setSignalMastsAtBlockBoundaryFromMenu
public void setSignalMastsAtBlockBoundaryFromMenu(@Nonnull PositionablePoint p)
-
setSignalMastsAtBlockBoundary
public void setSignalMastsAtBlockBoundary()
-
getSignalMastFromEntry
@CheckReturnValue public SignalMast getSignalMastFromEntry(@CheckForNull java.lang.String signalMastName, boolean requireEntry, @Nonnull 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.- Parameters:
signalMastName
- name of the signal mast.requireEntry
- true if a required field, else false.frame
- main frame.- Returns:
- signal mast, may be null.
-
isSignalMastAssignedAnywhere
public boolean isSignalMastAssignedAnywhere(@Nonnull 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.- Parameters:
signalMast
- the signal mast to query.- Returns:
- true if associated with panel, else false.
-
removeSignalMastAssignment
public void removeSignalMastAssignment(@CheckForNull SignalMast signalMast)
Removes the assignment of the specified SignalMast to either a turnout, a positionable point, or a level crossing wherever it is assigned.- Parameters:
signalMast
- the signal mast to remove.
-
removeSignalMastFromPanel
public void removeSignalMastFromPanel(@Nonnull SignalMast signalMast)
Removes the SignalMast with the specified name from the panel and from assignment to any turnout, positionable point, or level crossing.- Parameters:
signalMast
- the signal mast to remove.
-
refreshSignalMastAtBoundaryComboBox
void refreshSignalMastAtBoundaryComboBox()
-
updateBoundaryBasedSignalMastLogic
public void updateBoundaryBasedSignalMastLogic(@Nonnull SignalMast oldBlock1SignalMast, @Nonnull SignalMast oldBlock2SignalMast, @Nonnull SignalMast block1BoundSignalMast, @Nonnull SignalMast block2BoundSignalMast)
-
setIconOnPanel
public void setIconOnPanel(@Nonnull PositionableIcon l, int rotation, @Nonnull java.awt.Point p)
-
setIconOnPanel
public void setIconOnPanel(@Nonnull PositionableIcon l, int rotation, int xLoc, int yLoc)
-
southToNorth
java.awt.Point southToNorth(java.awt.geom.Point2D p, PositionableIcon l, boolean right, double fromPoint)
-
northToSouth
java.awt.Point northToSouth(java.awt.geom.Point2D p, PositionableIcon l, boolean right, double fromPoint)
-
westToEast
java.awt.Point westToEast(java.awt.geom.Point2D p, PositionableIcon l, boolean right, double fromPoint)
-
eastToWest
java.awt.Point eastToWest(java.awt.geom.Point2D p, PositionableIcon l, boolean right, double fromPoint)
-
northEastToSouthWest
java.awt.Point northEastToSouthWest(java.awt.geom.Point2D p, PositionableIcon l, int oldWidth, int oldHeight, double angleDEG, boolean right, double fromPoint)
-
southWestToNorthEast
java.awt.Point southWestToNorthEast(java.awt.geom.Point2D p, PositionableIcon l, int oldWidth, int oldHeight, double angleDEG, boolean right, double fromPoint)
-
northWestToSouthEast
java.awt.Point northWestToSouthEast(java.awt.geom.Point2D p, PositionableIcon l, int oldWidth, int oldHeight, double angleDEG, boolean right, double fromPoint)
-
southEastToNorthWest
java.awt.Point southEastToNorthWest(java.awt.geom.Point2D p, PositionableIcon l, int oldWidth, int oldHeight, double angleDEG, boolean right, double fromPoint)
-
isSignalMastOnPanel
public boolean isSignalMastOnPanel(@Nonnull SignalMast signalMast)
-
setSignalMastsAtTurnoutFromMenu
public void setSignalMastsAtTurnoutFromMenu(@Nonnull LayoutTurnout to, @Nonnull java.lang.String[] blocks)
-
setSignalMastsAtTurnout
public void setSignalMastsAtTurnout()
-
createListUsedSignalMasts
void createListUsedSignalMasts()
-
refreshSignalMastAtTurnoutComboBox
void refreshSignalMastAtTurnoutComboBox()
-
removeAssignment
public void removeAssignment(@Nonnull SignalMast mast)
-
setSignalMastsAtSlipFromMenu
public void setSignalMastsAtSlipFromMenu(@Nonnull LayoutSlip slip, @Nonnull java.lang.String[] blocks, @Nonnull javax.swing.JFrame theFrame)
-
setSignalMastsAtLayoutSlip
public void setSignalMastsAtLayoutSlip(@Nonnull javax.swing.JFrame theFrame)
-
refreshSignalMastAtSlipComboBox
void refreshSignalMastAtSlipComboBox()
-
setSignalMastsAtLevelXingFromMenu
public void setSignalMastsAtLevelXingFromMenu(@Nonnull LevelXing xing, @Nonnull java.lang.String[] blocks, @Nonnull javax.swing.JFrame theFrame)
-
setSignalMastsAtLevelXing
public void setSignalMastsAtLevelXing(@Nonnull javax.swing.JFrame theFrame)
-
refreshSignalMastAtXingComboBox
void refreshSignalMastAtXingComboBox()
-
setSensorsAtTurnoutFromMenu
public void setSensorsAtTurnoutFromMenu(@Nonnull LayoutTurnout to, @Nonnull java.lang.String[] blocks, @Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame frame)
-
setSensorsAtTurnout
public void setSensorsAtTurnout(@Nonnull javax.swing.JFrame frame)
-
setTurnoutSensor
<T extends LayoutTurnout> void setTurnoutSensor(T trackItem, Sensor newSensor, Sensor currSensor, LayoutEditorTools.BeanDetails<? extends NamedBean> beanDetail, LayoutTrack connect, java.awt.geom.Point2D coords, java.lang.String position)
Attached a sensor to a turnout block boundary. Supports both LayoutTurnout and LayoutSlip classes.- Type Parameters:
T
- The specific type, a subtype of LayoutTurnout- Parameters:
trackItem
- The turnout or slip that is being modified.newSensor
- The sensor that is being added.currSensor
- The sensor that might already be there, otherwise null.beanDetail
- The BeanDetails object that contains the supporting data.connect
- The track segment that is attached to this pointcoords
- The track componennt coordinatesposition
- Which of the four points is being changed- Since:
- 4.11.2
-
setSensorsAtLevelXingFromMenu
public void setSensorsAtLevelXingFromMenu(@Nonnull LevelXing xing, @Nonnull java.lang.String[] blocks, @Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSensorsAtLevelXing
public void setSensorsAtLevelXing(@Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setLevelXingSensor
void setLevelXingSensor(Sensor newSensor, Sensor currSensor, LayoutEditorTools.BeanDetails<? extends NamedBean> beanDetail, LayoutTrack connect, java.awt.geom.Point2D coords, java.lang.String position)
Attached a sensor to a level crossing block boundary.- Parameters:
newSensor
- The sensor that is being added.currSensor
- The sensor that might already be there, otherwise null.beanDetail
- The BeanDetails object that contains the supporting data.connect
- The track segment that is attached to this pointcoords
- The track componennt coordinatesposition
- Which of the four points is being changed- Since:
- 4.11.2
-
setSensorsAtSlipFromMenu
public void setSensorsAtSlipFromMenu(@Nonnull LayoutSlip slip, @Nonnull java.lang.String[] blocks, @Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSensorsAtSlip
public void setSensorsAtSlip(@Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSignalsAtSlipFromMenu
public void setSignalsAtSlipFromMenu(@Nonnull LayoutSlip ls, @Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
setSignalsAtSlip
public void setSignalsAtSlip(@Nonnull MultiIconEditor theEditor, @Nonnull javax.swing.JFrame theFrame)
-
getSignalHeadIcon
@CheckReturnValue public SignalHeadIcon getSignalHeadIcon(@Nonnull java.lang.String signalName)
get a signal head icon for the given signal head- Parameters:
signalName
- name of a signal head.- Returns:
- a SignalHeadIcon for the signal.
-
addLayoutTurnoutSignalHeadInfoToMenu
protected java.lang.Boolean addLayoutTurnoutSignalHeadInfoToMenu(@Nonnull java.lang.String inTurnoutNameA, @Nonnull java.lang.String inTurnoutNameB, @Nonnull javax.swing.JMenu inMenu)
-
addBlockBoundarySignalHeadInfoToMenu
protected java.lang.Boolean addBlockBoundarySignalHeadInfoToMenu(@Nonnull PositionablePoint inPositionablePoint, @Nonnull javax.swing.JMenu inMenu)
-
addLevelXingSignalHeadInfoToMenu
protected java.lang.Boolean addLevelXingSignalHeadInfoToMenu(@Nonnull LevelXing inLevelXing, @Nonnull javax.swing.JMenu inMenu)
-
addLayoutSlipSignalHeadInfoToMenu
protected java.lang.Boolean addLayoutSlipSignalHeadInfoToMenu(@Nonnull LayoutTurnout inLayoutTurnout, @Nonnull javax.swing.JMenu inMenu)
-
-