input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
public void choose spell int two hand int left hand int right hand if two hand 0 active spell 0 two hand spells two hand active spell 1 null active spell 2 null return else active spell 0 null if left hand 0 active spell 1 left hand spells left hand else active spell 1 null if right hand 0 active spell 2 right hand spells right hand else active spell 2 null
|
choose a specific spell to cast up to one two handed spell
|
public void choose target being target list for int i 0 i 3 i target i target list i if target i null active spell i choose hand target hand i target i else target hand i null
|
choose a target to cast each spell at
|
public void choose hand int two hand int left hand int right hand two hand hand two hand left hand hand left hand right hand hand right hand
|
choose which of the targets hands to cast the spell at
|
public void monster attack being beings if beings null return for int i 0 i beings length i if beings i null monsters i attack beings i
|
go through the list of monsters and tell them who to attack
|
public void cast spells for int i 0 i 3 i if active spell i null target i null active spell i cast from to this target i arena get beings
|
begin attaching spell effects from this wizard to his targets
|
public void run turn run spell run monsters
|
run a single turn
|
public void begin monsters synchronized monster attack token monsters ready false monster attack token notify
|
notify that we can let monsters attack
|
public void begin process effects synchronized process effects token spells ready false process effects token notify
|
notify that we can process the effects
|
private void finished synchronized finish token finished true finish token notify
|
function that is called to let wizard know that he can tell the
|
private void unfinished synchronized finish token finished false
|
function that is run to show that the wizard is not ready
|
public void run monsters being being list being list comm ask monster monsters arena get beings monster attack being list
|
ask who the monsters should attack then make the monsters
|
public void set year int year super set value year true false if day chooser null day chooser set year value inner spinner set value new integer value fire property change idate editor year old year value old year value
|
sets the year
|
public void set day chooser jday panel day chooser this day chooser day chooser
|
convenience method set a day chooser that might be updated directly
|
public void set calendar calendar calendar set calendar calendar true
|
sets the calendar property
|
public void action performed action event e int x calendar button get width int popup get preferred size get width int y calendar button get y calendar button get height calendar calendar calendar get instance date date date editor get date if date null calendar set time date j calendar set calendar calendar popup show calendar button x y date selected false
|
called when the jalendar button was pressed
|
public void property change property change event evt if evt get property name equals idate editor day if popup is visible date selected true popup set visible false set date j calendar get calendar get time else if evt get property name equals idate editor date if evt get source date editor fire property change idate editor date evt get old value evt get new value else set date date evt get new value
|
listens for a date property change or a day property change event
|
public void update ui super update ui set enabled is enabled if j calendar null swing utilities update component tree ui popup
|
updates the ui of itself and the popup
|
public void set locale locale l super set locale l date editor set locale l j calendar set locale l
|
sets the locale
|
public void set locale locale new locale if initialized super set locale new locale else locale old locale this locale this locale new locale day chooser set locale this locale month chooser set locale this locale fire property change idate editor locale old locale this locale
|
sets the locale property
|
public void set week of year visible boolean week of year visible day chooser set week of year visible week of year visible set locale locale
|
sets the week of year visible
|
public color get background color return day chooser get background color
|
returns the color of the decoration day names and weeks
|
public void set font font font if is initialized date editor get uicomponent set font font j calendar set font font super set font font
|
sets the font of all subcomponents
|
public void set background color color decoration background color day chooser set background color decoration background color
|
sets the background of days and weeks of year buttons
|
public jcalendar get jcalendar return j calendar
|
returns the jcalendar component
|
public void set selectable date range date min date max j calendar set selectable date range min max date editor set selectable date range j calendar get min selectable date j calendar get max selectable date
|
sets a valid date range for selectable dates
|
public void set selectable date range date min date date max date if min date null this min date default min date else this min date min date if max date null this max date default max date else this max date max date if this max date before this min date date tmp this min date this min date this max date this max date tmp
|
sets a valid date range for dates
|
public date set max date date max if max null this max date default max date else this max date max return this max date
|
sets the maximum date
|
public void set date date date date old date calendar get time calendar set time date int year calendar get calendar year int month calendar get calendar month int day calendar get calendar day of month year chooser set year year month chooser set month month day chooser set calendar calendar day chooser set day day fire property change idate editor date old date date
|
sets the date
|
public date set min date date min if min null this min date default min date else this min date min return this min date
|
sets the minimum date
|
public date get max selectable date return this max date
|
gets the maximum date
|
public date get min selectable date return this min date
|
gets the minimum date
|
public void set selectable date range date min date max day chooser set selectable range min max
|
sets a valid date range for selectable dates
|
public date get max selectable date return j calendar get max selectable date
|
gets the maximum selectable date
|
public date get min selectable date return j calendar get min selectable date
|
gets the minimum selectable date
|
protected void set date date date boolean fire property change date old date this date this date date if date null set text else calendar set time date hours calendar get calendar hour of day minutes calendar get calendar minute seconds calendar get calendar second millis calendar get calendar millisecond string formatted date date formatter format date try set text formatted date catch runtime exception e e print stack trace if date null date util check date date set foreground color black if fire property change fire property change idate editor date old date date
|
sets the date
|
public void item state changed item event e if e get state change item event selected int index get month combo box get selected index if index 0 index month set month index false
|
invoked on combo changes
|
private void set month int new month boolean select if this forward changes int prev month month month new month if select get month combo box set selected index month if ref day chooser null ref day chooser set month month fire property change idate editor month prev month month
|
set the month
|
public void set enabled boolean enabled get month combo box set enabled enabled get month spinner set enabled enabled super set enabled enabled
|
enable or disable jmonth chooser
|
public void set font font font get month combo box set font font super set font font
|
sets the font for this component
|
public void set value int new value set value new value true true inner spinner set value new integer this value
|
set the value
|
public void set font font font if value text field null value text field set font font
|
set the font property
|
public void set foreground color fg if value text field null value text field set foreground fg
|
set the foreground
|
public void set enabled boolean enabled super set enabled enabled inner spinner set enabled enabled value text field set enabled enabled if enabled value text field set background uimanager get color text field inactive background
|
enable or disable the jspin field
|
public void set horizontal alignment int alignment value text field set horizontal alignment alignment
|
set the horizontal alignment of the display
|
public void caret update caret event e value text field repaint
|
after user input the value of the textfield is validated
|
public void state changed change event e spinner number model model spinner number model inner spinner get model int value model get number int value set value value
|
invoked when the spinner model changes
|
protected void reset all date date calendar get time calendar calendar get instance locale calendar set time date set day names draw days
|
initilizes the locale specific names for the days of the week
|
protected void set day names date format symbols date format symbols new date format symbols locale day names date format symbols get short weekdays for int index 0 index day names length index if get max day displayed characters 0 get max day displayed characters 5 if day names index length get max day displayed characters day names index day names index substring 0 get max day displayed characters model update all
|
draws the day names of the day columnes
|
public date set date date date int row cal set time date cal set calendar hour get hour row cal set calendar minute get minute row cal set calendar second 0 return cal get time
|
return a new instance of date cloned from date argument with time set
|
public void increment index subdivisions if index subdivisions nb subdivisions length index subdivisions nb subdivisions length 1 super fire contents changed this 0 get size
|
augment the resolution of chooser
|
public void decrement index subdivisions if index subdivisions 0 index subdivisions 0 super fire contents changed this 0 get size
|
decrease the resolution of chooser
|
public void set month int month calendar set calendar month month int max days calendar get actual maximum calendar day of month draw days
|
sets a specific month
|
public void set font font font this get renderer set font font
|
sets the font property
|
public void set foreground color foreground super set foreground foreground if day table null day table update ui
|
sets the foreground color color
|
public void set background color color decoration background color this background color decoration background color this selection background color this background color darker day table update ui
|
sets the background of days and weeks of year buttons
|
public void set sunday foreground color sunday foreground this sunday foreground sunday foreground draw days
|
sets the sunday foreground
|
public void set weekday foreground color weekday foreground this weekday foreground weekday foreground draw days
|
sets the weekday foreground
|
public void update ui super update ui set font font decode dialog plain 11 if initialized if windows equals uimanager get look and feel get id set day borders visible false set decoration background visible true set decoration borders visible false else set day borders visible true set decoration background visible decoration background visible set decoration borders visible decoration borders visible
|
updates the ui and sets the day button preferences
|
public boolean is allow multi selection return allow multi selection
|
if true then multiselection was allowed
|
public void set allow multi selection boolean allow multi selection this allow multi selection allow multi selection this get day table set selection mode allow multi selection list selection model single interval selection list selection model single selection
|
allow multi day selection
|
public boolean is day borders visible return day borders visible
|
the days border is the button border of the day titles
|
private void create and show gui create and set up the window this set default close operation jframe exit on close display the window this pack this set visible true
|
create the gui and show it
|
public void init iworkbench workbench istructured selection selection this workbench workbench this selection selection set window title jadex agents editor plugin instance get string ui wizard label set default page image descriptor extended image registry instance get image descriptor jadex agents editor plugin instance get image full wizban new jadex
|
this just records the information
|
public void init iworkbench workbench istructured selection selection this workbench workbench this selection selection set window title jadex agents editor plugin instance get string ui wizard label set default page image descriptor extended image registry instance get image descriptor jadex agents editor plugin instance get image full wizban new eclipse jadex
|
this just records the information
|
protected eobject create initial model eclass e class eclass jadex package get eclassifier initial object creation page get initial object name eobject root object jadex factory create e class return root object
|
create a new model
|
protected eobject create initial model eclass e class eclass eclipse jadex package get eclassifier initial object creation page get initial object name eobject root object eclipse jadex factory create e class return root object
|
create a new model
|
protected string get label string type name try return jadex agents edit plugin instance get string ui type name type catch missing resource exception mre jadex agents editor plugin instance log mre return type name
|
returns the label for the specified type name
|
public command get command request request if request instanceof reconnect request object view reconnect request request get connection edit part get model if view instanceof view integer id new integer es upm dit gsi eclipse jadex diagram eclipse jadex diagram part jadex agents visual idregistry get visual id view view request get extended data put visual id key id return super get command request
|
extended request data key to hold editpart visual id
|
protected void handle activate recompute the read only state if editing domain get resource to read only map null editing domain get resource to read only map clear refresh any actions that may become enabled or disabled set selection get selection if removed resources is empty if handle dirty conflict get site get page close editor eclipse jadex editor this false else removed resources clear changed resources clear saved resources clear else if changed resources is empty changed resources remove all saved resources handle changed resources changed resources clear saved resources clear
|
handles activation of the editor or its associated views
|
protected void handle activate recompute the read only state if editing domain get resource to read only map null editing domain get resource to read only map clear refresh any actions that may become enabled or disabled set selection get selection if removed resources is empty if handle dirty conflict get site get page close editor jadex editor this false else removed resources clear changed resources clear saved resources clear else if changed resources is empty changed resources remove all saved resources handle changed resources changed resources clear saved resources clear
|
handles activation of the editor or its associated views
|
public void create field editors add field new string field editor preference constants repository location repository location get field editor parent add field new string field editor preference constants user user get field editor parent string field editor password field editor new string field editor preference constants password password get field editor parent password field editor get text control get field editor parent set echo char add field password field editor
|
creates the field editors
|
public void add pages page1 new export capability to wizard page add page page1
|
adding the page to the wizard
|
public void add pages page1 new add goal wizard page1 selection page2 new add goal wizard page2 selection page3 new parameter selection wizard page selection page3 set title add goal wizard add page page1 add page page2 add page page3
|
adding pages to the wizard
|
public void add pages array list string imports list xmlparser page1 new add import wizard page1 selection imports list page1 set title add import set wizard add page page1
|
adding pages to the wizard
|
public void add pages page1 new import capability wizard page add page page1
|
adding the page to the wizard
|
public void add pages page new add capability reference wizard page selection add page page
|
adding the page to the wizard
|
public void add pages page new agent wizard page selection add page page
|
adding the page to the wizard
|
private void initialize enabled properties changed
|
tests if the current workbench selection is a suitable container to use
|
public void add pages page new add expression wizard page selection add page page
|
adding the page to the wizard
|
public void add pages page1 new add event wizard page1 selection add page page1
|
adding pages to the wizard
|
public void add pages page new capability wizard page selection add page page
|
adding the page to the wizard
|
private void initialize capability name text set text new capability if selection null selection instanceof istructured selection object element istructured selection selection get first element if element instanceof iproject iproject project iproject element try if project has nature jadex project nature nature id project text set text project get name browse button set enabled false selected project project return catch core exception e
|
tests if the current workbench selection is a suitable container to use
|
private void dialog changed if project text get text length 0 update status a destination project for the new agent must be selected return if capability name text get text length 0 update status capability name must be specified return if capability name text get text replace index of 1 0 update status capability name must be valid return update status null
|
ensures that the all text fields are set correctly
|
private void initialize agent name text set text new agent if selection null selection instanceof istructured selection object element istructured selection selection get first element if element instanceof iproject iproject project iproject element try if project has nature jadex project nature nature id project text set text project get name browse button set enabled false selected project project return catch core exception e
|
tests if the current workbench selection is a suitable container to use
|
private void dialog changed if project text get text length 0 update status a destination project for the new agent must be selected return if agent name text get text length 0 update status agent name must be specified return if agent name text get text replace index of 1 0 update status agent name must be valid return update status null
|
ensures that the all text fields are set correctly
|
public void add pages page1 new add property wizard page1 selection add page page1
|
adding pages to the wizard
|
public void add pages page1 new add belief wizard page1 selection page1 set title add belief wizard page2 new add belief wizard page2 selection page2 set title add belief set wizard add page page1 add page page2
|
adding pages to the wizard
|
public void add pages page1 new export to repository wizard page add page page1
|
adding the page to the wizard
|
private void dialog changed file file new file get capability file path if capability name text get text length 0 update status capability name must be set return if capability file text get text length 0 update status capability file must be set return if file null file exists update status the selected capability file doesn t exist return if file get name ends with capability xml update status capability files must have the capability xml extension return update status null
|
ensures that the all text fields are set correctly
|
public void add pages page1 new add configuration wizard page1 selection add page page1
|
adding pages to the wizard
|
protected void handle destination browse button pressed file dialog dialog new file dialog get container get shell swt save swt sheet dialog set text select a name and a destination directory dialog set filter path get destination value dialog set filter extensions new string zip non nls 1 non nls 2 string selected file name dialog open if selected file name null directory file text set text selected file name
|
open an appropriate destination browser so that the user can specify a
|
private void dialog changed if capability file text get text length 0 update status a capability file must be selected return if directory file text get text length 0 update status a destination directory must be selected return update status null
|
ensures that the all text fields are set correctly
|
private palette container create eclipse jadex1 group palette group palette container new palette group es upm dit gsi eclipse jadex diagram eclipse jadex diagram part messages eclipse jadex1 group title palette container set id create eclipse jadex1 group non nls 1 palette container add create agent1 creation tool return palette container
|
creates eclipse jadex palette tool group
|
protected void add name property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui agent name feature get string ui property descriptor description ui agent name feature ui agent type jadex package literals agent name true false false item property descriptor generic value image null null
|
this adds a property descriptor for the name feature
|
protected void add content property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui imports content feature get string ui property descriptor description ui imports content feature ui imports type eclipse jadex package literals imports content true false false item property descriptor generic value image null null
|
this adds a property descriptor for the content feature
|
protected void add type property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui beliefs type feature get string ui property descriptor description ui beliefs type feature ui beliefs type eclipse jadex package literals beliefs type true false false item property descriptor generic value image null null
|
this adds a property descriptor for the type feature
|
protected void add name property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui beliefs name feature get string ui property descriptor description ui beliefs name feature ui beliefs type eclipse jadex package literals beliefs name true false false item property descriptor generic value image null null
|
this adds a property descriptor for the name feature
|
protected void add class property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui beliefs class feature get string ui property descriptor description ui beliefs class feature ui beliefs type eclipse jadex package literals beliefs class true false false item property descriptor generic value image null null
|
this adds a property descriptor for the class feature
|
protected void add type property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui expressions type feature get string ui property descriptor description ui expressions type feature ui expressions type eclipse jadex package literals expressions type true false false item property descriptor generic value image null null
|
this adds a property descriptor for the type feature
|
protected void add name property descriptor object object item property descriptors add create item property descriptor composeable adapter factory adapter factory get root adapter factory get resource locator get string ui expressions name feature get string ui property descriptor description ui expressions name feature ui expressions type eclipse jadex package literals expressions name true false false item property descriptor generic value image null null
|
this adds a property descriptor for the name feature
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.