This class represents a JComponent
on which all map elements are painted. It just creates the basic system which is needed, rendering itself is delegated to the Renderer-class!
- See Also
- vanetsim.gui.Renderer
vanetsim.gui.DrawingArea.DrawingArea |
( |
boolean |
useDoubleBuffer, |
|
|
boolean |
drawManualBuffered |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
useDoubleBuffer | true to set DoubleBuffering on, false to set it off |
drawManualBuffered | set to true to use a BufferdImage for drawing (manual DoubleBuffering) |
void vanetsim.gui.DrawingArea.keyPressed |
( |
KeyEvent |
e | ) |
|
|
inline |
Allows panning through pressing the keyboard arrows.
- Parameters
-
- See Also
- java.awt.event.KeyListener::keyPressed(java.awt.event.KeyEvent)
void vanetsim.gui.DrawingArea.keyReleased |
( |
KeyEvent |
e | ) |
|
|
inline |
Does nothing. Just necessary to implement the KeyListener
.
- Parameters
-
- See Also
- java.awt.event.KeyListener::keyReleased(java.awt.event.KeyEvent)
void vanetsim.gui.DrawingArea.keyTyped |
( |
KeyEvent |
e | ) |
|
|
inline |
Does nothing. Just necessary to implement the KeyListener
.
- Parameters
-
- See Also
- java.awt.event.KeyListener::keyTyped(java.awt.event.KeyEvent)
void vanetsim.gui.DrawingArea.mouseClicked |
( |
MouseEvent |
e | ) |
|
|
inline |
Does nothing. Just necessary to implement the MouseListener
.
- Parameters
-
- See Also
- java.awt.event.MouseListener::mouseClicked(java.awt.event.MouseEvent)
void vanetsim.gui.DrawingArea.mouseEntered |
( |
MouseEvent |
e | ) |
|
|
inline |
Notifies the MouseDragManager
that mouse entered this area.
- Parameters
-
- See Also
- java.awt.event.MouseListener::mouseEntered(java.awt.event.MouseEvent)
void vanetsim.gui.DrawingArea.mouseExited |
( |
MouseEvent |
e | ) |
|
|
inline |
Notifies the MouseDragManager
that mouse left this area.
- Parameters
-
- See Also
- java.awt.event.MouseListener::mouseExited(java.awt.event.MouseEvent)
void vanetsim.gui.DrawingArea.mousePressed |
( |
MouseEvent |
e | ) |
|
|
inline |
Tracks clicks in order to get focus and allow to get information about points on the map or edit something on the map. The work itself is done in the MousedragManager
.
- Parameters
-
- See Also
- java.awt.event.MouseListener::mousePressed(java.awt.event.MouseEvent)
void vanetsim.gui.DrawingArea.mouseReleased |
( |
MouseEvent |
e | ) |
|
|
inline |
Used for panning through mousedragging through the MousedragManager
.
- Parameters
-
- See Also
- java.awt.event.MouseListener::mouseReleased(java.awt.event.MouseEvent)
void vanetsim.gui.DrawingArea.mouseWheelMoved |
( |
MouseWheelEvent |
e | ) |
|
|
inline |
Listener for mouse scrolls.
- Parameters
-
- See Also
- java.awt.event.MouseWheelListener::mouseWheelMoved(java.awt.event.MouseWheelEvent)
void vanetsim.gui.DrawingArea.paintComponent |
( |
Graphics |
g | ) |
|
|
inline |
This method gets automatically called on a repaint()
. Therefore, rendering is delegated from here to the renderer.
- Parameters
-
g | the Graphics object to paint on |
void vanetsim.gui.DrawingArea.paintImmediately |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
inline |
Setting the RepaintManager
like seen on the official examples for Java2D (link last time checked on 12.08.2008).
This imitates the "On Screen" method used there and in some cases drastically improves performance (even when DoubleBuffering of this JComponent
is off the DoubleBuffering might still be on because the DoubleBuffering is inherited from the main JFrame
!).
- Parameters
-
x | the x coordinate for the bounding box to repaint |
y | the y coordinate for the bounding box to repaint |
width | the width |
height | the height |
void vanetsim.gui.DrawingArea.prepareBufferedImages |
( |
| ) |
|
|
inline |
Prepares all BufferedImages
and notifies the Renderer of a new drawing area size.
void vanetsim.gui.DrawingArea.revalidate |
( |
| ) |
|
|
inline |
This function gets called when a property value changes such that size, location or internal layout of change. We then need to check if our BufferdImages
still have the correct size and create new ones if needed!
The documentation for this class was generated from the following file:
- /Users/andreastomandl/Desktop/Vanet-Sim/Simulator/src/vanetsim/gui/DrawingArea.java