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

Quick Search    Search Deep

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


1   /**
2    * @modification $Date: 2001/12/03 16:28:07 $
3    * @statut       unstable
4    * @file         DjaCircle.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  import java.awt.event.*;
23  import javax.swing.*;
24  import javax.swing.border.*;
25  
26  public class DjaCircle
27         extends DjaEllipse
28  {
29    public DjaCircle(String _texte)
30    {
31      super(_texte);
32      setWidth(61);
33    }
34  
35    public DjaCircle()
36    {
37      this(null);
38    }
39  
40    public void setWidth(int _w)
41    {
42      super.setHeight(_w);
43      super.setWidth(_w);
44    }
45  
46    public void setHeight(int _h)
47    {
48      super.setWidth(_h);
49      super.setHeight(_h);
50    }
51  
52    public DjaAnchor[] getAnchors()
53    {
54      int x=getX();
55      int y=getY();
56      int w=getWidth();
57      int h=getHeight();
58  
59      DjaAnchor[] r=new DjaAnchor[8];
60  
61      r[0]=new DjaAnchor(this,0,NORTH,x+w/2,y);
62      r[2]=new DjaAnchor(this,2,EAST ,x+w-1,y+h/2);
63      r[4]=new DjaAnchor(this,4,SOUTH,x+w/2,y+h-1);
64      r[6]=new DjaAnchor(this,6,WEST ,x    ,y+h/2);
65  
66      r[1]=new DjaAnchor(this,1,NORTH,x+w-1-295*w/2000,y+    295*h/2000);
67      r[3]=new DjaAnchor(this,3,SOUTH,x+w-1-295*w/2000,y+h-1-295*h/2000);
68      r[5]=new DjaAnchor(this,5,SOUTH,x+    295*w/2000,y+h-1-295*h/2000);
69      r[7]=new DjaAnchor(this,7,NORTH,x+    295*w/2000,y+    295*h/2000);
70  
71      return r;
72    }
73  }