Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/memoire/dja/DjaAnchor.java


1   /**
2    * @modification $Date: 2001/12/03 16:28:07 $
3    * @statut       unstable
4    * @file         DjaAnchor.java
5    * @version      0.36
6    * @author       Guillaume Desnoix
7    * @email        guillaume@desnoix.com
8    * @license      GNU General Public License 2 (GPL2)
9    * @copyright    1998-2001 Guillaume Desnoix
10   */
11  
12  package com.memoire.dja;
13  
14  import com.memoire.fu.*;
15  import com.memoire.dnd.*;
16  import com.memoire.bu.*;
17  import com.memoire.dja.*;
18  import com.memoire.mst.*;
19  
20  
21  import java.awt.*;
22  
23  public class DjaAnchor
24         extends DjaManipulator
25  {
26    private int p_;
27    private int o_;
28    private int x_;
29    private int y_;
30  
31    private DjaObject parent_;
32  
33    public DjaAnchor(DjaObject _parent,int _p,int _o,int _x,int _y)
34    {
35      p_=_p;
36      o_=_o;
37      x_=_x;
38      y_=_y;
39      parent_=_parent;
40    }
41    
42    public final DjaOwner getOwner()
43    { return getParent(); }
44  
45    public int getX() { return x_; }
46    public int getY() { return y_; }
47    public int getO() { return o_; }
48  
49    public int getPosition() { return p_; }
50  
51    public DjaObject getParent() { return parent_; }
52  
53    public void paint(Graphics _g)
54    {
55      int x=getX();
56      int y=getY();
57  
58      _g.setColor(anchorsColor);
59      _g.drawLine(x-2,y-2,x+2,y+2);
60      _g.drawLine(x+2,y-2,x-2,y+2);
61    }
62  }
63