To jest stara wersja strony!
Opis
Damian Janicki janicki.damian@gmail.com
Investigate runtime integration aspects, mainly semi-automatical building of a GUI for Prolog programs possibilities XPCE, Static QT/Gtk, Gtk-Server, Java (Swing), Eclipse (SWT)
XPCE, QT, GTK, GtkServer, Java etc., SWI Prolog documentation
Feasibility study, a prototype.
integration options for Java: JPL (SWI),Logtalk (OO Prolog), architecture: MVC
approach: 2 -3 app. cases, M prolog, V in Java, C → JPL/Logtalk, e.g. ready M in Prolog, build V in Java: Car ES, opposite: ready MV i Java, build M in Prolog, make it work with the V
Spotkania
08.03.04
080311
080318
Projekt
show_yes_no_dialog(Tekst,Response) :-
jpl_new(array(class([java,lang],['String'])),['yes','no'], ArrayRef),
jpl_get(ArrayRef,0,ArrayPosRef),
jpl_get('javax.swing.JOptionPane', 'YES_NO_OPTION', YesNoRef),
jpl_get('javax.swing.JOptionPane', 'QUESTION_MESSAGE', QuestionRef),
jpl_call('javax.swing.JOptionPane', 'showOptionDialog', [@(null),
Tekst,
'Question',
YesNoRef,
QuestionRef,
@(null),
ArrayRef,
ArrayPosRef],
RetVal),
interpret(RetVal,Response).
interpret(1,no).
interpret(0,yes).
show_explain_dialog(Tekst) :-
jpl_call('javax.swing.JOptionPane', 'showMessageDialog', [@('null'),Tekst],_).
Predykat ask_question
Przed zmianami:
ask_question(starter_was_ok) :-
write('When you first started trying to start the car,'),nl,
write('did the starter crank the engine normally? '),nl.
Po zmianach (korzysta z Java):
ask_question(starter_was_ok,Res) :-
show_yes_no_dialog('When you first started trying to start the car did the starter crank the engine normally?',Res).
Predykat explain
Przed zmianami:
explain(wrong_gear) :-
nl,
write('Check that the gearshift is set to Park or Neutral.'),nl,
write('Try jiggling the gearshift lever.'),nl.
Po zmianach:
explain(wrong_gear) :-
show_explain_dialog('Check that the gearshift is set to Park or Neutral.Try jiggling the gearshift lever.').
Predykat user_says:
Przed:
user_says(Q,A) :- \+ stored_answer(Q,_),
ask_question(Q),
get_yes_or_no(Response),
asserta(stored_answer(Q,Response)),
Response = A.
Po:
user_says(Q,A) :- \+ stored_answer(Q,_),
ask_question(Q,Response),
asserta(stored_answer(Q,Response)),
Response = A.
V: Interfejs w Javie
Źródła projektu
Sprawozdanie
Materiały