question: protected boolean removeTurntable ( LayoutTurntable o ) { if ( ! noWarnTurntable ) { int selectedValue = JOptionPane . showOptionDialog ( this , rb . getString ( "Question4r" ) , Bundle . getMessage ( "WarningTitle" ) , JOptionPane . YES_NO_CANCEL_OPTION , JOptionPane . QUESTION_MESSAGE , null , new Object [ ] { Bundle . getMessage ( "ButtonYes" ) , Bundle . getMessage ( "ButtonNo" ) , rb . getString ( "ButtonYesPlus" ) } , Bundle . getMessage ( "ButtonNo" ) ) ; if ( selectedValue == 1 ) { return ( false ) ; } if ( selectedValue == 2 ) { noWarnTurntable = true ; } } if ( selectedObject == o ) { selectedObject = null ; } if ( prevSelectedObject == o ) { prevSelectedObject = null ; } for ( int j = 0 ; j < o . getNumberRays ( ) ; j ++ ) { TrackSegment t = o . getRayConnectOrdered ( j ) ; if ( t != null ) { substituteAnchor ( o . getRayCoordsIndexed ( j ) , o , t ) ; } } for ( int i = 0 ; i < turntableList . size ( ) ; i ++ ) { LayoutTurntable lx = turntableList . get ( i ) ; if ( lx == o ) { turntableList . remove ( i ) ; o . remove ( ) ; setDirty ( true ) ; repaint ( ) ; return ( true ) ; } } return ( false ) ; }
target:  Remove a Layout Turntable