Back to index

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

List of all members.

Public Member Functions

boolean down (int x, int y)
boolean up (int x, int y)
boolean drag (int x, int y)
boolean key (int key)
boolean keyDown (Event e, int key)
void yield ()
boolean down (int x, int y)
boolean up (int x, int y)
boolean drag (int x, int y)
boolean key (int key)
boolean keyDown (Event e, int key)
void yield ()

Package Functions

 DiagramControls (KansBoom ed, String t_line, String t_arrow, String t_rectangle, String t_ellipse, String t_text, String t_circle, String t_destroy, String t_move)
 DiagramControls (VrijeInvulVeld ed, String t_line, String t_arrow, String t_rectangle, String t_ellipse, String t_text, String t_circle, String t_destroy, String t_move)

Package Attributes

KansBoom editor
CheckboxGroup buttons
Checkbox line
Checkbox arrow
Checkbox rect
Checkbox ellipse
Checkbox text
Checkbox destroy
Checkbox move
final int CREATE = 0
final int DESTROY = 1
final int MOVE = 2
VrijeInvulVeld editor

Detailed Description

Definition at line 601 of file KansBoom.java.


Constructor & Destructor Documentation

DiagramControls.DiagramControls ( KansBoom  ed,
String  t_line,
String  t_arrow,
String  t_rectangle,
String  t_ellipse,
String  t_text,
String  t_circle,
String  t_destroy,
String  t_move 
) [inline, package]

Definition at line 608 of file KansBoom.java.

                                                                                                                                                                {
       editor = ed;
       setBackground(Color.white);
       GridBagLayout gridbag = new GridBagLayout();
       GridBagConstraints c = new GridBagConstraints();
       Component button;
       setLayout(gridbag);
       buttons = new CheckboxGroup();
       c.gridy = 0;
       c.gridx = GridBagConstraints.RELATIVE;
       c.anchor = GridBagConstraints.WEST;
       button = new DiagramControl(this, CREATE, (new Line()).getClass(), t_line ,  true);
       gridbag.setConstraints(button, c);
       add(button);
       button = new DiagramControl(this, CREATE, (new Arrow()).getClass(), t_arrow ,    false);
       gridbag.setConstraints(button, c);
       add(button);
       button = new DiagramControl(this, CREATE, (new Rect()).getClass(), t_rectangle, false);
       gridbag.setConstraints(button, c);
       add(button);
       button = new DiagramControl(this, CREATE, (new Ellipse()).getClass(), t_ellipse , false);
       gridbag.setConstraints(button, c);
       add(button);
       button = new DiagramControl(this, CREATE, (new Text()).getClass(), t_text ,    false);
       gridbag.setConstraints(button, c);
       add(button);
       c.gridy = 1;
       button = new DiagramControl(this, DESTROY, (new Object()).getClass(), t_destroy  , false);
       gridbag.setConstraints(button, c);
       add(button);
       button = new DiagramControl(this, MOVE, (new Object()).getClass(), t_move ,    false);
       gridbag.setConstraints(button, c);
       add(button);

    }
DiagramControls.DiagramControls ( VrijeInvulVeld  ed,
String  t_line,
String  t_arrow,
String  t_rectangle,
String  t_ellipse,
String  t_text,
String  t_circle,
String  t_destroy,
String  t_move 
) [inline, package]

Definition at line 501 of file VrijeInvulVeld.java.

                                                                                                                                                                       {
       editor = ed;
       setBackground(Color.white);
       GridBagLayout gridbag = new GridBagLayout();
       GridBagConstraints c = new GridBagConstraints();
       Component button;
       setLayout(gridbag);
       buttons = new CheckboxGroup();
       c.gridy = 0;
       c.gridx = 0;
       c.fill = GridBagConstraints.HORIZONTAL;
       c.weightx = 1;
       c.anchor = GridBagConstraints.CENTER;
       if(VrijeInvulVeld.draw_text){
           button = new DiagramControl(this, CREATE, (new Text()).getClass(), t_text ,  true);
           gridbag.setConstraints(button, c);add(button);c.gridx++;
       }
       if(VrijeInvulVeld.draw_line){
           button = new DiagramControl(this, CREATE, (new Line()).getClass(), t_line ,  false);
           gridbag.setConstraints(button, c);add(button);c.gridx++;
       }
       if(VrijeInvulVeld.draw_arrow){
           button = new DiagramControl(this, CREATE, (new Arrow()).getClass(), t_arrow ,  false);
           gridbag.setConstraints(button, c);add(button);c.gridx++;
       }
       if(VrijeInvulVeld.draw_rect){
           button = new DiagramControl(this, CREATE, (new Rect()).getClass(), t_rectangle, false);
           gridbag.setConstraints(button, c);add(button);c.gridx++;
       }
       if(VrijeInvulVeld.draw_ellipse){
           button = new DiagramControl(this, CREATE, (new Ellipse()).getClass(), t_ellipse , false);
           gridbag.setConstraints(button, c);add(button);c.gridx++;
       }
       button = new DiagramControl(this, MOVE, (new Object()).getClass(), t_move ,    false);
       gridbag.setConstraints(button, c);
       add(button);
       c.gridx++;
       button = new DiagramControl(this, DESTROY, (new Object()).getClass(), t_destroy  , false);
       gridbag.setConstraints(button, c);
       add(button);

    }

Member Function Documentation

boolean DiagramControls.down ( int  x,
int  y 
) [inline]

Implements EventConsumer.

Definition at line 543 of file VrijeInvulVeld.java.

                                      {
       DiagramControl current_button = (DiagramControl)buttons.getCurrent();
       DiagramItem target;
       Diagram diagram = editor.diagram;
       editor.showStatus("");
       switch(current_button.mode) {
           case CREATE:
           try {
              Class class_ = current_button.class_;
              target = (DiagramItem)class_.newInstance();
              target.diagram = diagram;
              target.create();
              editor.current_event_consumer = target;
              diagram.addElement(target);
              target.down(x, y);
           }
           catch (InstantiationException ex) {}
           catch (IllegalAccessException ex) {}
           return true;
           
           case DESTROY:
           target = diagram.nearby(x, y);
           if(target != null) {diagram.removeElement(target);target.destroy();}
           return true;
           
           case MOVE:
           target = diagram.nearby(x, y);
           if(target != null) {target.move();editor.current_event_consumer = target;target.down(x, y);}
           return false;
           
           default:
           return false;
       }
    }

Here is the call graph for this function:

boolean DiagramControls.down ( int  x,
int  y 
) [inline]

Implements EventConsumer.

Definition at line 643 of file KansBoom.java.

                                      {
       DiagramControl current_button = (DiagramControl)buttons.getCurrent();
       DiagramItem target;
       Diagram diagram = editor.diagram;
       editor.showStatus("");
       switch(current_button.mode) {
           case CREATE:
           try {
              Class class_ = current_button.class_;
              target = (DiagramItem)class_.newInstance();
              target.diagram = diagram;
              target.create();
              editor.current_event_consumer = target;
              diagram.addElement(target);
              target.down(x, y);
           }
           catch (InstantiationException ex) {}
           catch (IllegalAccessException ex) {}
           return true;
           
           case DESTROY:
           target = diagram.nearby(x, y);
           if(target != null) {diagram.removeElement(target);target.destroy();}
           return true;
           
           case MOVE:
           target = diagram.nearby(x, y);
           if(target != null) {target.move();editor.current_event_consumer = target;target.down(x, y);}
           return false;
           
           default:
           return false;
       }
    }

Here is the call graph for this function:

boolean DiagramControls.drag ( int  x,
int  y 
) [inline]

Implements EventConsumer.

Definition at line 582 of file VrijeInvulVeld.java.

                                      {
       return false;
    }
boolean DiagramControls.drag ( int  x,
int  y 
) [inline]

Implements EventConsumer.

Definition at line 682 of file KansBoom.java.

                                      {
       return false;
    }
boolean DiagramControls.key ( int  key) [inline]

Implements EventConsumer.

Definition at line 586 of file VrijeInvulVeld.java.

                                {
       return false;
    }
boolean DiagramControls.key ( int  key) [inline]

Implements EventConsumer.

Definition at line 686 of file KansBoom.java.

                                {
       return false;
    }
boolean DiagramControls.keyDown ( Event  e,
int  key 
) [inline]

Definition at line 590 of file VrijeInvulVeld.java.

                                             {
       /* For some reason we get the canvas key presses.  Pass them on XXX */
       return editor.display.keyDown(e, key);
    }

Here is the call graph for this function:

boolean DiagramControls.keyDown ( Event  e,
int  key 
) [inline]

Definition at line 690 of file KansBoom.java.

                                             {
       /* For some reason we get the canvas key presses.  Pass them on XXX */
       return editor.display.keyDown(e, key);
    }

Here is the call graph for this function:

boolean DiagramControls.up ( int  x,
int  y 
) [inline]

Implements EventConsumer.

Definition at line 578 of file VrijeInvulVeld.java.

                                    {
       return false;
    }
boolean DiagramControls.up ( int  x,
int  y 
) [inline]

Implements EventConsumer.

Definition at line 678 of file KansBoom.java.

                                    {
       return false;
    }
void DiagramControls.yield ( ) [inline]

Implements EventConsumer.

Definition at line 595 of file VrijeInvulVeld.java.

{}
void DiagramControls.yield ( ) [inline]

Implements EventConsumer.

Definition at line 695 of file KansBoom.java.

{}

Member Data Documentation

Checkbox DiagramControls.arrow [package]

Definition at line 604 of file KansBoom.java.

CheckboxGroup DiagramControls.buttons [package]

Definition at line 603 of file KansBoom.java.

final int DiagramControls.CREATE = 0 [package]

Definition at line 605 of file KansBoom.java.

Checkbox DiagramControls.destroy [package]

Definition at line 604 of file KansBoom.java.

final int DiagramControls.DESTROY = 1 [package]

Definition at line 605 of file KansBoom.java.

Definition at line 495 of file VrijeInvulVeld.java.

Definition at line 602 of file KansBoom.java.

Checkbox DiagramControls.ellipse [package]

Definition at line 604 of file KansBoom.java.

Checkbox DiagramControls.line [package]

Definition at line 604 of file KansBoom.java.

Checkbox DiagramControls.move [package]

Definition at line 604 of file KansBoom.java.

final int DiagramControls.MOVE = 2 [package]

Definition at line 605 of file KansBoom.java.

Checkbox DiagramControls.rect [package]

Definition at line 604 of file KansBoom.java.

Checkbox DiagramControls.text [package]

Definition at line 604 of file KansBoom.java.


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