public void windowClosing( WindowEvent e ) { System.out.println("Got windowClosing..."); closeSafely(); }
void addNewPoint() { NamedPointWorld npw = points.addNewPoint(); dialog.recreatePointsPanel(); dialog.pack(); }
public void reset(int i) { points.unset(i); dialog.reset(i); unsaved = true; }
public void useFineTuneResult( RegistrationResult r ) { if( r != null ) { NamedPointWorld point = points.get( indexOfPointBeingFineTuned ); point.x = r.point_would_be_moved_to_x; point.y = r.point_would_be_moved_to_y; point.z = r.point_would_be_moved_to_z; point.set = true; System.out.println("Got a result, changed point to: "+point); unsaved = true; if( dialog != null ) { dialog.setCoordinateLabel( indexOfPointBeingFineTuned, point.x, point.y, point.z ); dialog.pack(); } } progressWindow = null; }
addWindowListener( this ); setLayout(new GridBagLayout()); outerc.anchor = GridBagConstraints.LINE_START; outerc.fill = GridBagConstraints.HORIZONTAL; add(instructionsPanel,outerc); recreatePointsPanel(); add(pointsPanel,outerc); add(new Label(""),outerc); add(buttonsPanel,outerc); outerc.anchor = GridBagConstraints.LINE_START; outerc.fill = GridBagConstraints.NONE; add(templatePanel,outerc); add(registrationPanel,outerc); pack(); setVisible(true);
plugin.addNewPoint(); } else if (source == closeButton) { closeSafely(); } else if (source == saveButton) { plugin.save(".points"); if( plugin.useTemplate( templateImageFilename ) ) { templateFileName.setText(templateImageFilename); pack(); plugin.useTemplate( null ); templateFileName.setText("[None chosen]"); pack(); } else if( source == registerRigid ) { plugin.doRegistration(NamePoints.RIGID);
public void reset(int i) { assert i>0; assert i<coordinateLabels.length; coordinateLabels[i].setText("<unset>"); showButtons[i].setEnabled(false); resetButtons[i].setEnabled(false); pack(); }
public void stopFineTuneThreads( ) { synchronized( fineTuneThreadQueue ) { for( FineTuneThread runningThread : fineTuneThreadsStarted ) runningThread.askToFinish(); fineTuning = false; } for( FineTuneThread f : fineTuneThreadsStarted ) { System.out.println( "Waiting for thread " + f + " to finish..." ); try { f.join(); } catch( InterruptedException e ) { } System.out.println("... done waiting for thread."); } if( dialog != null ) dialog.setFineTuning( false ); if( progressWindow != null && progressWindow.useTheResult ) { useFineTuneResult( progressWindow.bestSoFar ); } System.out.println("FINISHED! (in stopFineTuneThreads)"); }
public void closeSafely() { if( plugin.unsaved ) { YesNoCancelDialog d = new YesNoCancelDialog( IJ.getInstance(), "Really quit?", "There are unsaved changes. Do you really want to quit?" ); if( ! d.yesPressed() ) return; } plugin.stopFineTuneThreads(); dispose(); }
setCoordinateLabel(counter, p.x, p.y,
dialog = new PointsDialog( "Marking up: "+imp.getTitle(), archiveClient, loadedTemplate ? templateParameter : null,
dialog.setCoordinateLabel(i,xWorld,yWorld,zWorld); dialog.pack();
dialog.pack();
dialog.setFineTuning(true);
void delete(int i) { String name = points.get(i).getName(); YesNoCancelDialog d = new YesNoCancelDialog( IJ.getInstance(), "Really delete?", "Do you really want to delete the point \""+name+"\"?" ); if( d.yesPressed() ) { points.delete(i); dialog.recreatePointsPanel(); dialog.pack(); } }
void rename(int i) { NamedPointWorld npw = points.get(i); GenericDialog gd = new GenericDialog( "Rename Point" ); gd.addStringField( "Rename point to:", npw.getName() ); gd.showDialog(); if( gd.wasCanceled() ) return; String newName = gd.getNextString(); boolean result = points.renamePointTo( i, newName ); if( result ) { dialog.markButtons[i].setLabel( newName ); dialog.pack(); } else { IJ.error("Couldn't rename point: there already is one called \"" + newName + "\"" ); } }
NamedPointSet nps = NamedPointSet.fromString( fileContents ); this.points = nps; dialog.recreatePointsPanel(); dialog.pack(); unsaved = false;
else { points = newNamedPoints; dialog.recreatePointsPanel(); dialog.pack();