Parcourir la source

Init with a newer version of the applet

Jean Fromentin il y a 8 ans
Parent
commit
af1d10cc23
23 fichiers modifiés avec 1583 ajouts et 107 suppressions
  1. 12 107
      AppletMain.html
  2. 195 0
      Braid.java
  3. 314 0
      BraidDrawing.java
  4. 453 0
      Components.java
  5. 11 0
      HandleReductionApplet.java
  6. 15 0
      HandleReductionMain.java
  7. 190 0
      HandleReductionPanel.java
  8. 149 0
      List.java
  9. 77 0
      Listener.java
  10. 53 0
      Node.java
  11. 17 0
      handleApplet.html
  12. BIN
      img/sample1.png
  13. BIN
      img/sample2.png
  14. BIN
      img/sample3.png
  15. BIN
      img/sample4.png
  16. BIN
      img/sigma.png
  17. BIN
      img/sigma1.png
  18. 97 0
      img/sigma1.svg
  19. BIN
      img/sigma1inv.png
  20. BIN
      img/sigma2.png
  21. BIN
      img/sigma2inv.png
  22. BIN
      img/sigma3.png
  23. BIN
      img/sigma3inv.png

Fichier diff supprimé car celui-ci est trop grand
+ 12 - 107
AppletMain.html


+ 195 - 0
Braid.java

@@ -0,0 +1,195 @@
+/* File : Braid.java
+ * Program : Handle Reduction Aimation - Applet 
+ * By Jean Fromentin <jfroment@info.unicaen.fr>
+ * Copyright 2008 Jean Fromentin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+class Braid extends List{
+    public int handleType;
+    public int strandNumber=4;
+    public Node handleBegin;
+    public Node handleEnd;
+    public int handleBeginIndice;
+    public int handleEndIndice;
+    public int handleStrand;
+    public int trivialNumber; 
+
+    public Braid(){}
+
+    public Braid(String braidWord){
+	int length;
+	int value;
+	char letter;
+	strandNumber=4;
+	value=0;
+	length=braidWord.length();
+	addLast(0);
+	for(int i=0;i<length;i++){
+	    letter=braidWord.charAt(i);
+	    if(letter>='a' && letter<='z'){
+		value=(int)(letter-'a')+1;
+		if(value+1>strandNumber){       
+		    strandNumber=value+1;     
+		}
+	    }
+	    else if(letter>='A' && letter<='Z'){
+		value=-(int)(letter-'A')-1;
+		if(-value+1>strandNumber){
+		    strandNumber=-value+1;
+		}
+	    }
+	    else{
+		value=0;
+	    }
+	    addLast(value);
+	}
+	addLast(0);
+    }
+	
+	
+    public void findHandle(){
+	Node handles[]=new Node[strandNumber];
+	int indices[]=new int[strandNumber];
+	int signs[]=new int[strandNumber];
+	int sign,value;
+	boolean stop;
+	int indice=0;
+	for(int i=0;i<strandNumber;i++){
+	    signs[i]=0;
+	}
+	stop=false;
+	value=0;
+	sign=0;
+	initCurrent();
+	while(!stop){
+	    value=value();
+	    sign=1;
+	    if(value<0){
+		value=-value;
+		sign=-1;
+	    }
+	    else if(value==0){                
+		sign=0;
+	    }
+	    if(signs[value]*sign<0){
+		stop=true;
+	    }
+	    else{
+		signs[value]=sign;
+		indices[value]=indice;
+		handles[value]=getCurrent();
+		for(int j=1;j<value;j++){
+		    signs[j]=0;
+		}
+	    }
+	    if(isEnd()){
+		stop=true;
+	    }
+	    if(!stop){
+		indice++;
+		shift(); 
+	    }
+	}
+	if(signs[value]*sign<0){
+	    handleBegin=handles[value];
+	    handleEnd=getCurrent();
+	    handleBeginIndice=indices[value];
+	    handleEndIndice=indice;
+	    handleStrand=value;
+	    handleType=-sign;
+	}
+	else{
+	    handleStrand=0;
+	}
+    }
+	
+    public void insertTrivials(){
+	int value;
+	boolean stop;
+	stop=false;
+	setCurrent(handleBegin);
+	trivialNumber=0;
+	while(!stop){
+	    value=value();
+	    if(Math.abs(value)==handleStrand-1){
+		addBefore(0);
+		setCurrent(addAfter(0));
+		trivialNumber+=2;
+	    }
+	    shift();
+	    if(getCurrent()==handleEnd){
+		stop=true;
+	    }
+	}
+	handleEndIndice+=trivialNumber;
+    }
+	
+    public void removeHandle(){
+	int sign;
+	int value;
+	boolean stop;
+	sign=-handleType;
+	stop=false;
+	setCurrent(handleBegin);
+	while(!stop){
+	    value=value();
+	    if(Math.abs(value)==handleStrand){
+		(getCurrent()).setValue(0); 
+	    }
+	    if(value==0){
+		(getCurrent()).setValue((handleStrand-1)*sign);
+		sign=-sign;
+	    }
+	    if(value==handleStrand-1){
+		(getCurrent()).setValue(value+1);
+	    }
+	    if(value==-(handleStrand-1)){
+		(getCurrent()).setValue(value-1);
+	    }
+	    if(getCurrent()==handleEnd){
+		stop=true;
+	    }
+	    else{
+		shift();
+	    }
+	}
+	trivialNumber=2;
+    }
+	
+    public void removeTrivials(){
+	remove(handleBegin);
+	remove(handleEnd);
+	trivialNumber=0;
+    }
+	
+    public int indice(){
+	int value;
+	int indice=0;
+	boolean stop=false;
+	initCurrent();
+	while(!stop){
+	    value=value();
+	    if(Math.abs(value)>Math.abs(indice)){
+		indice=value;
+	    }
+	    if(isEnd()){
+		stop=true;  
+	    }
+	    else{        
+		shift(); 
+	    }
+	}
+	return indice;
+    }
+	
+}

+ 314 - 0
BraidDrawing.java

@@ -0,0 +1,314 @@
+/* File : BraidDrawing.java
+ * Program : Handle Reduction Aimation - Applet 
+ * By Jean Fromentin <jfroment@info.unicaen.fr>
+ * Copyright 2008 Jean Fromentin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.geom.GeneralPath;
+
+
+public class BraidDrawing extends Braid{
+    private float strandStep;               //The distance between two strand
+    private float strandWidth;              //The width of a strand
+    private float strandLeft;               //The x position of the leftmost strand
+    private float[][] xPos;
+    private float yUp;
+    private float yPos;
+    public boolean handleNormalDraw;        //This variable is true if we draw the handle with the classic metod
+    public boolean onHandle;                //This variable is true if we are in between the handleBegin Node and the handleEnd node
+    public float trivialHeight;   
+    private Color[] strandColor;             //The color of different strand
+    private Color handleColor=Color.black;   //The color of the handle
+    private Color originalHandleStrandColor; //The original color of the handle strand
+    static public boolean isDraw;                  //For not repeat drawing
+    public boolean firstDraw;
+	
+    public BraidDrawing(String braidWord){
+	super(braidWord);
+	trivialNumber=0;
+	trivialHeight=0;
+	handleNormalDraw=true;
+	isDraw=false;
+    }
+    public void initStrandColor(){
+	strandColor=new Color[strandNumber];
+	for(int strand=1;strand<strandNumber+1;strand++){
+	    strandColor[strand-1]=Color.getHSBColor((float)1-(float)strand/(float)strandNumber,(float)1,1);     
+	}
+    }
+	
+    public void drawTrivial(Graphics g,int indice, int strandNumber,float trivialHeight){
+	float nextYPos;
+	nextYPos=yPos+strandStep*trivialHeight;
+	for(int strand=1;strand<strandNumber+1;strand++){
+	    if(handleNormalDraw || (!handleNormalDraw && !isOnHandle(indice,strand))){
+		drawLine(g,xPos[indice][strand-1],yPos,xPos[indice+1][strand-1],nextYPos,strandColor[strand-1]);
+	    }
+	}
+	yPos=nextYPos;
+    }
+	
+    public boolean isOnHandle(int indice,int strand){
+        return (indice>=handleBeginIndice && indice<=handleEndIndice && strand==handleStrand);
+    }
+    
+    public void drawLine(Graphics g, float xA, float yA, float xB,float yB,Color color){
+	Graphics2D g2=(Graphics2D)g;
+	g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
+	g2.setStroke(new BasicStroke(strandWidth*2,BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL));
+	GeneralPath path=new GeneralPath();
+	float yBezier=(yB-yA)/3;
+	path.moveTo(xA,yA);
+	path.curveTo(xA,yA+yBezier,xB,yA+2*yBezier,xB,yB);
+	g2.setColor(Color.white);                                       
+	g2.draw(path);
+	g2.setStroke(new BasicStroke(strandWidth,BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL));
+	path=new GeneralPath();
+	path.moveTo(xA,yA);
+	path.curveTo(xA,yA+yBezier,xB,yA+2*yBezier,xB,yB);
+	g2.setColor(color);                                       
+	g2.draw(path);
+    }
+    
+    public void drawCrossing(Graphics g,int indice, int strandNumber,int generator, int exp){
+	int begin;
+	int step;
+	GeneralPath gpl,gpm,gpr;	
+	if(exp==1){
+	    begin=1;
+	}
+	else{
+	    begin=strandNumber;
+	}
+	for(int strand=begin;0<strand && strand<strandNumber+1;strand+=exp){
+	    if(handleNormalDraw || (!handleNormalDraw && !isOnHandle(indice,strand))){
+		if (strand==generator){
+		    step=1;
+		}
+		else if(strand==generator+1){
+		    step=-1;
+		}
+		else{
+		    step=0;
+		}
+		drawLine(g,xPos[indice][strand-1],yPos,xPos[indice+1][strand+step-1],yPos+strandStep,strandColor[strand-1]);
+	    }
+	}
+	yPos+=strandStep;
+	Color temp=strandColor[generator-1];
+	strandColor[generator-1]=strandColor[generator];
+	strandColor[generator]=temp;
+	if(generator==handleStrand && isOnHandle(indice,handleStrand)){
+	    handleStrand++;
+	}
+	else if(generator==handleStrand-1 && isOnHandle(indice,handleStrand)){
+	    handleStrand--;
+	}
+    }
+	
+    public void drawHandle(Graphics g){
+	float yPos;
+	int nextHandleStrand;
+	int generator;
+	float height;
+	Node current;
+	Node backupCurrent;
+	backupCurrent=getCurrent();
+	current=handleBegin;
+	setCurrent(current);
+	yPos=handleBeginIndice*strandStep+yUp;
+	nextHandleStrand=handleStrand;
+	for(int indice=handleBeginIndice;indice<handleEndIndice+1;indice++){
+	    generator=value();
+	    if(generator<0){
+		generator=-generator;
+	    }
+	    if(generator==handleStrand){
+		nextHandleStrand=handleStrand+1;
+	    }
+	    else if(generator==handleStrand-1 && generator!=0){
+		nextHandleStrand=handleStrand-1;
+	    }
+	    else{
+		nextHandleStrand=handleStrand;
+	    }
+	    if(generator==0){
+		height=trivialHeight*strandStep;
+	    }
+	    else{
+		height=strandStep;
+	    }
+	    drawLine(g,xPos[indice][handleStrand-1],yPos,xPos[indice+1][nextHandleStrand-1],yPos+height,handleColor);	
+	    handleStrand=nextHandleStrand;
+	    shift();
+	    yPos+=height;
+	}
+	setCurrent(backupCurrent);
+	yPos=yUp;
+    }
+	
+    public void draw(Graphics g){
+	int generator;          
+	int exponent;    
+	initCurrent();                                                       
+	initStrandColor();        
+	yPos=yUp;                                                           
+	int stop=0;                                                            
+	int indice=0;
+	if(!handleNormalDraw && handleType==1){
+	    drawHandle(g);
+	}
+	while(stop==0){
+	    if(getCurrent()==handleBegin){
+		onHandle=true;
+		originalHandleStrandColor=strandColor[handleStrand-1];
+		strandColor[handleStrand-1]=handleColor;
+	    }
+			
+	    generator=value();
+	    exponent=1;
+	    if(generator<0){  
+		exponent=-1;
+		generator=-generator;              
+	    }
+	    if(generator!=0){
+		drawCrossing(g,indice,strandNumber,generator,exponent);
+	    }
+	    else{
+		if(indice!=0 && indice!=length()){
+		    drawTrivial(g,indice,strandNumber,trivialHeight);
+		}
+		else{
+		    drawTrivial(g,indice,strandNumber,1);
+		}
+	    }
+	    if(getCurrent()==handleEnd){
+		onHandle=false;
+		strandColor[handleStrand-1]=originalHandleStrandColor;
+	    }
+	    if(isEnd()){    
+		stop=1;
+	    }
+	    else{
+		shift();
+	    }
+	    indice++;
+	}
+	drawTrivial(g,indice,strandNumber,1);
+	if(!handleNormalDraw && handleType==-1){
+	    drawHandle(g);
+	} 
+    }
+	
+    public void calcXPos(Graphics g,Rectangle r,int animationStep,float parameterAnimationStep2,float parameterAnimationStep4,float parameterAnimationStep5){  
+	g.setColor(Color.white);   
+	g.fillRect(0,0,r.width,r.height); 
+	strandStep=(float)Math.min((double)r.width/(double)(strandNumber+1),(double)r.height/((double)(length())-((double)1-(double)trivialHeight)*(double)trivialNumber));
+	strandWidth=strandStep/(float)5;
+	strandLeft=((float)r.width-((float)(strandNumber+1)*(float)strandStep+strandWidth))/(float)2;
+	yUp=(float)Math.max((double)0,(double)(r.height-(double)strandStep*((double)(length())-((double)1-(double)trivialHeight)*(double)trivialNumber))/(double)2);
+	int length=length();
+	xPos=new float[length+2][];
+	for(int i=0;i<length+2;i++){
+	    xPos[i]=new float[strandNumber];
+	    for(int j=0;j<strandNumber;j++){
+		xPos[i][j]=strandLeft+(j+1)*strandStep;
+	    }
+	}
+	int generator;
+	Node current;
+	if(handleStrand>0){
+	    if(animationStep>=2 && animationStep<=4){
+		for(int indice=handleBeginIndice+1;indice<=handleEndIndice;indice++){
+		    xPos[indice][handleStrand]+=(parameterAnimationStep2-1)*(float)strandStep;
+		}
+	    }
+	    if(animationStep==4){
+		current=handleBegin;
+		for(int indice=handleBeginIndice+1;indice<=handleEndIndice;indice++){
+		    xPos[indice][handleStrand-1]+=parameterAnimationStep4*(float)strandStep;
+		}
+		setCurrent(current);
+		shift();
+		for(int indice=handleBeginIndice+2;indice<handleEndIndice;indice++){
+		    generator=value();
+		    if(generator<0){
+			generator=-generator;
+		    }
+		    if(handleStrand>1 && generator==handleStrand-1){
+			xPos[indice-1][handleStrand-2]+=parameterAnimationStep4*(float)strandStep;
+			xPos[indice][handleStrand-2]+=parameterAnimationStep4*(float)strandStep;
+		    }
+		    shift();
+		}
+		
+	    }
+	    if(animationStep==5){
+		current=handleBegin;
+		setCurrent(current);
+		int currentStrand=handleStrand;
+		for(int indice=handleBeginIndice;indice<=handleEndIndice;indice++){
+		    generator=value();
+		    if(generator<0){
+			generator=-generator;
+		    }
+		    if(generator==currentStrand){
+			currentStrand++;
+		    }
+		    else if(generator==currentStrand-1){
+			currentStrand--;
+		    }
+		    if(handleStrand>1 && currentStrand==handleStrand-1){
+			xPos[indice+1][handleStrand-2]+=parameterAnimationStep5*(float)strandStep;
+		    }
+		    shift();
+		}
+	    }
+	}	
+    }
+	
+	
+    public String word(){
+	boolean stop;
+	int value;
+	String res="";
+	initCurrent();
+	stop=false;
+	while(!stop){
+	    value=value();
+	    if(value>0){
+		res+=(char)((value-1)+'a');
+	    }
+	    else if(value<0){
+		res+=(char)((-value-1)+'A');
+	    }
+	    if(isEnd()){
+		stop=true;
+	    }
+	    if(!stop){
+		shift();
+	    }
+	}
+	if(res==""){
+	    res="empty";
+	}
+	return res;
+    }
+	
+}

+ 453 - 0
Components.java

@@ -0,0 +1,453 @@
+/* File : Components.java
+ * Program : Handle Reduction Animation - Applet 
+ * By Jean Fromentin <jean.froment@gmail.com>
+ * Copyright 2000 Jean Fromentin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+import java.awt.Dimension;
+import java.awt.Insets;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.GridLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.AdjustmentEvent;
+import javax.swing.Action;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JDialog;
+import javax.swing.JRadioButton;
+import javax.swing.JPanel;
+import javax.swing.JLabel;
+import javax.swing.JTextField;
+import javax.swing.JOptionPane;
+import javax.swing.JScrollBar;
+import javax.swing.ButtonGroup;
+import javax.swing.Timer;
+
+
+public class Components extends JPanel{
+    private HandleReductionPanel handleReductionPanel;
+    private JButton draw,compare,reduce,controls,controlsApply,controlsCancel;
+    private JRadioButton continuous,stepByStep;
+    private JTextField wordField,firstWordField,secondWordField;
+    private JScrollBar delayScrollBar;
+    private int pauseDelay,newPauseDelay;
+    private JLabel wordLabel,delayLabel;
+    private JDialog controlsFrame,compareFrame,drawFrame;
+    private Listener listener;
+    private Timer animationTimer;
+    private Boolean reducing,continuousAnimation,comparing;
+    private String word,word1,word2;
+
+    public Components(){
+	handleReductionPanel=new HandleReductionPanel();
+	draw=new JButton("Draw");
+	compare=new JButton("Compare");
+	reduce=new JButton("Reduce");
+	controls=new JButton("Controls");
+	wordLabel=new JLabel("Empty word");
+	    
+	//Layout
+	setLayout(new BorderLayout());
+	add(wordLabel,BorderLayout.NORTH);
+	add(handleReductionPanel,BorderLayout.CENTER);
+	JPanel buttonPanel=new JPanel();
+       	add(buttonPanel,BorderLayout.SOUTH);
+	buttonPanel.setLayout(new FlowLayout());
+	buttonPanel.add(draw);
+	buttonPanel.add(compare);
+	buttonPanel.add(reduce);
+	buttonPanel.add(controls);
+	
+	//Action listenner
+	listener=new Listener(this);
+	draw.addActionListener(listener);
+	compare.addActionListener(listener);
+	reduce.addActionListener(listener);
+	controls.addActionListener(listener);
+
+	//Action command
+	draw.setActionCommand("draw");
+	compare.setActionCommand("compare");
+	reduce.setActionCommand("reduce");
+	controls.setActionCommand("controls");
+
+	//States
+	reducing=false;
+	comparing=false;
+	continuousAnimation=true;
+	reduce.setEnabled(false);
+	pauseDelay=10;
+	createTimer();
+
+    }
+    //Buttons state
+    public void setButtonsState(Boolean drawState,Boolean compareState,Boolean reduceState,Boolean controlsState){
+	draw.setEnabled(drawState);
+	compare.setEnabled(compareState);
+	reduce.setEnabled(reduceState);
+	controls.setEnabled(controlsState);
+    }
+
+    //Actions
+
+    public void updateWord(){
+	wordLabel.setText("Current word : "+handleReductionPanel.getCurrentWord());
+	wordLabel.updateUI();
+    }
+
+    public void draw(){
+	drawFrame=new JDialog();
+	drawFrame.setResizable(false);
+	drawFrame.setTitle("Draw braid");
+	
+	//First word
+	JLabel wordLabel=new JLabel(" Braid word : ");
+	wordField=new JTextField();
+	wordField.setPreferredSize(new Dimension(200, 28));
+
+	//Buttons 
+	JButton drawCancel,drawApply;
+	drawCancel=new JButton("Cancel");
+	drawApply=new JButton("Draw");
+	
+	//Action listenner
+	drawCancel.addActionListener(listener);
+	drawApply.addActionListener(listener);
+	
+	//Action command
+	drawCancel.setActionCommand("drawCancel");
+	drawApply.setActionCommand("drawApply");
+	
+	//Layout
+	GridBagLayout gb=new GridBagLayout();
+	GridBagConstraints gbc=new GridBagConstraints();
+	drawFrame.setLayout(gb);
+	gbc.anchor = GridBagConstraints.EAST;
+	gbc.insets = new Insets(5, 5, 5, 5);
+	gbc.gridx=0;
+	gbc.gridy=0;
+	gbc.gridwidth=1;
+	gb.setConstraints(wordLabel,gbc);
+	drawFrame.add(wordLabel);
+	gbc.gridx=1;
+	gbc.gridy=0;
+	gbc.gridwidth=2;
+	gb.setConstraints(wordField,gbc);
+	drawFrame.add(wordField);
+	gbc.gridx=1;
+	gbc.gridy=1;
+	gbc.gridwidth=1;
+	gb.setConstraints(drawCancel,gbc);
+	drawFrame.add(drawCancel);
+	gbc.gridx=2;
+	gbc.gridy=1;
+	gbc.gridwidth=1;
+	gb.setConstraints(drawApply,gbc);
+	drawFrame.add(drawApply);
+	
+	drawFrame.pack();
+	drawFrame.setVisible(true);
+
+	/*JOptionPane dialog = new JOptionPane();
+	String word = dialog.showInputDialog(this,"Enter the braid word to draw :");
+	handleReductionPanel.writeBraidWord(word);
+	updateWord();
+	setButtonsState(true,true,true,true);
+	reduce.setText("Reduce");
+	reduce.updateUI();*/	
+    }
+
+    public void drawBraid(){
+	word=wordField.getText();
+	comparing=false;
+	handleReductionPanel.writeBraidWord(word);
+	updateWord();
+	setButtonsState(true,true,true,true);
+	reduce.setText("Reduce");
+	reduce.updateUI();
+    }
+
+    public void closeDraw(){
+	drawFrame.dispose();
+    }
+    public void reduce(){
+	if(reducing){
+	    animationTimer.stop();
+	    reducing=false;
+	    setButtonsState(true,true,true,true);
+	    reduce.setText("Continue");
+	    reduce.updateUI();
+	}
+	else{
+	    reducing=true;
+	    setButtonsState(false,false,true,false);
+	    reduce.setText("Pause");
+	    reduce.updateUI();
+	    animationTimer.start();
+	}
+    }
+
+    public void controls(){
+       	controlsFrame=new JDialog();
+	controlsFrame.setResizable(false);
+	controlsFrame.setTitle("Controls");
+
+	//Animation mode
+	JLabel modeLabel=new JLabel("  Animation : ");
+	continuous=new JRadioButton("Continuous",continuousAnimation);
+	stepByStep=new JRadioButton("Step-by-step",!continuousAnimation);
+	ButtonGroup group = new ButtonGroup();
+	group.add(continuous);
+	group.add(stepByStep);
+	
+	//Pause delay
+	newPauseDelay=pauseDelay;
+	JLabel pauseLabel=new JLabel("  Pause delay : ");
+	delayLabel=new JLabel("  "+newPauseDelay+" ms ");
+	delayScrollBar=new JScrollBar(JScrollBar.HORIZONTAL,newPauseDelay,1,0,100);
+	delayScrollBar.setPreferredSize(new Dimension(150,20));
+	//Buttons
+	controlsApply=new JButton("Apply");
+	controlsCancel=new JButton("Cancel");
+	
+
+	//Layout
+	GridBagLayout gb=new GridBagLayout();
+	GridBagConstraints gbc=new GridBagConstraints();
+	controlsFrame.setLayout(gb);
+	gbc.anchor = GridBagConstraints.WEST;
+	gbc.insets = new Insets(5, 5, 5, 5);
+	gbc.gridx=0;
+	gbc.gridy=0;
+	gbc.gridwidth=1;
+	gb.setConstraints(pauseLabel,gbc);
+	controlsFrame.add(pauseLabel);
+	gbc.gridx=1;
+	gbc.gridy=0;
+	gbc.gridwidth=2;
+	gb.setConstraints(delayScrollBar,gbc);
+	controlsFrame.add(delayScrollBar);
+	gbc.gridx=3;
+	gbc.gridy=0;
+	gbc.gridwidth=1;
+	gb.setConstraints(delayLabel,gbc);
+	controlsFrame.add(delayLabel);
+	gbc.gridx=0;
+	gbc.gridy=1;
+	gbc.gridwidth=1;
+	gb.setConstraints(modeLabel,gbc);
+	controlsFrame.add(modeLabel);
+	gbc.gridx=1;
+	gbc.gridy=1;
+	gbc.gridwidth=2;
+	gb.setConstraints(continuous,gbc);
+	controlsFrame.add(continuous);
+	gbc.gridx=1;
+	gbc.gridy=2;
+	gbc.gridwidth=2;
+	gb.setConstraints(stepByStep,gbc);
+	controlsFrame.add(stepByStep);
+	gbc.anchor = GridBagConstraints.EAST;
+
+	gbc.gridx=2;
+	gbc.gridy=3;
+	gbc.gridwidth=1;
+	gb.setConstraints(controlsCancel,gbc);
+	controlsFrame.add(controlsCancel);
+	gbc.gridx=3;
+	gbc.gridy=3;
+	gbc.gridwidth=1;
+	gb.setConstraints(controlsApply,gbc);
+	controlsFrame.add(controlsApply);
+
+	//Action listenner
+	controlsApply.addActionListener(listener);
+	controlsCancel.addActionListener(listener);
+	delayScrollBar.addAdjustmentListener(listener);
+	
+	//Action command
+	controlsApply.setActionCommand("controlsApply");
+	controlsCancel.setActionCommand("controlsCancel");
+	
+	//Active frame
+	controlsFrame.pack();
+	controlsFrame.setVisible(true);
+    }
+    
+    public void delayAdjust(){
+	newPauseDelay=delayScrollBar.getValue();
+	delayLabel.setText("  "+newPauseDelay+" ms ");
+	delayLabel.updateUI();
+    }
+
+    public void saveParameters(){
+	continuousAnimation=continuous.isSelected();
+	pauseDelay=newPauseDelay;
+	animationTimer.setDelay(pauseDelay);
+    }
+    
+    public void closeControls(){
+	controlsFrame.dispose();
+    }
+
+    public void compare(){
+	compareFrame=new JDialog();
+	compareFrame.setResizable(false);
+	compareFrame.setTitle("Compare braids");
+	
+	//First word
+	JLabel firstWordLabel=new JLabel(" First braid word : ");
+	firstWordField=new JTextField();
+	firstWordField.setPreferredSize(new Dimension(200, 28));
+
+	//Second word
+	JLabel secondWordLabel=new JLabel(" Second braid word : ");
+	secondWordField=new JTextField();
+	secondWordField.setPreferredSize(new Dimension(200, 28));
+
+	//Buttons 
+	JButton compareCancel,compareApply;
+	compareCancel=new JButton("Cancel");
+	compareApply=new JButton("Compare");
+	
+	//Action listenner
+	compareCancel.addActionListener(listener);
+	compareApply.addActionListener(listener);
+	
+	//Action command
+	compareCancel.setActionCommand("compareCancel");
+	compareApply.setActionCommand("compareApply");
+	
+	//Layout
+	GridBagLayout gb=new GridBagLayout();
+	GridBagConstraints gbc=new GridBagConstraints();
+	compareFrame.setLayout(gb);
+	gbc.anchor = GridBagConstraints.EAST;
+	gbc.insets = new Insets(5, 5, 5, 5);
+	gbc.gridx=0;
+	gbc.gridy=0;
+	gbc.gridwidth=1;
+	gb.setConstraints(firstWordLabel,gbc);
+	compareFrame.add(firstWordLabel);
+	gbc.gridx=1;
+	gbc.gridy=0;
+	gbc.gridwidth=2;
+	gb.setConstraints(firstWordField,gbc);
+	compareFrame.add(firstWordField);
+	gbc.gridx=0;
+	gbc.gridy=1;
+	gbc.gridwidth=1;
+	gb.setConstraints(secondWordLabel,gbc);
+	compareFrame.add(secondWordLabel);
+	gbc.gridx=1;
+	gbc.gridy=1;
+	gbc.gridwidth=2;
+	gb.setConstraints(secondWordField,gbc);
+	compareFrame.add(secondWordField);
+	gbc.gridx=1;
+	gbc.gridy=2;
+	gbc.gridwidth=1;
+	gb.setConstraints(compareCancel,gbc);
+	compareFrame.add(compareCancel);
+	gbc.gridx=2;
+	gbc.gridy=2;
+	gbc.gridwidth=1;
+	gb.setConstraints(compareApply,gbc);
+	compareFrame.add(compareApply);
+	
+	compareFrame.pack();
+	compareFrame.setVisible(true);	
+    }
+
+    public void compareBraids(){
+	word1=firstWordField.getText();
+	word2=secondWordField.getText();
+	System.out.println(word1+"/"+word2);
+	word=word1;
+	char l;
+	for(int i=word2.length()-1;i>=0;i--){
+	    l=word2.charAt(i);
+	    if('a'<=word2.charAt(i) && word2.charAt(i)<='z'){
+		l=(char)((int)l-(int)'a'+(int)'A');
+	    }
+	    else if('A'<=word2.charAt(i) && word2.charAt(i)<='Z'){
+		l=(char)((int)l-(int)'A'+(int)'a');	    }
+	    word+=l;
+	}
+	handleReductionPanel.writeBraidWord(word);
+	comparing=true;
+	updateWord();
+	setButtonsState(true,true,true,true);
+	reduce.setText("Reduce");
+	reduce.updateUI();
+    }
+
+    public void closeCompare(){
+	compareFrame.dispose();
+    }
+
+    //Timer
+    public void createTimer(){
+	if(animationTimer!=null){
+	    animationTimer.stop();
+	}
+	animationTimer=new Timer(pauseDelay,listener);
+	animationTimer.setActionCommand("tic");
+    }
+
+    public void tic(){
+	handleReductionPanel.refresh();
+	int state=handleReductionPanel.reduce();
+	if(state==2){
+	    updateWord();
+	    if(!continuousAnimation){
+		reduce();
+	    }
+	}
+	else if(state==0){
+	    animationTimer.stop();
+	    reducing=false;
+	    setButtonsState(true,true,false,true);
+	    String finalWord=handleReductionPanel.getCurrentWord();
+	    String message;
+	    int ind=handleReductionPanel.braidDrawing.indice();
+	    if(!comparing){
+		if(finalWord.equals("Empty")){
+		     message="The final word is empty, so your initial braid word \n"+word+" is trivial.";
+		}
+		else{
+		     message="There is no more handle and the final word is nonempty,\nso your initial braid word "+word+" is not trivial.";
+		}
+	    }
+	    else{
+		if(ind==0){
+		    message="The final word is empty,\nso your initial braid words "+word1+" and "+word2+" are equivalent.";
+		}
+		else{
+		    message="There is no more handle and the final word is nonempty,\nso your initial braid words "+word1+" and "+word2+" are not equivalent.";
+		}
+
+	    }
+	    JOptionPane.showMessageDialog(null,message);
+	    reduce.setText("Reduce");
+	    reduce.updateUI();
+	}
+    }
+}
+
+

+ 11 - 0
HandleReductionApplet.java

@@ -0,0 +1,11 @@
+import javax.swing.JApplet;
+
+public class HandleReductionApplet extends JApplet{
+
+    public void init(){
+	setContentPane(new Components());
+    }
+  
+
+
+}

+ 15 - 0
HandleReductionMain.java

@@ -0,0 +1,15 @@
+import java.awt.Color;
+import javax.swing.JFrame;
+
+
+public class HandleReductionMain{
+    public static void main(String args[]) {
+	JFrame  handleFrame= new JFrame(); 
+	handleFrame.setTitle("Handle reduction");
+	handleFrame.setBackground(Color.white);
+	handleFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+	handleFrame.setContentPane(new Components());
+	handleFrame.setSize(1000,900);
+	handleFrame.setVisible(true);
+    }
+}

+ 190 - 0
HandleReductionPanel.java

@@ -0,0 +1,190 @@
+/* File : HandleReductionPanel.java
+ * Program : Handle Reduction Aimation - Applet 
+ * By Jean Fromentin <jfroment@info.unicaen.fr>
+ * Copyright 2008 Jean Fromentin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Image;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+
+public class HandleReductionPanel extends JPanel {
+    private JLabel currentBraidWord;
+    private String braidWord="";   
+    private boolean braidWordSet=false;
+    public BraidDrawing braidDrawing; 
+    public String currentWord="";
+    public boolean working=false;
+    private int animationStep;
+    private float parameterAnimationStep2=1;
+    private float parameterAnimationStep4;
+    private float parameterAnimationStep5;
+    private boolean continuousAnimation=true;
+    private Image offScreenBuffer; 
+
+	
+    public HandleReductionPanel(){
+	setBackground(new Color(220,220,220));
+	setVisible(true);
+    }
+	
+    public void add(char c){
+	braidWord+=c;
+	writeBraidWord(braidWord);
+    }
+	
+    public void remove(){
+	if(braidWord.length()!=0){
+	    braidWord=braidWord.substring(0,braidWord.length()-1);
+	    writeBraidWord(braidWord);
+	}
+    }
+	
+    public void clear(){
+	braidWord="";
+	writeBraidWord(braidWord);
+    }
+	
+    public void writeBraidWord(String buffer){
+	braidWord=buffer;
+	braidDrawing=new BraidDrawing(braidWord);
+	animationStep=0;
+	updateCurrentBraidWord();
+	braidWordSet=true;
+	update(getGraphics());
+    }
+
+    public void updateCurrentBraidWord(){
+	currentWord=braidDrawing.word();
+    }
+
+    public String getCurrentWord(){
+	return braidWord;
+    }
+	
+    public void paint(Graphics g){
+	if(!braidDrawing.isDraw){
+	    update(g);
+	    braidDrawing.isDraw=true;
+	}
+	else{
+	    g.drawImage(offScreenBuffer,0,0,this);
+	}
+    }
+	
+    public void refresh(){
+	update(getGraphics());
+    }
+	
+    public void update(Graphics g) {
+	if(braidWordSet){
+	    Graphics gr;
+	    if (offScreenBuffer==null||(!(offScreenBuffer.getWidth(this)==getBounds().width && offScreenBuffer.getHeight(this)==getBounds().height))){
+		offScreenBuffer=createImage(getBounds().width,getBounds().height);
+	    }
+	    gr=offScreenBuffer.getGraphics();
+	    braidDrawing.calcXPos(gr,getBounds(),animationStep,parameterAnimationStep2,parameterAnimationStep4,parameterAnimationStep5);
+	    braidDrawing.draw(gr); 
+	    g.drawImage(offScreenBuffer,0,0,this);
+	}
+    }
+	
+    public int reduce(){
+	if(!braidWordSet){
+	    JOptionPane.showMessageDialog(null,"Vous devez d'abord saisir un mot de tresse ","Erreur",JOptionPane.ERROR_MESSAGE);
+	    return 0;
+	}
+	else if(animationStep==0){	
+	    braidDrawing.handleNormalDraw=true;
+	    braidDrawing.findHandle();
+	    if(braidDrawing.handleStrand==0){
+		return 0;
+	    }
+	    braidDrawing.firstDraw=true;
+	    braidDrawing.insertTrivials();
+	    braidDrawing.trivialHeight=0;
+	    animationStep=1;
+	}
+	else if(animationStep==1){
+	    if(braidDrawing.trivialHeight>=1){
+		braidDrawing.trivialHeight=1;
+		parameterAnimationStep2=1;	    
+		animationStep=2;
+	    }
+	    else{
+		braidDrawing.trivialHeight+=0.1;
+	    }
+	}
+	else if(animationStep==2){
+	    braidDrawing.handleNormalDraw=false;
+	    if(parameterAnimationStep2<0){
+		parameterAnimationStep2=0;
+		animationStep=3;
+	    }
+	    else{
+		parameterAnimationStep2-=(float)(0.05);
+	    }
+	}
+	else if(animationStep==3){
+	    parameterAnimationStep4=0;
+	    animationStep=4;
+	}
+	else if(animationStep==4){
+	    if(parameterAnimationStep4>=1){
+		braidDrawing.removeHandle();
+		parameterAnimationStep2=1;
+		parameterAnimationStep5=1;
+		animationStep=5;
+	    }
+	    else{
+		parameterAnimationStep4+=(float)0.05;
+	    }
+	}
+	else if(animationStep==5){
+	    if(parameterAnimationStep5<=0){
+		parameterAnimationStep5=0;
+		animationStep=6;
+	    }
+	    else{
+		parameterAnimationStep5-=(float)0.05;
+	    }
+	}
+	else if(animationStep==6){
+	    if(braidDrawing.trivialHeight<=0){
+		braidDrawing.trivialHeight=0;
+		animationStep=7;
+	    }
+	    else{
+		braidDrawing.trivialHeight-=0.1;
+	    }
+	}
+	else if(animationStep==7){
+	    braidDrawing.removeTrivials();
+	    braidDrawing.handleNormalDraw=true;
+	    braidDrawing.handleStrand=0;
+	    animationStep=0;
+	    braidDrawing.handleBeginIndice=0;
+	    braidDrawing.handleEndIndice=0;
+	    return 2;
+	}
+	else{
+	    return 0;
+	}
+	braidWord=braidDrawing.word();
+	return 1;
+    }
+}

+ 149 - 0
List.java

@@ -0,0 +1,149 @@
+/* File : List.java
+ * Program : Handle Reduction Aimation - Applet 
+ * By Jean Fromentin <jfroment@info.unicaen.fr>
+ * Copyright 2008 Jean Fromentin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+class List {
+    private Node first;
+    private Node last;
+    public Node current;  
+    public int length;
+    
+    public List(){
+	length=0;
+    }
+    
+    public Node getFirst(){
+	return first;
+    }	
+    
+    public Node getLast(){
+	return last;
+    }
+	
+    public void initCurrent(){
+	current=first;
+    }
+    
+    public void setCurrent(Node _current){
+	current=_current;
+    }
+    
+    public Node getCurrent(){
+	return current;
+    }
+    
+    public boolean isEnd(){
+	return current==last;
+    }
+	
+    public void shift(){
+	current=current.getNext();
+    }
+	
+    public void addFirst(int value){
+	Node node=new Node(value);
+	if(length==0){
+	    first=node;
+	    last=node;
+	}
+	else{
+	    first.setPrevious(node);
+	    node.setNext(first);
+	    first=node;
+	}
+	length++;
+    }
+	
+    public void addLast(int value){
+	Node node=new Node(value);
+	if(length==0){
+	    first=node;
+	    last=node;
+	}
+	else{
+	    last.setNext(node);
+	    node.setPrevious(last);
+	    last=node;
+	}
+	length++;
+    }
+    
+    public Node addBefore(int value){
+	Node node=new Node(value);
+	if(current==first){
+	    first=node;
+	    node.setNext(current);
+	    current.setPrevious(node);
+	}
+	else {
+	    Node temp=current.getPrevious();
+	    temp.setNext(node);
+	    node.setPrevious(temp);
+	    current.setPrevious(node);
+	    node.setNext(current);
+	}
+	length++;
+	return node;
+    }
+    
+    public Node addAfter(int value){
+	Node node=new Node(value);
+	if(current==last){
+	    last=node;
+	    node.setPrevious(current);
+	    current.setNext(node);
+	}
+	else{
+	    Node temp=current.getNext();
+	    temp.setPrevious(node);
+	    node.setNext(temp);
+	    current.setNext(node);
+	    node.setPrevious(current);
+	}
+	length++;
+	return node;
+    }
+	
+    public void remove(Node node){
+	if(length!=0){
+	    if(length==1){
+		length=0;
+	    }
+	    else{
+		if(node==first){
+		    first=node.getNext();
+		    node=first;
+		}
+		else if(node==last){
+		    last=node.getPrevious();
+		    current=last;
+		}
+		else{
+		    (node.getPrevious()).setNext(node.getNext());
+		    (node.getNext()).setPrevious(node.getPrevious());
+		}
+		length--;
+	    }
+	}
+    }
+    
+    public int value(){
+	return current.getValue();
+    }
+	
+    public int length(){
+	return length;
+    }
+}

+ 77 - 0
Listener.java

@@ -0,0 +1,77 @@
+/* File : Listener.java
+ * Program : Handle Reduction Aimation - Applet 
+ * By Jean Fromentin <jfroment@info.unicaen.fr>
+ * Copyright 2008 Jean Fromentin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+import java.awt.event.ActionListener;
+import java.awt.event.AdjustmentListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.AdjustmentEvent;
+
+
+public class Listener implements ActionListener, AdjustmentListener{
+    private Components components;
+    
+    public Listener(Components components){
+	this.components=components;
+    }
+    
+    public void actionPerformed(ActionEvent event){
+	String action=event.getActionCommand();
+	if(action.equals("draw")){
+	    components.draw();
+	}
+	else if(action.equals("drawApply")){
+	    components.drawBraid();
+	    components.closeDraw();
+	}
+	else if(action.equals("drawCancel")){
+	    components.closeDraw();
+	}
+	else if(action.equals("reduce")){
+	    components.reduce();
+	}
+	else if(action.equals("controls")){
+	    components.controls();
+	}
+	else if(action.equals("compare")){
+	    components.compare();
+	}
+	else if(action.equals("compareApply")){
+	    components.compareBraids();
+	    components.closeCompare();
+	}
+	else if(action.equals("compareClose")){
+	    components.closeCompare();
+	}
+	else if(action.equals("controlsApply")){
+	    components.saveParameters();
+	    components.closeControls();
+	}
+	else if(action.equals("controlsCancel")){
+	    components.closeControls();
+	}
+	else if(action.equals("tic")){
+	    components.tic();
+	}
+	else{
+	    System.out.println(action);
+	}
+    }
+
+    public void adjustmentValueChanged(AdjustmentEvent event){
+	components.delayAdjust();
+    }
+
+}

+ 53 - 0
Node.java

@@ -0,0 +1,53 @@
+/* File : Node.java
+ * Program : Handle Reduction Aimation - Applet 
+ * By Jean Fromentin <jfroment@info.unicaen.fr>
+ * Copyright 2008 Jean Fromentin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+class Node {
+    private int value;     
+	private Node next;
+	private Node previous;
+    
+    public Node(){
+		value=0;
+    }
+    
+    public Node(int _value){
+		value=_value;
+    }
+    
+    public void setValue(int _value){
+		value=_value;
+    }
+	
+    public void setPrevious(Node _previous){
+		previous=_previous;
+    }
+    
+    public void setNext(Node _next){
+		next=_next;
+    }
+	
+    public int getValue(){
+		return value;
+    }
+    
+    public Node getPrevious(){
+		return previous;
+    }
+    
+    public Node getNext(){
+		return next;
+    }
+}

+ 17 - 0
handleApplet.html

@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+   "http://www.w3.org/TR/html4/strict.dtd">
+
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <link rel="stylesheet" href="english.css" type="text/css" media="screen" title="Simple">
+<title>Handle Reduction : Java Applet</title>
+  </head>
+
+<body> 
+
+<div class="applet">
+  <applet code="HandleReductionApplet.class" codebase="applet/" height="600" width="800">
+</div>
+
+</body></html>

BIN
img/sample1.png


BIN
img/sample2.png


BIN
img/sample3.png


BIN
img/sample4.png


BIN
img/sigma.png


BIN
img/sigma1.png


+ 97 - 0
img/sigma1.svg

@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="134"
+   height="61"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docname="sigma1.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.4"
+     inkscape:cx="375"
+     inkscape:cy="520"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:object-paths="true"
+     inkscape:object-nodes="true"
+     objecttolerance="50"
+     gridtolerance="50"
+     guidetolerance="50"
+     inkscape:window-width="640"
+     inkscape:window-height="701"
+     inkscape:window-x="20"
+     inkscape:window-y="42">
+    <inkscape:grid
+       type="xygrid"
+       id="grid2383"
+       visible="true"
+       enabled="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Calque 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-209.5,-461.86218)">
+    <path
+       style="fill:#00ffff;fill-opacity:1;fill-rule:evenodd;stroke:#00ffff;stroke-width:7;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 260,472.36218 C 260,492.36218 220,492.36218 220,512.36218"
+       id="path2387"
+       sodipodi:nodetypes="cc" />
+    <path
+       style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#80ff00;stroke-width:7;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 300,472.36218 L 300,512.36218"
+       id="path2389" />
+    <path
+       style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:7;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 340,472.36218 L 340,512.36218"
+       id="path2391" />
+    <path
+       style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:21;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 220,472.36218 C 220,492.36218 260,492.36218 260,512.36218"
+       id="path3163"
+       sodipodi:nodetypes="cc" />
+    <path
+       style="fill:#8000ff;fill-opacity:1;fill-rule:evenodd;stroke:#8000ff;stroke-width:7;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 220,472.36218 C 220,492.36218 260,492.36218 260,512.36218"
+       id="path2385"
+       sodipodi:nodetypes="cc" />
+  </g>
+</svg>

BIN
img/sigma1inv.png


BIN
img/sigma2.png


BIN
img/sigma2inv.png


BIN
img/sigma3.png


BIN
img/sigma3inv.png