View Javadoc

1   /*
2    *  File: IMiscRenderer.java 
3    *  Copyright (c) 2004-2008  Peter Kliem (Peter.Kliem@jaret.de)
4    *  A commercial license is available, see http://www.jaret.de.
5    *
6    *  This program is free software; you can redistribute it and/or modify
7    *  it under the terms of the GNU General Public License as published by
8    *  the Free Software Foundation; either version 2 of the License, or
9    *  (at your option) any later version.
10   *
11   *  This program is distributed in the hope that it will be useful,
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   *  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, write to the Free Software
18   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19   */
20  package de.jaret.util.ui.timebars.swing.renderer;
21  
22  import java.awt.Graphics;
23  import java.awt.Rectangle;
24  
25  import de.jaret.util.ui.timebars.TimeBarViewerDelegate;
26  import de.jaret.util.ui.timebars.swing.TimeBarViewer;
27  
28  /**
29   * Interface describing a renderer for various elements in the swing time bar viewer.
30   * 
31   * @author kliem
32   * @version $Id: IMiscRenderer.java 802 2008-12-28 12:30:41Z kliem $
33   */
34  public interface IMiscRenderer {
35      /**
36       * Render the selected region.
37       * 
38       * @param graphics Graphics to paint with
39       * @param tbv timebar viewer
40       * @param delegate the delegate
41       */
42      void renderRegionRect(Graphics graphics, TimeBarViewer tbv, TimeBarViewerDelegate delegate);
43  
44      /**
45       * Render the selection rectangle.
46       * 
47       * @param graphics Graphics to paint with
48       * @param tbv timebar viewer
49       * @param selectionRect the selection rectangle in coordinates
50       */
51      void renderSelectionRect(Graphics graphics, TimeBarViewer tbv, Rectangle selectionRect);
52  
53      /**
54       * Draw a row gridline for the time bar viewer.
55       * 
56       * @param graphics Graphics to draw with
57       * @param x1 start x
58       * @param y1 start y
59       * @param x2 end x
60       * @param y2 end y
61       */
62      void drawRowGridLine(Graphics graphics, int x1, int y1, int x2, int y2);
63  
64      /**
65       * Draw a row background for the time bar viewer if a row is either selected or highlighted.
66       * 
67       * @param graphics Graphics to paint with
68       * @param x x cord
69       * @param y y coord
70       * @param width width of the area
71       * @param height height of the area
72       * @param selected true if the row is selected
73       * @param highlighted true if the row is highlighted
74       */
75      void drawRowBackground(Graphics graphics, int x, int y, int width, int height, boolean selected, boolean highlighted);
76  
77  }