Class CircuitBuilder
java.lang.Object
jmri.jmrit.display.controlPanelEditor.CircuitBuilder
ControlPanelEditor CircuitBuilder tools.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) JmriJFramestatic final Colorprotected ControlPanelEditorstatic final Colorstatic final Color(package private) ArrayList<Positionable>************************** Mouse ************************(package private) static int(package private) static int(package private) static int(package private) static int(package private) static int(package private) static int(package private) static int -
Constructor Summary
ConstructorsConstructorDescription*************************************************************** -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcheckForPortalIcons(OBlock block, String key) Check that there is at least one PortalIcon. called from various _editFrame'sprotected StringcheckForPortals(OBlock block, String key) protected StringcheckForTrackIcons(OBlock block, String key) protected voidprotected voidcloseCircuitBuilder(OBlock block) protected voiddeletePortalIcon(PortalIcon icon) protected booleandoMouseClicked(List<Positionable> selections, JmriMouseEvent event) booleandoMouseDragged(Positionable selection, JmriMouseEvent event) Prevent dragging when CircuitBuilder is in progress, except for PortalIcon.protected booleandoMousePressed(JmriMouseEvent event) If CircuitBuilder is in progress, restore what editor nulls.protected booleandoMousePressed(JmriMouseEvent event, Positionable selection) Make note of selection.booleandoMouseReleased(Positionable selection, boolean dragging) protected static voiddoSize(JComponent comp, int max, int min) booleanSecond call needed to only drag the portal icon and not entire selectionprotected voideditCircuit(String title, boolean fromMenu) protected voideditCircuitError(String sysName) protected voideditCircuitPaths(String title, boolean fromMenu) protected voideditPortalDirection(String title, boolean fromMenu) protected voideditPortalError(String name) protected voideditPortalError(OBlock block, Portal portal, PortalIcon icon) protected voideditPortals(String title, boolean fromMenu) protected voideditSignalFrame(String title, boolean fromMenu) protected ArrayList<Positionable>getCircuitIcons(OBlock block) protected EditFrameprotected List<PortalIcon>getPortalIcons(Portal portal) protected HashMap<NamedBean,ArrayList<PositionableIcon>> protected List<PositionableIcon>getSignalIconMap(NamedBean mast) protected PortalgetSignalPortal(NamedBean mast) protected voidhidePortalIcons(boolean hideAll) protected booleaniconIntersectsBlock(Positionable icon, OBlock block) protected static booleanisTrack(Positionable pos) protected static JPanelmakeBoxPanel(boolean vertical, JComponent textField, String label, String tooltip) protected JMenumakeMenu()Makes menu for ControlPanelEditor.protected static JPanelmakeTextBoxPanel(boolean vertical, JTextField textField, String label, boolean editable, String tooltip) protected void************** Set up editing Frames ****************protected voidprotected booleanportalIconMove(PortalIcon pos, int x, int y) protected voidputSignalPortal(NamedBean mast, Portal portal) protected booleanqueryConvertTrackIcons(OBlock block, String key) Check if the block being edited has all its track icons converted to indicator icons If icons need conversion. ask if user wants to convert themprotected booleanrectIntersectsBlock(Rectangle iconRect, OBlock block) protected voidremoveBlock(OBlock block) Remove block, but keep the track icons.protected booleansaveSelectionGroup(ArrayList<Positionable> selectionGroup) Keep selections when editing.protected voidprotected voidsetIconGroup(OBlock block) Edit frame closing, set block's icons to support OBlock's state changes
-
Field Details
-
STRUT_SIZE
-
_cbFrame
-
_editor
-
_editGroupColor
-
_pathColor
-
_highlightColor
-
_saveSelectionGroup
************************** Mouse ************************ -
NONE
-
OBLOCK
-
PORTAL
-
OPATH
-
ARROW
-
SIGNAL
-
-
Constructor Details
-
CircuitBuilder
public CircuitBuilder()*************************************************************** -
CircuitBuilder
-
-
Method Details
-
makeMenu
Makes menu for ControlPanelEditor. Called by ControlPanelEditor at init before contents have been loaded.- Returns:
- the menu, created if needed
-
openCBWindow
-
getEditFrame
-
newCircuit
************** Set up editing Frames **************** -
editCircuit
-
editCircuitError
-
editPortals
-
editPortalError
-
editPortalError
-
editPortalDirection
-
editSignalFrame
-
editCircuitPaths
-
setCurrentBlock
-
hidePortalIcons
-
setIconGroup
Edit frame closing, set block's icons to support OBlock's state changes- Parameters:
block- OBlock to set icon selections into data maps
-
closeCircuitBuilder
-
iconIntersectsBlock
-
rectIntersectsBlock
-
getCircuitIcons
-
getPortalIcons
-
getSignalIconMap
-
getSignalIconMap
-
getSignalPortal
-
putSignalPortal
-
removeBlock
Remove block, but keep the track icons. Sets block reference in icon to null.- Parameters:
block- the block to remove
-
checkForPortals
-
checkForPortalIcons
Check that there is at least one PortalIcon. called from various _editFrame's- Parameters:
block- check icons of this blockkey- properties key- Returns:
- true if at least one PortalIcon found
-
checkForTrackIcons
-
deletePortalIcon
-
queryConvertTrackIcons
Check if the block being edited has all its track icons converted to indicator icons If icons need conversion. ask if user wants to convert them- Parameters:
block- OBlock to checkkey- properties key- Returns:
- true if all track icons are IndicatorTrack icons
-
isTrack
-
portalIconMove
- Parameters:
pos- PortalIcon attempting a move. allow or disallowx- new x positiony- new y position- Returns:
- allow, or not
-
saveSelectionGroup
Keep selections when editing. Editor calls at entry to mousePressed(). CircuitBuilder keeps is own concept of what is "selected".- Parameters:
selectionGroup- the selection group to save- Returns:
- true if retaining a reference to a frame
-
doMousePressed
Make note of selection.- Parameters:
event- the triggering eventselection- the selection- Returns:
- true
-
doMousePressed
If CircuitBuilder is in progress, restore what editor nulls.- Parameters:
event- the triggering event- Returns:
- true if the selection group is restored; false otherwise
-
doMouseReleased
-
doMouseClicked
-
doMouseDragged
Prevent dragging when CircuitBuilder is in progress, except for PortalIcon.- Parameters:
selection- the item(s) being draggedevent- the triggering event- Returns:
- true to prevent dragging; false otherwise
-
dragPortal
Second call needed to only drag the portal icon and not entire selection- Returns:
- true if portal frame is open
-
closeCBWindow
-
doSize
-
makeTextBoxPanel
protected static JPanel makeTextBoxPanel(boolean vertical, JTextField textField, String label, boolean editable, String tooltip) -
makeBoxPanel
protected static JPanel makeBoxPanel(boolean vertical, JComponent textField, String label, String tooltip)
-