KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thoughtriver > open > vectorvisuals > VVViewPane


1 /*
2  * VVViewPane.java
3  *
4  * Created on 24/05/2005
5  */

6
7 package com.thoughtriver.open.vectorvisuals;
8
9 import java.awt.*;
10 import java.awt.event.*;
11
12 /**
13  * This interface must be implemented by any <CODE>Component</CODE> that is to
14  * be used as a rendering surface for the Vector Visuals system. An instance of
15  * such a <CODE>Component</CODE> must be passed into the constructor of the
16  * <CODE>VVDisplay</CODE> class.
17  *
18  * @author Brandon Franklin
19  * @version $Date: 2006/11/25 09:18:36 $
20  */

21 public interface VVViewPane {
22
23     /**
24      * Sets the focusable state of this <CODE>Component</CODE> to the
25      * specified value. This value overrides the <CODE>Component</CODE>'s
26      * default focusability.
27      *
28      * @param focusable indicates whether this <CODE>Component</CODE> is
29      * focusable
30      */

31     void setFocusable(boolean focusable);
32
33     /**
34      * Repaints this <CODE>Component</CODE>.
35      * <P>
36      * If this <CODE>Component</CODE> is a lightweight <CODE>Component</CODE>,
37      * this method causes a call to this <CODE>Component</CODE>'s <CODE>paint</CODE>
38      * method as soon as possible. Otherwise, this method causes a call to this
39      * <CODE>Component</CODE>'s <CODE>update</CODE> method as soon as
40      * possible.
41      */

42     void repaint();
43
44     /**
45      * Returns the current width of this <CODE>Component</CODE>.
46      *
47      * @return the current width of this <CODE>Component</CODE>
48      */

49     int getWidth();
50
51     /**
52      * Returns the current height of this <CODE>Component</CODE>.
53      *
54      * @return the current height of this <CODE>Component</CODE>
55      */

56     int getHeight();
57
58     /**
59      * Returns the background <CODE>Color</CODE> of this <CODE>Component</CODE>.
60      *
61      * @return this <CODE>Component</CODE>'s background <CODE>Color</CODE>;
62      * if this <CODE>Component</CODE> does not have a background
63      * <CODE>Color</CODE>, the background <CODE>Color</CODE> of its
64      * parent is returned
65      */

66     Color getBackground();
67
68     /**
69      * Adds the specified <CODE>MouseListener</CODE> to receive mouse events
70      * from this <CODE>Component</CODE>.
71      *
72      * @param listener the <CODE>MouseListener</CODE> to add
73      */

74     void addMouseListener(MouseListener listener);
75
76     /**
77      * Removes the specified <CODE>MouseListener</CODE> so that it no longer
78      * receives mouse events from this <CODE>Component</CODE>.
79      *
80      * @param listener the <CODE>MouseListener</CODE> to remove
81      */

82     void removeMouseListener(MouseListener listener);
83
84     /**
85      * Adds the specified <CODE>MouseMotionListener</CODE> to receive mouse
86      * motion events from this <CODE>Component</CODE>.
87      *
88      * @param listener the <CODE>MouseMotionListener</CODE> to add
89      */

90     void addMouseMotionListener(MouseMotionListener listener);
91
92     /**
93      * Removes the specified <CODE>MouseMotionListener</CODE> so that it no
94      * longer receives mouse motion events from this <CODE>Component</CODE>.
95      *
96      * @param listener the <CODE>MouseMotionListener</CODE> to remove
97      */

98     void removeMouseMotionListener(MouseMotionListener listener);
99
100     /**
101      * Adds the specified <CODE>MouseWheelListener</CODE> to receive mouse
102      * wheel events from this <CODE>Component</CODE>.
103      *
104      * @param listener the <CODE>MouseWheelListener</CODE> to add
105      */

106     void addMouseWheelListener(MouseWheelListener listener);
107
108     /**
109      * Removes the specified <CODE>MouseWheelListener</CODE> so that it no
110      * longer receives mouse wheel events from this <CODE>Component</CODE>.
111      *
112      * @param listener the <CODE>MouseWheelListener</CODE> to remove
113      */

114     void removeMouseWheelListener(MouseWheelListener listener);
115
116     /**
117      * Provides this <CODE>VVViewPane</CODE> with a reference to the <CODE>VVDisplay</CODE>
118      * that is being used to control the vector world, and that should be used
119      * for <CODE>paint</CODE> calls.
120      *
121      * @param vvDisplay the <CODE>VVDisplay</CODE> that is being used to
122      * control the vector world
123      */

124     void setVVDisplay(VVDisplay vvDisplay);
125
126 }
127
Popular Tags