infinitewisdom.view
Class GameWorldView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by infinitewisdom.view.GameWorldView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
GameWorldViewDom1

public abstract class GameWorldView
extends javax.swing.JPanel

See Also:
Serialized Form

Nested Class Summary
static class GameWorldView.GWVState
           
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean captureKeys
           
protected  boolean cheat
           
protected  CheatManagerIF cheatManager
          Currenly only manages who can see a unit's goal.
protected  GameWorld gameWorld
           
protected  GameWorldView.GWVState gwvstate
          GameWorldView state.
protected  java.util.List<OverlayIF> overlays
           
protected  PlayerIF player
           
protected  java.util.List<PlayerView> playerViews
           
protected  double scale
           
protected  UnitView selectedUnitView
           
protected  javax.swing.JPanel toppanel
           
protected  Vec2f transIncrement
           
protected  Vec2f translate
           
protected  UnitControlPanel unitControlPanel
           
 java.awt.Font unitlabels
          Lazy
protected  java.util.List<UnitSelectionListener> unitListeners
           
protected  UnitPalette unitPalette
           
protected  java.util.List<UnitView> unitviews
           
protected  ViewConfig viewConfig
           
protected  double zoomRate
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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
GameWorldView(GameWorld gw, CheatManagerIF lp)
           
 
Method Summary
 void addUnitSelectionListener(UnitSelectionListener ul)
           
 void createViewForNewUnits()
           
 GameWorld getGameWorld()
           
 java.util.List<OverlayIF> getOverlays()
           
 PlayerIF getPlayer()
           
 java.util.List<PlayerView> getPlayerViews()
           
 double getScale()
           
 UnitView getSelectedUnitView()
           
 javax.swing.JPanel getToppanel()
           
 Vec2f getTranslate()
           
 java.util.List<UnitView> getUnitviews()
           
 ViewConfig getViewConfig()
           
 boolean isCaptureKeys()
           
 boolean isCheat()
           
 void overlaytest(java.awt.Graphics graphics)
          Deprecated.
 void paint(java.awt.Graphics g)
           
 void scrollDown()
           
 void scrollLeft()
           
 void scrollRight()
           
 void scrollUp()
           
 void setCaptureKeys(boolean captureKeys)
           
 void setCheat(boolean cheat)
           
 void setPlayer(PlayerIF player)
           
 void setPlayerViews(java.util.List<PlayerView> playerViews)
           
 void setScale(double scale)
           
 void setState(GameWorldView.GWVState st)
          Used by UnitControlPanel, when it gives back the control to GameWorldView.
 void setToppanel(javax.swing.JPanel toppanel)
           
 void setTranslate(Vec2f translate)
           
 void setUnitControlPanel(UnitControlPanel controlPanel)
           
 void setUnitPalette(UnitPalette unitPalette)
           
protected  void signalUnitSelected()
           
 Vec2f UIToWorldCoord(java.awt.Point p)
           
 UnitView unitSelector(java.awt.Point p)
           
 java.awt.Point WorldToUICoord(Vec2f v)
           
 void zoomin()
           
 void zoomout()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

viewConfig

protected ViewConfig viewConfig

scale

protected double scale

translate

protected Vec2f translate

transIncrement

protected Vec2f transIncrement

zoomRate

protected final double zoomRate
See Also:
Constant Field Values

unitlabels

public java.awt.Font unitlabels
Lazy


gameWorld

protected GameWorld gameWorld

playerViews

protected java.util.List<PlayerView> playerViews

unitviews

protected java.util.List<UnitView> unitviews

unitListeners

protected java.util.List<UnitSelectionListener> unitListeners

selectedUnitView

protected UnitView selectedUnitView

cheatManager

protected CheatManagerIF cheatManager
Currenly only manages who can see a unit's goal.


player

protected PlayerIF player

unitControlPanel

protected UnitControlPanel unitControlPanel

toppanel

protected javax.swing.JPanel toppanel

unitPalette

protected UnitPalette unitPalette

cheat

protected boolean cheat

captureKeys

protected boolean captureKeys

gwvstate

protected GameWorldView.GWVState gwvstate
GameWorldView state.


overlays

protected java.util.List<OverlayIF> overlays
Constructor Detail

GameWorldView

public GameWorldView(GameWorld gw,
                     CheatManagerIF lp)
Method Detail

isCaptureKeys

public boolean isCaptureKeys()

setCaptureKeys

public void setCaptureKeys(boolean captureKeys)

unitSelector

public UnitView unitSelector(java.awt.Point p)

setState

public void setState(GameWorldView.GWVState st)
Used by UnitControlPanel, when it gives back the control to GameWorldView.


UIToWorldCoord

public Vec2f UIToWorldCoord(java.awt.Point p)

WorldToUICoord

public java.awt.Point WorldToUICoord(Vec2f v)

signalUnitSelected

protected void signalUnitSelected()

getPlayerViews

public java.util.List<PlayerView> getPlayerViews()

setPlayerViews

public void setPlayerViews(java.util.List<PlayerView> playerViews)

getTranslate

public Vec2f getTranslate()

setTranslate

public void setTranslate(Vec2f translate)

getScale

public double getScale()

setScale

public void setScale(double scale)

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class javax.swing.JComponent

overlaytest

public void overlaytest(java.awt.Graphics graphics)
Deprecated. see drawOverlays(Graphics g)

Parameters:
graphics -

addUnitSelectionListener

public void addUnitSelectionListener(UnitSelectionListener ul)

setUnitControlPanel

public void setUnitControlPanel(UnitControlPanel controlPanel)

getToppanel

public javax.swing.JPanel getToppanel()

setToppanel

public void setToppanel(javax.swing.JPanel toppanel)

getGameWorld

public GameWorld getGameWorld()

getPlayer

public PlayerIF getPlayer()

setPlayer

public void setPlayer(PlayerIF player)

zoomin

public void zoomin()

zoomout

public void zoomout()

scrollLeft

public void scrollLeft()

scrollRight

public void scrollRight()

scrollUp

public void scrollUp()

scrollDown

public void scrollDown()

getOverlays

public java.util.List<OverlayIF> getOverlays()

isCheat

public boolean isCheat()

setCheat

public void setCheat(boolean cheat)

createViewForNewUnits

public void createViewForNewUnits()

getViewConfig

public ViewConfig getViewConfig()

setUnitPalette

public void setUnitPalette(UnitPalette unitPalette)

getUnitviews

public java.util.List<UnitView> getUnitviews()

getSelectedUnitView

public UnitView getSelectedUnitView()