input
stringlengths
10
828
output
stringlengths
5
107
protected void on select
this method must be overriden by each subclass if required
public void add extension string extension if filters null filters new hashtable 5 filters put extension to lower case this full description null
adds a filetype dot extension to filter against
public string get description if full description null if description null is extension list in description full description description null description build the description from the extension list enumeration extensions filters keys if extensions null full description string extensions next element while extensions has more elements full description string extensions next element full description else full description description return full description
returns the human readable description of this filter
public int size return contents
return the current number of mappings in the hash map
public boolean is empty return contents 0 true false
returns code true code if this map contains no key value mappings
public void clear construct initial cap load factor
removes all mappings from this map
public int get object counter return object counter
return the number of objects created in by this instance
public float get load factor return load factor
return the load factor of the instance
public void set rehash boolean rehashing this rehashing rehashing
enable disable rehashing defaults to code true code
protected void fire tree nodes changed conf node conf node int len tree model listeners size tree model event e new tree model event this new object conf node for int i 0 i len i tree model listener tree model listeners element at i tree nodes changed e
notifies all listeners that have registered interest for notification on this event type
public void add tree model listener tree model listener l tree model listeners add element l
adds a listener for the tree model event posted after the tree changes
public int get child count object parent return conf node parent get children size
returns the number of children of parent
public object get root return root
returns the root of the tree
public boolean is leaf object node if conf node node get children size 0 return true else return false
returns true if node is a leaf
public void remove tree model listener tree model listener l tree model listeners remove element l
removes a listener previously added with add tree model listener
private model get next plugin if plugins to execute null plugins to execute size 0 model plugin model plugins to execute get first plugins to execute remove first plugin register observer this plugin manager set current model plugin return plugin else return null
returns the next plugin list model that wants to be executed
public void print statistics boolean full if full for int i 0 i capacity i system out println count i count i system out println initial capacity initial cap system out println capacity capacity system out println number of elements contents
statistical output for this map
public void set value object value this value value
setter method for code value code property
public void set next map element next this next next
setter method for code next code property
public map element get next return next
getter method for code next code property
private void zip file or directory file file throws file not found exception ioexception if file is directory string dir root file get name zip dir file dir root else zip file entry file null
file may be a single file or directory
private list get elements to process iterator iterator throws missing attribute exception if iterator null throw new illegal argument exception missing iterator vector process new vector element element null while iterator has next element element iterator next if get attribute value element xmltags process compare to true 0 process add element return process
get all elements to process
public void add tab component component boolean closeable add tab component get name component null closeable
adds a code component code represented by a title and no icon
public void add chatroom chatroom chat this chatrooms add chat
it adds the user to the chatroom
public void add tab string title component component icon extra icon boolean closeable boolean do paint close icon closeable try object prop null if prop jcomponent component get client property is closable null do paint close icon boolean prop catch exception ignored could probably be a class cast exception super add tab title do paint close icon new close tab icon extra icon null component if header viewport null for component c get components if tabbed pane scrollable viewport equals c get name header viewport jviewport c
adds a code component code represented by a title and an icon
public void add handler server handler handler string name thread t new thread this handlers handler name t start
it adds a server handler
public server socket get socket return this socket
it returns the socket of the server
public void remove chatroom chatroom chat this chatrooms remove chat
it removes the user from the chatroom
public boolean check error if this error this socket null this socket is connected this io is alive return true return false
it checks whether there is an error for the user
public int get size return this users size
it gets the number of users in the chatroom
public boolean join user user if this users contains user return false this users add user this send user user get name has joined this get name return true
it joins the user to the chatroom
public message factory get io return this io
it returns the io
public void part user user this users remove user this send user user get name has left this get name
it removes the user from the chatroom
public boolean contains user user return this users contains user
it checks if the user is in the chatroom
public int frequency card card return collections frequency this cards card
it gives the frequency that the card appears in the players hand
public void send user user string message for iterator user i this users iterator i has next user u i next if u user u get io write this get name message message factory chat
it sends the message to all users in the chatroom
public void kill for iterator chatroom i this chatrooms iterator i has next i next part this i remove try if this socket null this socket close this socket null catch ioexception e this socket null
it removes the suer from the chatroom and closes the server socket
public boolean contains card card return this cards contains card
it checks whether the players hand contains a particular card
public boolean is full return this users size this limit
it checks if the input thread is full
public void add user user throws ioexception buffered reader in new buffered reader new input stream reader user get socket get input stream this users put user in
it adds a user to the input thread
public void clear error this error false
it gets rid of the users error
public void add user user this users add user
it adds a user to the chat thread
public void add user user throws ioexception print writer out new print writer user get socket get output stream false this users put user out
it adds the user to the output thread
private int get sorting suit card card if card get suit card trump return card trump card trump 2 else if card get suit trump suit card get number trump number return card trump card trump 1 else if card get number trump number return card trump card get suit 1 else if card get suit trump suit return card trump else return card get suit
gets the suit used for sorting
public void set current play list card play try this current play collections synchronized list play catch null pointer exception e this current play collections empty list
it sets the current play
private int get game value card card if card get suit card trump if card get number card big joker return card trump 4 8 else return card trump 3 7 else if card get suit trump suit card get number trump number return card trump 2 6 else if card get number trump number return card trump 1 5 else if card get suit trump suit return card trump 4 else return card get suit
gets the value of the card in the current game
private int get sorting value card card return card get number trump number card get suit trump suit card set trump number card set trump card get number set trump sorting was taken care of in get sorting suit i think return card get number
it gets the sorting value of the card
public void init io socket s throws ioexception this socket s this in new buffered reader new input stream reader socket get input stream this out new print writer socket get output stream false this add handler new input handler in this add handler new output handler out this add handler new command handler this add handler new chat handler
it initializes the io
public void kill thread threads new thread this iogroup active count this iogroup interrupt this iogroup enumerate threads system out println waiting for threads to die for int i 0 i threads length i try threads i join catch exception e interrupted or nullpointer shouldn t matter system out println threads dead try if this socket null this socket close this socket null catch ioexception e this socket null try if this in null this in close this in null catch ioexception e this in null if this out null this out close this out null clean up messagefactory
it kills the factory
public iofactory get io return this io
it gets the message factory
public tractor game get game return this game
it getts the game
public void set game tractor game game this game game
it sets the game
public void start game this gamethread new thread game thread public void run try container new tractor game container game container set display mode 1024 600 false container set target frame rate 30 container set always render true todo clean up game on close don t exit whole program container set force exit false container start catch slick exception e todo auto generated catch block e print stack trace this gamethread start
it starts the game
public void update status ts swing utilities invoke later new runnable public void run client view get instance update status
it updates the status asynchronously
public void stop game this container exit
it stops the game
public client error get error code return this error code
it gets the error code
public int get connection status return this connection status
it gets the connection status
public boolean is connected return this io is alive
it returns whether the client is connected
public string get username this name field select all return this name field get text
returns the username
private void clear error this error code client error no error this error msg null
it clears errors
private void set error client error error string message this error code error this error msg message
it sets what the error is
public void set player string name this name name
it sets the player given the name parameter
public void play cards graphics card played this playedcards collections synchronized list arrays as list played
it plays the card
public void focus chat this chat line grab focus
it focuses on the chat window
public void play cards list graphics card played this playedcards collections synchronized list played
it plays the card
public void clear table this lasthand this playedcards this playedcards collections empty list
it clears the table
public void reset this cards 0
it clears the other players hand
public void set host user user this host user send command game command set host user get name user
it sets the host of the gameroom
public graphics card get card return this card
it gets the card
public int frequency graphics card card synchronized this return collections frequency this hand values card
it returns the frequency of a card
public void add card guicontext container graphics card card synchronized this this hand put new card button container card 0 int y spacing 148 card update locations
it adds a card to the players hand
public void remove card card button card synchronized this card set accepting input false if this hand get card null system out println uh oh hotdog this hand contains key card system out println removing with card button reference this hand remove card system out println this hand to string replace n dispose of cardbutton update locations
it removes a card from the players hand
public int get game size return this players
it gets the number of players in the game
public void join string name chat pane tojoin new chat pane name this tab map put name to upper case tojoin this chat tabs add tab tojoin true this chat tabs set selected component tojoin
it joins the new chatroom
public void sort int trumpsuit int trumpnumber synchronized this remove everything and readd to sort lol hash map card button graphics card temp new hash map card button graphics card iterator card button fail this hand key set iterator while fail has next card button cb fail next temp put cb this hand get cb fail remove graphics card trump suit trumpsuit graphics card trump number trumpnumber fail temp key set iterator while fail has next card button cb fail next this hand put cb temp get cb fail remove update locations
it sorts the players hand based on the trump suit
private void update locations never called from unsynchronzied block so no need to sync float start this x spacing this cards size 2 card button card null iterator card button i hand key set iterator if i has next while true card i next card set x start if i has next card set size spacing 148 start spacing else card set size 100 148 break
it updates the location of the players hand
public void part string name this chat tabs remove this tab map get name to upper case this tab map remove name to upper case
it leaves the chatroom
public void render guicontext container graphics g throws slick exception synchronized this for iterator card button i hand key set iterator i has next card button cb i next if cb is accepting input cb render container g if this show last float start this x2 spacing this lasthand size 2 for graphics card card this lasthand g draw image card get fullsize image start y2 start spacing else float start this x2 spacing this playedcards size 2 for graphics card card this playedcards g draw image card get fullsize image start y2 start spacing
it draws the hand
public void show this show true
it shows the button
public string get selected chatroom name return this chat tabs get selected component get name
it gets the particular chatroom name
public void hide this disable this show false
it hides the button
public void enable this set accepting input true this set normal image normal image this set mouse over image mouseover image
it enables the use of the button
public void disable this set accepting input false this set normal image disabled image this set mouse over image disabled image
it disables the use of the button
public void add button pressed listener button pressed listener l this pressed l
it adds a listener that checks whether the button has been pressed
public chat pane get chatroom string name return this tab map get name
returns the chatroom
public image get image return this scaled
it returns the image of the card
public jtext field get chat line return this chat line
it gets the chat line
public image get fullsize image return this image
it returns the full size image of the card
synchronized public void append string s this textarea append n s this lines this textarea get line count if this lines max lines int offset try offset this textarea get line end offset this lines max lines 1 catch bad location exception e todo auto generated catch block e print stack trace return this textarea replace range 0 offset this lines this textarea get line count swing utilities invoke later new runnable public void run scroll to bottom
adds a string to the chat window
public void clear message queue int type this in type clear
it clears the message queue
public closeable tabbed pane get chat tabs return this chat tabs
it gets the chat tabs
public void flush while this has next write try thread sleep 100 catch interrupted exception e
it waits until the write queue finishes writing
public int get message size int type return this in type size
returns the size of the message
public string get next message int type return this in type poll
it returns the next message
public string get next message int type boolean blocking if blocking while this has next message type try thread sleep 10 catch interrupted exception e return null return this get next message type
it returns the next message with type and blocking parameters
public chat pane get console return this console
it gets the console
public string get next write return this out poll
it returns what is being written next
public boolean has next message int type return this in type is empty
it checks whether there is another message
public boolean has next write return this out is empty
it checks whether there is another message to be written
public boolean is alive return system current time millis last pong timeout
it checks whether the message factory is alive