input
stringlengths
10
828
output
stringlengths
5
107
public entity remove current child and get next children remove current child if current child children size return entity children element at current child else return null
removes current child and sets current to point at the next entity
public entity get first child current child 0 if current child children size return entity children element at current child else return null
gets the first child of this entity
public entity get last child current child children size 1 if current child 0 return entity children element at current child else return null
gets the last child of this entity
public entity get next child current child if current child children size return entity children element at current child else return null
gets the next child of this entity
public entity get previous child current child if current child 0 return entity children element at current child else return null
gets the previous child of this entity
private void print usage system out println usage for sharpster system out println system out println checkout file files role role part plugin system out println update file files role role part plugin system out println commit file files role role part plugin system out println system out println system out println list system out println system out println add file files system out println remove file files system out println move source files dest files system out println system out println scmcommand versioncontrolcommand system out println shutdown
functions prints a usage message to user in case of erroneous input
private void print response response res null system out println responses from the daemon n int number of responses response get response count for int i 0 i number of responses i res response get response i if res null system out println res to string
function prints response that comes back from daemon
private boolean cmp first arg string cmp try string first rem args get first return first equals ignore case cmp catch no such element exception e return false
function that compares an argument to the first object in the
public plugin data parse arguments linked list string args string role if args null args size 0 part of file plugin plugin get plugin from name default if plugin null return null if role null role equals return plugin set role role else return plugin parse arguments null else string name string args get first part of file plugin plugin get plugin from name name if plugin null return null args remove first if role null role equals return plugin set role role else return plugin parse arguments args
creates a code plugin data code object from a command
private boolean cmp first arg case string cmp try string first rem args get first return first equals cmp catch no such element exception e return false
function that compares an argument to the first object in the
private void remove first arg try rem args remove first catch no such element exception e
removes the first argument from the argument list
private boolean first arg exists return rem args size 0
checks if there are more arguments in the list
public boolean local clear directory string working directory boolean res true file root new file working directory if root null root is directory return false file file list root list files for int i 0 i file list length i if file list i is directory res res local clear directory file list i get absolute path file list i delete return res
deletes all files in the code working directory code and its subfolders
private boolean first arg is param return cmp first arg to prefix
checks if the next parameter is a program switch
private void parse shutdown response daemon communication shutdown
tells the server to shutdown
private void parse checkout file collection files new file collection if parse param file files system out println missing files for checkout print usage return string role parse param role if parse param part files role check if were doing checkout with default then role isn t needed shared file file files get file 0 if file get plugin data get plugin name equals default role n a response daemon communication checkout files role
parses user arguments for files and a role to use then forwards a
private void parse update file collection files new file collection if parse param file files system out println missing files for update print usage return string role parse param role if parse param part files role check if were committing with default then role isn t needed shared file file files get file 0 if file get plugin data get plugin name equals default role n a response daemon communication update files role
parses user input for update arguments and then forwards an update call
private void parse commit file collection files new file collection if parse param file files system out println missing files for commit print usage return string role parse param role if parse param part files role check if were committing with default then role isn t needed shared file file files get file 0 if file get plugin data get plugin name equals default role n a response daemon communication commit files role
parses user input for commit arguments and then forwards a commit call
public void initialize command manager cm command manager cm
initializes the client communication object sets the value of
private void parse add file collection files new file collection if parse param file files system out println missing files for add print usage return response daemon communication add files
parses user input for add arguments and then forwards an add call
public void initialize daemon plugin manager pm version control manager vcmanager this vcmanager vcmanager this parser pm
perform eventual initializations
public void shutdown shutdown requested true system out println cc shutdown was called try this interrupt this join 1 wait for thread to die catch interrupted exception e system out println cc thread has shutdown string sharpster dir system get property sharpster home convert to a format that java likes sharpster dir sharpster dir replace sharpster daemon write config file sharpster dir config sharpster xml
notifies the thread to stop
private void parse remove file collection files new file collection if parse param file files system out println missing files for remove print usage return response daemon communication remove files
parses user input for remove arguments and then forwards a remove call
public void initialize file manager fmi file manager fmi
initializes the command manager
public string get plugin description return get scmplugin from name sharpster daemon get scm system get plugin description
loading the current scm module and returning a short discription of the plugin
public response collection commit file collection files string role return file manager commit files role
commits the changes in the files to the underlying scm
private void parse list file collection files new file collection response daemon communication list files system out println files
forwards a list call to the sharpster server
public response collection checkout file collection files return get scmplugin from name sharpster daemon get scm system checkout files
loading the current scm module and checking out the files from the underlying
public response collection update file collection files string role return file manager update files role
updates the files in files according to the role
public response collection add file collection files return file manager add files
adds new files to the underlying scm
public response collection remove file collection files return file manager remove files
removes files from the underlying scm
public response collection list file collection files return file manager list files
list all files in the underlying scm
public response collection add file collection files return get scmplugin from name sharpster daemon get scm system add files
loading the current scm module and taking the files specified in
public response collection remove file collection files return get scmplugin from name sharpster daemon get scm system remove files
loading the current scm module and remove the files specified in
private void parse scmcommand if first arg exists system out println missing command string for scm command print usage return string cmd new string while first arg exists cmd cmd rem args get first remove first arg string working dir system get property user dir response daemon communication execute scmcommand cmd working dir
parses user input for an scm command and then sends this command to
public response collection remove file collection files response collection response new response collection response append collection local file manager remove files files if response has error return response response append collection vcmanager remove files return response
removes the files in files from the central scm and from the
public response collection list file collection files return vcmanager list files
lists all the files in the central scm
private string parse param role if first arg exists return if cmp first arg role cmp first arg case r return eat role or r remove first arg if first arg exists return string role null try role rem args get first remove first arg catch no such element exception e role null return role
parses user input for role or r and then expects the following
public string get plugin name return new string cvsmanager
give the name of the plugin
public string get plugin name return new string svnmanager
returning a string of the name of the plugin
public string get plugin description return new string plugin for the concurrent versions system cvs
give the description of the plugin
public string get plugin description return new string class for handling svn calls
returning a short discription of the plugin
public response collection commit file collection files response collection responses new response collection string cvs root sharpster daemon get scm root string cvs user sharpster daemon get scm user string cvs pass sharpster daemon get scm pass string shapster temp sharpster daemon get scm temp run a update before the commit good thing to do tm and it checks for conflikts responses append collection update files string cvsmessage new string cvs d pserver cvs user cvs pass cvs root commit m sharpster responses append collection run cvscommand cvsmessage shapster temp return responses
commit files in cvs
public response collection list file collection files response collection responses new response collection string shapster temp sharpster daemon get scm temp string tempdir shapster temp file separator sys sharpster file tempfolder new file tempdir tempfolder mkdir responses append collection checkout all tempdir file root folder new file tempdir list recursive root folder files root folder get absolute path length local file manager filemanager new local file manager filemanager local clear directory tempdir tempfolder delete return responses
create a file collection with all the files in the cvs
private string cvs get version file folder string file name try file reader fr new file reader folder get absolute path file separator cvs file separator entries buffered reader entries new buffered reader fr string temp while temp entries read line null string params temp split if params 1 equals file name params length 2 entries close return params 2 entries close catch file not found exception e do something good catch ioexception e do something good return new string
looks in folder cvs entries for the version of the file file name
private void check if conflict file collection files response collection responses for int i 0 i files get file count i shared file file files get file i string file string new string sharpster daemon get scm temp fs file get path in scm fs file get file name look for mine file which indicates conflict file string mine file temp file2 new file file string if temp file2 exists scmconflict response error message new scmconflict response error message set error true error message set file file responses add response error message
checks whether there is a conflict on any of the specified files
public void set note ok boolean note ok this note ok note ok
initialise le boolean note ok
public void set window main window window this window window
affecte le param tre la main window window
private void start geocode location location new geocoder task execute new geocode query location
spawn a reverse geocoding operation to find names for the given
public void on item click adapter view parent view view int position long id cursor cursor cursor parent get item at position position string url cursor get string col url intent link intent new intent intent action view uri parse url start activity link intent
when clicked launch any associated
private void start geocode string query new geocoder task execute new geocode query query
spawn a forward geocoding operation to find the location of a given name
protected void set action enabled boolean enabled m title set enabled enabled m map set enabled enabled m save set enabled enabled
enable or disable any gui actions including text fields and buttons
public border builder get border builder return border builder get instance border type
returns border builder to be used to construct the node component
public point get slide center return slide center
returns desired center coordinate for the slide
public border type get border type return border type
returns desired border type for the node
public void fill diagram option data spec if spec null return numbering spec numbering ordering level spec ordering level
copies values from some other diagram option spec instance
protected jlabel bundle create component return new jlabel bundle content
returns a component to put into the node
public jnode data clone string other content point other center border type border type super get border type return new jnode data border type editable other content other center
creates a new jnode spec with the same border type and editability
public jnode data clone string other content point other center color other color string other comment string other group border type border type super get border type return new jnode data border type editable other content other center other color other comment other group
creates a new jnode spec with the same border type and editability
public boolean is numbering enabled return number nodes
returns true if numbering of the nodes is enabled and
public boolean invert numbering number nodes number nodes pane get link controller enable node numbering number nodes return number nodes
inverts numbering options
public diagram option data get spec diagram option data result new diagram option data result numbering number nodes result ordering level order level return result
converts object to
public void set ordering level ordering level level order level level pane get link controller get graph engine set level level
sets preferred auto layout policy for this diagram
public void mark modified boolean saved modified trigger set state saved
marks panes content as modified
public ordering level get ordering level return order level
returns preferred auto layout policy for this diagram
public boolean is saved return this get modified trigger get state
checks either document is saved or not
public htmlproducer get image maker if image maker null image maker new htmlproducer this return image maker
returns an image producer associated with this component
public jmenu create application help menu help menu menu new help menu menu add item how to http code google com p jthinker wiki how to menu add separator menu add item about http code google com p jthinker menu add item license http code google com p jthinker wiki license return menu
creates applications help menu
public void save current boolean ask name diagram pane pane get current diagram if pane null return pane save diagram ask name content changed pane
saves the current diagram
public void add link pane diagram type type diagram pane link pane new diagram pane type string title type get title do add pane link pane title
adds a new empty
protected diagram pane get current diagram return get diagram get selected index
returns diagram that is currently selected
public diagram pane get diagram int i if i 1 return null component component get component at i if component instanceof jscroll pane return null jscroll pane scroll pane jscroll pane component jviewport viewport jviewport scroll pane get component 0 component viewport get component 0 if component instanceof diagram pane return diagram pane component return null
returns diagram at the specified index
public int get diagram index diagram pane pane for int i 0 i get tab count i if pane get diagram i return i return 1
returns index of the specified diagram
public boolean close all for diagram pane pane get all diagrams if pane is saved continue if pane asked save return false return true
closes all diagrams
public point get last display location return last display location
returns last display location
public void load new file file choose load jthinker files if file null return try add link pane file catch throwable t logger log level severe unable to open t
loads a diagram from file
public void state changed trigger event extends point event point p event get state boolean flag true for jlink edge linker get all wires edge set switched false if edge distance to point p 5 flag edge set switched true flag false
turns edges blue when theyre pointed and black when theyre not
public void propagate left click mouse event e jlink active edge null for jlink edge linker get all wires if edge is switched active edge edge break if active edge null return if active edge instanceof jedge linker on linking done jedge active edge
dispatches click that happened somewhere on the pane either on
public void update name field set text edited get content comment field set text edited get comment back color set item color edited get color
reloads values from the node
public jmenu create application diagram options menu jmenu diaopt menu new jmenu diagram options numbering item new jcheck box menu item new numbering option action diaopt menu add numbering item jmenu ordering new jmenu diagram layout ordering off item new jcheck box menu item new ordering off action ordering add ordering off item ordering overlap item new jcheck box menu item new ordering overlap action ordering add ordering overlap item diaopt menu add ordering diaopt menu add separator grouping item new jmenu item new group management action diaopt menu add grouping item return diaopt menu
creates applications diagram options menu
public diagram controller get link controller return linker
returns controller of the view
public jnode get peer a return peer a
returns a node on which edge starts
public t get peer z return peer z
returns a component on which edge ends
public color get item color object obj get selected item if obj instanceof jcolor label return jcolor label obj value else return null
returns the color that corresponds to selected item
public void set item color color c for int i 0 i get item count i object obj this get item at i if obj instanceof jcolor label jcolor label cl jcolor label obj if cl value equals c this set selected item obj return
selects the item that corresponds to given color
public jnode group get node group string name jnode group group group names get name if group null group new jnode group name background group names put name group return group
resolves group by its name
public void switch on mouse move point p set switched distance to point p 5 0
checks where mouse pointer is and switches component accordingly
public jnode group get node group jnode node return grouping get node
resolves group by its containee
public string get node group name jnode node jnode group group get node group node for map entry string jnode group item group names entry set if group item get value return item get key return null
resolves groups name by its containee
public void group string name jnode node ungroup node jnode group group get node group name group add content node grouping put node group
puts node into a node group
public void watch jcomponent compo peers add compo
adds a peer to the collection of watched components
public void unwatch jcomponent compo peers remove compo
adds a peer to the collection of watched components
public point compute origin rectangle filled area compute filled area point origin filled area get location origin translate gap left gap top return origin
computes the origin point of the image
protected dimension compute image size dimension area size int width math max area size width title size width gap left gap right int height area size height title size height gap top gap bottom gap title return new dimension width height
computes the size of the image to be produced
protected buffered image prepare image rectangle area dimension image size compute image size area get size buffered image image new buffered image image size width image size height buffered image type int rgb graphics g image get graphics g set color window utils get default background g fill rect 0 0 image size width image size height return image
allocates an image and fills it with white
public jnode data get node spec string node group host get group handler get node group name this return spec clone content window utils compute center point this get color comment node group
returns nodes building specification
public buffered image produce image rectangle area compute filled area buffered image image prepare image area graphics g image get graphics g translate gap left area x gap top area y if container instanceof jbackground jbackground container paint background g color container background container get background container set background window utils get default background container paint components g container set background container background g image get graphics g translate gap left area height gap top gap title title paint g return image
produces an image that is the snapshot of the container
public void ungroup jnode node jnode group group grouping get node if group null grouping remove node group remove content node
removes a node from the group its currently in
public void set content string content this content content jlabel bundle bundle jlabel bundle this get component 0 bundle set text get display content bundle set size bundle get preferred size set size get preferred size get parent validate
sets textual content for the node
public void jpeg export file file throws ioexception buffered image image produce image image io write image jpeg file
produces an image and saves it as a jpeg file to given location