Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.zazof.jteg.gui
Class CardContainerCanvas  view CardContainerCanvas download CardContainerCanvas.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended byorg.zazof.jteg.gui.CardContainerCanvas
All Implemented Interfaces:
javax.accessibility.Accessible, org.zazof.jteg.CardControllerListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable, java.awt.event.WindowListener

public class CardContainerCanvas
extends java.awt.Canvas
implements org.zazof.jteg.CardControllerListener, java.awt.event.MouseListener, java.awt.event.WindowListener

CardContainerCanvas is the class responsible for drawing the Cardset of the user of this client. It is the 'container' that will hold references to CardCanvas objects ,... It also implements the MouseListener interface for interaction with the user.


Nested Class Summary
 
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  java.util.Vector $cardCanvasList
           
private  org.zazof.jteg.CardController $currentController
           
private  javax.swing.JFrame $parent
           
private  java.awt.image.BufferedImage bi
           
private static boolean DEBUG
           
private  java.awt.Graphics2D g2d
           
 
Fields inherited from class java.awt.Canvas
 
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
CardContainerCanvas(javax.swing.JFrame parent)
          Constructor
 
Method Summary
 void cardsChanged(org.zazof.jteg.CardController cc)
          Method that mentions to the CardContainerCanvas that the cards have changed.
 org.zazof.jteg.Card getCardAt(int xCoord, int yCoord)
          Returns the card at the specified absolute coordinates.
 org.zazof.jteg.Card getCardAtPosition(int relativePosition)
          Returns the card at the specified relative position.
 java.lang.String[] getExchangeParams()
           
 void mouseClicked(java.awt.event.MouseEvent me)
          Handles the actions that happen when a Mousebutton is clicked
 void mouseEntered(java.awt.event.MouseEvent me)
          This method is called when the mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent me)
          This method is called when the mouse exits a component.
 void mousePressed(java.awt.event.MouseEvent me)
          This method is called when the mouse is pressed over a component.
 void mouseReleased(java.awt.event.MouseEvent me)
          This method is called when the mouse is released over a component.
 void paint(java.awt.Graphics g)
          Repaints the canvas window.
 void update(java.awt.Graphics g)
          Draw & Paint method.
 void windowActivated(java.awt.event.WindowEvent we)
          This method is called when a window is activated.
 void windowClosed(java.awt.event.WindowEvent we)
          This method is called when the window is closed.
 void windowClosing(java.awt.event.WindowEvent we)
          This method is called when the user calls the system menu close function, giving the program a chance to cancel the close.
 void windowDeactivated(java.awt.event.WindowEvent we)
          This method is called when the window is deactivated.
 void windowDeiconified(java.awt.event.WindowEvent we)
          This method is called when the window is deiconified.
 void windowIconified(java.awt.event.WindowEvent we)
          This method is called when the window is iconified.
 void windowOpened(java.awt.event.WindowEvent we)
          This method is called when the window is made visible.
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

$parent

private javax.swing.JFrame $parent

$currentController

private org.zazof.jteg.CardController $currentController

bi

private java.awt.image.BufferedImage bi

g2d

private java.awt.Graphics2D g2d

$cardCanvasList

private java.util.Vector $cardCanvasList

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

CardContainerCanvas

public CardContainerCanvas(javax.swing.JFrame parent)
Constructor

Method Detail

cardsChanged

public void cardsChanged(org.zazof.jteg.CardController cc)
Method that mentions to the CardContainerCanvas that the cards have changed.

Specified by:
cardsChanged in interface org.zazof.jteg.CardControllerListener

paint

public void paint(java.awt.Graphics g)
Description copied from class: java.awt.Canvas
Repaints the canvas window. This method should be overridden by a subclass to do something useful, as this method simply paints the window with the background color.


update

public void update(java.awt.Graphics g)
Draw & Paint method. Draws the different cards, with their selectionbox and the Put-2-armies button.


mouseClicked

public void mouseClicked(java.awt.event.MouseEvent me)
Handles the actions that happen when a Mousebutton is clicked

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent me)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse enters a component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent me)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse exits a component.

Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse is pressed over a component.

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse is released over a component.

Specified by:
mouseReleased in interface java.awt.event.MouseListener

getCardAt

public org.zazof.jteg.Card getCardAt(int xCoord,
                                     int yCoord)
Returns the card at the specified absolute coordinates. Returns null if no card is at that position


getCardAtPosition

public org.zazof.jteg.Card getCardAtPosition(int relativePosition)
Returns the card at the specified relative position. Returns null if there is no card active at that position


windowOpened

public void windowOpened(java.awt.event.WindowEvent we)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is made visible.

Specified by:
windowOpened in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent we)
Description copied from interface: java.awt.event.WindowListener
This method is called when the user calls the system menu close function, giving the program a chance to cancel the close.

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent we)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is closed.

Specified by:
windowClosed in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent we)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is iconified.

Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent we)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is deiconified.

Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent we)
Description copied from interface: java.awt.event.WindowListener
This method is called when a window is activated. Only Frames and Dialogs can be active, and the active window always contains the component with focus.

Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent we)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is deactivated.

Specified by:
windowDeactivated in interface java.awt.event.WindowListener

getExchangeParams

public java.lang.String[] getExchangeParams()
                                     throws org.zazof.jteg.IllegalExchangeException