Package ruscz.game.gameOfProd.Windows
Class WindowOfBattle
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- ruscz.game.gameOfProd.Windows.WindowOfBattle
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible
public class WindowOfBattle extends javax.swing.JPanelThis class holds JPanel used for battle sequences It also holds references to all main classes used for battle- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classWindowOfBattle.CanvasThis class handles repainting of all battle elements and entities-
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
-
-
Field Summary
Fields Modifier and Type Field Description private Battlebattleprivate WindowOfBattle.Canvascanvasstatic intCANVAS_HEIGHTstatic intCANVAS_WIDTHstatic intCELL_SIZEprivate CommandListcommandListprivate ConsoleInputconsoleInputprivate EnemyDescriptionenemyDescriptionprivate Gamegameprivate java.lang.StringhitSoundprivate static booleanisReadyToPaintprivate booleanisRunAwayPossibleprivate ItemsInventoryitemsInventoryprivate static intKEY_ESCAPEprivate java.lang.StringloseCutsceneprivate MenuOfActionsmenuOfActionsprivate MusicManagermusicManagerprivate java.lang.Stringnameprivate SituationTextsituationTextprivate java.lang.StringwinCutscene-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description WindowOfBattle(Game game)
-
Method Summary
Modifier and Type Method Description BattlegetBattle()WindowOfBattle.CanvasgetCanvas()CommandListgetCommandList()ConsoleInputgetConsoleInput()EnemyDescriptiongetEnemyDescription()GamegetGame()java.lang.StringgetHitSound()ItemsInventorygetItemsInventory()java.lang.StringgetLoseCutscene()MenuOfActionsgetMenuOfActions()MusicManagergetMusicManager()java.lang.StringgetName()SituationTextgetSituationText()java.lang.StringgetWinCutscene()booleanisRunAwayPossible()voidstart(java.lang.String name)Starts battle sequence - parses actors and other assetsjavax.swing.JButtonstyle(javax.swing.JButton button)Styles buttonvoidwriteToOutput(java.lang.String s)Displays text in situationText field-
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintComponent, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printComponent, printChildren, 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, 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, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, checkImage, checkImage, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
CELL_SIZE
public static final int CELL_SIZE
- See Also:
- Constant Field Values
-
CANVAS_WIDTH
public static int CANVAS_WIDTH
-
CANVAS_HEIGHT
public static int CANVAS_HEIGHT
-
KEY_ESCAPE
private static final int KEY_ESCAPE
- See Also:
- Constant Field Values
-
isReadyToPaint
private static boolean isReadyToPaint
-
canvas
private final WindowOfBattle.Canvas canvas
-
situationText
private final SituationText situationText
-
enemyDescription
private final EnemyDescription enemyDescription
-
menuOfActions
private final MenuOfActions menuOfActions
-
consoleInput
private final ConsoleInput consoleInput
-
commandList
private final CommandList commandList
-
itemsInventory
private final ItemsInventory itemsInventory
-
game
private final Game game
-
battle
private Battle battle
-
musicManager
private MusicManager musicManager
-
winCutscene
private java.lang.String winCutscene
-
loseCutscene
private java.lang.String loseCutscene
-
name
private java.lang.String name
-
hitSound
private java.lang.String hitSound
-
isRunAwayPossible
private boolean isRunAwayPossible
-
-
Constructor Detail
-
WindowOfBattle
public WindowOfBattle(Game game)
-
-
Method Detail
-
getSituationText
public SituationText getSituationText()
-
getEnemyDescription
public EnemyDescription getEnemyDescription()
-
getMenuOfActions
public MenuOfActions getMenuOfActions()
-
getConsoleInput
public ConsoleInput getConsoleInput()
-
getCommandList
public CommandList getCommandList()
-
getItemsInventory
public ItemsInventory getItemsInventory()
-
getBattle
public Battle getBattle()
-
start
public void start(java.lang.String name)
Starts battle sequence - parses actors and other assets- Parameters:
name- is battle file name
-
getCanvas
public WindowOfBattle.Canvas getCanvas()
-
writeToOutput
public void writeToOutput(java.lang.String s)
Displays text in situationText field- Parameters:
s- is text to be displayed
-
style
public javax.swing.JButton style(javax.swing.JButton button)
Styles button- Parameters:
button- is button to be styled- Returns:
- styled button
-
getGame
public Game getGame()
-
getMusicManager
public MusicManager getMusicManager()
-
getWinCutscene
public java.lang.String getWinCutscene()
-
getLoseCutscene
public java.lang.String getLoseCutscene()
-
getName
public java.lang.String getName()
- Overrides:
getNamein classjava.awt.Component
-
getHitSound
public java.lang.String getHitSound()
-
isRunAwayPossible
public boolean isRunAwayPossible()
-
-