KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > it > businesslogic > ireport > gui > JRulePanel


1 /*
2  * Copyright (C) 2005 - 2006 JasperSoft Corporation. All rights reserved.
3  * http://www.jaspersoft.com.
4  *
5  * Unless you have purchased a commercial license agreement from JasperSoft,
6  * the following license terms apply:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as published by
10  * the Free Software Foundation.
11  *
12  * This program is distributed WITHOUT ANY WARRANTY; and without the
13  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
18  * or write to:
19  *
20  * Free Software Foundation, Inc.,
21  * 59 Temple Place - Suite 330,
22  * Boston, MA USA 02111-1307
23  *
24  *
25  *
26  *
27  * JRulePanel.java
28  *
29  * Created on 12 febbraio 2003, 22.52
30  *
31  */

32
33 package it.businesslogic.ireport.gui;
34
35 import java.awt.event.MouseEvent JavaDoc;
36 import java.awt.geom.AffineTransform JavaDoc;
37 import javax.swing.*;
38 import java.awt.*;
39 import it.businesslogic.ireport.util.*;
40 import java.awt.event.MouseListener JavaDoc;
41
42 /**
43  *
44  * @author Administrator
45  */

46 public class JRulePanel extends JPanel {
47     
48     public static int TYPE_HORIZONTAL = 0;
49     public static int TYPE_VERTICAL = 1;
50     
51     private boolean fontSet = false;
52     private JReportFrame jReportFrame = null;
53     
54     private int type = TYPE_HORIZONTAL;
55     
56     private int cursorPosition;
57     
58     private boolean dragging = false;
59     private java.awt.image.BufferedImage JavaDoc savedImage = null;
60     private ImageIcon horizontalRuleStopIcon = null;
61     
62     private java.util.List JavaDoc guideLines = new java.util.ArrayList JavaDoc();
63     private int lastTempGuidePosition = -1;
64     private Stroke dottedStroke = null;
65
66     
67     /** Creates a new instance of JRulePane */
68     public JRulePanel() {
69         setCursorPosition(-1);
70         Font f = this.getFont();
71         this.setFont( new Font( f.getName(), 0, 10)); //f.getFamily())
72

73         setDottedStroke((Stroke) new BasicStroke((float) (1f),
74                                             BasicStroke.CAP_BUTT,
75                                             BasicStroke.JOIN_BEVEL, 0f,
76                                             new float[] { 1f, 1f }, 0f));
77                                             
78         horizontalRuleStopIcon = new javax.swing.ImageIcon JavaDoc(getClass().getResource("/it/businesslogic/ireport/icons/toolbars/rulestop.png"));
79         
80         addMouseMotionListener(new java.awt.event.MouseMotionAdapter JavaDoc() {
81             public void mouseDragged(java.awt.event.MouseEvent JavaDoc evt) {
82                 panelMouseDragged(evt);
83             }
84             public void mouseMoved(java.awt.event.MouseEvent JavaDoc evt) {
85                 panelMouseMoved(evt);
86             }
87         });
88         
89         addMouseListener(new java.awt.event.MouseAdapter JavaDoc() {
90             public void mousePressed(java.awt.event.MouseEvent JavaDoc evt) {
91                 panelMousePressed(evt);
92             }
93             public void mouseReleased(java.awt.event.MouseEvent JavaDoc evt) {
94                 panelMouseReleased(evt);
95             }
96         });
97     }
98                
99     public void setRightFont(Graphics g)
100     {
101         if (fontSet) return;
102         
103         if (g == null) return;
104         /*
105         Font f = g.getFont();
106         f = new Font( f.getName(), 0, 10); //f.getFamily()
107         g.setFont(f);
108         */

109          //setFont(f); //f.getFamily()
110
//fontSet = true;
111
}
112
113     /**
114      * Paints the container. This forwards the paint to any lightweight
115      * components that are children of this container. If this method is
116      * reimplemented, super.paint(g) should be called so that lightweight
117      * components are properly rendered. If a child component is entirely
118      * clipped by the current clipping setting in g, paint() will not be
119      * forwarded to that child.
120      *
121      * @param g the specified Graphics window
122      * @see Component#update(Graphics)
123      *
124      * 0 10 x1 x2 x3
125      * +-----+-----+------------------------------------+-----+-------
126      * | |:::::|::::::::::::::::::::::::::::::::::::|:::::|
127      * | |:::::|::::::::::::::::::::::::::::::::::::|:::::|
128      *
129      * <============= scroll_h =========================================>
130      *
131      * x1 = Margin left position
132      * x2 = Margin right position
133      * x3 = Page width position
134      * scroll_h = horizontal position of the scroll bar.
135      *
136      */

137     public void paint(Graphics g) {
138         
139         if (getJReportFrame() == null) return;
140         setRightFont(g);
141         g.setFont( this.getFont());
142         setCursorPosition(-1);
143         
144         //g.setColor(new Color( 255,255,255));
145
g.setColor(this.getBackground());
146         g.fillRect(0,0, this.getWidth(), this.getHeight());
147
148         String JavaDoc unitName = MainFrame.getMainInstance().getProperties().getProperty("DefaultUnit","cm");
149         double unit = Unit.CENTIMETERS;
150         if (unitName.equals("cm")) unit = Unit.CENTIMETERS;
151         else if (unitName.equals("pixels")) unit = Unit.PIXEL;
152         else if (unitName.equals("mm")) unit = Unit.MILLIMETERS;
153         else if (unitName.equals("inches")) unit = Unit.INCHES;
154
155         g.setColor(new Color( 255,255,255));
156
157
158         double k=0;
159
160         double zoomfactor = getJReportFrame().getZoomFactor();
161
162         int line=0;
163         int i=0;
164         //int i = 10-HScrollBar1.getValue();
165
int oldi=-100;
166         double module = 2;
167
168         boolean isMillimeters = (unit == Unit.MILLIMETERS);
169         if (isMillimeters)
170         {
171             unit = Unit.CENTIMETERS;
172         }
173
174         boolean isPixel = false;
175         // Choose module...
176
int tick_space = 50;
177         if (unit == Unit.PIXEL)
178         {
179             isPixel = true;
180             unit = 50;
181             tick_space = 100;
182         }
183
184         if (((int)(convertUnitToPixel(1,unit)*zoomfactor)) >= tick_space)
185         {
186             module = 10;
187         }
188
189         if (getType() == TYPE_HORIZONTAL)
190         {
191                 int x1=10 + getJReportFrame().getZoomedDim( getJReportFrame().getReport().getLeftMargin()) - getJReportFrame().getHScroll();
192                 int x2=10 + getJReportFrame().getZoomedDim( getJReportFrame().getReport().getWidth() - getJReportFrame().getReport().getRightMargin() ) - getJReportFrame().getHScroll();
193                 int x3=10 + getJReportFrame().getZoomedDim( getJReportFrame().getReport().getWidth()) - getJReportFrame().getHScroll()-1;
194
195                 g.fillRect(Math.max(x1,0) ,0, Math.min(x2, this.getWidth()) - Math.max(x1,0), this.getHeight());
196
197                 java.awt.Color JavaDoc c = this.getBackground().darker();
198                 if (x1 > 0)
199                 {
200                     g.setColor(c);
201                     g.fillRect(Math.max(10 - getJReportFrame().getHScroll(),0), 0, x1-Math.max(10 - getJReportFrame().getHScroll(),0), this.getHeight());
202                     g.setColor(c.darker());
203                     g.drawRect(Math.max(10 - getJReportFrame().getHScroll(),0), 0, x1-Math.max(10 - getJReportFrame().getHScroll(),0), this.getHeight());
204                 }
205
206                 if (x2 < this.getWidth())
207                 {
208                     g.setColor(c);
209                     g.fillRect(x2, 0, Math.min(this.getWidth(), x3) - x2, this.getHeight());
210                     g.setColor(c.darker());
211                     g.drawRect(x2, 0, Math.min(this.getWidth(), x3) - x2, this.getHeight());
212                 }
213
214                 g.setColor(new Color(0,0,0));
215                 g.drawLine(0,this.getHeight()-1, this.getWidth(), this.getHeight()-1);
216
217                 i = x1;
218
219
220                 while (i< this.getWidth())
221                 {
222                         if (i>=0)
223                         {
224                                 if ((line%module)==0)
225                                 {
226                                         if (i-oldi > 20)
227                                         {
228                                                 String JavaDoc s = ""+(int)k;
229                                                 if (isMillimeters) s += "0";
230                                                 if (isPixel) s = ""+((int)k*50);
231
232                                                 int w = g.getFontMetrics().stringWidth(s);
233                                                 g.drawString(s ,i - (w/2), (g.getFontMetrics().getHeight()/2)+3);
234                                                 //writeRotateString((Graphics2D)g,i - (w/2), (g.getFontMetrics().getHeight()/2)+3, s);
235
oldi= i;
236                                                 g.drawLine(i,16,i,12);
237                                         }
238                                         else
239                                         {
240                                             g.drawLine(i,5,i,10);
241                                         }
242
243                                 }
244                                 else
245                                 {
246                                     if (module == 10 && (line%5) !=0)
247                                     {
248                                         g.drawLine(i,7,i,8);
249                                     }
250                                     else
251                                     {
252                                         g.drawLine(i,6,i,9);
253                                     }
254                                 }
255                         }
256                         line++;
257                         k = line*(1.0/module);
258                         i = x1 + (int)(convertUnitToPixel(k,unit) * zoomfactor);
259
260
261                 }
262
263
264                 line=1;
265                 k = 1.0/module;
266                 oldi=x1;
267                 i = x1 - (int)(convertUnitToPixel(k,unit) * zoomfactor);
268                 while (x1 > 0 && i > -10)
269                 {
270                         if (i>=0)
271                         {
272                                 if ((line%module)==0)
273                                 {
274                                         if (oldi-i > 20)
275                                         {
276                                                 String JavaDoc s = ""+(int)k;
277                                                 if (isMillimeters) s += "0";
278                                                 if (isPixel) s = ""+((int)k*50);
279
280                                                 int w = g.getFontMetrics().stringWidth(s);
281                                                 g.drawString(s ,i - (w/2), (g.getFontMetrics().getHeight()/2)+3);
282                                                 oldi= i;
283                                                 g.drawLine(i,16,i,12);
284                                         }
285                                         else
286                                         {
287                                             g.drawLine(i,5,i,10);
288                                         }
289
290                                 }
291                                 else
292                                 {
293                                     if (module == 10 && (line%5) !=0)
294                                     {
295                                         g.drawLine(i,7,i,8);
296                                     }
297                                     else
298                                     {
299                                         g.drawLine(i,6,i,9);
300                                     }
301                                 }
302                         }
303                         line++;
304                         k = line*(1.0/module);
305                         i = x1 - (int)(convertUnitToPixel(k,unit) * zoomfactor);
306                 }
307                 
308                 for (i=0; i<getGuideLines().size(); ++i)
309                 {
310                     Integer JavaDoc pos = (Integer JavaDoc)getGuideLines().get(i);
311                     int posI = pos.intValue();
312                     // Calc posI....
313
posI = 10 + (int)(posI*zoomfactor) - getJReportFrame().getHScroll();
314                     g.drawImage(horizontalRuleStopIcon.getImage(),posI-4, 7, this);
315                 }
316
317         }
318         else // VERTICAL.....
319
{
320                 int y1=10 + getJReportFrame().getZoomedDim( getJReportFrame().getReport().getTopMargin()) - getJReportFrame().getVScroll();
321                 int y2=10 + getJReportFrame().getZoomedDim( getJReportFrame().getReport().getDesignHeight() - getJReportFrame().getReport().getBottomMargin() ) - getJReportFrame().getVScroll();
322                 int y3=10 + getJReportFrame().getZoomedDim( getJReportFrame().getReport().getDesignHeight()) - getJReportFrame().getVScroll()-1;
323
324                 g.fillRect(0, Math.max(y1,0), this.getWidth(), Math.min(y2, this.getHeight()) - Math.max(y1,0));
325
326                 java.awt.Color JavaDoc c = this.getBackground().darker();
327                 if (y1 > 0)
328                 {
329                     g.setColor(c);
330                     g.fillRect(0, Math.max(10 - getJReportFrame().getVScroll(),0), this.getWidth(), y1-Math.max(10 - getJReportFrame().getVScroll(),0));
331                     g.setColor(c.darker());
332                     g.drawRect(0, Math.max(10 - getJReportFrame().getVScroll(),0), this.getWidth(), y1-Math.max(10 - getJReportFrame().getVScroll(),0));
333                 }
334
335                 if (y2 < this.getHeight())
336                 {
337                     g.setColor(c);
338                     g.fillRect(0,y2, this.getWidth(), Math.min(this.getHeight(), y3) - y2);
339                     g.setColor(c.darker());
340                     g.drawRect(0,y2, this.getWidth(), Math.min(this.getHeight(), y3) - y2);
341                 }
342
343                 g.setColor(new Color(0,0,0));
344                 g.drawLine(this.getWidth()-1, 0, this.getWidth()-1, this.getHeight());
345
346
347                 i=y1;
348
349                 while (i< this.getHeight())
350                 {
351                         if (i>=0)
352                         {
353                                 if ((line%module)==0)
354                                 {
355                                         if (i-oldi > 20)
356                                         {
357                                                 String JavaDoc s = ""+(int)k;
358                                                 if (isMillimeters) s += "0";
359                                                 if (isPixel) s = ""+((int)k*50);
360                                                 writeRotateString((Graphics2D)g, 4, i, s);
361                                                 //g.drawString(s ,1, i + g.getFontMetrics().getDescent());
362
oldi= i;
363                                                 g.drawLine(16,i,12,i);
364                                         }
365                                         else
366                                         {
367                                             g.drawLine(5,i,10,i);
368                                         }
369
370                                 }
371                                 else
372                                 {
373                                     if (module == 10 && (line%5) !=0)
374                                     {
375                                         g.drawLine(7,i,8,i);
376                                     }
377                                     else
378                                     {
379                                         g.drawLine(6,i,9,i);
380                                     }
381                                 }
382                         }
383                         line++;
384                         k = line*(1.0/module);
385                         i = y1 + (int)(convertUnitToPixel(k,unit) * zoomfactor);
386                 }
387
388
389
390                 line=1;
391                 k = 1.0/module;
392                 oldi=y1;
393                 i = y1 - (int)(convertUnitToPixel(k,unit) * zoomfactor);
394                 while (y1 > 0 && i > -10)
395                 {
396                         if (i>=0)
397                         {
398                                 if ((line%module)==0)
399                                 {
400                                         if (i-oldi > 20)
401                                         {
402                                                 String JavaDoc s = ""+(int)k;
403                                                 if (isMillimeters) s += "0";
404                                                 if (isPixel) s = ""+((int)k*50);
405
406                                                 int w = g.getFontMetrics().stringWidth(s);
407                                                 writeRotateString((Graphics2D)g, 4, i, s);
408                                                 //g.drawString(s ,1, i + g.getFontMetrics().getDescent());
409
oldi= i;
410                                                 g.drawLine(16,i,12,i);
411                                         }
412                                         else
413                                         {
414                                             g.drawLine(5,i,10,i);
415                                         }
416
417                                 }
418                                 else
419                                 {
420                                     if (module == 10 && (line%5) !=0)
421                                     {
422                                         g.drawLine(7,i,8,i);
423                                     }
424                                     else
425                                     {
426                                         g.drawLine(6,i,9,i);
427                                     }
428                                 }
429                         }
430                         line++;
431                         k = line*(1.0/module);
432                         i = y1 - (int)(convertUnitToPixel(k,unit) * zoomfactor);
433                 }
434                 
435                 for (i=0; i<getGuideLines().size(); ++i)
436                 {
437                     Integer JavaDoc pos = (Integer JavaDoc)getGuideLines().get(i);
438                     int posI = pos.intValue();
439                     // Calc posI....
440
posI = 10 + (int)(posI*zoomfactor) - getJReportFrame().getHScroll();
441                     g.drawImage(horizontalRuleStopIcon.getImage(),7,posI-4, this);
442                 }
443
444         }
445     }
446     
447     
448     
449    public void writeRotateString(Graphics2D g2, int x, int yCenter, String JavaDoc s)
450   {
451         
452        
453     java.awt.geom.Rectangle2D JavaDoc sb = g2.getFontMetrics().getStringBounds(s, g2) ;
454     int sw = (int)sb.getWidth();
455     int sh = (int)(sb.getHeight()/2);
456     
457         //g2.drawString(s,x - sw/3, yCenter+sh/2);
458

459         
460         AffineTransform JavaDoc oldAr = g2.getTransform();
461     
462     int rotX = x;
463     int rotY = yCenter;
464     
465         AffineTransform JavaDoc at = g2.getTransform();
466         at.rotate(-Math.PI/2.0, x, yCenter);
467         at.translate(-(sw/2),sh);
468     //AffineTransform at = AffineTransform.getRotateInstance(-Math.PI/2.0, x, yCenter);
469
//AffineTransform at2 = AffineTransform.getTranslateInstance(-(sw/2),sh);
470
g2.setTransform(at);
471     
472     g2.drawString(s,x,yCenter);//s,x - (sw/2) , yCenter + sh);
473
g2.setTransform(oldAr);
474         
475   }
476     
477     /** Getter for property cursorPosition.
478      * @return Value of property cursorPosition.
479      *
480      */

481     public int getCursorPosition() {
482         return cursorPosition;
483     }
484     
485     /** Setter for property cursorPosition.
486      * @param cursorPosition New value of property cursorPosition.
487      *
488      */

489     public void setCursorPosition(int cursorPosition) {
490         Graphics g = this.getGraphics();
491         if (g==null) return;
492         g.setXORMode(Color.WHITE);
493         
494         if (getType() == TYPE_HORIZONTAL)
495         {
496             g.drawLine(this.cursorPosition, 0,this.cursorPosition, this.getHeight());
497             this.cursorPosition = cursorPosition;
498             g.drawLine(this.cursorPosition, 0,this.cursorPosition, this.getHeight());
499         }
500         else
501         {
502             g.drawLine( 0, this.cursorPosition, this.getWidth(), this.cursorPosition);
503             this.cursorPosition = cursorPosition;
504             g.drawLine(0, this.cursorPosition, this.getWidth(), this.cursorPosition);
505         }
506         
507         g.setPaintMode();
508    }
509
510     public JReportFrame getJReportFrame() {
511         return jReportFrame;
512     }
513
514     public void setJReportFrame(JReportFrame jReportFrame) {
515         this.jReportFrame = jReportFrame;
516     }
517     
518     public int convertUnitToPixel( double value, double unit)
519     {
520         if (unit == Unit.PIXEL) return (int)value;
521         return (int)Unit.convertToPixels(value,unit);
522     }
523
524     public int getType() {
525         return type;
526     }
527
528     public void setType(int type) {
529         if (type != this.type)
530         {
531             horizontalRuleStopIcon = new javax.swing.ImageIcon JavaDoc(getClass().getResource("/it/businesslogic/ireport/icons/toolbars/rulestop" + ((type == TYPE_VERTICAL) ? "v" : "") + ".png"));
532             this.type = type;
533         }
534     }
535
536     public void panelMousePressed(java.awt.event.MouseEvent JavaDoc evt) {
537         
538         // Look for an existing gridline....
539
int currentLine = -1;
540         for (int i=0; i<getGuideLines().size(); ++i)
541         {
542             Integer JavaDoc pos = (Integer JavaDoc)getGuideLines().get(i);
543             int posI = pos.intValue();
544             // Calc posI....
545
int scroll = (getType() == TYPE_HORIZONTAL) ? getJReportFrame().getHScroll() : getJReportFrame().getVScroll();
546             posI = 10 + (int)(posI*getJReportFrame().getZoomFactor()) - scroll;
547             
548             int mousePos = (getType() == TYPE_HORIZONTAL) ? evt.getX() : evt.getY();
549             
550             if (mousePos > posI-3 && mousePos < posI+3)
551             {
552                 currentLine = posI;
553                 getGuideLines().remove(i);
554                 break;
555             }
556         }
557         
558         savedImage = ((java.awt.image.BufferedImage JavaDoc)this.createImage(this.getWidth(), this.getHeight()));
559         Graphics2D savedGraphics = savedImage.createGraphics();
560         this.paint( savedGraphics );
561         
562         if (getType() == TYPE_HORIZONTAL) this.getGraphics().drawImage(horizontalRuleStopIcon.getImage(),evt.getX()-4, 7, this);
563         else this.getGraphics().drawImage(horizontalRuleStopIcon.getImage(),7, evt.getY()-4, this);
564         
565         lastTempGuidePosition = (getType() == TYPE_HORIZONTAL) ? evt.getX() : evt.getY();
566         Graphics2D jrfGraphics = (Graphics2D)this.getJReportFrame().getReportPanel().getGraphics();
567         Stroke oldStroke = jrfGraphics.getStroke();
568         jrfGraphics.setXORMode(java.awt.Color.YELLOW);
569         jrfGraphics.setStroke(getDottedStroke());
570         if (lastTempGuidePosition >= 0)
571         {
572             if (getType() == TYPE_HORIZONTAL) jrfGraphics.drawLine(currentLine, 0,currentLine,this.getJReportFrame().getHeight());
573             else jrfGraphics.drawLine(0,currentLine, this.getJReportFrame().getWidth(), currentLine);
574         }
575         if (getType() == TYPE_HORIZONTAL) jrfGraphics.drawLine(lastTempGuidePosition, 0,lastTempGuidePosition,this.getJReportFrame().getHeight());
576         else jrfGraphics.drawLine(0,lastTempGuidePosition, this.getJReportFrame().getWidth(), lastTempGuidePosition);
577         jrfGraphics.setPaintMode();
578         jrfGraphics.setStroke(oldStroke);
579     }
580     
581     public void panelMouseReleased(java.awt.event.MouseEvent JavaDoc evt) {
582         
583         this.getGraphics().drawImage(savedImage,0, 0, this);
584        
585         if (getType() == TYPE_HORIZONTAL)
586         {
587             if (evt.getX() > 0 && evt.getX() < this.getWidth())
588             {
589                 int newPosition = getJReportFrame().getLogicalDim((int)evt.getX()+getJReportFrame().getHScroll()-10);
590                 this.getGuideLines().add( new Integer JavaDoc(newPosition) );
591                 this.repaint();
592                 this.getJReportFrame().repaint();
593             }
594         }
595         else
596         {
597             if (evt.getY() > 0 && evt.getY() < this.getHeight())
598             {
599                 int newPosition = getJReportFrame().getLogicalDim((int)evt.getY()+getJReportFrame().getVScroll()-10);
600                 this.getGuideLines().add( new Integer JavaDoc(newPosition) );
601                 this.repaint();
602                 this.getJReportFrame().repaint();
603             }
604         }
605     }
606
607     public void panelMouseDragged(MouseEvent JavaDoc e) {
608   
609         this.getGraphics().drawImage(savedImage,0, 0, this);
610         
611         if (getType() == TYPE_HORIZONTAL)
612         {
613             this.getGraphics().drawImage(horizontalRuleStopIcon.getImage(),e.getX()-4, 7, this);
614         
615         }
616         else
617         {
618             this.getGraphics().drawImage(horizontalRuleStopIcon.getImage(),7, e.getY()-4, this);
619         }
620         
621         Graphics2D jrfGraphics = (Graphics2D)this.getJReportFrame().getReportPanel().getGraphics();
622         Stroke oldStroke = jrfGraphics.getStroke();
623         jrfGraphics.setXORMode(java.awt.Color.YELLOW);
624         jrfGraphics.setStroke(getDottedStroke());
625         if (lastTempGuidePosition >= 0)
626         {
627             if (getType() == TYPE_HORIZONTAL) jrfGraphics.drawLine(lastTempGuidePosition, 0,lastTempGuidePosition,this.getJReportFrame().getHeight());
628             else jrfGraphics.drawLine(0,lastTempGuidePosition, this.getJReportFrame().getWidth(), lastTempGuidePosition);
629         }
630         lastTempGuidePosition = (getType() == TYPE_HORIZONTAL) ? e.getX() : e.getY();
631         if (getType() == TYPE_HORIZONTAL) jrfGraphics.drawLine(lastTempGuidePosition, 0,lastTempGuidePosition,this.getJReportFrame().getHeight());
632         else jrfGraphics.drawLine(0,lastTempGuidePosition, this.getJReportFrame().getWidth(), lastTempGuidePosition);
633         jrfGraphics.setPaintMode();
634         jrfGraphics.setStroke(oldStroke);
635     }
636
637     public void panelMouseMoved(MouseEvent JavaDoc e) {
638         setCursorPosition( getType() == TYPE_HORIZONTAL ? e.getX() : e.getY());
639     }
640
641     public boolean isDragging() {
642         return dragging;
643     }
644
645     public void setDragging(boolean dragging) {
646         this.dragging = dragging;
647     }
648
649     public java.util.List JavaDoc getGuideLines() {
650         return guideLines;
651     }
652
653     public void setGuideLines(java.util.List JavaDoc guideLines) {
654         this.guideLines = guideLines;
655     }
656
657     public Stroke getDottedStroke() {
658         return dottedStroke;
659     }
660
661     public void setDottedStroke(Stroke dottedStroke) {
662         this.dottedStroke = dottedStroke;
663     }
664 }
665
Popular Tags