input
stringlengths
10
828
output
stringlengths
5
107
public void del chord int index remove index set modified true revalidate repaint
delete the chord at position index
public void del selected chords int number get chord count for int i 0 i number i if is selected chord i del chord i i number repaint set modified true
delete all the chords who are currently selected
public boolean is selected chord int chord index if get chord at chord index is selected return true else return false
indicate if the chord at index position is selected or not
public color get display color return display color
get the color in which the chord will be show in chord cast
public void move chord int dest int from component temp get component from remove from add temp dest set modified true
move a chord from the from position to the dest position
protected int find bloc origine x int string nb double ratio return int horizontal margin element size 2 string nb 1 string spacing ratio
methods use to localise positions where to draw the elements
public void move chord int dest component obj remove obj add obj dest set modified true
move a chord contain in the chord sheet from
protected int find bloc relative x int string nb double ratio return int horizontal margin string nb 1 string spacing ratio
methods use to localise positions where to draw the elements
protected int find bloc origine y int fret nb double ratio return int top margin fret spacing fret nb 1 fret spacing 2 element size 2 ratio
methods use to localise positions where to draw the elements
public void set display color color c display color c
set the color in which the chord will be show in chord cast
public void swap chords int i int j chord ui temp chord ui int temp int if i j return if i j temp int i i j j temp int temp chord ui get chord at i add get component j i add temp chord ui j set modified true
swap the chord at position i with the chord at position j
public int get selected count int nb 0 for int i 0 i get chord count i if is selected chord i nb return nb
indicate if there is only one chord selected in the chord sheet
public chord ui get selected chord for int i 0 i get chord count i if is selected chord i return get chord at i return null if there is no selected chord
return the first selected chord ui
public void reload last title int index chord sheet vector size 1 reload title index
reload the title of the last chord sheet on screen
public void duplicate chord if get selected count 1 chord ui new chord ui new chord ui this new chord ui get chord copy chord get selected chord get chord add new chord ui revalidate set modified true
clone the selected chord in a new chord
protected int get component index component comp int n get component count for int i 0 i n i if get component i comp return i return 1 the component is not in the chord sheet
retreive the position of a specific chord ui in the chord sheet
public void reload title int n if chord sheet vector null n 0 n chord sheet vector size chord sheet sheet chord sheet chord sheet vector get n string is name sheet get title if sheet is modified tabbed pane set title at n is name else tabbed pane set title at n is name
reload the title of the chord sheet at position n on screen
public void cut copy get current sheet del selected chords
cut the selected chords of the current chord sheet
public void copy int i empty buffer chord buffer remove all chord sheet sheet get current sheet chord ui cui null for i 0 i sheet get chord count i cui sheet get chord at i if cui is selected try chord buffer add chord chord cui get chord clone catch exception exc exc print stack trace
copy the selected chords of the current chord sheet
public void add sheet chord sheet sheet new chord sheet tabbed pane sheet add change listener this chord sheet vector add sheet this set current sheet get last sheet index sheet set modified false this set menu bar state
add a new empty chord sheet
public void add sheet chord sheet sheet sheet add change listener this chord sheet vector add sheet this set current sheet get last sheet index sheet set modified false chord sheet temp chord sheet chord sheet vector get 0 if temp is modified system out println not modified temp get file name if temp get file name null temp get file name equals system out println not saved default sheet unused set current sheet 0 remove current sheet this set menu bar state
add a new chord sheet
public void add chord to sheet while no tab is selected chord sheet sheet get current sheet if sheet null sheet add chord
add a chord to the current chord sheet
public void del chord of sheet get current sheet del selected chords
delete all selected chords in the current chord sheet
public boolean remove current sheet if get current sheet is modified string str message format format chord cast get string chordcast save changes message new string get current sheet get title int n joption pane show confirm dialog this str chord cast get string chordcast save changes title joption pane yes no cancel option if n joption pane ok option if save false return false else if n joption pane cancel option return false int index tabbed pane get selected index tabbed pane remove index chord sheet vector remove index set menu bar state return true
remove the current chord sheet
public boolean remove sheets while chord sheet vector is empty set current sheet 0 if remove current sheet false return false set menu bar state return true
remove all the chord sheets loaded
public void select all chords get current sheet set selected all true
set all the chords of the current chord sheet to the state selected
public chord sheet get current sheet if tabbed pane get tab count 0 return null if chord sheet vector is empty false return chord sheet chord sheet vector element at tabbed pane get selected index else return null
return a link to the current chord sheet
public void set current sheet int index if chord sheet vector size index the index is valid this tabbed pane set selected index index chord sheet chord sheet vector get index request focus in window
set the focus on the chord sheet at a specified index
public void load string url try chord sheet sheet this file chooser load url if ask load file sheet get file name add sheet sheet this add recent file sheet this reload last title this tabbed pane set tool tip text at tabbed pane get tab count 1 sheet get file name else we remove the last chordsheet temporary added tabbed pane remove tabbed pane get component count 1 catch file format exception exc joption pane popup new joption pane exc get message joption pane error message joption pane ok option
load a chord sheet contains in the history from disk
public boolean save chord sheet temp sheet this get current sheet if temp sheet null joption pane show message dialog null please select a file to save return false try if temp sheet get file name equals the sheet have already been saved if file chooser save temp sheet temp sheet get file name if get position in recent files temp sheet 1 this add recent file temp sheet return true else the sheet is saved for the first time return save as catch exception exc joption pane show message dialog null exc get message return false return true
save a chord sheet on disk in a xcs format
public boolean save as try chord sheet temp sheet this get current sheet if this file chooser save temp sheet this add recent file temp sheet this tabbed pane set tool tip text at tabbed pane get selected index temp sheet get file name return true else return false catch ioexception exc joption pane popup new joption pane exc get message joption pane error message joption pane ok option return false
save a chord sheet on disk in a xcs format
public void save all int temp tabbed pane get selected index for int i 0 i chord sheet vector size i set current sheet i save set current sheet temp
save all the open chord sheets in a xcs format
public void export sheet export interface export try todo have to ask the user wich format we want file chooser export sheet get current sheet export catch exception exc joption pane popup new joption pane exc get message joption pane error message joption pane ok option
save a chord sheet on disk in a html format
public void sort by name boolean increase get current sheet sort chords increase
sort all the chords of the current chord sheet by their name
public void swap chords int i int j get current sheet swap chords i j
swap the chord at position i with the chord at position j
public void clone sheet chord sheet new chord sheet int i chord sheet source sheet source sheet this get current sheet create a new chord sheet and add it at the last position this add sheet new chord sheet chord sheet this chord sheet vector last element for i 0 i source sheet get component count i new chord sheet add chord chord ui source sheet get component i get chord new chord sheet set title source sheet get title
clone the current chord sheet and add the clone at the last position
public void set chords colors neck showing color this display color neck printing color this printing color this repaint
change the color of the chords
public void window closing window event evt quit
close the application
public void print sheet boolean is selection print try if get current sheet null printer controller printer new printer controller printer print sheet get current sheet is selection print else joption pane show message dialog null please first load a sheet catch exception exc exc print stack trace joption pane show message dialog null exc get message
print the current sheet
public void init filter config filter config this filter config filter config if filter config null if debug log admin filter initializing filter
init method for this filter
public string get target format or null string source format if source format null return null string map value this format relations get source format to lower case return map value
returns the target format in lowercase for the given source format or
public string get target format string source format if source format null return null string target format or null get target format or null source format if target format or null null return source format to lower case return target format or null
returns the target format for the given source format
public string get target picture format return this target picture format
returns the target picture format lowercase may be the same as the file
public int get num images boolean allow search throws jupload ioexception init image reader try return this image reader get num images allow search catch ioexception e throw new jupload ioexception image reader writer helper get num images file image input stream e
call to image reader
public void write iioimage iio image throws jupload ioexception init image writer try this image writer write null iio image this image writer param catch ioexception e throw new jupload ioexception image reader writer helper write e
write a picture in the output picture file
public string get location return null this location unknown location this location
retrieves the human readable location of this exception class
public string get class name and clause if get cause null return this get class get name else return this get class get name this get cause get class get name
returns jupload exception class name cause class name
public void run load icon
implementation of the runnable interface
synchronized public void shutdown now if this executor service null stop running jobs this executor service shutdown now this executor service null
stop all current and to come thread
private void stop running jobs enumeration icon worker e this hash map elements icon worker iw null while e has more elements iw e next element if iw status icon worker status to be loaded iw status icon worker status not loaded
lazily mark all jobs as not done
synchronized public void append string t super append t
this call must be synchronized so that there is no interaction with the
public void property change property change event e string prop e get property name if the directory changed don t show an image if jfile chooser directory changed property equals prop we stops all running job if the user gets back to this directory the non calculated icons will be added to the job list this upload policy display debug jupload file view directory changed 50 stop running jobs
waiting for jfile chooser events
synchronized public void insert string str int pos super insert str pos
this call must be synchronized so that there is no interaction with the
synchronized public void replace range string str int start int end super replace range str start end
this call must be synchronized so that there is no interaction with the
synchronized public void set text string t super set text t
this call must be synchronized so that there is no interaction with the
public void delete log try if null this last reponse body file if this last reponse body file delete this upload policy display warn unable to delete this last reponse body file this last reponse body file get name this last reponse body file null catch exception e nothing to do
delete the current log
private void dispose dialog boolean retry validated this retry validated retry validated this countdown timer stop this dispose
actually closes the dialog box and set the retry validated status
public thread new thread runnable runnable thread thread new thread this icon worker thread group runnable thread set priority thread min priority return thread
implementation of thread factory
public component get drop component return this
return the component on which drop event can occur
public void component hidden component event arg0 we don t care
catches the i hidden i event on the jviewport
public void add rotation int quarter this quarter rotation quarter we ll have to recalculate the upload length as the resulting file is different if any file has been prepared they must be deleted delete working copy picture file delete transformed picture file this upload length 1 we keep the quarter in the segment 0 4 while this quarter rotation 0 this quarter rotation 4 while this quarter rotation 4 this quarter rotation 4 we need to change the precalculated picture if any if this offscreen image null this offscreen image flush this offscreen image null
this function is used to rotate the picture
public void component moved component event arg0 we don t care
catches the i moved i event on the jviewport
public void component resized component event arg0 is the width set if get width 0 table column model col model this jtable get column model for int i 0 i this model get column count i col model get column i set preferred width this model get column size percentage i this scroll pane get viewport get width 100
when the size of the file list actually the jviewport changes we adapt
public void component shown component event arg0 we don t care
catches the i shown i event on the jviewport
public boolean contains file file boolean found false synchronized this rows iterator file data i this rows iterator while i has next if file equals i next get file found true break synchronized return found
does this table contain this file
public void set grid border color color color this jtable set grid color color
set color of files list grid border
public void set table header back color color color this jtable get table header set background color
set back color of table header
public boolean is picture return this is picture
indicates if this file is actually a picture or not
public void set model file panel data model2 file panel data model super set model file panel data model this file panel data model file panel data model
set the model
public void set table header font font font this jtable get table header set font font
set table header text font
public file get file at int row synchronized this rows file data file data this rows get row return file data null null file data get file
ask for the file contained at specified row number
public int get sorted column index return this sorted column index
retrieve the currently sorted column
public void set table header text color color color this jtable get table header set foreground color
set text color of table header
public file data get file data at int row int size 1 if row 0 try synchronized this rows size this rows size return row size this rows get row null catch array index out of bounds exception e nothing to do it seems that it can occurs when upload is very fast for instance small files to localhost this upload policy display warn e get class get name in file panel data model2 get file data at row return null
ask for the file contained at specified row number
public boolean is sorted column ascending return this sorted column ascending
retrieve the current sort order
public void sort column int col boolean ascending synchronized this rows collections sort this rows new column comparator col ascending fire table data changed
sort the rows according to one column
public boolean is sortable int col return boolean class get column class col
return true if this column can be sorted
public void popup menu will become visible popup menu event arg0 string s this upload policy get last response body this j menu item view last response body set enabled s null s equals
set the view last response body menu enabled or disabled
public void shutdown now this file view shutdown now
shutdown any running task
protected boolean is file data flavor flavors for data flavor flavor flavors if this file list flavor equals flavor return true return false
indicates if this data flavor is for a file type of data
protected boolean is url data flavor flavors for data flavor flavor flavors if this uri list flavor equals flavor return true return false
indicates if this data flavor is for a url type of data
public int get column size percentage int col return this column size percentage col
retrieves the default colum percentage size of a column that is its
public void rotate int quarter if this picture file data null cursor previous cursor this upload policy set wait cursor this picture file data add rotation quarter the previously calculated picture is now wrong this offscreen image flush this offscreen image null calculate offscreen image repaint this upload policy set cursor previous cursor else this upload policy display warn hum this is really strange there is no picture file data in the picture panel command is ignored
this function adds a quarter rotation to the current picture
public void property change property change event e string prop e get property name if jfile chooser directory changed property equals prop the directory changed don t show an image set file null else if jfile chooser selected file changed property equals prop if a file became selected find out which one set file file e get new value
hum were interested in these events directory changed property and
private frame find parent frame japplet the applet container c the applet while c null if c instanceof frame return frame c c c get parent return frame null
find the jframe which contains the applet
public void set property string prop string value this jupload context set property prop value
this allow runtime modifications of properties from javascript
public string start upload return this jupload context start upload
javascript can call this method to start the upload
public void unload if this js handler null this js handler is alive this js handler interrupt this js handler null
this method is called when the applet is unloaded actually when it is
public string js string string s string dollar replacement matcher quote replacement string single quote replacement matcher quote replacement string linefeed replacement matcher quote replacement n if s null s equals return else s s replace all dollar replacement s s replace all s s replace all single quote replacement s s replace all n linefeed replacement s s replace all r return s
generate a js string that can be written in a javascript expression
public void action performed action event e display info action e get action command if e get action command this rotate left button get action command this picture panel rotate 1 else if e get action command this rotate right button get action command this picture panel rotate 1 action performed
this method handles the clicks on the rotation buttons
protected jupload text area get log window return this log window
get the log window that is the component where messages debug info
private string get property string property name string default value string value null try value this svn properties get property property name catch exception e system out println warn e get class get name when getting the property name property e get message will return value return value null default value value
try to get a property from the loaded properties
public boolean get file chooser image preview return this file chooser image preview
getter for file chooser image preview
public void set file chooser image preview boolean file chooser image preview this file chooser image preview file chooser image preview
setter for file chooser icon from file content
public upload policy get upload policy throws jupload exception return this upload policy
retrieves the current upload policy
public void action performed action event arg0 update upload progress bar value update upload status bar
the only event managed here is the timer event
public void clear bar content let s stop the update process this timer stop this preparation progress bar set value 0 this preparation progress bar set string this upload progress bar set value 0 this upload progress bar set string
clean all bar content
private void init progress bar throws jupload exception to follow the state of file preparation this preparation progress bar set maximum 100 this file preparation thread get nb files to sent this preparation progress bar set string to follow the state of the actual upload this upload progress bar set maximum 100 this upload policy get context get upload panel get file panel get files length this upload progress bar set string
initialize the maximum value for the two progress bar 100 the number of
public void set error message string error texte this preparation progress bar set string error texte
set an error text that will be displayed on the progress bar
public void upload is finished let s stop the update process this timer stop update upload progress bar text update upload status bar
this just stops the timer