use of jmri.jmrit.display.Editor.TargetPane in project JMRI by JMRI.
the class CircuitBuilder method editCircuitPaths.
protected void editCircuitPaths(String title) {
if (editingOK()) {
editCircuitDialog(title);
if (_currentBlock != null) {
checkCircuits();
// check icons to be indicator type
_circuitIcons = _circuitMap.get(_currentBlock);
if (!iconsConverted(_currentBlock)) {
queryConvertIcons(_currentBlock);
}
// must have converted icons for paths
if (!iconsConverted(_currentBlock)) {
JOptionPane.showMessageDialog(_editor, Bundle.getMessage("needConversion", _currentBlock.getDisplayName(), Bundle.getMessage("ButtonEdit"), Bundle.getMessage("EditTrackSegment")), Bundle.getMessage("noIcons"), JOptionPane.INFORMATION_MESSAGE);
} else {
_editor.setSelectionGroup(makeSelectionGroup(_currentBlock, true));
_currentBlock.setState(OBlock.UNOCCUPIED);
// A temporary path "TEST_PATH" is used to display the icons representing a path
_currentBlock.allocate(EditCircuitPaths.TEST_PATH);
_editor.disableMenus();
TargetPane targetPane = (TargetPane) _editor.getTargetPanel();
targetPane.setSelectGroupColor(_editGroupColor);
targetPane.setHighlightColor(_editGroupColor);
_editPathsFrame = new EditCircuitPaths(Bundle.getMessage("OpenPathTitle"), this, _currentBlock);
}
}
}
}
use of jmri.jmrit.display.Editor.TargetPane in project JMRI by JMRI.
the class CircuitBuilder method editPortals.
protected void editPortals(String title) {
if (editingOK()) {
editCircuitDialog(title);
if (_currentBlock != null) {
checkCircuits();
_circuitIcons = _circuitMap.get(_currentBlock);
// check icons to be indicator type
if (!iconsConverted(_currentBlock)) {
queryConvertIcons(_currentBlock);
}
_editor.setSelectionGroup(makeSelectionGroup(_currentBlock, true));
_editor.disableMenus();
TargetPane targetPane = (TargetPane) _editor.getTargetPanel();
targetPane.setSelectGroupColor(_editGroupColor);
targetPane.setHighlightColor(_highlightColor);
_editPortalFrame = new EditPortalFrame(Bundle.getMessage("OpenPortalTitle"), this, _currentBlock, false);
}
}
}
use of jmri.jmrit.display.Editor.TargetPane in project JMRI by JMRI.
the class DrawFrame method setDrawParams.
protected void setDrawParams() {
TargetPane targetPane = (TargetPane) _parent.getEditor().getTargetPanel();
Stroke stroke = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 10f);
targetPane.setSelectRectStroke(stroke);
targetPane.setSelectRectColor(Color.green);
}
Aggregations