Skip to content
Permalink
Browse files

Completed EditSignalFrame

  • Loading branch information...
pete_ pete_
pete_ authored and pete_ committed Jul 12, 2019
1 parent de22f0e commit ffdeed08b6912e80375f63578c7be64c7262ba80

Large diffs are not rendered by default.

@@ -80,6 +80,7 @@ drawInstructions3a = (Optional) To control the visibility of the shape,
#drawInstructions3b = Enter the name of a sensor in the [{0}] field below.
VisibleSensor = Sensor name for Visibility or Level Control
SensorMsg = An Active Sensor can either hide the shape or change its display level
NoSensorManager = No SensorManager for this protocol, shape cannot acquire a sensor.
HideOnSensor = Hide Shape
ChangeLevel = Change Level
SameLevel = Same Level
@@ -97,6 +98,8 @@ buttonClearSelection = Clear Selection
buttonChangeName = Change Name
buttonDeletePortal= Delete Portal
ButtonNextCircuit = Next Circuit
ButtonAddMast = Configure Mast
ButtonRemoveMast= Remove Mast
OpenPicklist = Open {0} Picklist

#labels
@@ -109,19 +112,29 @@ ErrorSensor = Error Sensor
#ErrorSensorMsg = Error Sensor:
ErrorPortal = Error Portal
blockState = Circuit (OBlock) State:
editCiruit = Edit Circuit
DragOccupancySensor = Drag name of a sensor that can detect occupancy to the "{0}" field.
detectorSensorName = Enter the name of the sensor that detects occupancy for this track circuit
detectorErrorName = Enter the name of the sensor that indicates power problems for this track circuit
AddRemoveIcons = Select (or deselect) all the track icons that display this OBlock track circuit
blockName = Circuit Name:
portalName = Portal Name
mastName = Signal Mast Name
blockLength = Block Length

makePortal = Make Portal
PortalTitle = Portals into and out of circuit {0}
SignalTitle = Edit Signal masts protecting block {0}
selectPortalProtection= Select a portal for protection of {0}
portalName = Portal Name
PortalDirection1= Set the icons that indicate entry into block "{0}".
PortalDirection2= The icon shows the direction of movement
PortalDirection3= when a Warrant is allocated and set.
PortalDirection4= Select a Portal to show its entry direction into the block.
PortalDirection5= Select the desired icon below to change the direction icon.
selectPortal = To make an icon for a Portal in the list, select it from the list,
noIcon = No Icon
dragIcon = then drag the icon below to its position between the circuits on the panel.
portalIconPosition=A portal icon should touch both Blocks of the Portal\nIf the blocks are not adjacent, drag a second icon to the other block.
enterNameToDrag = To make a new Portal, enter text into the Portal Name box,
dragNewIcon = then drag the icon below to the panel to create both the Portal and its icon.

PathTitle = Paths through track circuit {0}
pathName = Path Name
enterNewPath = To make a new Path, enter text into the Path Name box
@@ -132,44 +145,49 @@ editPathIcons = then select or deselect the portal and track icons.
throwPathTO = To get the correct turnout position for a path,
holdShiftDown = Select, then click the turnout with the Shift key down.
makePath = Make Path
DragOccupancySensor = Drag name of a sensor that can detect occupancy to the "{0}" field.
DragMast = Drag name of a Signal Mast to the {0} field.
editCiruit = Edit Circuit
PortalDirection1= Set the icons that indicate entry into block "{0}".
PortalDirection2= The icon shows the direction of movement
PortalDirection3= when a Warrant is allocated and set.
PortalDirection4= Select a Portal to show its entry direction into the block.
PortalDirection5= Select the desired icon below to change the direction icon.
noIcon = No Icon
parallelPortal = {0} and {1} are both Portals between {2} and {3}.\nIf this is incorrect, delete one of them.
NoSensorManager = No SensorManager for this protocol, shape cannot acquire a sensor.
pathLength =Path Length

detectorSensorName = Enter the name of the sensor that detects occupancy for this track circuit
detectorErrorName = Enter the name of the sensor that indicates power problems for this track circuit

selectAdjacentCircuit = Select an adjacent track circuit of "{0}" to make a Portal between them.
SignalTitle = Edit Signal masts protecting block {0}
mastName = Signal Mast Name
configureSignal = ConfigureSignal
selectPortalProtection= Select the portal where a signal for protection of {0} is set.
selectSignalMast= Enter the name of a signal mast into the Signal Mast name field.
positionMast = Now reposition the mast icon displayed over the portal.
entranceSpace = Entrance space adjustment
differentSignals= Signal "{0}" protects portal "{1}", Change this to signal "{2}"?
noMast = No signal protects portal "{0}". Set signal "{1}" to protect it?
differentName = Signal name is "{0}". Change name to "{1}"?
spaceChanged = Entrance adjustment for signal "{0}" is changed.
unattachedMast = Signal mast "{0}" is not set to protect any block.
attachMast = \nDo you want this mast to protect block {0}?
replaceSignalMast=Do you want to replace signal mast {0} with mast {1} at portal {2}?
mastProtectsPortal=Signal mast {0} protects block {1} at portal {2}.
switchProtection= \nDo you want it to protect block {0} at portal {1}?
removeSignalMast=Confirm that you want to remove signal mast {0} and its icon at portal {1}.
noPortalProtection=There is no signal configured to protect {0} at portal{1}.
DragMast = Drag name of a Signal Mast to the {0} Mast Name field.

ToolTipConvertIcon = Convert circuit icons to Indicator Track icons (re-orienting or repositioning may be needed)
ToolTipDeleteCircuit= Delete this track circuit but keep its icons, if any.
TooltipBlockName = Enter a name to change the User Name of the OBlock for this Circuit.
TooltipBlockLength=Enter a length for the Paths in this OBlock.
TooltipPathLength=Enter a length for the above named path.
TooltipPathUnitButton = Click to switch the unit of length between metric and imperial.
ToolTipAddPath = Enter a name, then select the icons that show\nthe track and portals of the path. Then press this button.
ToolTipAddPath = Enter a name, then select the icons that show the track and portals of the path. Then press this button.
ToolTipDeletePath = Delete the path selected in the list from the track circuit.
#ToolTipEditPath = Select a path from the list to display it. Then add or delete the icons of the path.
ToolTipClearList = Clear the selections in the list.
TooltipPathName = Enter the name of the Path through this Track Circuit.
TooltipPathName = Enter the name for a new Path through this Track Circuit.
TooltipPortalName= Enter a name to create a new Portal to OBlock "{0}".
ToolTipMastName = Enter a name to configure a signal mast to protect block "{0}".
ToolTipChangeName= Enter another name to change the name of a selection in the above list.
ToolTipDeletePortal= Delete the selected portal and its icon.
ToolTipPickLists = Click on either the system or user name, then drag it and drop it into the entry field.
ToolTipAddMast = Configures the signal mast to protect {0} at the selected portal.
ToolTipRemoveMast=Removes the signal protection at the selected portal of {0}. (Does not delete the signal)

# error/warning messages
NeedDataTitle = Please enter Data
cannotEditCB = Cannot edit while running or displaying a warrant.\n (warrant "{0}")
#enterOBlockName
AskTitle = What shall we do?
blockExists = Circuit "{0}" or "{1}" already exist. Do you want to edit it?
AlreadyEditing = Editing a Detection Circuit in progress. Please complete before starting a new edit.
@@ -180,7 +198,7 @@ notIndicatorIcon = The highlighted track icon is not an Indicator Track icon. Do
noSensor = No Detection Sensor
noDetecterSensor = No detector Sensor specified. This will be a Dark block and cannot be included in an interlock.
badSensorName = "{0}" is not a valid Sensor name.
mixedSensors = No detector Sensor specified. Do you want to use the Error Sensor for occupancy?
mixedSensors = No detector Sensor specified. Do you want to use the Error Sensor for occupancy?
makePaths = Path Requirement
noIcons = No Icons
needIcons = Block circuit (OBlock) "{0}" needs Indicator Track icons to add a {1} in CircuitBuilder.
@@ -192,7 +210,7 @@ noPortalIcon = Portal "{0}" does not have an icon.\nPortal Icons are needed t
BlockPaths = Block Path
DirectionArrow = Direction Arrow
PortalOrPath = Portal or Path
iconNotOnAdjacent = Portal icon "{0}" does not join Circuit "{1}" to an adjacent Circuit.
#iconNotOnAdjacent = Portal icon "{0}" does not join Circuit "{1}" to an adjacent Circuit.
badPath = Invalid Path
iconNotInCircuit = This icon is not part of track circuit "{0}".
portalNotInCircuit = Portal "{0}" does not connect to track circuit (OBlock) "{1}".
@@ -212,19 +230,19 @@ changePathName = Select a path from the above list. Enter the name change and p
confirmBlockDelete = Are you sure you want to delete the circuit and all its paths and all its portals?
confirmPortalDelete = Delete portal "{0}" and its icon?\nDeleting a portal modifies all paths using the portal.
duplicatePathName = Path "{0}" is the name of another Path in Circuit {1}.
noSuchPortal = There is no portal called "{0}".
portalHasIcon = Portal "{0}" has an icon. It is now highlighted.
invalidPortal = Portal "{0}" attached to OBlock "{1}" invalid - only one block.
#noSuchPortal = There is no portal called "{0}".
#portalHasIcon = Portal "{0}" has an icon. It is now highlighted.
#invalidPortal = Portal "{0}" attached to OBlock "{1}" invalid - only one block.
turnoutNotSet = Turnout "{0}" must be set to "Closed" or "Thrown".
tooManyPortals = A path cannot have more than two portals.
tooFewPortals = A path must have at least one portal.
balloonTrack = Is path "{0}" a balloon track?\n({1} is both an entrance and exit portal)
sensorFail = Sensor failed for "{0}" due to {1}.
#balloonTrack = Is path "{0}" a balloon track?\n({1} is both an entrance and exit portal)
#sensorFail = Sensor failed for "{0}" due to {1}.
portalIconMisplaced = A Portal icon "{0}" is positioned incorrectly or\nits adjacent circuit has unconverted icons.
blocksEtcOK = Currently defined OBlocks, Portals and Paths are consistent without errors.
replacePortalBlock = Replace portal connection of {0} to {1} with {0} to {2}?\nIf action is taken, {0}'s paths to {1} will now go to {2}.
#replacePortalBlock = Replace portal connection of {0} to {1} with {0} to {2}?\nIf action is taken, {0}'s paths to {1} will now go to {2}.
savePath = Changes to path "{0}" not saved.
saveChanges = Save changes?
saveChanges = Make and save changes?
changePath = Path "{0}" has been changed. Do you want to make this change?
samePath = Path "{1}" is stored with the name "{0}".
changeName = Path {0} already defined as "{1}". Do you want to change the name to "{0}"?
@@ -237,7 +255,7 @@ noPathIcons = Path "{0}" has no icons to display it. Select track and portal ic
waitForPalette = Please wait while the Item Palette is loading...
multipleBlockSelections=Choose which block the highlighted portal should connect to "{0}".
multipleSelections = Icons are stacked over each other.\nSelect the one you want.
multipleBlocks = Choose which adjacent block for Portal {0}
#multipleBlocks = Choose which adjacent block for Portal {0}
MustBeFloat = {0} is an invalid number. Must be a positive decimal number.
needLength = Please enter a length for the block paths.
exitQuestion = \nIgnore message and Exit?
@@ -1368,7 +1368,9 @@ public void mouseClicked(MouseEvent event) {
showPopUp(selection, event);
}
} else if (selection != null) {
if (!_circuitBuilder.doMouseClicked(getSelectedItems(event), event)) {
if (_circuitBuilder.doMouseClicked(getSelectedItems(event), event)) {
return;
} else {
selection.doMouseClicked(event);
}
if (selection instanceof IndicatorTrack) {
@@ -37,8 +37,7 @@
private JTextField _blockState;
private JTextField _numTrackSeg;
private JTextField _numTurnouts;
private JTextField _length;
private JToggleButton _units;
private LengthPanel _lengthPanel;

// Sensor list
OpenPickListButton<Sensor> _pickTable;
@@ -59,7 +58,6 @@ protected JPanel makeContentPanel() {
_blockState = new JTextField();
_numTrackSeg = new JTextField();
_numTurnouts = new JTextField();
_length = new JTextField();
JPanel p = new JPanel();

p.add(new JLabel(Bundle.getMessage("AddRemoveIcons")));
@@ -124,23 +122,13 @@ protected JPanel makeContentPanel() {
// contentPane.add(makePickListPanel());
contentPane.add(Box.createVerticalStrut(STRUT_SIZE));

JPanel pp = new JPanel();
// pp.setLayout(new BoxLayout(pp, BoxLayout.X_AXIS));
_length.setText(Float.toString(_homeBlock.getLengthIn()));
pp.add(CircuitBuilder.makeTextBoxPanel(
false, _length, "Length", true, "TooltipBlockLength"));
_length.setPreferredSize(new Dimension(100, _length.getPreferredSize().height));
_units = new JToggleButton("foo", !_homeBlock.isMetric());
_units.setToolTipText(Bundle.getMessage("TooltipPathUnitButton"));
_units.addActionListener((ActionEvent event) -> {
changeUnits();
});
pp.add(_units);
contentPane.add(pp);
_lengthPanel = new LengthPanel(_homeBlock, "blockLength");
_lengthPanel.changeUnits();
_lengthPanel.setLength(_homeBlock.getLengthMm());
contentPane.add(_lengthPanel);
contentPane.add(Box.createVerticalStrut(STRUT_SIZE));

contentPane.add(makeDoneButtonPanel());
changeUnits();
return contentPane;
}
private JPanel makeButtonPanel() {
@@ -197,16 +185,6 @@ private void convertIcons() {
this.toFront();
}

private void changeUnits() {
if (_units.isSelected()) {
_units.setText("in");
_length.setText(Float.toString(_homeBlock.getLengthIn()));
} else {
_units.setText("cm");
_length.setText(Float.toString(_homeBlock.getLengthCm()));
}
}

/*
* *********************** end setup *************************
*/
@@ -299,29 +277,16 @@ protected void closingEvent(boolean close) {
_parent.setIconGroup(_homeBlock);
String msg = _parent.checkForTrackIcons(_homeBlock, "PortalOrPath");
if(msg == null) {
String name = _length.getText();
try {
float f = Float.parseFloat(name);
if (_units.isSelected()) {
f *= 25.4f;
} else {
f *= 10f;
}
if (f < 0) {
msg = Bundle.getMessage("MustBeFloat", name);
} else if (f < .0001) {
msg = Bundle.getMessage("needLength", name);
}
_homeBlock.setLength(Math.max(f, 0.0f));
} catch (NumberFormatException nfe) {
msg = Bundle.getMessage("MustBeFloat", name);
}
_homeBlock.setLength(_lengthPanel.getLength());
}
// check Sensors
if (msg == null) {
msg = checkForSensors();
}
closingEvent(close, msg);
if (_pickTable != null) {
_pickTable.closePickList();
}
}

private String checkForSensors() {

0 comments on commit ffdeed0

Please sign in to comment.
You can’t perform that action at this time.