Search in sources :

Example 6 with TargetPane

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);
            }
        }
    }
}
Also used : TargetPane(jmri.jmrit.display.Editor.TargetPane)

Example 7 with TargetPane

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);
        }
    }
}
Also used : TargetPane(jmri.jmrit.display.Editor.TargetPane)

Example 8 with TargetPane

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);
}
Also used : BasicStroke(java.awt.BasicStroke) Stroke(java.awt.Stroke) BasicStroke(java.awt.BasicStroke) TargetPane(jmri.jmrit.display.Editor.TargetPane)

Aggregations

TargetPane (jmri.jmrit.display.Editor.TargetPane)8 BasicStroke (java.awt.BasicStroke)1 Stroke (java.awt.Stroke)1 ArrayList (java.util.ArrayList)1 IndicatorTrack (jmri.jmrit.display.IndicatorTrack)1 Positionable (jmri.jmrit.display.Positionable)1 OBlock (jmri.jmrit.logix.OBlock)1 Portal (jmri.jmrit.logix.Portal)1 PortalManager (jmri.jmrit.logix.PortalManager)1