input
stringlengths
10
828
output
stringlengths
5
107
private jpanel get jpanel if j panel null grid bag constraints grid bag constraints1 new grid bag constraints grid bag constraints1 gridx 2 grid bag constraints1 gridy 0 grid bag constraints grid bag constraints new grid bag constraints grid bag constraints gridx 1 grid bag constraints gridy 0 j panel new jpanel j panel set layout new grid bag layout j panel add get jbutton new grid bag constraints j panel add get jbutton1 grid bag constraints j panel add get jbutton2 grid bag constraints1 return j panel
this method initializes j panel
private jbutton get jbutton if j button null j button new jbutton j button set text add j button add action listener new java awt event action listener public void action performed java awt event action event e add row return j button
this method initializes j button
private jtext field get jtext field username if j text field username null j text field username new jtext field return j text field username
this method initializes j text field username
private jtext field get jtext field fullname if j text field fullname null j text field fullname new jtext field return j text field fullname
this method initializes j text field fullname
private jbutton get jbutton1 if j button1 null j button1 new jbutton j button1 set text make pdf j button1 add action listener new java awt event action listener public void action performed java awt event action event e make pdf return j button1
this method initializes j button1
private jtext field get jtext field description if j text field description null j text field description new jtext field return j text field description
this method initializes j text field description
public void set message string text j label message set text text
set the message to appear in the dialog above the data entry fields
private jbutton get jbutton2 if j button2 null j button2 new jbutton j button2 set text close j button2 add action listener new java awt event action listener public void action performed java awt event action event e set visible false return j button2
this method initializes j button2
public void set lang string lang language l lang
set the language to use with tesseract use eng for english passed
private jmenu bar get jjmenu bar if j jmenu bar null j jmenu bar new jmenu bar j jmenu bar add get jmenu1 j jmenu bar add get jmenu return j jmenu bar
this method initializes j jmenu bar
private jmenu get jmenu if j menu null j menu new jmenu j menu set text edit j menu set mnemonic key event vk e j menu add get jmenu item j menu add get jmenu item1 j menu add get jmenu item undo j menu add get jmenu item redo j menu add get jmenu item add row return j menu
this method initializes j menu
private jmenu item get jmenu item if j menu item copy null j menu item copy new jmenu item new default editor kit copy action j menu item copy set text copy j menu item copy set mnemonic key event vk c j menu item copy set accelerator key stroke get key stroke key event vk c action event ctrl mask j menu item copy set enabled true return j menu item copy
this method initializes j menu item
private void initialize this set size 522 310 this set preferred size new dimension 600 300 this set content pane get jcontent pane this set title running jobs this pack
this method initializes this
private jmenu item get jmenu item1 if j menu item paste null j menu item paste new jmenu item new default editor kit paste action j menu item paste set text paste j menu item paste set mnemonic key event vk p j menu item paste set accelerator key stroke get key stroke key event vk v action event ctrl mask j menu item paste set enabled true return j menu item paste
this method initializes j menu item1
private jtable get jtable if j table null j table new jtable singleton get singleton instance get job list j table set auto resize mode jtable auto resize subsequent columns j table set default renderer integer class new button renderer cancel j table set default editor integer class new button editor button editor action cancel job this int character width singleton get singleton instance get character width j table get column model get column 0 set preferred width character width 6 return j table
this method initializes j table
private jmenu get jmenu1 if j menu1 null j menu1 new jmenu j menu1 set text file j menu1 set mnemonic key event vk f j menu1 add get jmenu item3 j menu1 add get jmenu item2 return j menu1
this method initializes j menu1
private jmenu item get jmenu item3 if j menu item3 null j menu item3 new jmenu item j menu item3 set text create pdf j menu item3 set mnemonic key event vk d j menu item3 add action listener new java awt event action listener public void action performed java awt event action event e make pdf return j menu item3
this method initializes j menu item3
private jmenu item get jmenu item2 if j menu item null j menu item new jmenu item j menu item set text close window j menu item add action listener new java awt event action listener public void action performed java awt event action event e set visible false return j menu item
this method initializes j menu item
private jtext field get jtext field3 if j text field locality null j text field locality new jtext field j text field locality set input verifier metadata retriever get input verifier specimen class specific locality j text field locality j text field locality set tool tip text metadata retriever get field help specimen class specific locality j text field locality add key listener new java awt event key adapter public void key typed java awt event key event e this pane set state to dirty return j text field locality
this method initializes j text field3
private jtext field get jtext field full name if j text field full name null j text field full name new jtext field return j text field full name
this method initializes j text field full name
public void set image file file an image file throws ioexception if an image file null reference image filename an image file get name reference image path an image file get path load image image io read an image file j text field image file name set text an image file get name
set the image displayed in the editor given a file
private jtext field get jtext field about if j text field about null j text field about new jtext field return j text field about
this method initializes j text field about
private jcombo box get jcombo box if j combo box null j combo box new jcombo box users roles return j combo box
this method initializes j combo box
private jbutton get jbutton if j button null j button new jbutton j button set enabled false j button set text save j button add action listener new java awt event action listener public void action performed java awt event action event e save return j button
this method initializes j button
private void initialize this set preferred size new dimension 1100 900 this set jmenu bar get jjmenu bar this set content pane get jcontent pane this set title image template editor
this method initializes this
private jpanel get jcontent pane if j content pane null j content pane new jpanel j content pane set layout new border layout j content pane add get jpanel1 java awt border layout center return j content pane
this method initializes j content pane
private boolean test default template boolean result false if properties contains key key templatedefault string template id properties get property key templatedefault try position template template new position template template id template get class added to suppress findbugs dls dead local store no exception thrown this template is ok result true catch no such template exception e template isn t recognized set property to default template properties set property key templatedefault position template template default return result
test to see if the key templatedefault matches a valid position template
private void initialize this set size 755 357 this set title what is this image this set content pane get jcontent pane
this method initializes this
public void add job runnable job a job jobs add a job this fire table data changed
add job adds a runnable job to this model as a new row
public void test get singleton instance singleton instance singleton get singleton instance assert equals instance singleton get singleton instance
test method for
private jpanel get jcontent pane if j content pane null j content pane new jpanel j content pane set layout new border layout j content pane add get jpanel border layout west j content pane add get image panel border layout center return j content pane
this method initializes j content pane
private jbutton get jbutton1 if j button1 null j button1 new jbutton j button1 set text zoom out j button1 set mnemonic key event vk minus j button1 add action listener new java awt event action listener public void action performed java awt event action event e zoom out return j button1
this method initializes j button1
private jtext field get jtext field template id if j text field template id null j text field template id new jtext field 50 return j text field template id
this method initializes j text field template id
private jbutton get jbutton2 if j button2 null j button2 new jbutton j button2 set text full 1 j button2 set mnemonic key event vk 1 j button2 add action listener new java awt event action listener public void action performed java awt event action event e zoom full return j button2
this method initializes j button2
private image zoom panel get image panel if image panel null image panel new image zoom panel return image panel
this method initializes image panel
private jtext field get jtext field barcode if j text field barcode null j text field barcode new jtext field j text field barcode add key listener new java awt event key adapter public void key typed java awt event key event e check values return j text field barcode
this method initializes j text field barcode
private jbutton get jbutton3 if j button3 null j button3 new jbutton j button3 set text fit window j button3 set mnemonic key event vk f j button3 add action listener new java awt event action listener public void action performed java awt event action event e zoom to fit return j button3
this method initializes j button3
private jscroll pane get jscroll pane if j scroll pane null j label new image panel j label set text image goes here j scroll pane new jscroll pane j scroll pane set autoscrolls true j scroll pane set viewport view j label return j scroll pane
this method initializes j scroll pane
private jtext field get jtext field drawer number if j text field drawer number null j text field drawer number new jtext field j text field drawer number add key listener new java awt event key adapter public void key typed java awt event key event e check values return j text field drawer number
this method initializes j text field drawer number
private jbutton get jbutton4 if j button4 null j button4 new jbutton j button4 set text center j button4 set mnemonic key event vk c j button4 add action listener new java awt event action listener public void action performed java awt event action event e center return j button4
this method initializes j button4
private jcombo box get jcombo box if j combo box null j combo box new jcombo box j combo box add item j combo box add item sel specimen j combo box add item sel drawer j combo box add item sel other j combo box set selected item return j combo box
this method initializes j combo box
public void test set file candidate image file file try file new candidate image file new file this get class get resource all tests file empty get file new position template try file set file new file all tests file invalid name new position template fail failed to throw unreadable file exception for invalid filename catch unreadable file exception e pass catch unreadable file exception e fail threw unexpected unreadable file exception e get message
test method for
public void test position template position template t new position template assert equals t get name new position template get name
test method for
public void test to jsonstring unit tray label u new unit tray label u set family family string json u to jsonstring assert equals f family b t g s u i r a d json u set subfamily subfamily u set tribe tribe u set genus genus u set specific epithet specific u set authorship author 1800 u set drawer number 111 1 u set collection rod eastwood collection json u to jsonstring assert equals f family b subfamily t tribe g genus s specific u i r a author 1800 d 111 1 c rod eastwood collection json
test method for
public void test get barcode text candidate image file file try file new candidate image file new file this get class get resource all tests file valid barcode get file new position template assert equals all tests barcode in file valid barcode file get barcode text assert equals candidate image file result barcode scanned file get barcode status catch unreadable file exception e fail threw unexpected unreadable file exception e get message
test method for
public void test get barcode status candidate image file file try file new candidate image file new file this get class get resource all tests file empty get file new position template assert equals candidate image file result error file get barcode status catch unreadable file exception e fail threw unexpected unreadable file exception e get message
test method for
public void test detect template for image default position template detector detector new default position template detector try detector detect template for image new file all tests file invalid name fail failed to throw unreadable file exception for invalid file catch unreadable file exception e pass try string template detector detect template for image new file this get class get resource all tests file empty get file assert equals position template template no component parts template catch unreadable file exception e fail threw unexpected unreadable file exception e get message todo test templates with example images here
test method for
public void test get sha1 hash string string a string hash 86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 assert equals hash hash utility get sha1 hash string string the quick red fox jumped over the lazy brown dog hash 73119267f916971817361c4ae8ed06111f3deaee assert equals hash hash utility get sha1 hash string string utf 16 u 4 d91 sneeze hash 94aa69d55a9c75485a6a8604aacff8fb8e529112 hash returned by my sql select sha1 assert equals hash hash utility get sha1 hash string string some basic latin characters with escaped as hash a89252809482882a6820cdbe7d8ec4bc978491aa assert equals hash hash utility get sha1 hash string
test method for
public void test extract number barcode matcher matcher new mczentbarcode assert equals integer value of 1 matcher extract number mcz ent00000001 assert null matcher extract number mcz entaaaaaaaaaa
test method for
private jmenu get jmenu if j menu null j menu new jmenu j menu set text file j menu set mnemonic key event vk f j menu add get jmenu item load image j menu add get jmenu item create template j menu add get jmenu item2 return j menu
this method initializes j menu
public void test match found in barcode matcher matcher new mczentbarcode assert true matcher match found in mcz ent01234567 assert false matcher match found in not a barcode assert false matcher match found in assert false matcher match found in null assert false matcher match found in mcz ent123 assert false matcher match found in mczent01234567 assert false matcher match found in mcz tst01234567 assert true matcher match found in mcz ent01234567 n assert true matcher match found in n mcz ent01234567 n assert true matcher match found in mcz ent01234567a assert false matcher match found in mczent01234567 n
test method for
public void test make from number barcode builder builder new mczentbarcode assert equals mcz ent01234567 builder make from number integer value of 1234567 assert equals mcz ent00000001 builder make from number integer value of 1 assert equals mcz ent00000000 builder make from number integer value of 0 assert null builder make from number null assert null builder make from number integer max value assert null builder make from number integer min value assert null builder make from number integer value of 1
test method for
private void initialize this set size new dimension 694 530 this set title about image capture app app name this set content pane get jpanel dimension screen size toolkit get default toolkit get screen size this set location screen size width this get width 2 screen size height this get height 2
this method initializes this
private jpanel get jpanel if j content pane null j content pane new jpanel j content pane set layout new border layout j content pane add get jpanel1 border layout south j content pane add get jpanel2 border layout center return j content pane
this method initializes j panel
private jbutton get jbutton if j button null j button new jbutton j button set text close j button set mnemonic key event vk c j button add action listener new java awt event action listener public void action performed java awt event action event e this dialog set visible false this dialog dispose return j button
this method initializes j button
public string get template identifier return get template id
get the identifying name of this position template
private jtext field get jtext field app if j text field app null j text field app new jtext field image capture app app name j text field app set editable false return j text field app
this method initializes j text field app
private jtext field get jtext field version if j text field version null j text field version new jtext field image capture app app version j text field version set editable false return j text field version
this method initializes j text field version
private jtext field get jtext field if j text field null j text field new jtext field image capture app app rev j text field set editable false return j text field
this method initializes j text field
private jtext area get jtext area if j text area null j text area new jtext area 3 50 j text area set text image capture app app description j text area set editable false return j text area
this method initializes j text area
private jtext field get jtext field1 if j text field copyright null j text field copyright new jtext field image capture app app copyright j text field copyright set editable false return j text field copyright
this method initializes j text field1
private jtext field get jtext field12 if j text field1 null j text field1 new jtext field image capture app app contributors j text field1 set editable false return j text field1
this method initializes j text field1
private jtext field get jtext field2 if j text field2 null j text field2 new jtext field image capture app app libraries j text field2 set editable false return j text field2
this method initializes j text field2
private jtext field get jtext field14 if j text field last updated by null j text field last updated by new jtext field j text field last updated by set editable false j text field last updated by set tool tip text metadata retriever get field help specimen class last updated by j text field last updated by set enabled false j text field last updated by set foreground color black return j text field last updated by
this method initializes j text field1
private jmenu item get jmenu item2 if j menu item2 null j menu item2 new jmenu item if running from main j menu item2 set text exit j menu item2 set mnemonic key event vk e else j menu item2 set text close window j menu item2 set mnemonic key event vk c j menu item2 add action listener new java awt event action listener public void action performed java awt event action event e if running from main image capture app exit image capture app exit normal else this frame set visible false return j menu item2
this method initializes j menu item2
private jmenu bar get jjmenu bar if j jmenu bar null j jmenu bar new jmenu bar j jmenu bar add get jmenu file j jmenu bar add get jmenu edit j jmenu bar add get jmenu action j jmenu bar add get jmenu data j jmenu bar add get jmenu quality control j jmenu bar add get jmenu config j jmenu bar add get jmenu help return j jmenu bar
this method initializes j jmenu bar
private jmenu get jmenu file if j menu file null j menu file new jmenu j menu file set text file j menu file set mnemonic key event vk f j menu file add get jmenu item log j menu file add get jmenu item logout j menu file add get jmenu item exit return j menu file
this method initializes j menu file
private jtext field get jtext field2 if j text field2 null j text field2 new jtext field j text field2 set editable false return j text field2
this method initializes j text field2
private jmenu item get jmenu item exit if j menu item exit null j menu item exit new jmenu item j menu item exit set text exit j menu item exit set mnemonic key event vk e j menu item exit add action listener new java awt event action listener public void action performed java awt event action event e image capture app clean up system out println exit by user from main menu image capture app exit image capture app exit normal return j menu item exit
this method initializes j menu item exit
private jscroll pane get jscroll pane collectors if j scroll pane collectors null j scroll pane collectors new jscroll pane j scroll pane collectors set viewport view get jtable collectors j scroll pane collectors set preferred size new dimension j scroll pane collectors get width 150 j scroll pane collectors add key listener new java awt event key adapter public void key typed java awt event key event e this pane set state to dirty return j scroll pane collectors
this method initializes j scroll pane collectors
private jmenu get jmenu help if j menu help null j menu help new jmenu j menu help set text help j menu help set mnemonic key event vk h j menu help add get jmenu item about j menu help add separator j menu help add get jmenu item j menu help add get jmenu item version return j menu help
this method initializes j menu help
private jmenu item get jmenu item about if j menu item about null j menu item about new jmenu item j menu item about set text about j menu item about set mnemonic key event vk b j menu item about add action listener new java awt event action listener public void action performed java awt event action event e about dialog a new about dialog a pack a set visible true return j menu item about
this method initializes j menu item about
private jmenu item get jmenu item version if j menu item version null j menu item version new jmenu item image capture app app name ver image capture app app version j menu item version set enabled false return j menu item version
this method initializes j menu item version
private jtext field get jtext field date updated if j text field date last updated null j text field date last updated new jtext field j text field date last updated set editable false j text field date last updated set enabled false j text field date last updated set foreground color black return j text field date last updated
this method initializes j text field1
public string get template id return template id
get the identifying name of this position template
private jtext field get jtext field8 if j text field image file name null j text field image file name new jtext field 50 j text field image file name set editable false return j text field image file name
this method initializes j text field8
private jpanel get jpanel2 if j panel2 null grid bag constraints grid bag constraints3 new grid bag constraints grid bag constraints3 fill grid bag constraints both grid bag constraints3 weighty 1 0 grid bag constraints3 anchor grid bag constraints north grid bag constraints3 weightx 1 0 j panel2 new jpanel j panel2 set layout new grid bag layout j panel2 add get jscroll pane grid bag constraints3 return j panel2
this method initializes j panel2
private jtext field get jtext field22 if j text field creator null j text field creator new jtext field j text field creator set editable false j text field creator set enabled false j text field creator set foreground color black j text field creator set tool tip text metadata retriever get field help specimen class creator return j text field creator
this method initializes j text field2
private jscroll pane get jscroll pane if j scroll pane null j scroll pane new jscroll pane j scroll pane set preferred size new dimension 600 150 j scroll pane set viewport view get jtable return j scroll pane
this method initializes j scroll pane
private jtable get jtable if j table null j table new jtable list position template templates position template get templates j table set model new position template table model templates j table get column set cell renderer new button renderer j table get column set cell editor new button editor button editor open template this frame return j table
this method initializes j table
private jmenu get jmenu config if j menu config null j menu config new jmenu j menu config set text configuration j menu config set mnemonic key event vk c j menu config set enabled true j menu config add get jmenu item edit templates j menu config add get jmenu item preferences j menu config add get jmenu item users j menu config add get jmenu item change password return j menu config
this method initializes j menu config
private image panel for drawing get image panel for drawing if image panel for drawing null image panel for drawing new image panel for drawing image panel for drawing set preferred size new dimension 600 600 return image panel for drawing
this method initializes image panel for drawing
private jtext field get jtext field32 if j text field date created null j text field date created new jtext field j text field date created set editable false j text field date created set enabled false j text field date created set foreground color black return j text field date created
this method initializes j text field3
private jscroll pane get jscroll pane1 if j scroll pane1 null j scroll pane1 new jscroll pane j scroll pane1 set preferred size new dimension 800 800 j scroll pane1 set viewport view get image panel for drawing return j scroll pane1
this method initializes j scroll pane1
private jmenu get jmenu edit if j menu edit null j menu edit new jmenu j menu edit set text edit j menu edit set mnemonic key event vk e j menu edit add get jmenu item copy j menu edit add get jmenu item paste return j menu edit
this method initializes j menu edit
private jscroll pane get jscroll pane numbers if j scroll pane numbers null j scroll pane numbers new jscroll pane j scroll pane numbers set viewport view get jtable j scroll pane numbers set preferred size new dimension j scroll pane numbers get width j text field barcode get font metrics j text field barcode get font get height 6 j scroll pane numbers add key listener new java awt event key adapter public void key typed java awt event key event e this pane set state to dirty return j scroll pane numbers
this method initializes j scroll pane numbers
private jmenu item get jmenu item preferences if j menu item preferences null j menu item preferences new jmenu item j menu item preferences set text preferences j menu item preferences set mnemonic key event vk n j menu item preferences add action listener new java awt event action listener public void action performed java awt event action event e properties editor p new properties editor p pack p set visible true return j menu item preferences
this method initializes j menu item
private jbutton get jbutton if j button null j button new jbutton j button set text check for barcode j button set mnemonic key event vk c j button add action listener new java awt event action listener public void action performed java awt event action event e if template null image panel for drawing get image null j text field barcode scan set text candidate image file get barcode text from image buffered image image panel for drawing get image template return j button
this method initializes j button
private jmenu item get jmenu item copy if j menu item copy null j menu item copy new jmenu item new default editor kit copy action j menu item copy set text copy j menu item copy set mnemonic key event vk c j menu item copy set accelerator key stroke get key stroke key event vk c action event ctrl mask j menu item copy set enabled true return j menu item copy
this method initializes j menu item1
private jmenu item get jmenu item paste if j menu item paste null j menu item paste new jmenu item new default editor kit paste action j menu item paste set text paste j menu item paste set mnemonic key event vk p j menu item paste set accelerator key stroke get key stroke key event vk v action event ctrl mask j menu item paste set enabled true return j menu item paste
this method initializes j menu item2
private jtext field get jtext field barcode scan if j text field barcode scan null j text field barcode scan new jtext field j text field barcode scan set editable false return j text field barcode scan
this method initializes j text field
private jmenu item get jmenu item log if j menu item log null j menu item log new jmenu item j menu item log set text view history j menu item log set mnemonic key event vk h j menu item log add action listener new java awt event action listener public void action performed java awt event action event e event log log window new event log log window pack log window set visible true system gc return j menu item log
this method initializes j menu item log
private jbutton get jbutton1 if j button unit tray barcode null j button unit tray barcode new jbutton j button unit tray barcode set text check taxon barcode j button unit tray barcode add action listener new java awt event action listener public void action performed java awt event action event e j text field unit tray barcode set text candidate image file get barcode unit tray text from image buffered image image panel for drawing get image template return j button unit tray barcode
this method initializes j button1
private jpanel get jpanel if j panel null j panel new jpanel j panel set layout new border layout j panel add get jpanel1 border layout south j panel add get jpanel center border layout center return j panel
this method initializes j panel
private jtext field get jtext field if j text field unit tray barcode null j text field unit tray barcode new jtext field j text field unit tray barcode set editable false return j text field unit tray barcode
this method initializes j text field
private jtext field get jtext field9 if control utbarcode null control utbarcode new jtext field control utbarcode set editable false return control utbarcode
this method initializes j text field
private jpanel get jpanel center if j panel center null j label count new jlabel j label count set text j panel center new jpanel j panel center set layout new border layout j panel center add j label count border layout south return j panel center
this method initializes j panel center
private jmenu item get jmenu item edit templates if j menu item edit templates null j menu item edit templates new jmenu item j menu item edit templates set text edit templates j menu item edit templates set mnemonic key event vk t j menu item edit templates add action listener new java awt event action listener public void action performed java awt event action event e position template editor template editor new position template editor template editor pack template editor set visible true return j menu item edit templates
this method initializes j menu item3
private jmenu get jmenu data if j menu data null j menu data new jmenu j menu data set text data j menu data set mnemonic key event vk d j menu data add get jmenu item search j menu data add get jmenu item browse images j menu data add get jmenu item browse specimens return j menu data
this method initializes j menu
private jmenu get jmenu quality control if j menu quality control null j menu quality control new jmenu j menu quality control set text quality control j menu quality control set mnemonic key event vk q j menu quality control add get jmenu item validate image no db j menu quality control add get jmenu item qcbarcodes j menu quality control add get jmenu item reconcile files return j menu quality control
this method initializes j menu1