|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--de.uni_paderborn.robots.gui.ArenaCanvas
|
+--de.uni_paderborn.robots.gui.ArenaDesignerCanvas
Canvas of the ArenaDesignerFrame, which draws the arena and responds to mouse clicks on the fields.
| Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent, javax.swing.JComponent.ActionStandin, javax.swing.JComponent.IntVector, javax.swing.JComponent.KeyboardState |
| Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
| Field Summary | |
private ArenaDesignerFrame |
arenaDesignerFrame
link to ArenaDesignerFrame |
private static int |
EXIT
constant for exit 18 |
private Wormhole |
firstWormhole
first marked wormhole of two wormholes |
private static int |
FLOOR
constant for floor |
static int |
ICON_NUMBER
number of icons |
private int |
lastMouseRowColX
last mouse positions x-coordinate |
private int |
lastMouseRowColY
last mouse positions y-coordinate |
private static int |
lastPlacedItem
last placed item |
private static int |
ROBOT_FIELD
constant for robot field |
private static int |
WALL0
constant for wall 0 |
private static int |
WALL1
constant for wall 1 |
private static int |
WALL10
constant for wall 10 |
private static int |
WALL11
constant for wall 11 |
private static int |
WALL12
constant for wall 12 |
private static int |
WALL13
constant for wall 13 |
private static int |
WALL14
constant for wall 14 |
private static int |
WALL15
constant for wall 15 |
private static int |
WALL2
constant for wall 2 |
private static int |
WALL3
constant for wall 3 |
private static int |
WALL4
constant for wall 4 |
private static int |
WALL5
constant for wall 5 |
private static int |
WALL6
constant for wall 6 |
private static int |
WALL7
constant for wall 7 |
private static int |
WALL8
constant for wall 8 |
private static int |
WALL9
constant for wall 9 |
private static int |
WELL
constant for well 17 |
private static int |
WORMHOLE
constant for wormhole |
| Fields inherited from class de.uni_paderborn.robots.gui.ArenaCanvas |
arenaImages, fields, zoom |
| Fields inherited from class javax.swing.JComponent |
_bounds, accessibleContext, actionMap, ACTIONMAP_CREATED, alignmentX, alignmentY, ANCESTOR_INPUTMAP_CREATED, ANCESTOR_USING_BUFFER, ancestorInputMap, ancestorNotifier, autoscroller, border, changeSupport, clientProperties, CREATED_DOUBLE_BUFFER, flags, FOCUS_INPUTMAP_CREATED, focusInputMap, HAS_FOCUS, htmlKey, htmlView, inputVerifier, IS_DOUBLE_BUFFERED, IS_OPAQUE, IS_PAINTING_TILE, IS_PRINTING, IS_PRINTING_ALL, KEY_EVENTS_ENABLED, KEYBOARD_BINDINGS_KEY, listenerList, maximumSize, minimumSize, NEXT_FOCUS, paintImmediatelyClip, paintingChild, preferredSize, readObjectCallbacks, REQUEST_FOCUS_DISABLED, tmpRect, TOOL_TIP_TEXT_KEY, ui, uiClassID, UNDEFINED_CONDITION, verifyInputWhenFocusTarget, vetoableChangeSupport, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW, WHEN_IN_FOCUSED_WINDOW_BINDINGS, WIF_INPUTMAP_CREATED, windowInputMap |
| Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads, serialVersionUID |
| Fields inherited from class java.awt.Component |
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
ArenaDesignerCanvas(ArenaDesignerFrame arenaDesignerFrame,
Fields fields,
boolean zoom)
constructor, creates a new ArenaDesignerCanvas |
|
| Method Summary | |
private java.awt.Point |
calculateRowCol(int x,
int y)
This method calculates the column and row of the field in the arena where the mouse click occured. |
static int |
getLastPlacedItem()
This method gets the last placed item |
void |
getMouseClick(java.awt.event.MouseEvent e)
This method is executed if the user clicks with the mouse button, to place an item on a specified field. |
private Item |
getNewItem(int item)
This method creates a new item specified by the number and returns it. |
private int |
getNextUsefulItem(int x,
int y)
This method computes the next useful item which can be placed on the given field. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Empty implementation. |
void |
mouseDragged(java.awt.event.MouseEvent e)
This method is executed if the user clicks with the mouse button, to place an item on a specified field and drag the mouse. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Empty implementation. |
void |
mouseExited(java.awt.event.MouseEvent e)
Empty implementation. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Empty implementation. |
void |
mousePressed(java.awt.event.MouseEvent e)
This method is executed if the user presses a mouse button, to mark the first wormhole of two wormholes which should be connected. |
void |
mouseReleased(java.awt.event.MouseEvent e)
This method is executed if the user releases a mouse button, to mark the second wormhole of two wormholes which should be connected. |
void |
paint(java.awt.Graphics g)
Draws the arena fields and its contents. |
static void |
setLastPlacedItem(int item)
This method sets the last placed item |
| Methods inherited from class de.uni_paderborn.robots.gui.ArenaCanvas |
drawField, getFields, getZoom, setFields, setZoom |
| Methods inherited from class javax.swing.JComponent |
_paintImmediately, |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getLayout, getMouseEventTarget, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFocusOwner, setLayout, transferFocus, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, constructComponentName, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, getWindowForObject, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isEnabledImpl, isLightweight, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resetGC, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
| Field Detail |
public static final int ICON_NUMBER
private static final int FLOOR
private static final int WALL0
private static final int WALL1
private static final int WALL2
private static final int WALL3
private static final int WALL4
private static final int WALL5
private static final int WALL6
private static final int WALL7
private static final int WALL8
private static final int WALL9
private static final int WALL10
private static final int WALL11
private static final int WALL12
private static final int WALL13
private static final int WALL14
private static final int WALL15
private static final int WELL
private static final int EXIT
private static final int WORMHOLE
private static final int ROBOT_FIELD
private static int lastPlacedItem
private int lastMouseRowColX
private int lastMouseRowColY
private ArenaDesignerFrame arenaDesignerFrame
private Wormhole firstWormhole
| Constructor Detail |
public ArenaDesignerCanvas(ArenaDesignerFrame arenaDesignerFrame,
Fields fields,
boolean zoom)
fields - Fields-object with the fields of the arenazoom - initial zoom of canvas| Method Detail |
public void getMouseClick(java.awt.event.MouseEvent e)
e - MouseEvent object
private int getNextUsefulItem(int x,
int y)
x - x-coordinate of fieldy - y-coordinate of field
private java.awt.Point calculateRowCol(int x,
int y)
x - x-coordinate in componenty - y-coordinate in componentpublic void paint(java.awt.Graphics g)
paint in class ArenaCanvasg - Graphics objectpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - MouseEvent objectpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenere - MouseEvent objectpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - MouseEvent objectpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenere - MouseEvent objectpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenere - MouseEvent objectpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - MouseEvent objectpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - MouseEvent objectprivate Item getNewItem(int item)
item - int identifier for itempublic static void setLastPlacedItem(int item)
item - int identifier for itempublic static int getLastPlacedItem()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||