input
stringlengths
10
828
output
stringlengths
5
107
public void clear message string message this status bar clear status
xxx may want to pass in a message id vs a string
protected void handle updateid throws ioexception this local id this get message handle log info handle updateid this local id this message queue add updateid this message queue add this local id synchronized this message queue system out println handle updateid notifying this message queue notify system out println handle updateid sent notify
gets an id from the socket and puts it on a message queue
public void list changed card list change event event system out println pile viewer list changed this pile get name system out println event
note we currently do not sign up for this the
public void action performed action event a this local player send chat input get text this add text you input get text input set text this update
handle a return key send the chat line
public void update this scroll bar set value this scroll bar get maximum
make sure the bottom of the text is in view
protected void handle data throws ioexception string card id card card card id get message handle log info handle card data request card id card this get card by net id card id this send card data card
handle a request for card data
public void send pile player player string pile name card card pile pile enumeration cards enum vector cards this trace send pile pile name this sendln stack this sendln pile name to lower case this send network id pile player get pile pile name send each card in the stack by name only cards pile get cards this trace cards cards size cards enum cards elements while cards enum has more elements card card cards enum next element this sendln card get title no spaces this sendln end
send the deck of the the local player
private void handle draw xxx ignoring player id it can only be us string net player id net player id get message handle log info handle draw net player id handle log debug library before draw this get pile library dump try this transfer library hand 1 catch not enough cards exception exc system out println net mage bridge handle draw xxx out of sync handle log debug library before draw this get pile library dump this get pile hand dump
handles doing a remote draw from the deck
private void handle life string net player id get message integer new life new integer get message handle log info handle life new life this set state life new life
handle a change to remote players life
protected void add child views
abstract called during setup so view can shadow any children
protected void handle stack string pile name string net player id pile pile pile name this get message net player id this get message handle log info handle stack pile name pile this get pile pile name this handle sendstack pile
figure out which stack is being sent and then call handle sendstack
protected void handle getstack string pile name string player net id player player pile name this get message player net id this get message handle log info handle get stack pile name handle log debug looking for player network id player net id player player this get entity player net id handle log debug player player this send pile player pile name
handles other part of a stack transfer
public pile filter card db int color if color all return this card source pile pile filtered new pile xxx for int z 0 z names size z string card name string names element at z int card color card database find color card name if card color color sorted add element card name filtered this card source pile return filtered
function to filter the contents of the card list to show just
private void handle diff string pile name string net player id pile pile pile name this get message net player id this get message handle log info handle diff pile name if pile name deck pile name library pile this get pile pile name pile set state diff true
handles setting diff flags
public void send remote diff pile pile this sendln diff netmage calls it a deck if pile get name equals library this sendln deck else this sendln pile get name to lower case xxx why would we assume it was local player this send network id this local player
send a notification that pile has changed somehow
public void push status string message status field set text message
xxx implement properly push the current message on a stack
public void pop status xxx this clear status
xxx implement properly pop the last message off of the stack
public void center int width int height dimension dim new dimension get toolkit get screen size int xpos dim width 2 width 2 int ypos dim height 2 height 2 set location xpos ypos
center window on screen
public void send card data card card throws ioexception point location send log info send card data card get name this sendln card this sendln string card get state net id this sendln card get title no spaces location point card get state location if location null this sendln 0 this sendln 0 else this sendln location x this sendln location y if card get state boolean tapped this sendln tapped else this sendln untapped
send data about this card to the remote player
public void action performed action event event deck saver save deck
save the deck
public void action performed action event event deck saver save as deck
save the deck
public void send card moved card card throws ioexception point location string net id send log info send card moved card get name net id string card get state net id if net id null net id this get card net id send log debug new net id net id card set state net id net id this net card idto card put net id card this sendln id this sendln net id this sendln move location point card get state location this sendln location x this sendln location y
send a location update to the remote player unsolicited
public void send card removed card card pile pile throws ioexception point location string net id send log info send card removed card get name pile get name net id string card get state net id if net id null net id this get card net id send log debug new net id net id card set state net id net id this net card idto card put net id card this sendln id this sendln net id this sendln remove if pile get name equals library this sendln deck else this sendln pile get name to lower case
send a notification that a card was remove from in play
protected string encode digest byte digest string buffer buffer new string buffer byte b for int i 0 i digest length i b digest i if b 0 b byte 256 b if b 16 buffer append 0 buffer append integer to string b 16 return buffer to string
xxx why is this so obtuse i cant believe theres
protected void send draw pile pile this sendln draw this send network id this local player
notify remote that local player drew a card
protected void start get card data string id throws ioexception send log info start get card data id ask remote about the card this sendln data this sendln id
start the creation a new instance of a card that is a proxy
public double get orientation double my orientation 0 if this parent transform null my orientation this orientation else xxx should probably cache this listen for parent changed double parent orientation this parent transform get orientation system out println have a parent system out println me this orientation system out println parent parent orientation my orientation this orientation parent orientation if my orientation math pi my orientation 0 system out println new my orientation return my orientation
return my current absolute orientation
public void send text string text send log info send text text this sendln chat this sendln text
send chat text across the net
public string get seat name return this seat get seat name
xxx all of the proxy stuff is a wart i think
public void mouse pressed mouse event e if e is shift down xxx doesn t belong here add another listener int row pile jtable get selected row card card card this pile model get card in row row if this card shower null this card shower new card shower this card shower show card card
note all actions are currently handled by a card transfer mouse handler
protected int get new id int id send log info get new id id this card idcounter this card idcounter send log dedbug returning id return id
provides a new id number for a card being added to the table
protected string get card net id throws ioexception if this server return new integer this get new id to string else return get new remote id
get a game unique identifier for a card
public boolean remove node int i remove get node i if get node i 1 head head get node i 1 get node i 1 set prev null length return false else get node i 1 set next get node i 1 get node i 1 set prev get node i 1 length return true
remove the node at the given index
public void replace head char color replace head color 0
replaces data in first node with new data
public void push char color int number node new node if head null replace head color number return new node new node tail color number tail set next new node tail new node length add new node ask parent to re layout us validate
pushes nodes xxx what does that really mean
public int get number int index node current head for int i 1 i index i current current get next return current get number
get a nodes number
protected void check clipboard system out println check clipboard toolkit toolkit get toolkit clipboard clipboard toolkit get system clipboard transferable transferable clipboard get contents this system out println transferable transferable system out println clipboard name clipboard get name if transferable null this use best flavor transferable this use unicode flavor transferable this scan all flavors transferable
seeing if clipboard works on linux from mozilla
protected jpanel create up down panel jpanel panel new jpanel new grid layout 1 2 down new jbutton v up new jbutton exchange new jbutton v panel add down panel add exchange panel add up this down add action listener new one way transfer action this deck view this sideboard view this up add action listener new one way transfer action this sideboard view this deck view this exchange add action listener new card exchange action this deck view this sideboard view return panel
note that we cannot necessarily create actions because
public void raise view view xxx probably have to raise in a logical tree too this remove view this add view 0 if this rendering view view this rendering view raise view
raise the specified view to the top of the z order
public void action performed action event a this local player pass
pass button was clicked
public boolean would accept view view xxx return true
xxx need to check with model
public void send pile info pile pile string key string value string pile id pile id this get pile net id pile this sendln pile pile id key value
xxx should this just be a set state
public void send card info card card string player id string card id card id this get card net id card this sendln card info card id name card get name qty 1
card info card id name name other state
protected void get prefs
xxx what is this for
public void drag drop end drag source drop event event dnd log info if event get drop success remove element
this message goes to drag source listener informing it that the dragging
public void drag over drop target drag event event dnd log info event accept drag dn dconstants action copy or move
is invoked when a drag operation is going on over top of a
public void drag drop end drag source drop event event dnd log info if event get drop success remove element undo the stop autoscrolling hell hack started above this drop target set active true
this message goes to drag source listener informing it that the dragging
protected void handle getstack string first token my tokenizer tokens string pile name string player net id player player pile name tokens next token player net id tokens next token handle log info handle get stack pile name handle log debug looking for player network id player net id player player this get entity player net id handle log debug player player this send pile player pile name
handles other part of a stack transfer
protected void handle transfer event transfer event event pile source event get source pile pile dest event get dest pile card card event get card player player card get owner string buffer message new string buffer system logger println handle transfer xxx wrong to assume that the cards owner is doing the transfer message append this get id player message append transfer message append this get id source message append message append this get id dest message append message append this get id card logger info message to string
xxx need an actor who did the transfer
public long get events mask return event masks all events
return the events we are interested in all of them
public void set filename pattern string pattern if pattern null this filename pattern pattern this update filename
the b date pattern b takes a string in the same format as
public string get filename pattern return this filename pattern
returns the value of the b date pattern b option
protected void sub append xxx logging event event system out println per game appender sub append if actual filename null try roll over catch ioexception ioe log log error roll over failed ioe super sub append event
this method differentiates daily rolling file appender from its
public card list get cards pile from pile xxx creating a new pile will be expensive just a view into another pile return null
extract the specified cards from the pile and return them
public card list look at cards return null
return a list of the specified cards from the pile but
public void transfer pile from pile pile to pile system out println single card card spec transfer this card get name from from pile get name to to pile get name from pile remove card card to pile add card card
xxx should throw a transaction error
protected void send set phase game turn event event player actor event get actor string phase string event get old value turn log debug send set phase actor get name phase this sendln turn phase phase actor get name
xxx plug phase in an event bus handler and a network message
protected void handle player command player player my tokenizer args string second term args next token if second term equals transfer this transfer card player args return if second term equals state this change state player args return if second term equals chat this send chat player args return if second term equals shuffled this shuffle pile player args return system out println handle player command xxx unhandled args get original string
handle a command line whose first term is a player id
protected void replay buffered reader reader throws ioexception string line xxx is this always necessary i can t see when we could keep an existing game and not get terribly confused this game clear line reader read line while line null this dispatch line line reader read line try reader close catch ioexception e
xxx would like to be less specific about the reader but
public void send text player source string text send log info send text text this sendln chat this get net id source text
send chat text across the net
public double get orientation return this orientation
return my current absolute orientation
public void handle server int port integer timeout xxx this should only be necessary until we have localized coordinates player player vector players this game get local players if players size 1 system out println xxx too many local players player player players element at 0 player set state network id server xxx use the timeout pass in the user agent remote player manager manager new remote player manager game port
set up this game as a server
public void handle client string server address int port xxx this should only be necessary until we have localized coordinates player player vector players this game get local players if players size 1 system out println xxx too many local players player player players element at 0 system out println updating net id player get name system out println orig val player get state network id player set state network id client new remote player manager this game server address port this protocol
set up this game as a client of another
protected void move card player player card card player get pile in play get card 0 move the card card set state location new point 200 100
move a random card
public vector register controller controller controller this controller controller control queue forwards commands from controller controllable this control queue new vector return this control queue
returns a vector for passing messages
public void save deck deck url deck url xxx pass the deck and sideboard in to the omd deck writer system out println xxx sorry omd saving not finished yet
save the specified deck in omd format to the specified url
public boolean supports features long features return true
chance for controllable to prohibit certain actions such as rewind
public void wake up controllee system out println controller check started xxx undocumented part of protocol started print check started this controllee if this controllee is started this start controllee
wake up start our controllable if necessary
public void check status boolean block string msg if block msg string this status queue remove 0 this handle status msg else while this status queue is empty msg string this status queue remove 0 this handle status msg
xxx maybe this should be a separate thread
public deck load string deck filename xxx won t work the player is not needed use card db singleton player player new player deck deck new deck player this load deck deck filename return deck
create a new deck and populate it from deck filename
protected string read next buffered reader in string line null try line in read line system out println read line catch ioexception e system out println error while reading from file return line
read in a single line
public void filter string filter spec
xxx support more interesting filter specs
public card remove card card card return null
do nothing on remove
public void init utils instance utils utils get url url instance utils get file configuration utils logger file if url null logger info url is null else property configurator configure url org apache xml security init init
the initialization of the logger attached to this service
public boolean fire alert soapenvelope msg throws exception document document msg get as document node temp document get first child node soap message temp get last child boolean eval boolean xp evaluate xpath soap message xpath constants boolean return eval boolean value
this function returns true if the allert should be fired
public message invoke message req message resp throws exception file writer fw new file writer output file true buffered writer out new buffered writer fw out write req get soappart as string n n out close return req
this is the main method exposed by the web service
public void init utils instance utils utils get url url instance utils get file configuration utils logger file if url null system out println url null else property configurator configure url logger info authentication service started try final class loader cl thread current thread get context class loader class c cl load class org sosie2 service common ldapcallback handler callback callback handler c new instance catch exception ex logger fatal exception in authentication service ex print stack trace
initializes the logger config file and the callback handler which will be
public void serve soapenvelope req soapenvelope resp try retrieve the message from the message context message context mc message context get current context message m req mc get request message message m resp mc get response message m resp invoke m req m resp mc set response message m resp catch exception exception generate soap exception depending on the type of exception received if exception instanceof sosie exception handle sosie exception resp sosie exception exception else handle other exception resp exception
the main method that is to be exposed over the internet
public void init utils instance utils utils get url url instance utils get file configuration utils logger file if url null system out println url null for logger file else property configurator configure url string authorization file config get property authorization file try authorization list this load properties authorization file catch exception e logger fatal simple authorization service exception occured e get message e print stack trace
initialization of logger and loading the fle with the authorization names
public samlattribute statement create attribute statement samlattribute attributes string subject name string target throws samlexception samlattribute statement as new samlattribute statement vector string conf methods new vector string conf methods add samlsubject conf sender vouches subject new samlsubject new samlname identifier subject name conf methods null null as set subject subject for int i 0 i attributes length i as add attribute attributes i attach the target attribute samlattribute target attribute create target attribute target as add attribute target attribute return as
creates a new saml attribute statement
protected void handle sosie exception soapenvelope resp sosie exception exception try resp get body add fault resp create name client exception get detail message class exception get exception class new locale english catch exception e e print stack trace
this is a example of method to handle sosie exceptions
protected samlannotation generate annotation string subject name string attributes string target throws exception return new samlannotation attributes subject name target
this method generates one annotation with several attribute statements
protected samlannotation generate annotation string attributes string target throws exception return generate annotation actor attributes target
getenerateas a saml annotation
protected document add annotation document document samlannotation annotation string actor wssec samltoken ws token new wssec samltoken wssec header ws header new wssec header actor false ws header insert security header document system out println annotation annotation get samlassertion to string document ws token build document annotation get assertion ws header return document
appends a new annotation to a soap envelope
public void sign string alg key k collection certs throws samlexception assertion sign alg k certs
signs the annotation
public void verify throws samlexception assertion verify
verifies that the digital signature attached to the annotation is valid
private void add children tree menu element element if children null children new array list tree menu element children add element
adds a child element
public mystique data get mystique data return mystique data
getter of the property tt mystique data tt
public string get image width return image width
getter of the property tt image width tt
public string get image height return image height
getter of the property tt image height tt
public void set mystique data mystique data mystique data this mystique data mystique data
setter of the property tt mystique data tt
public string get bnumber return b number
getter of the property tt b number tt
public hashtable get bookmark hash return bookmark hash
getter of the property tt bookmark hash tt
public string get bindex return b index
getter of the property tt b index tt
public void set bookmark hash hashtable bookmark hash this bookmark hash bookmark hash
setter of the property tt bookmark hash tt
public hashtable get fields hash return fields hash
getter of the property tt fields hash tt
public void set fields hash hashtable fields hash this fields hash fields hash
setter of the property tt fields hash tt
public list get images to copy return images to copy
getter of the property tt images to copy tt
public string get images path return images path
getter of the property tt picture path tt
public void set images path string i path this images path i path
setter of the property tt picture path tt