Commit 6573c6b0 authored by Guillaume Chomat's avatar Guillaume Chomat
Browse files

some minor modification

parent 8cd85ddc
......@@ -19,12 +19,26 @@
<date>20 mars 2002</date>
</articleinfo>
<section><title>Introduction</title>
<para>Flowcomposer est une interface graphique ayant pour but l'édition de compositions de transformations de documents XML</para>
<para>Flowcomposer est basé sur l'environement <ulink url="http://transmorpher.inrialpes.fr">Transmorpher.</ulink></para>
</section>
<section>
<title>Contexte d'utilisation</title>
<section><title>Type d'utilisateur</title>
<para>FlowComposer ne distingue qu'un seul type ou catégorie d'uitilisateur. Le but de FlowComposer est de faciliter l'édition de compositions de transformations de documents XML basées sur Transmorpher. La seul catégorie est celle des utilisateurs désirant manipuler des compositions de trasformations.</para>
<para></para>
<para>On peut distinguer deux types d'utilisateurs.</para>
<itemizedlist>
<listitem>
<para>Pour l'édition de compositions.</para>
</listitem>
<listitem>
<para>Pour la visualisation de compositions.</para>
</listitem>
</itemizedlist>
<para>Ces deux catégories sont très proches.</para>
</section>
<section><title>Contexte materiel</title>
......@@ -42,27 +56,26 @@
<section>
<title>Description des services</title>
<para>Services</para>
<para>Les services correspondent à toutes les fonctionnalitées permises par FlowComposer. Ces services vont s'éterndre au fil des années. Certains d'entre eux seront directement lié aux services proposées par Transmorpher. Toute modification, suppression ou ajout de service pour les nouvelles versions de Transmorpher devra être aisément répercutable sur FlowComposer et ne devra pas entrainé de disfonctionnalité majeur. A une version de FlowComposer correspondra une version de Transmorpher.</para>
<para></para>
<section id="file">
<title>File</title>
<section id="load"><title>load</title>
<para>Charge une composition de transformation locale. Dans le cas où le fichier chargé est invalidé par rapport à la DTD du transmorpher, un message d'erreur devra informer à l'utilisateur du problème.</para>
</section>
<section><title>download</title>
<section><title>La barre de Menu</title>
<section id="file"><title>File</title>
<section id="load"><title>load</title>
<para>Charge une composition de transformation locale. Dans le cas où le fichier chargé est invalidé par rapport à la DTD du transmorpher, un message d'erreur devra informer à l'utilisateur du problème.</para>
</section>
<para>Charge une composition de transformation située sur un ordinateur distant.
<section><title>download</title>
<para>Charge une composition de transformation située sur un ordinateur distant.
Dans le cas où le fichier chargé est invalidé par rapport à la DTD du transmorpher, un message d'erreur devra informer à l'utilisateur du problème.
De plus, si l'ordinateur distant n'est pas accessible, l'utilisateur devra en être informé.Enfin, a partir du moment où la connection est établie, tous problèmes intervenant au cours du chargement devra être clairement signalé.
</para>
</section>
</section>
<section><title>save</title>
......@@ -320,6 +333,7 @@
<para>Informations sur le transmorpher.</para>
</section>
</section>
</section>
</section>
<section><title>Traitement des erreurs</title>
......@@ -330,7 +344,5 @@
<section><title>Evolutions</title>
<para></para>
</section>
</article>
\ No newline at end of file
/**
* $Id: FCMarqueeHandler.java,v 1.10 2002-05-27 16:22:45 frederic Exp $
* $Id: FCMarqueeHandler.java,v 1.11 2002-05-28 12:56:25 gchomat Exp $
*
* Transmorpher
*
......@@ -29,6 +29,31 @@
package fr.fluxmedia.flowcomposer;
import javax.swing.JPanel;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JDialog;
import javax.swing.JButton;
import javax.swing.JLabel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.Hashtable;
import java.awt.GridLayout;
import java.awt.Dimension;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;
import fr.fluxmedia.transmorpher.Graph.Call;
import com.jgraph.JGraph;
import com.jgraph.graph.*;
import fr.fluxmedia.transmorpher.Graph.Process;
import fr.fluxmedia.transmorpher.Graph.Port;
import fr.fluxmedia.transmorpher.Graph.Channel;
......@@ -52,12 +77,11 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
protected JGraph currentProcess;
protected Process currentTransformation;
protected FlowComposer flowcomposer;
// temporary
protected int count=0;
protected Call currentCall;
public transient JToggleButton marquee = new JToggleButton();
......@@ -78,7 +102,8 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
protected Object beginCell, endCell;
public FCMarqueeHandler(){
public FCMarqueeHandler(FlowComposer flowcomposer){
this.flowcomposer = flowcomposer;
}
......@@ -93,7 +118,7 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
System.out.println("currentTransformation "+currentTransformation);
}
}
public JGraph getCurrentProcess(){
return currentProcess;
}
......@@ -145,7 +170,7 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
}
public void mouseReleased(MouseEvent event) {
EditCall dialog;
count++;
if(currentProcess != null)
{
......@@ -153,33 +178,31 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
if (event != null && !event.isConsumed() && !marquee.isSelected()) {
if (merge.isSelected())
{
currentCall = new Merge("merge"+count,"concat",currentTransformation);
if(((ProcessGraph)currentProcess).getUserObject() instanceof Process)
((Process)(((ProcessGraph)currentProcess).getUserObject())).addCall(currentCall);
((ProcessGraph)currentProcess).addVertex(currentCall,start,ProcessGraph.MERGE);
dialog = new EditCall((JFrame)(currentProcess.getTopLevelAncestor()),(ProcessGraph)currentProcess,null,start,FCConstants.MERGE);
}
else if (generate.isSelected())
{
currentCall = new Generate("generate"+count,"readfile",currentTransformation,1,"/local_home/gchomat/transmorpher/samples/biblio/input/bibexmo.xml");
if(((ProcessGraph)currentProcess).getUserObject() instanceof Process)
((Process)(((ProcessGraph)currentProcess).getUserObject())).addCall(currentCall);
((ProcessGraph)currentProcess).addVertex(currentCall,start,ProcessGraph.GENERATE);
((ProcessGraph)currentProcess).addVertex(currentCall,start,FCConstants.GENERATE);
}
else if (serialize.isSelected())
{
currentCall = new Serialize("serialize"+count,"writefile",currentTransformation,1,"test.xml");
currentCall = new Serialize("serialize"+count,"writefile",currentTransformation,1,currentProcess+"serialize"+count+".xml");
if(((ProcessGraph)currentProcess).getUserObject() instanceof Process)
((Process)(((ProcessGraph)currentProcess).getUserObject())).addCall(currentCall);
((ProcessGraph)currentProcess).addVertex(currentCall,start,ProcessGraph.SERIALYSE);
((ProcessGraph)currentProcess).addVertex(currentCall,start,FCConstants.SERIALYSE);
}
else if (dispatch.isSelected())
{
currentCall = new Dispatch("dispatch"+count,"broadcast",currentTransformation);
if(((ProcessGraph)currentProcess).getUserObject() instanceof Process)
((Process)(((ProcessGraph)currentProcess).getUserObject())).addCall(currentCall);
((ProcessGraph)currentProcess).addVertex(currentCall,start,ProcessGraph.DISPATCH);
((ProcessGraph)currentProcess).addVertex(currentCall,start,FCConstants.DISPATCH);
}
else if (applyExternal.isSelected())
......@@ -187,31 +210,31 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
currentCall = new ApplyExternal("applyExternal"+count,"xslt","/local_home/gchomat/transmorpher/samples/biblio/xslt/sort-ty.xsl",currentTransformation);
if(((ProcessGraph)currentProcess).getUserObject() instanceof Process)
((Process)(((ProcessGraph)currentProcess).getUserObject())).addCall(currentCall);
((ProcessGraph)currentProcess).addVertex(currentCall,start,ProcessGraph.APPLYEXTERNAL);
((ProcessGraph)currentProcess).addVertex(currentCall,start,FCConstants.APPLYEXTERNAL);
}
else if (applyProcess.isSelected())
{
currentCall = new ApplyProcess("applyProcess"+count,"no",currentTransformation);
if(((ProcessGraph)currentProcess).getUserObject() instanceof Process)
((Process)(((ProcessGraph)currentProcess).getUserObject())).addCall(currentCall);
((ProcessGraph)currentProcess).addVertex(currentCall,start,ProcessGraph.APPLYPROCESS);
((ProcessGraph)currentProcess).addVertex(currentCall,start,FCConstants.APPLYPROCESS);
}
else if (applyRuleset.isSelected())
{
currentCall = new ApplyRuleset("applyRuleset"+count,"no",currentTransformation);
if(((ProcessGraph)currentProcess).getUserObject() instanceof Process)
((Process)(((ProcessGraph)currentProcess).getUserObject())).addCall(currentCall);
((ProcessGraph)currentProcess).addVertex(currentCall,start,ProcessGraph.APPLYRULESET);
((ProcessGraph)currentProcess).addVertex(currentCall,start,FCConstants.APPLYRULESET);
}
else if (applyQuery.isSelected())
{
currentCall = new ApplyQuery("applyQuery"+count,"tmq",currentTransformation);
if(((ProcessGraph)currentProcess).getUserObject() instanceof Process)
((Process)(((ProcessGraph)currentProcess).getUserObject())).addCall(currentCall);
((ProcessGraph)currentProcess).addVertex(currentCall,start,ProcessGraph.APPLYQUERY);
((ProcessGraph)currentProcess).addVertex(currentCall,start,FCConstants.APPLYQUERY);
}
else if (edgeNormal.isSelected()) {
currentProcess.getModel().insert(null,null,null,null);
currentProcess.getModel().insert(null,null,null,null);
if ((beginCell!=null)&&(endCell!=null)&&(!beginCell.equals(endCell))) {
doConnectionSet(beginCell,endCell);
......@@ -309,7 +332,7 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
Map map = GraphConstants.createMap();
GraphConstants.setPoints(map, list);
Map viewMap = new Hashtable();
NormalEdge edge = new NormalEdge();
NormalEdge edge = new NormalEdge(channel);
viewMap.put(edge, map);
Object[] insert = new Object[]{edge};
ConnectionSet cs = new ConnectionSet();
......@@ -320,9 +343,11 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
cs.connect(edge,currentProcess.getPortForLocation(p.x,p.y), true);
cs.connect(edge,currentProcess.getPortForLocation(p2.x,p2.y), false);
currentProcess.getModel().insert(insert, cs, null, viewMap);
((ProcessGraph)currentProcess).updatePorts("output",(DefaultGraphCell)cell);
((ProcessGraph)currentProcess).updatePorts("input",(DefaultGraphCell)cell2);
//((ProcessGraph)currentProcess).layoutPorts(cell,"output");
((ProcessGraph)currentProcess).updatePorts("output",(DefaultGraphCell)cell);
((ProcessGraph)currentProcess).updatePorts("input",(DefaultGraphCell)cell2);
//((ProcessGraph)currentProcess).layoutPorts(cell,"output");
//((ProcessGraph)currentProcess).layoutPorts(cell2,"input");
/*
((ProcessGraph)currentProcess).layoutPorts(cell,"output");
......@@ -334,11 +359,325 @@ public class FCMarqueeHandler extends BasicMarqueeHandler {
public void overlay(Graphics g) {
super.overlay(g);
if (start != null) {
if ((edgeNormal.isSelected()) && current != null)
g.drawLine(start.x, start.y, current.x, current.y);
}
}
class EditCall extends JDialog implements ActionListener{
protected JTextField idText ;
protected JComboBox strategy,typeChooser,ref;
protected JFileChooser fileChooser;
protected JButton ok,cancel;
protected JLabel idJLabel, fileJLabel, refJLabel, strategyJLabel, typeJLabel;
final static String idLabel ="id :";
final static String fileLabel ="file :";
final static String refLabel ="ref :";
final static String strategyLabel ="strategy :";
final static String typeLabel ="type :";
final static String okTitle = "OK";
final static String cancelTitle = "Cancel";
final static int HORIZONTAL_GAP = 5;
final static int VERTICAL_GAP = 5;
protected JFrame frame;
protected Call call;
protected GridLayout layout;
protected boolean editMode;
protected int type;
protected ProcessGraph currentProcess;
protected Point start;
public EditCall(JFrame frame, ProcessGraph currentProcess, Call call, Point start, int type){
super(frame,"",true);
this.frame = frame;
this.call = call;
this.start = start;
this.type = type;
this.currentProcess = currentProcess;
editMode = (call == null);
//this.setResizable(false);
buildDialog();
}
/**
build the dialog depends on type and call
*/
public void buildDialog(){
switch(type)
{
case FCConstants.MERGE :
setTitle("New Merge Properties");
layout = new GridLayout(3,2,HORIZONTAL_GAP,VERTICAL_GAP);
getContentPane().setLayout(layout);
if(call!=null){
setTitle(call.getId()+" Properties");
idJLabel = new JLabel(idLabel);
idJLabel.setMaximumSize(new Dimension(idLabel.length(),20));
getContentPane().add(idJLabel);
idText= new JTextField(call.getId(),20);
idJLabel.setLabelFor(idText);
getContentPane().add(idText);
typeJLabel = new JLabel(typeLabel);
getContentPane().add(typeJLabel);
typeChooser = new JComboBox(new Object[]{"concat"});
typeJLabel.setLabelFor(typeChooser);
getContentPane().add(typeChooser);
}
else{
setTitle("New Merge Properties");
idJLabel = new JLabel(idLabel);
idJLabel.setMaximumSize(new Dimension(idLabel.length(),20));
getContentPane().add(idJLabel);
idText= new JTextField("titi",20);
idJLabel.setLabelFor(idText);
getContentPane().add(idText);
typeJLabel = new JLabel(typeLabel);
getContentPane().add(typeJLabel);
typeChooser = new JComboBox(new Object[]{"concat"});
typeJLabel.setLabelFor(typeChooser);
getContentPane().add(typeChooser);
}
JPanel panelButton = new JPanel();
ok = new JButton(okTitle);
ok.addActionListener(this);
cancel = new JButton(cancelTitle);
cancel.addActionListener(this);
panelButton.add(ok);
panelButton.add(cancel);
getContentPane().add(panelButton);
break;
case FCConstants.DISPATCH :
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
case FCConstants.SERIALYSE :
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
case FCConstants.APPLYEXTERNAL :
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
case FCConstants.APPLYPROCESS:
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
case FCConstants.APPLYQUERY:
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
case FCConstants.APPLYRULESET:
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
case FCConstants.GENERATE:
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
default :
System.out.println("not yet implemented");
break;
}
this.pack();
this.setLocationRelativeTo(frame);
this.setVisible(true);
}
//ACTION LISTENER
public void actionPerformed(ActionEvent event){
String id = idText.getText();
if(event.getSource() == ok )
{
//ok action.
if(!(id.equals(""))){
//id != ""
if(currentProcess.isSingleId(id))
{
//id is single
switch(type)
{
case FCConstants.MERGE :
if(call==null){
call = new Merge(id,typeChooser.getSelectedItem().toString(),null);
((ProcessGraph)currentProcess).addVertex(call,start,FCConstants.MERGE);
this.setVisible(false);
}
else{
}
break;
case FCConstants.DISPATCH :
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
case FCConstants.SERIALYSE :
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
case FCConstants.APPLYEXTERNAL :
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
case FCConstants.APPLYPROCESS:
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
case FCConstants.APPLYQUERY:
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
case FCConstants.APPLYRULESET:
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
case FCConstants.GENERATE:
if(call!=null){
System.out.println("not yet implemented");
}
else{
System.out.println("not yet implemented");
}
break;
default :
System.out.println("not yet implemented");
break;
}
createCall();
}
else
{
}
}
else{
//id = ""
}
}
else if(event.getSource() == cancel)
{
}
}
public void createCall(){
}
}
}