Back to index

wims  3.65+svn20090927
Public Member Functions | Package Functions | Package Attributes
Rect Class Reference
Inheritance diagram for Rect:
Inheritance graph
[legend]
Collaboration diagram for Rect:
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

 Rect ()
 Rect (StringTokenizer tok) throws Exception
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 ()
void draw (Graphics g)
double distance (int _x, int _y)
 Rect ()
 Rect (StringTokenizer tok) throws Exception
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 ()
void draw (Graphics g)
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 843 of file KansBoom.java.


Constructor & Destructor Documentation

Rect.Rect ( ) [inline, package]

Definition at line 844 of file KansBoom.java.

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

Definition at line 845 of file KansBoom.java.

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

Definition at line 744 of file VrijeInvulVeld.java.

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

Definition at line 745 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 Rect.describe ( ) [inline, package, virtual]

Implements DiagramItem.

Definition at line 747 of file VrijeInvulVeld.java.

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

Implements DiagramItem.

Definition at line 847 of file KansBoom.java.

{return "rectangle," + 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 Rect.distance ( int  _x,
int  _y 
) [inline, package, virtual]

Implements DiagramItem.

Definition at line 763 of file VrijeInvulVeld.java.

                                    {
       double dtop, dbottom, dleft, dright, dist;
       if(_x < x){
           dtop = Misc.distance(_x, _y, x, y);
       }
       else 
       {
           if(_x > x+w){
              dtop = Misc.distance(_x, _y, x+w, y);
           }
           else
           {
              dtop = Math.abs(_y - y);
           }
       }    
    
       if(_x < x){
           dbottom = Misc.distance(_x, _y, x, y+h);
       }
       else
       {
           if(_x > x+w){
              dbottom = Misc.distance(_x, _y, x+w, y+h);
           }
           else
           {
              dbottom = Math.abs(_y - (y+h));
           }
       }
       
       if(_y < y)
           dleft = Misc.distance(_x, _y, x, y);
       else if(_y > y+h)
           dleft = Misc.distance(_x, _y, x, y+h);
       else
           dleft = Math.abs(_x - x);
    
       if(_y < y)
           dright = Misc.distance(_x, _y, x+w, y);
       else if(_y > y+h)
           dright = Misc.distance(_x, _y, x+w, y+h);
       else
           dright = Math.abs(_x - (x+w));

       dist = dtop;
       if(dbottom < dist){dist = dbottom;}
       if(dleft < dist){dist = dleft;}
       if(dright < dist){dist = dright;}
       
       return dist;
    }

Here is the call graph for this function:

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

Implements DiagramItem.

Definition at line 863 of file KansBoom.java.

                                    {
       double dtop, dbottom, dleft, dright, dist;
       if(_x < x){
           dtop = Misc.distance(_x, _y, x, y);
       }
       else 
       {
           if(_x > x+w){
              dtop = Misc.distance(_x, _y, x+w, y);
           }
           else
           {
              dtop = Math.abs(_y - y);
           }
       }    
    
       if(_x < x){
           dbottom = Misc.distance(_x, _y, x, y+h);
       }
       else
       {
           if(_x > x+w){
              dbottom = Misc.distance(_x, _y, x+w, y+h);
           }
           else
           {
              dbottom = Math.abs(_y - (y+h));
           }
       }
       
       if(_y < y)
           dleft = Misc.distance(_x, _y, x, y);
       else if(_y > y+h)
           dleft = Misc.distance(_x, _y, x, y+h);
       else
           dleft = Math.abs(_x - x);
    
       if(_y < y)
           dright = Misc.distance(_x, _y, x+w, y);
       else if(_y > y+h)
           dright = Misc.distance(_x, _y, x+w, y+h);
       else
           dright = Math.abs(_x - (x+w));

       dist = dtop;
       if(dbottom < dist){dist = dbottom;}
       if(dleft < dist){dist = dleft;}
       if(dright < dist){dist = dright;}
       
       return dist;
    }

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 Rect.draw ( Graphics  g) [inline, package, virtual]

Implements DiagramItem.

Definition at line 756 of file VrijeInvulVeld.java.

                          {
       g.drawLine(x  , y  , x+w, y  );
       g.drawLine(x+w, y  , x+w, y+h);
       g.drawLine(x+w, y+h, x  , y+h);
       g.drawLine(x  , y+h, x  , y  );
    }
void Rect.draw ( Graphics  g) [inline, package, virtual]

Implements DiagramItem.

Definition at line 856 of file KansBoom.java.

                          {
       g.drawLine(x  , y  , x+w, y  );
       g.drawLine(x+w, y  , x+w, y+h);
       g.drawLine(x+w, y+h, x  , y+h);
       g.drawLine(x  , y+h, x  , y  );
    }
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 Rect.specify_line_x1 ( ) [inline, package, virtual]

Implements DiagramItem.

Definition at line 751 of file VrijeInvulVeld.java.

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

Implements DiagramItem.

Definition at line 851 of file KansBoom.java.

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

Implements DiagramItem.

Definition at line 753 of file VrijeInvulVeld.java.

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

Implements DiagramItem.

Definition at line 853 of file KansBoom.java.

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

Implements DiagramItem.

Definition at line 752 of file VrijeInvulVeld.java.

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

Implements DiagramItem.

Definition at line 852 of file KansBoom.java.

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

Implements DiagramItem.

Definition at line 754 of file VrijeInvulVeld.java.

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

Implements DiagramItem.

Definition at line 854 of file KansBoom.java.

{return -1;}
String Rect.specify_text ( ) [inline, package, virtual]

Implements DiagramItem.

Definition at line 748 of file VrijeInvulVeld.java.

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

Implements DiagramItem.

Definition at line 848 of file KansBoom.java.

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

Implements DiagramItem.

Definition at line 749 of file VrijeInvulVeld.java.

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

Implements DiagramItem.

Definition at line 849 of file KansBoom.java.

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

Implements DiagramItem.

Definition at line 750 of file VrijeInvulVeld.java.

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

Implements DiagramItem.

Definition at line 850 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: