private void deleteAngle(){
  if (angles == null)   return;
  if (angles.length == 1) {
    angles=null;
    jTFChangeAngle.setText("");
    angleModel.removeValueAt(0);
    jLAngleCount.setText(JL_NUMBER_OF_ANGLES_TEXT + "0");
    btnDeleteAngle.setEnabled(false);
  }
 else {
    double[] tmpAngles=new double[angles.length - 1];
    for (int i=0; i < angles.length - 1; i++) {
      if (i >= selectedAngleIndex) {
        tmpAngles[i]=angles[i + 1];
      }
 else {
        tmpAngles[i]=angles[i];
      }
    }
    angles=tmpAngles;
    angleModel.removeValueAt(selectedAngleIndex);
    selectedAngleIndex=0;
    jTFChangeAngle.setText(angles[selectedAngleIndex] + "\u00BA");
    jLAngleCount.setText("Count of Angles: " + angles.length);
  }
  repaint();
}

private void deleteAngle ( ) { if ( angles == null ) return ; if ( angles . length == 1 ) { angles = null ; jTFChangeAngle . setText ( "" ) ; angleModel . removeValueAt ( 0 ) ; jLAngleCount . setText ( JL_NUMBER_OF_ANGLES_TEXT + "0" ) ; btnDeleteAngle . setEnabled ( false ) ; } else { double [ ] tmpAngles = new double [ angles . length - 1 ] ; for ( int i = 0 ; i < angles . length - 1 ; i ++ ) { if ( i >= selectedAngleIndex ) { tmpAngles [ i ] = angles [ i + 1 ] ; } else { tmpAngles [ i ] = angles [ i ] ; } } angles = tmpAngles ; angleModel . removeValueAt ( selectedAngleIndex ) ; selectedAngleIndex = 0 ; jTFChangeAngle . setText ( angles [ selectedAngleIndex ] + "º" ) ; jLAngleCount . setText ( "Count of Angles: " + angles . length ) ; } repaint ( ) ; }
deletes the selected angle and updates all relevant gui components .
