@@ -104,7 +104,10 @@ public void paint(Graphics g) {
104104 drawStaticEllipses (g2d );
105105 }
106106 }
107-
107+ private int getStaticEllipsesCount (){
108+ ArrayList <Ellipse > es = mImg .getEllipseStatic ();
109+ return es == null ? 0 : es .size ();
110+ }
108111 public void drawStaticEllipses (Graphics2D g2d ) {
109112 AffineTransform old = g2d .getTransform ();
110113 // -----------------------------------------//
@@ -126,8 +129,6 @@ public void drawStaticEllipses(Graphics2D g2d) {
126129
127130
128131
129-
130-
131132 g2d .setColor (Color .black );
132133 g2d .setStroke (bs );
133134 g2d .draw (ed );
@@ -248,19 +249,24 @@ public void drawElps(Graphics2D g2d, ArrayList<Ellipse> elpses) {
248249 public void updateStatus () {
249250 ll = null ;
250251 waitLastPoint = false ;
251- if (unfinished .size () == 2 ) {
252+ int unfinishedSize = unfinished .size ();
253+ if (unfinishedSize == 2 ) {
252254 waitLastPoint = true ;
253255 ll = new LinearLine (unfinished .get (0 ), unfinished .get (1 ));
254256 }
255- if (unfinished . size () == 3 ) {
257+ if (unfinishedSize == 3 ) {
256258 Ellipse e = new Ellipse (unfinished .get (0 ), unfinished .get (1 ), this .projPoint );
257259 e .setOffsetForTableDisplay (this .minX , this .minY );
258260 mImg .addElps (e );
259261 Flags .numNewEllipse ++;
260262 unfinished = new ArrayList <>();
261263 this .activedEllipseIdx = mImg .getElpses ().size () - 1 ;
264+
265+ }
266+ mainFrame .marksUpdatedAtSelectedImage (this .mImg );
267+ if (unfinishedSize == 3 ){
268+ mainFrame .coordListTH .rightPanelSetSelectedLine (this .activedEllipseIdx +getStaticEllipsesCount ());
262269 }
263- mainFrame .marksUpdatedAtSelected (this .mImg );
264270 repaint ();
265271 }
266272
@@ -277,6 +283,7 @@ public void activateClosest(int x, int y) {
277283 }
278284 Point_ p = new Point_ (x , y );
279285 this .activedEllipseIdx = findTheClosestEllipse (p );
286+ mainFrame .coordListTH .rightPanelSetSelectedLine (this .activedEllipseIdx +getStaticEllipsesCount ());
280287 this .repaint ();
281288 }
282289
0 commit comments