protected fun removeTurntable(o: LayoutTurntable): Boolean { if (!noWarnTurntable) { val selectedValue: Int = javax.swing.JOptionPane.showOptionDialog( this, rb.getString("Question4r"), Bundle.getMessage("WarningTitle"), javax.swing.JOptionPane.YES_NO_CANCEL_OPTION, javax.swing.JOptionPane.QUESTION_MESSAGE, null, arrayOf<Any>( 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 (j in 0 until o.getNumberRays()) { val t: TrackSegment = o.getRayConnectOrdered(j) if (t != null) { substituteAnchor(o.getRayCoordsIndexed(j), o, t) } } for (i in 0 until turntableList.size()) { val lx: LayoutTurntable = turntableList.get(i) if (lx === o) { turntableList.remove(i) o.remove() setDirty(true) repaint() return true } } return false }
Remove a Layout Turntable