@@ -107,6 +107,8 @@ public void run() {
107107 * Create the frame.
108108 */
109109 public MainFrame () {
110+ setResizable (false );
111+ setTitle ("Face Annotation Tool" );
110112 setDefaultCloseOperation (JFrame .EXIT_ON_CLOSE );
111113 setBounds (100 , 100 , 1195 , 601 );
112114 contentPane = new JPanel ();
@@ -124,36 +126,41 @@ public MainFrame() {
124126 JScrollPane rightScrollPanel = new JScrollPane ();
125127
126128 GroupLayout gl_contentPane = new GroupLayout (contentPane );
127- gl_contentPane .setHorizontalGroup (gl_contentPane .createParallelGroup (Alignment .LEADING ).addGroup (gl_contentPane
128- .createSequentialGroup ()
129- .addGroup (gl_contentPane .createParallelGroup (Alignment .LEADING )
130- .addComponent (toolPanel , GroupLayout .DEFAULT_SIZE , 1173 , Short .MAX_VALUE )
131- .addGroup (gl_contentPane .createSequentialGroup ().addGap (3 )
132- .addComponent (leftScrollPanel , GroupLayout .PREFERRED_SIZE , 230 ,
133- GroupLayout .PREFERRED_SIZE )
134- .addPreferredGap (ComponentPlacement .RELATED )
135- .addComponent (scrollPanel , GroupLayout .PREFERRED_SIZE , 643 , GroupLayout .PREFERRED_SIZE )
136- .addPreferredGap (ComponentPlacement .RELATED ).addComponent (rightScrollPanel ,
137- GroupLayout .PREFERRED_SIZE , 286 , GroupLayout .PREFERRED_SIZE )))
138- .addContainerGap ()));
139- gl_contentPane .setVerticalGroup (gl_contentPane .createParallelGroup (Alignment .TRAILING ).addGroup (gl_contentPane
140- .createSequentialGroup ()
141- .addComponent (toolPanel , GroupLayout .PREFERRED_SIZE , 38 , GroupLayout .PREFERRED_SIZE )
142- .addGroup (gl_contentPane .createParallelGroup (Alignment .LEADING )
143- .addGroup (gl_contentPane .createSequentialGroup ().addPreferredGap (ComponentPlacement .RELATED )
144- .addGroup (gl_contentPane .createParallelGroup (Alignment .TRAILING )
145- .addComponent (leftScrollPanel , GroupLayout .PREFERRED_SIZE , 516 ,
146- GroupLayout .PREFERRED_SIZE )
147- .addComponent (scrollPanel , GroupLayout .DEFAULT_SIZE , 535 , Short .MAX_VALUE )))
148- .addGroup (gl_contentPane .createSequentialGroup ().addGap (14 ).addComponent (rightScrollPanel ,
149- GroupLayout .PREFERRED_SIZE , 505 , GroupLayout .PREFERRED_SIZE )))
150- .addContainerGap ()));
129+ gl_contentPane .setHorizontalGroup (
130+ gl_contentPane .createParallelGroup (Alignment .LEADING )
131+ .addGroup (gl_contentPane .createSequentialGroup ()
132+ .addGroup (gl_contentPane .createParallelGroup (Alignment .LEADING )
133+ .addComponent (toolPanel , GroupLayout .DEFAULT_SIZE , 1174 , Short .MAX_VALUE )
134+ .addGroup (gl_contentPane .createSequentialGroup ()
135+ .addGap (3 )
136+ .addComponent (leftScrollPanel , GroupLayout .PREFERRED_SIZE , 230 , GroupLayout .PREFERRED_SIZE )
137+ .addPreferredGap (ComponentPlacement .RELATED )
138+ .addComponent (scrollPanel , GroupLayout .PREFERRED_SIZE , 643 , GroupLayout .PREFERRED_SIZE )
139+ .addPreferredGap (ComponentPlacement .RELATED )
140+ .addComponent (rightScrollPanel , GroupLayout .PREFERRED_SIZE , 286 , GroupLayout .PREFERRED_SIZE )))
141+ .addContainerGap ())
142+ );
143+ gl_contentPane .setVerticalGroup (
144+ gl_contentPane .createParallelGroup (Alignment .TRAILING )
145+ .addGroup (gl_contentPane .createSequentialGroup ()
146+ .addComponent (toolPanel , GroupLayout .PREFERRED_SIZE , 38 , GroupLayout .PREFERRED_SIZE )
147+ .addGroup (gl_contentPane .createParallelGroup (Alignment .LEADING )
148+ .addGroup (gl_contentPane .createSequentialGroup ()
149+ .addPreferredGap (ComponentPlacement .RELATED )
150+ .addGroup (gl_contentPane .createParallelGroup (Alignment .TRAILING )
151+ .addComponent (leftScrollPanel , GroupLayout .PREFERRED_SIZE , 516 , GroupLayout .PREFERRED_SIZE )
152+ .addComponent (scrollPanel , GroupLayout .DEFAULT_SIZE , 535 , Short .MAX_VALUE )))
153+ .addGroup (gl_contentPane .createSequentialGroup ()
154+ .addGap (14 )
155+ .addComponent (rightScrollPanel , GroupLayout .DEFAULT_SIZE , 527 , Short .MAX_VALUE )))
156+ .addContainerGap ())
157+ );
151158
152159 button = new JButton ("TEST" );
160+ button .setVisible (false );
153161 button .addActionListener (new ActionListener () {
154162 public void actionPerformed (ActionEvent e ) {
155- imgListTH .tm .setRowCount (0 );
156- System .out .println ("src = 0" );
163+ coordListTH .clearAll ();
157164 }
158165 });
159166 toolPanel .add (button );
@@ -207,7 +214,7 @@ public void mouseMoved(MouseEvent e) {
207214 }
208215 });
209216 imagePanel .setForeground (Color .WHITE );
210- imagePanel .setBackground (Color . ORANGE );
217+ imagePanel .setBackground (new Color ( 250 , 250 , 210 ) );
211218
212219 imagePanel .setSize (1 , 1 );
213220 scrollPanel .setViewportView (imagePanel );
@@ -245,7 +252,9 @@ public void valueChanged(ListSelectionEvent e) {
245252 void rightTableOnClick (ListSelectionEvent e ){
246253 if (e .getValueIsAdjusting ())
247254 return ;
255+
248256 int rowIdx = coordListTH .getSelectedRowIndex ();
257+
249258 cm .clickOnRightTable (rowIdx );
250259 }
251260 void leftTableOnClick (ListSelectionEvent e ) {
@@ -270,15 +279,14 @@ void setRightPanelCoords(MyImage mim) {
270279 //call this will update right panel with image's staticEllipse/Ellipse
271280 //use null as the arg will use a selectedRow as target image
272281 if (mim == null ) {
273- System .out .println ("setRightPanelCoords with null" );
274282 if (leftTableSelectedRow == -1 ) {
275- System .err .println ("bad0 at setRightPanelCoords" );
283+ System .err .println ("bad-0 at setRightPanelCoords" );
276284 return ;
277285 }
278286 String p = imgListTH .getBehindRowDataAt (leftTableSelectedRow );
279287 mim = pathImgPair .get (p );
280288 if (mim == null ) {
281- System .err .println ("bad1 at setRightPanelCoords" );
289+ System .err .println ("bad-1 at setRightPanelCoords" );
282290 return ;
283291 }
284292
@@ -333,6 +341,7 @@ void loadImageList() {
333341
334342 pathImgPair = IOTool .filterImageList (imgList , this );
335343 if (pathImgPair .size () == 0 ){
344+ pathImgPair = null ;
336345 return ;
337346 }
338347 fillImageNameTable ();
@@ -474,12 +483,6 @@ public void marksUpdatedAtSelectedImage(MyImage mim) {
474483 if (leftTableSelectedRow == -1 ) {
475484 System .err .println ("marking on non-loaded image?" );
476485 }
477- // if(mim == null){
478- // String p = imgListTH.getBehindRowDataAt(leftTableSelectedRow);
479- // mim = pathImgPair.get(p);
480- // if(mim == null) System.err.println("bad at marksUpdatedAtSelected");
481- // return;
482- // }
483486 imgListTH .setValueAt (leftTableSelectedRow , 2 , mim .getMarkNumString ());
484487 setRightPanelCoords (mim );
485488 }
0 commit comments