Comunidad de diseño web y desarrollo en internet online

Crear diagrama de flujo

Citar            
MensajeEscrito el 23 May 2005 06:29 pm
Hola Amigos,
Necesito crear un Diagrama de flujo diamico en flash ("Asp y BD"),los campos que se relacionan con cada uno estan en una tabla
Me podrian indicar como unir un cuadro con otro haciendo el quiebre necesario, osea no ir directamente de punto a punto si no que vaya por ejemplo
Linea vertical y luego horizontal hasta el cuadro necesario

O un ejemplo mejor:
Un Diagrama Entidad Relacion de SQL

No se si me explique bien.

Si tienen ejemplos muchas gracias

Por vicman

46 de clabLevel



 

firefox
Citar            
MensajeEscrito el 28 May 2005 07:07 am
quieres dibujar las lineas??
"MovieClip.lineTo" en la ayuda.

si no es eso, pos no entendí :?

Por Acidbjazz

716 de clabLevel



Genero:Masculino  

Lima - Perú

firefox
Citar            
MensajeEscrito el 28 May 2005 06:30 pm
Aca te va un código programe hace 2 años para ello. Incluso toma la angulación entre los puntos :

Código :

// ////////////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////Clase Arrow To///////////////////////////////////////////
// ////////////////////////////Programado Por Hernan Fernandez////////////////////////////////
// /////////////////////////////////////////2003//////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////////
ArrowTo = function (x, y, x2, y2, id) { var offset = 0.000000001;this.x = x+offset;this.y = y+offset;this.x2 = x2+offset;this.y2 = y2+offset;this.id = id;this.stroke = 1;this.rgb = 0x00000;this.alpha = 100;this.Clean();this.Draw(this.stroke, this.rgb, this.alpha);this.render();};
// ////////////////////////////////Metodos Principales///////////////////////////////////////////
// Calculo de la longitud de la flecha
ArrowTo.prototype.Dist = function() {
    var x = this.x2-this.x;
    var y = this.y2-this.y;
    return Math.sqrt(x*x+y*y);
};
// Calculo angulo flecha
ArrowTo.prototype.Ang = function() {
    var x = this.x2-this.x;
    var y = this.y2-this.y;
    if (this.x == 0) {
        return (Math.atan2(y, x)*(180/Math.PI))-90;
    } else {
        return Math.atan2(y, x)*(180/Math.PI);
    }
};
// Dibujo de la flecha
ArrowTo.prototype.Draw = function(a, b, c) {
    with (eval(this.id)) {
        var x2 = this.Dist();
        lineStyle(a, b, c);
        lineTo(x2, 0);
        lineTo(x2, -10);
        lineTo(x2+10, 0);
        lineTo(x2, 10);
        lineTo(x2, 0);
    }
};
// Representacion de la flecha en escenario
ArrowTo.prototype.render = function() {
    var angulo = this.Ang();
    with (eval(this.id)) {
        _x = this.x;
        _y = this.y;
        _rotation = angulo;
    }
};
// ////////////////////////////////Metodos Secundarios//////////////////////////////////////////
// Seteo del alpha de la flecha
ArrowTo.prototype.setAlpha = function(a) {
    this.Clean();
    this.alpha = a;
    this.Draw(this.stroke, this.rgb, this.alpha);
};
// Seteo del color de la flecha
ArrowTo.prototype.setCol = function(a) {
    this.Clean();
    this.rgb = a;
    this.Draw(this.stroke, this.rgb, this.alpha);
};
// Seteo del grosor de la flecha
ArrowTo.prototype.setStroke = function(s) {
    this.Clean();
    this.stroke = s;
    this.Draw(this.stroke, this.rgb, this.alpha);
};
// Seteo de todo el lineStyle de la flecha
ArrowTo.prototype.setLineStyle = function(a, b, c) {
    this.Clean();
    this.stroke = a;
    this.rgb = b;
    this.alpha = c;
    this.Draw(this.stroke, this.rgb, this.alpha);
};
// Borrado de la flecha
ArrowTo.prototype.Clean = function() {
    with (eval(this.id)) {
        clear();
    }
};
// /////////////////////////////////////////////////////////////////////////////////////////////
trace(">>__Clase ArrowTo() Cargado__<<");
// /////////////////////////////////////////////////////////////////////////////////////////////



Esto hace lo mismo pero "quebrando" la línea en una línea entre cortada :

Código :

/////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////ArrowToPts Class////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////Metodos Privados//////////////////////////////////////////////////
//Distancia entre puntos
Math.Dist = function(id) {
   var x = id.x2-id.x, y = id.y2-id.y;
   return Math.sqrt(x*x+y*y);
};
//Angulo de la flecha
Math.Ang = function(id) {
   var x = id.x2-id.x, y = id.y2-id.y;
   return Math.atan2(y, x)*(180/Math.PI);
};
//Constructor de la flecha
ArrowToPts = function (x, y, x2, y2, id) {
   this.x=x, this.y=y, this.x2=x2, this.y2=y2, this.id=id, this.rgb=0x000000, this.stroke=1, this.alpha=100;
   this.draw(this.stroke, this.rgb, this.alpha);
};
//Referencia al objeto Prototype
ATP = ArrowToPts.prototype;
//Dibujo principal de la flecha
ATP.draw = function(s, r, a) {
   this.clean();
   var cant = 10, div = Math.Dist(this);
   with (eval(this.id)) {
      lineStyle(s, r, a);
      moveTo(0, 0);
      for (var i = 1; i<div/cant; i += 2) {
         lineTo(i*10, 0);
         moveTo((i+1)*10, 0);
      }
      this.punta(s, r, a);
   }
};
//Dibujo Secundario, punta de la flecha
ATP.punta = function(s, r, a, d) {
   var x = Math.Dist(this), y = 0;
   with (eval(this.id)) {
      if (d == undefined) {
         lineStyle(s, r, a);
         moveTo(x, y), lineTo(x, y+10), lineTo(x+10, y), lineTo(x, y-10), lineTo(x, y);
      } else {
         lineStyle(s, r, a);
         beginFill(d, a);
         moveTo(x, y), lineTo(x, y+10), lineTo(x+10, y), lineTo(x, y-10), lineTo(x, y);
         endFill();
      }
   }
   this.pos();
};
//Posicionamiento de la flecha
ATP.pos = function() {
   var angulo = Math.Ang(this);
   with (eval(this.id)) {
      _rotation = angulo;
      _x = this.x;
      _y = this.y;
   }
};
//Borrado de la flecha
ATP.clean = function() {
   with (eval(this.id)) {
      clear();
   }
};
////////////////////////////////////////Metodos Publicos/////////////////////////////////////////////////
//Grosor de la flecha
ATP.setStroke = function(s) {
   this.stroke = s;
   this.draw(this.stroke, this.rgb, this.alpha);
};
//Transparencia de la flecha
ATP.setRGB2 = function(r) {
   this.rgb = r;
   this.draw(this.stroke, this.rgb, this.alpha);
};
//Color de la flecha
ATP.setAlpha = function(a) {
   this.alpha = a;
   this.draw(this.stroke, this.rgb, this.alpha);
};
//Setea las tres propiedades basicas de la linea
ATP.setLineStyle = function(s, r, a) {
   this.alpha=a, this.stroke=s, this.rgb=r;
   this.draw(this.stroke, this.rgb, this.alpha);
};
//Pinta o cambia la punta
ATP.setPunta = function(s, r, a) {
   this.punta(s, r, a);
};
trace(">>ArrowToPts Loaded<<");
/////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////Hernan Matias Fernandez///////////////////////////////////////////
//////////////////////////////////////////////2003///////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////



Son clases con metodos y propiedades, solo lee el código no es nada difícil [ quizás el calculo de angulo te complique pero no tienes porque entenderlo eso es un metodo privado ]

Salu2, Hernán . -

Por Hernán

BOFH

6148 de clabLevel

19 tutoriales
23 articulos

Genero:Masculino   REC Desarrollador de GAIA

Marketing & IT

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.