|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
vanetsim.gui.DrawingArea
public final class DrawingArea
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!
Renderer,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
DrawingArea(boolean useDoubleBuffer,
boolean drawManualBuffered)
Constructor. |
|
| Method Summary | |
|---|---|
void |
keyPressed(java.awt.event.KeyEvent e)
Allows panning through pressing the keyboard arrows. |
void |
keyReleased(java.awt.event.KeyEvent e)
Does nothing. |
void |
keyTyped(java.awt.event.KeyEvent e)
Does nothing. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Does nothing. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Notifies the MouseDragManager that mouse entered this area. |
void |
mouseExited(java.awt.event.MouseEvent e)
Notifies the MouseDragManager that mouse left this area. |
void |
mousePressed(java.awt.event.MouseEvent e)
Tracks clicks in order to get focus and allow to get information about points on the map or edit something on the map. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Used for panning through mousedragging through the MousedragManager. |
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Listener for mouse scrolls. |
void |
paintComponent(java.awt.Graphics g)
This method gets automatically called on a repaint(). |
void |
paintImmediately(int x,
int y,
int width,
int height)
Setting the RepaintManager like seen
on the official examples for Java2D
(link last time checked on 12.08.2008). |
void |
prepareBufferedImages()
Prepares all BufferedImages and notifies the Renderer of a new drawing area size. |
void |
revalidate()
This function gets called when a property value changes such that size, location or internal layout of change. |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DrawingArea(boolean useDoubleBuffer,
boolean drawManualBuffered)
useDoubleBuffer - true to set DoubleBuffering on, false to set it offdrawManualBuffered - set to true to use a BufferdImage for drawing (manual DoubleBuffering)| Method Detail |
|---|
public void paintComponent(java.awt.Graphics g)
repaint(). Therefore, rendering is delegated from here to
the renderer.
paintComponent in class javax.swing.JComponentg - the Graphics object to paint onpublic void prepareBufferedImages()
BufferedImages and notifies the Renderer of a new drawing area size.
public void revalidate()
BufferdImages still have the correct size and create new ones if needed!
revalidate in class javax.swing.JComponent
public void paintImmediately(int x,
int y,
int width,
int height)
RepaintManager like seen
on the official examples for Java2D
(link last time checked on 12.08.2008).JComponent is off the DoubleBuffering might still be on because the
DoubleBuffering is inherited from the main JFrame!).
paintImmediately in class javax.swing.JComponentx - the x coordinate for the bounding box to repainty - the y coordinate for the bounding box to repaintwidth - the widthheight - the heightpublic void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved in interface java.awt.event.MouseWheelListenere - the MouseWheelEventMouseWheelListener.mouseWheelMoved(java.awt.event.MouseWheelEvent)public void keyTyped(java.awt.event.KeyEvent e)
KeyListener.
keyTyped in interface java.awt.event.KeyListenere - the KeyEventKeyListener.keyTyped(java.awt.event.KeyEvent)public void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenere - the KeyEventKeyListener.keyPressed(java.awt.event.KeyEvent)public void mousePressed(java.awt.event.MouseEvent e)
MousedragManager.
mousePressed in interface java.awt.event.MouseListenere - the MouseEventMouseListener.mousePressed(java.awt.event.MouseEvent)public void mouseReleased(java.awt.event.MouseEvent e)
MousedragManager.
mouseReleased in interface java.awt.event.MouseListenere - the MouseEventMouseListener.mouseReleased(java.awt.event.MouseEvent)public void keyReleased(java.awt.event.KeyEvent e)
KeyListener.
keyReleased in interface java.awt.event.KeyListenere - the KeyEventKeyListener.keyReleased(java.awt.event.KeyEvent)public void mouseClicked(java.awt.event.MouseEvent e)
MouseListener.
mouseClicked in interface java.awt.event.MouseListenere - the MouseEventMouseListener.mouseClicked(java.awt.event.MouseEvent)public void mouseEntered(java.awt.event.MouseEvent e)
MouseDragManager that mouse entered this area.
mouseEntered in interface java.awt.event.MouseListenere - the MouseEventMouseListener.mouseEntered(java.awt.event.MouseEvent)public void mouseExited(java.awt.event.MouseEvent e)
MouseDragManager that mouse left this area.
mouseExited in interface java.awt.event.MouseListenere - the MouseEventMouseListener.mouseExited(java.awt.event.MouseEvent)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||