Tags:
create new tag
view all tags
Cette page de travail regroupe les elements mis en oeuvre pendant le stage de Main.BriceColucci (avril-juin 2008). Suite à ce stage, une page de documentation regroupe l'ensemble des fonctionnalités qui ont été intégrées dans le module JMCS. %TOC% ---++ Liens utiles * [[http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html][Convention de codage java]] * [[http://www.touilleur-express.fr/2008/02/17/presentation-de-la-jsr-296-swing-application-framework/][Article sur le framework jsr-296]] * [[http://java.sun.com/docs/books/tutorial/ui/features/components.html][Aperçu des composants SWING classiques]] * [[http://www.scribd.com/doc/248585/Swing-App-Framework][Présentation flash en anglais sur appFramework JAVA]]<br /> (fait en 2006 donc dépassé, mais sympa pour comprendre au début) * [[https://appframework.dev.java.net/nonav/javadoc/AppFramework-1.03/index.html][appFramework javadoc]] ---<br /> Objectif : Réunir au sein d'un même module logiciel facilement réutilisable, un maximum de fonctionnalités<br />partagées par toutes les applications graphiques JAVA du JMMC ---++ Les points du cahier des charges (CCH) * (1) Uniformiser les interfaces => _factorisation du code_ * (2) Uniformiser l'utilisation des logiciels * (3) Maximiser l'intégration aux principaux SE * (4) Améliorer la finition graphique des interfaces * (5) Faciliter la maintenance => _factorisation du code_ ---++ Le framework SWING *appFramework* Ce framework peut être décrit sous la forme de deux cercles concentriques. * Le noyau : C'est l'application avec les procédures suivantes : launch(), startup(), exit() et shutdown() * Le contexte : Les données disponibles hors application, celles de l'application, le gestionnaire d'actions, le gestionnaire de ressources et le service de tâches. <img src="https://appframework.dev.java.net/intro/images/architecture-diagram.png" /> ---+ Comment on utilise *appFramework*?<br /> Au minimum, on doit : * Dériver notre interface graphique (IG) de *Application* * Surcharger la méthode startup() et appeler setVisible() * Lancer launch() de la classe *Application* avec en paramètre le nom de notre IG <br /> De ces points on conclue que : * Il y a une factorisation importante du code, *ce qui répond au besoins (1), (2) et (5) du CCH* ---+ Le gestionnaire de ressources Voici un exemple de contenu d'un fichier de ressources d'une interface graphique appFramework :<br /><br /> <span class="purple">label.opaque = true<br /> label.background = 0, 0, 0<br /> label.foreground = 255, 255, 255<br /> label.text = Hello World<br /> label.font = Lucida-PLAIN-48<br /> label.icon = earth.png<br /></span> <br /> Et le code correspondant :<br /><pre> <b>public class SingleFrameExample2 extends SingleFrameApplication {<br /> public void startup(String[] args) {<br /> JLabel label = new JLabel();<br /> label.setName("label");<br /> show(label);<br /> }<br /> public static void main(String[] args) {<br /> launch(SingleFrameExample2.class, args);<br /> }<br /> }</b></pre><br /> Résultat :<br /> <img src="https://appframework.dev.java.net/intro/images/SingleFrameExample2-screenshot.png" /><br /><br /> *Ce système de gestion des ressources répond au besoin (1) et (5)* ---+ Code that scan a class methods: <verbatim> import java.lang.reflect.Method; private void launchSetPropertiesMethods() { String className = "fr.jmmc.mcs.gui.AboutBoxView"; String chSequence = "setResizable"; try { Class classToApply = Class.forName(className); Method[] methods = classToApply.getMethods(); for(int i=0; i<methods.length; i++) { Method method = methods[i]; String methodName = method.getName(); if(methodName.contains(chSequence)) { method.invoke(obj_, true); } } } catch(Exception ex) { ex.getMessage(); } } </verbatim>
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r8
<
r7
<
r6
<
r5
<
r4
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r8 - 2008-11-06
-
GuillaumeMella
Home
Site map
Jmmc web
Faq web
ProspectiveHRA2014 web
Software web
VltiSchool2010 web
VltiSchool2013 web
VltiSchool2015 web
VltiSchool2018 web
Main web
Sandbox web
DeuxiemePage web
TWiki web
Software Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
E
dit
A
ttach
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback