input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
protected string get mucdomain return muc domain
|
returns the default muc service domain
|
public void test send roster group send user1 s roster groups to user2 try roster exchange manager roster exchange manager new roster exchange manager get connection 0 for iterator it get connection 0 get roster get groups it has next roster exchange manager send roster group it next get bare jid 1 catch exception e e print stack trace fail an error occured sending the roster
|
high level api test
|
public void test send message event request create a chat for each connection chat chat1 get connection 0 create chat get bare jid 1 create the message to send with the roster message msg chat1 create message msg set subject any subject you want msg set body an interesting body comes here add to the message all the notifications requests offline delivered displayed composing message event manager add notifications requests msg true true true true send the message that contains the notifications request try chat1 send message msg catch exception e fail an error occured sending the message
|
high level api test
|
public void test discover publish items support try boolean can publish service discovery manager get instance for get connection 0 can publish items get service name assert false messenger does not support publishing so far can publish catch exception e fail e get message
|
tests support for publishing items to another entity
|
protected void fire subject updated listeners string subject string from subject updated listener listeners null synchronized subject updated listeners listeners new subject updated listener subject updated listeners size subject updated listeners to array listeners for int i 0 i listeners length i listeners i subject updated subject from
|
fires subject updated listeners
|
public void set image url string image url if image url null image url length 0 if image url char at image url length 1 image url image url substring 0 image url length 1 this image url image url rebuild the image tags build image tags
|
sets the base url for emoticon images
|
public string get schemes string buffer buf new string buffer 50 for int i 0 i schemes size i buf append string schemes get i append buf delete char at buf length 1 return buf to string
|
returns the current supported uri schemes as a comma seperated string
|
public void set schemes string schemes if schemes null return enpty the current list this schemes clear string tokenizer st new string tokenizer schemes while st has more elements this schemes add st next element
|
sets the current supported uri schemes as a comma seperated string
|
public void do suspend table m game table get referee suspend game m default callback null
|
suspend the game
|
public void do invite dialog do invite dialog null false
|
bring up an invite dialog
|
public void do invite bot m game table get referee add bot m default callback null
|
send a request for a retainer bot created by the parlor
|
public void do invite bot select choose factory bot dialog box new choose factory bot dialog m game table get connection m parlor get ruleset box set visible true if box get success return do invite bot box get bot uri box get factory jid
|
bring up a dialog to select a factory and bot uri
|
protected void set recent ready boolean val if val date now new date m ready pressed recently new date now get time 1000 ready recent interval else m ready pressed recently null
|
set the temporary player pushed ready flag
|
protected boolean get recent ready if m ready pressed recently null return false date now new date return now before m ready pressed recently
|
check the player pushed ready flag
|
protected void cancel connection remove packet listener invitation packet listener connection remove connection listener this
|
cancels all the listeners that this invitations monitor has added to the connection
|
public dimension preferred layout size container target synchronized target get tree lock dimension dim new dimension 0 0 int nmembers target get component count for int i 0 i nmembers i component component target get component i if component is visible rectangle bounds component get bounds dim height math max dim height bounds y bounds height dim width math max dim width bounds x bounds width insets insets target get insets dim width insets left insets right dim height insets top insets bottom return dim
|
returns the preferred dimensions for this layout given the i visible i
|
public void set zoom mode int zoom mode this zoom mode zoom mode
|
sets the zoom mode to be used
|
public void reset original bounds cache clear original font cache clear
|
resets the cache with the initial component bounds and the font size
|
public jtext field get text field if text field null text field new jtext field text field set columns 3 text field set text text field set focusable false text field set editable false return text field
|
get the real editor component
|
public jlist get list box if list box null list box new jlist return list box
|
get the real editor component
|
public jradio button get radio button if radio button null radio button new jradio button radio button set text return radio button
|
get the real editor component
|
public jcheck box get check box if checkbox null checkbox new jcheck box checkbox set text return checkbox
|
get the real editor component
|
public jtext field get text field if text field null text field new jtext field text field set columns 20 text field set text text field set focusable false text field set editable false return text field
|
get the real editor component
|
public jtext area get text area if text area null text area new jtext area 5 80 text area set border new jtext field get border text area set line wrap true return text area
|
get the real editor component
|
public jtext field get text field if text field null text field new jtext field return text field
|
get the real editor component
|
public jcombo box get combo box if combo box null combo box new wide combo box return combo box
|
get the real editor component
|
public void register editor parameter type param type class editor if editors contains key param type editors put param type editor
|
register a parameter editor for the provided parameter type
|
public void unregister editor string param type if editors contains key param type editors remove param type
|
unregisters the editor for the parameter type
|
public iparameter editor get editor parameter type type throws parameter editor exception if type null throw new illegal argument exception mandatory parameter type is null if editors contains key type throw new parameter editor exception unsupported parameter type type try class editor class editors get type return iparameter editor editor class new instance catch instantiation exception e throw new parameter editor exception e get message e catch illegal access exception e throw new parameter editor exception e get message e
|
return a registered parameter editor
|
public int get int value return integer parse int get string value
|
return the parameter value as integer
|
public boolean get boole value return 1 equals get string value true equals ignore case get string value
|
return the parameter value as boolean
|
public parameter get parameter string id if params contains key id throw new illegal argument exception parameter with id id is not registered return params get id
|
return the parameter by the parameter id
|
private void initialize this set title res get string dialog title this set content pane get jcontent pane set resizable false reset default button focus adapter new focus adapter public void focus gained focus event e jbutton button jbutton e get source get root pane set default button button public void focus lost focus event e get root pane set default button get cancel button add close on escape
|
this method initializes this
|
private void add close on escape key stroke escape key stroke key stroke get key stroke key event vk escape 0 false action escape action new abstract action public void action performed action event e set visible false get root pane get input map jcomponent when in focused window put escape key stroke escape get root pane get action map put escape escape action
|
enables the close on esc behavior
|
private jpanel get buttons panel if buttons panel null buttons panel new jpanel buttons panel set border border factory create empty border 10 0 0 0 buttons panel set layout new equals layout swing constants right 10 5 return buttons panel
|
this method initializes buttons panel
|
public jbutton add option option option if options contains key option get id throw new illegal argument exception dialog option id option get id is not unique jbutton btn create button option get buttons panel add btn options put option get id new option bean option btn return btn
|
adds an option to the dialog represented by the jbutton
|
private jpanel get parameter panel if parameter panel null parameter panel new jpanel form layout layout new form layout right pref 4dlu fill max 20dlu pref grow 4dlu min parameter panel set layout layout return parameter panel
|
this method initializes parameter panel
|
private void complete editing iterator iparameter editor it editors parameter editors values iterator while it editors has next iparameter editor editor it editors next editor complete editing
|
notifies the parameter editors to stop the editing
|
public option get selected option return selected option
|
return the selected option
|
private jbutton create button option option jbutton btn new jbutton btn set text option get text btn set action command option get id btn set tool tip text option get user data btn add action listener new button action listener option btn set default capable false if button size null btn set minimum size button size if button font null btn set font button font btn add focus listener reset default button focus adapter return btn
|
creates a jbutton based on provided code option code
|
public void set message string message this message message get message text area set text message
|
set the message text to show
|
private void set selected option option option if option instanceof cancel option selected option option else selected option null
|
set the selected option
|
private jscroll pane get message scroll pane if message scroll pane null message scroll pane new jscroll pane message scroll pane set border border factory create empty border 0 0 0 0 message scroll pane set viewport view get message text area return message scroll pane
|
this method initializes message scroll pane
|
private jtext area get message text area if message text area null message text area new jtext area message text area set editable false message text area set focusable false font f message text area get font if f null f instanceof uiresource message text area set font uimanager get font option pane font if message font null message text area set font message font return message text area
|
this method initializes message text area
|
public option show dialog add cancel button add message panel add parameter panel set default option pack set location relative to get owner set visible true return selected option
|
used to show the dialog and get the chosen option
|
private void add message panel if message null message length 0 grid bag constraints gc new grid bag constraints gc gridx 0 gc gridy 0 gc fill grid bag constraints both gc weightx 1 0 gc weighty 1 0 gc insets new insets 10 10 10 20 main panel add get message scroll pane gc
|
add a message panel to the dialog
|
private void add parameter panel if parameter editors size 0 add parameter panel grid bag constraints gc new grid bag constraints gc gridx 0 gc gridy 1 gc fill grid bag constraints both gc weightx 1 0 gc weighty 1 0 gc insets new insets 5 10 10 10 main panel add get parameter panel gc
|
add a parameter panel to the dialog
|
private jbutton get cancel button if cancel button null cancel button create button new cancel option cancel button set default capable true return cancel button
|
returns a cancel button
|
public void set show icon boolean is show icon get icon panel set visible is show icon
|
controls whether icon in the top left dialog corner is to be shown
|
public void set show message boolean is show message get message scroll pane set visible is show message
|
controls whether the message is to be shown
|
public void set orientation int orientation painter set orientation orientation repaint
|
sets orientation of the roller
|
public iwidget holder get widget holder iwidget widget return widget holder to widget get widget
|
returns code widget holder code for a given widget
|
public void set orientation int orientation if orientation swing constants horizontal orientation swing constants vertical throw new assertion error geometry should be one of vertical or horizontal not orientation this orientation orientation
|
sets orientation of painting
|
public void set roll part count int count this roll count count
|
sets amount of rolling parts
|
public void set hat size int size this hat size size
|
sets size widht or height it depends on orientation of hat element of
|
public int get hat size return hat size
|
returns height or width of the hat part of the roller
|
public void set roll size int roll size this roll size roll size
|
sets the roll size of the component
|
public int get slabs part rectangle bounds return orientation swing constants vertical bounds height 2 hat size roll size 1 bounds width 2 hat size roll size 1
|
returns height or width of the slabs part of the roller
|
public void set cut size int size this cut size
|
sets the size width or height of the cut parameter
|
public void reset throws xml exception if last loaded layout null load last loaded layout
|
reloads the last loaded layout
|
private void fire undo state changed internal object listeners undo state listener list get listener list for int i listeners length 2 i 0 i 2 if listeners i iundo state listener class iundo state listener listeners i 1 undo state changed new undo state event this
|
notifies all listeners that the selection has changed
|
public void remove model listener model listener l listener list remove model listener class l
|
removes a listener from the list thats notified each time a change to
|
protected void set value is adjusting boolean value is adjusting this value is adjusting value is adjusting
|
indicates that changes to the values of the model should be considered as
|
public boolean get value is adjusting return this value is adjusting
|
returns code true code indicating that changes to the model should be
|
public void set inset int inset this inset inset
|
set insets to surrounding component
|
private void fire widget selection changed internal object listeners widget selection listener list get listener list for int i listeners length 2 i 0 i 2 if listeners i iwidget selection listener class iwidget selection listener listeners i 1 widget selection changed new widget selection event this
|
notifies all listeners that the selection has changed
|
public void finalize throws throwable try keyboard focus manager get current keyboard focus manager remove key event dispatcher key event dispatcher finally super finalize
|
releasing resources and unregistering listeners to prevent memory leaks
|
public void zoom in zoom in 0 1
|
zooms in the layout by 10 percent
|
public void zoom in double delta zoom layout set zoom level zoom layout get zoom level delta apply zoom
|
zooms in the layout by specified value
|
public void zoom out zoom out 0 1
|
zooms out the layout by 10 percent
|
public void zoom out double delta zoom layout set zoom level zoom layout get zoom level delta apply zoom
|
zooms out the layout by specified value
|
public void zoom all zoom layout set zoom level 1 0 apply zoom
|
adjusts the zoom level that way that the whole layout fits to screen
|
public void reset zoom layout zoom layout reset
|
resets the zoom layout cache
|
public void set zoom mode int zoom mode zoom layout set zoom mode zoom mode
|
sets the zoom mode to be used
|
public void set zoom enabled boolean enabled zoom layout set zoom enabled enabled
|
enables disables the zoom functionality
|
public igraphics get igraphics return ig
|
returns the igraphics object of this frame
|
public void shutdown window event wev new window event this window event window closing toolkit get default toolkit get system event queue post event wev
|
shuts down the program
|
public void add debug line vector start vector end color c debug lines add new debug line start end c
|
adds a line to the class buffer to be
|
public void add debug text string string debug text add string
|
adds a line of text to the class buffer to be
|
public string get active texture return active texture
|
return the active texture
|
public void draw debug info menu menu igraphics g if is debug info enabled add debug text app state menu item menu get selected render debug info g
|
displays info about the menu when called
|
public void set active texture string id active texture id texture tex textures get id if id null tex null return if tex null system out println set active texture no such texture id id return tex enable tex bind
|
set the active texture
|
public void add texture string id buffered image data texture tex texture io new texture data true if tex null system out println add texture texture creation failed return textures put id tex
|
add a texture to the texture manager
|
private void render debug info igraphics g for debug line d debug lines g draw line d start d end d c int i 0 for string s debug text g draw text s 10 30 i 7 debug lines clear debug text clear
|
the method that draws the lines and text in the buffer
|
public void set debug info enabled boolean debug info enabled this debug info enabled debug info enabled
|
enable or disable drawing of debug info
|
public boolean is debug info enabled return debug info enabled
|
returns true if debug drawing is enabled
|
public int get frame index int pos animations get current anim get frame index current frame return pos
|
get the current frame index image offset
|
public string get id return tex id
|
returns the id of the texture used by this sprite
|
public vector get bounding box size return bounding box size
|
returns the position of the minimum rectangle containing this polygon
|
public void next animation current frame 0 if animations get current anim is looping set animation idle
|
skip to the next animation looping the
|
public vector get bounding box position return bounding box position
|
returns the size of the minimum rectangle containing this polygon
|
public int get hor frames return hor frames
|
get the horizontal frame resolution of
|
public int get ver frames return ver frames
|
get the vertical frame resolution of
|
public int get index return pos index
|
returns the index of the frame in the segmented image it belongs to
|
public void set animation string anim id if current anim equals anim id return if animations contains key anim id current anim anim id current time 0 current frame 0
|
set the current animation
|
public void set mirrored boolean mirrored this mirrored mirrored
|
set the mirrored value for the sprite
|
public boolean get mirrored return mirrored
|
get the mirrored value for the sprite
|
public void animate current time 1 0 if current time animations get current anim get frame duration current frame current frame current time 0 if current frame animations get current anim get frames length current frame 0
|
step the sprite one step forward in the animation
|
public void animate double t current time 1 0 if current time animations get current anim get frame duration current frame current frame current time 0 if current frame animations get current anim get frames length next animation
|
step the sprite one step forward in the animation
|
public double get length if x 0 return math abs y else if y 0 return math abs x return math sqrt x x y y
|
returns the length of the vector
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.