Back to index

wims  3.65+svn20090927
Public Member Functions | Package Functions | Package Attributes
Arrow Class Reference
Inheritance diagram for Arrow:
Inheritance graph
[legend]
Collaboration diagram for Arrow:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void yield ()
void yield ()
boolean down (int _x, int _y)
boolean down (int _x, int _y)
boolean up (int _x, int _y)
boolean up (int _x, int _y)
boolean drag (int _x, int _y)
boolean drag (int _x, int _y)
boolean key (int key)
boolean key (int key)

Package Functions

 Arrow ()
 Arrow (StringTokenizer tok) throws Exception
void draw (Graphics g)
String describe ()
String specify_text ()
int specify_text_x ()
int specify_text_y ()
int specify_line_x1 ()
int specify_line_y1 ()
int specify_line_x2 ()
int specify_line_y2 ()
 Arrow ()
 Arrow (StringTokenizer tok) throws Exception
void draw (Graphics g)
String describe ()
String specify_text ()
int specify_text_x ()
int specify_text_y ()
int specify_line_x1 ()
int specify_line_y1 ()
int specify_line_x2 ()
int specify_line_y2 ()
double distance (int _x, int _y)
double distance (int _x, int _y)
void create ()
void create ()
void destroy ()
void destroy ()
void move ()
void move ()

Package Attributes

Diagram diagram
int state
final int NONE = 0
final int CREATE = 1
final int MOVE = 2
int x
int y
int w
int h
int movex
int movey

Detailed Description

Definition at line 978 of file KansBoom.java.


Constructor & Destructor Documentation

Arrow.Arrow ( ) [inline, package]

Definition at line 979 of file KansBoom.java.

{super();}
Arrow.Arrow ( StringTokenizer  tok) throws Exception [inline, package]

Definition at line 980 of file KansBoom.java.

{ super(tok);}
Arrow.Arrow ( ) [inline, package]

Definition at line 879 of file VrijeInvulVeld.java.

{super();}
Arrow.Arrow ( StringTokenizer  tok) throws Exception [inline, package]

Definition at line 880 of file VrijeInvulVeld.java.

{ super(tok);}

Member Function Documentation

void DiagramItem.create ( ) [inline, package, inherited]

Reimplemented in Text, and Text.

Definition at line 649 of file VrijeInvulVeld.java.

                  {
       state = CREATE;
    }
void DiagramItem.create ( ) [inline, package, inherited]

Reimplemented in Text, and Text.

Definition at line 749 of file KansBoom.java.

                  {
       state = CREATE;
    }

Here is the caller graph for this function:

String Arrow.describe ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 926 of file VrijeInvulVeld.java.

{return "arrow," + x + "," + y + "," + (x+w) + "," +(y+h);}
String Arrow.describe ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 1026 of file KansBoom.java.

{return "arrow," + x + "," + y + "," + (x+w) + "," +(y+h);}
void DiagramItem.destroy ( ) [inline, package, inherited]

Definition at line 658 of file VrijeInvulVeld.java.

{}
void DiagramItem.destroy ( ) [inline, package, inherited]

Definition at line 758 of file KansBoom.java.

{}

Here is the caller graph for this function:

double Line.distance ( int  _x,
int  _y 
) [inline, package, virtual, inherited]

Implements DiagramItem.

Definition at line 858 of file VrijeInvulVeld.java.

                                    {
       if(w == 0 && h == 0)
       return Misc.distance(x, y, _x, _y);
       /* Set origin to end of line */
       _x -= x;
       _y -= y;
       /* Find line length and unit vector along line */
       double len = Math.sqrt(w*w + h*h);
       double u = w / len;
       double v = h / len;
       /* Find nearest point on line using dot product */
       double r = _x * u + _y * v;
       if(r < 0)
           return Misc.distance(0, 0, _x, _y);
       if(r > len)
           return Misc.distance(w, h, _x, _y);
           return Misc.distance(r * u, r * v, _x, _y);
    }

Here is the call graph for this function:

double Line.distance ( int  _x,
int  _y 
) [inline, package, virtual, inherited]

Implements DiagramItem.

Definition at line 958 of file KansBoom.java.

                                    {
       if(w == 0 && h == 0)
       return Misc.distance(x, y, _x, _y);
       /* Set origin to end of line */
       _x -= x;
       _y -= y;
       /* Find line length and unit vector along line */
       double len = Math.sqrt(w*w + h*h);
       double u = w / len;
       double v = h / len;
       /* Find nearest point on line using dot product */
       double r = _x * u + _y * v;
       if(r < 0)
           return Misc.distance(0, 0, _x, _y);
       if(r > len)
           return Misc.distance(w, h, _x, _y);
           return Misc.distance(r * u, r * v, _x, _y);
    }

Here is the call graph for this function:

boolean DiagramItem.down ( int  _x,
int  _y 
) [inline, inherited]

Implements EventConsumer.

Reimplemented in Text, and Text.

Definition at line 664 of file VrijeInvulVeld.java.

                                        {
       switch(state){
           case CREATE:
           x = _x; y = _y;
           return true;
           
           case MOVE:
           movex = _x; movey = _y;
           return true;
       }
       return false;
    }
boolean DiagramItem.down ( int  _x,
int  _y 
) [inline, inherited]

Implements EventConsumer.

Reimplemented in Text, and Text.

Definition at line 764 of file KansBoom.java.

                                        {
       switch(state){
           case CREATE:
           x = _x; y = _y;
           return true;
           
           case MOVE:
           movex = _x; movey = _y;
           return true;
       }
       return false;
    }

Here is the caller graph for this function:

boolean DiagramItem.drag ( int  _x,
int  _y 
) [inline, inherited]

Implements EventConsumer.

Reimplemented in Text, and Text.

Definition at line 693 of file VrijeInvulVeld.java.

                                        {
       switch(state){
           case CREATE:
           w = _x - x; h = _y - y;
           return true;
       
           case MOVE:
           x += (_x - movex);
           y += (_y - movey);
           movex = _x;
           movey = _y;
           return true;
       }
       return false;
    }
boolean DiagramItem.drag ( int  _x,
int  _y 
) [inline, inherited]

Implements EventConsumer.

Reimplemented in Text, and Text.

Definition at line 793 of file KansBoom.java.

                                        {
       switch(state){
           case CREATE:
           w = _x - x; h = _y - y;
           return true;
       
           case MOVE:
           x += (_x - movex);
           y += (_y - movey);
           movex = _x;
           movey = _y;
           return true;
       }
       return false;
    }
void Arrow.draw ( Graphics  g) [inline, package, virtual]

Reimplemented from Line.

Definition at line 881 of file VrijeInvulVeld.java.

                          {
       /* Draw a line */
       Graphics2D g2 = (Graphics2D) g;
       if(!VrijeInvulVeld.original){
           int dy=(int) VrijeInvulVeld.ysize / VrijeInvulVeld.ygrid;
           int dx=(int) VrijeInvulVeld.xsize / VrijeInvulVeld.ygrid;
           if( state != 2){
              y=dy*((int) Math.round(y/dy));
              h=dy*((int) Math.round(h/dy));
           }
           if(state == 1 || state == 2){
              g2.setColor(VrijeInvulVeld.textcolor);
              g2.setStroke( new BasicStroke(1.0f));
              if(VrijeInvulVeld.textalign){
                  for(int p=0;p<VrijeInvulVeld.ysize;p=p+dy){
                     g2.drawLine(0,p,VrijeInvulVeld.xsize,p);
                  }
              }
              else
              {
                  for(int p=0;p<VrijeInvulVeld.xsize;p=p+dx){
                     g2.drawLine(p,0,p,VrijeInvulVeld.ysize);
                  }      
              }
           }
       }
           
       VrijeInvulVeld.linecounter++;
       g2.setColor(VrijeInvulVeld.drawcolor);
       g2.setStroke( new BasicStroke(VrijeInvulVeld.thickness));
       g2.drawLine(x, y, x+w, y+h);
       if(w == 0 && h == 0){return;}
       
       /* Find unit vector along line */
       double len = Math.sqrt(w*w + h*h);
       double u = w / len;
       double v = h / len;

       /* Draw arrow head */
       double _x = x + w - 5 * u;
       double _y = y + h - 5 * v;
       g2.drawLine(x+w, y+h, (int)(_x - 5 * v + 0.5), (int)(_y + 5 * u + 0.5));
       g2.drawLine(x+w, y+h, (int)(_x + 5 * v + 0.5), (int)(_y - 5 * u + 0.5));
    }
void Arrow.draw ( Graphics  g) [inline, package, virtual]

Reimplemented from Line.

Definition at line 981 of file KansBoom.java.

                          {
       /* Draw a line */
       Graphics2D g2 = (Graphics2D) g;
       if(!KansBoom.original){
           int dy=(int) KansBoom.ysize / KansBoom.ygrid;
           int dx=(int) KansBoom.xsize / KansBoom.ygrid;
           if( state != 2){
              y=dy*((int) Math.round(y/dy));
              h=dy*((int) Math.round(h/dy));
           }
           if(state == 1 || state == 2){
              g2.setColor(KansBoom.textcolor);
              g2.setStroke( new BasicStroke(1.0f));
              if(KansBoom.textalign){
                  for(int p=0;p<KansBoom.ysize;p=p+dy){
                     g2.drawLine(0,p,KansBoom.xsize,p);
                  }
              }
              else
              {
                  for(int p=0;p<KansBoom.xsize;p=p+dx){
                     g2.drawLine(p,0,p,KansBoom.ysize);
                  }      
              }
           }
       }
           
       KansBoom.linecounter++;
       g2.setColor(KansBoom.drawcolor);
       g2.setStroke( new BasicStroke(KansBoom.thickness));
       g2.drawLine(x, y, x+w, y+h);
       if(w == 0 && h == 0){return;}
       
       /* Find unit vector along line */
       double len = Math.sqrt(w*w + h*h);
       double u = w / len;
       double v = h / len;

       /* Draw arrow head */
       double _x = x + w - 5 * u;
       double _y = y + h - 5 * v;
       g2.drawLine(x+w, y+h, (int)(_x - 5 * v + 0.5), (int)(_y + 5 * u + 0.5));
       g2.drawLine(x+w, y+h, (int)(_x + 5 * v + 0.5), (int)(_y - 5 * u + 0.5));
    }
boolean DiagramItem.key ( int  key) [inline, inherited]

Implements EventConsumer.

Reimplemented in Text, and Text.

Definition at line 709 of file VrijeInvulVeld.java.

                                {
       return false;
    }
boolean DiagramItem.key ( int  key) [inline, inherited]

Implements EventConsumer.

Reimplemented in Text, and Text.

Definition at line 809 of file KansBoom.java.

                                {
       return false;
    }
void DiagramItem.move ( ) [inline, package, inherited]

Definition at line 660 of file VrijeInvulVeld.java.

                {
       state = MOVE;
    }
void DiagramItem.move ( ) [inline, package, inherited]

Definition at line 760 of file KansBoom.java.

                {
       state = MOVE;
    }

Here is the caller graph for this function:

int Arrow.specify_line_x1 ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 930 of file VrijeInvulVeld.java.

{return x;}
int Arrow.specify_line_x1 ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 1030 of file KansBoom.java.

{return x;}
int Arrow.specify_line_x2 ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 932 of file VrijeInvulVeld.java.

{return (x+w);}
int Arrow.specify_line_x2 ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 1032 of file KansBoom.java.

{return (x+w);}
int Arrow.specify_line_y1 ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 931 of file VrijeInvulVeld.java.

{return y;}
int Arrow.specify_line_y1 ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 1031 of file KansBoom.java.

{return y;}
int Arrow.specify_line_y2 ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 933 of file VrijeInvulVeld.java.

{return (y+h);}
int Arrow.specify_line_y2 ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 1033 of file KansBoom.java.

{return (y+h);}
String Arrow.specify_text ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 927 of file VrijeInvulVeld.java.

{return null; }
String Arrow.specify_text ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 1027 of file KansBoom.java.

{return null; }
int Arrow.specify_text_x ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 928 of file VrijeInvulVeld.java.

{return -1; }
int Arrow.specify_text_x ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 1028 of file KansBoom.java.

{return -1; }
int Arrow.specify_text_y ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 929 of file VrijeInvulVeld.java.

{return -1; }
int Arrow.specify_text_y ( ) [inline, package, virtual]

Reimplemented from Line.

Definition at line 1029 of file KansBoom.java.

{return -1; }
boolean DiagramItem.up ( int  _x,
int  _y 
) [inline, inherited]

Implements EventConsumer.

Reimplemented in Text, and Text.

Definition at line 677 of file VrijeInvulVeld.java.

                                      {
       switch(state){
           case CREATE:
           w = _x - x; h = _y - y;
           yield();
           return true;
           
           case MOVE:
           x += (_x - movex);
           y += (_y - movey);
           yield();
           return true;
       }
       return false;
    }

Here is the call graph for this function:

boolean DiagramItem.up ( int  _x,
int  _y 
) [inline, inherited]

Implements EventConsumer.

Reimplemented in Text, and Text.

Definition at line 777 of file KansBoom.java.

                                      {
       switch(state){
           case CREATE:
           w = _x - x; h = _y - y;
           yield();
           return true;
           
           case MOVE:
           x += (_x - movex);
           y += (_y - movey);
           yield();
           return true;
       }
       return false;
    }

Here is the call graph for this function:

void DiagramItem.yield ( ) [inline, inherited]

Implements EventConsumer.

Reimplemented in Text, and Text.

Definition at line 653 of file VrijeInvulVeld.java.

void DiagramItem.yield ( ) [inline, inherited]

Implements EventConsumer.

Reimplemented in Text, and Text.

Definition at line 753 of file KansBoom.java.

Here is the caller graph for this function:


Member Data Documentation

final int DiagramItem.CREATE = 1 [package, inherited]

Definition at line 723 of file KansBoom.java.

Diagram DiagramItem.diagram [package, inherited]

Definition at line 721 of file KansBoom.java.

int DiagramItem.h [package, inherited]

Definition at line 724 of file KansBoom.java.

final int DiagramItem.MOVE = 2 [package, inherited]

Definition at line 723 of file KansBoom.java.

int DiagramItem.movex [package, inherited]

Definition at line 725 of file KansBoom.java.

int DiagramItem.movey [package, inherited]

Definition at line 725 of file KansBoom.java.

final int DiagramItem.NONE = 0 [package, inherited]

Definition at line 723 of file KansBoom.java.

int DiagramItem.state [package, inherited]

Definition at line 722 of file KansBoom.java.

int DiagramItem.w [package, inherited]

Definition at line 724 of file KansBoom.java.

int DiagramItem.x [package, inherited]

Definition at line 724 of file KansBoom.java.

int DiagramItem.y [package, inherited]

Definition at line 724 of file KansBoom.java.


The documentation for this class was generated from the following files: