/[classpath]/classpath/java/awt/BasicStroke.java
ViewVC logotype

Diff of /classpath/java/awt/BasicStroke.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by ericb, Mon May 6 02:43:17 2002 UTC revision 1.2 by mkoch, Mon Dec 23 12:45:46 2002 UTC
# Line 59  public class BasicStroke implements Stro Line 59  public class BasicStroke implements Stro
59    private final float[] dash;    private final float[] dash;
60    private final float phase;    private final float phase;
61    
62      /**
63       * Creates a basic stroke.
64       *
65       * @param width May not be negative .
66       * @param cap May be either CAP_BUTT, CAP_ROUND or CAP_SQUARE.
67       * @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER.
68       * @param miterlimit the limit to trim the miter join. The miterlimit must be
69       * greater than or equal to 1.0f.
70       * @param dash The array representing the dashing pattern.
71       * @param dash_phase is negative and dash is not null.
72       *
73       * @exception IllegalArgumentException If one input parameter doesn't meet
74       * its needs.
75       */
76    public BasicStroke(float width, int cap, int join, float miterlimit,    public BasicStroke(float width, int cap, int join, float miterlimit,
77                       float[] dash, float dashPhase)                       float[] dash, float dashPhase)
78    {    {
79      if (width < 0 || miterlimit < 1 || cap < CAP_BUTT || cap > CAP_SQUARE      if (width < 0 ||
80          || join < JOIN_MITER || join > JOIN_BEVEL)          miterlimit < 1.0f ||
81            cap < CAP_BUTT ||
82            cap > CAP_SQUARE ||
83            join < JOIN_MITER ||
84            join > JOIN_BEVEL)
85        throw new IllegalArgumentException();        throw new IllegalArgumentException();
86    
87      this.width = width;      this.width = width;
88      this.cap = cap;      this.cap = cap;
89      this.join = join;      this.join = join;
# Line 73  public class BasicStroke implements Stro Line 92  public class BasicStroke implements Stro
92      phase = dashPhase;      phase = dashPhase;
93    }    }
94    
95      /**
96       * Creates a basicc stroke.
97       *
98       * @param width The width of the BasicStroke. May not be negative .
99       * @param cap May be either CAP_BUTT, CAP_ROUND or CAP_SQUARE.
100       * @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER.
101       * @param miterlimit the limit to trim the miter join. The miterlimit must be
102       * greater than or equal to 1.0f.
103       *
104       * @exception IllegalArgumentException If one input parameter doesn't meet
105       * its needs.
106       */
107    public BasicStroke(float width, int cap, int join, float miterlimit)    public BasicStroke(float width, int cap, int join, float miterlimit)
108    {    {
109      this(width, cap, join, miterlimit, null, 0);      this(width, cap, join, miterlimit, null, 0);
110    }    }
111    
112      /**
113       * Creates a basicc stroke.
114       *
115       * @param width The width of the BasicStroke. May not be nehative.
116       * @param cap May be either CAP_BUTT, CAP_ROUND or CAP_SQUARE.
117       * @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER.
118       *
119       * @exception IllegalArgumentException If one input parameter doesn't meet
120       * its needs.
121       * @exception IllegalArgumentException FIXME
122       */
123    public BasicStroke(float width, int cap, int join)    public BasicStroke(float width, int cap, int join)
124    {    {
125      this(width, cap, join, 10, null, 0);      this(width, cap, join, 10, null, 0);
126    }    }
127    
128      /**
129       * Creates a basicc stroke.
130       *
131       * @param width The width of the BasicStroke.
132       *
133       * @exception IllegalArgumentException If width is negative.
134       */
135    public BasicStroke(float width)    public BasicStroke(float width)
136    {    {
137      this(width, CAP_SQUARE, JOIN_MITER, 10, null, 0);      this(width, CAP_SQUARE, JOIN_MITER, 10, null, 0);
138    }    }
139    
140      /**
141       * Creates a basicc stroke.
142       */
143    public BasicStroke()    public BasicStroke()
144    {    {
145      this(1, CAP_SQUARE, JOIN_MITER, 10, null, 0);      this(1, CAP_SQUARE, JOIN_MITER, 10, null, 0);

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26