public class MaritimeTradeOverlay extends OverlayView implements IMaritimeTradeOverlay
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
(package private) java.awt.image.BufferedImage |
brickImg |
(package private) ResourceType[] |
getAvailables |
(package private) ResourceType[] |
giveAvailables |
(package private) java.awt.image.BufferedImage |
oreImg |
(package private) java.awt.image.BufferedImage |
reloadImg |
(package private) java.lang.String |
resourceImageFolder |
(package private) java.awt.image.BufferedImage |
sheepImg |
(package private) java.awt.image.BufferedImage |
wheatImg |
(package private) java.awt.image.BufferedImage |
woodImg |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
MaritimeTradeOverlay() |
Modifier and Type | Method and Description |
---|---|
IMaritimeTradeController |
getController()
Controller getter
|
void |
hideGetOptions()
Hides the "get" resources and undo components.
|
void |
hideGiveOptions()
Hides the "give" resources and undo components.
|
void |
reset()
Resets the view to its initial state.
|
static java.awt.image.BufferedImage |
resize(java.awt.image.BufferedImage image,
int width,
int height) |
void |
selectGetOption(ResourceType selectedResource,
int amount)
Selects the resource the user has selected to receive.
|
void |
selectGiveOption(ResourceType selectedResource,
int amount)
Selects the resource the user has selected to give.
|
void |
setCancelEnabled(boolean enabled)
Enables or disables the cancel button.
|
void |
setStateMessage(java.lang.String message)
Sets the message on the button indicating the state of the trade.
|
void |
setTradeEnabled(boolean enable)
Enables or disables the trade button.
|
void |
showGetOptions(ResourceType[] enabledResources)
Shows all the "get" resources, enabling the ones the player can receive,
and disabling the ones he can't.
|
void |
showGiveOptions(ResourceType[] enabledResources)
Shows all the "give" resources, enabling the ones the player can give,
and disabling the ones he can't.
|
closeModal, isModalShowing, setWindow, showModal
setController
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, 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
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
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
closeModal, isModalShowing, showModal
setController
java.awt.image.BufferedImage reloadImg
java.awt.image.BufferedImage woodImg
java.awt.image.BufferedImage brickImg
java.awt.image.BufferedImage sheepImg
java.awt.image.BufferedImage wheatImg
java.awt.image.BufferedImage oreImg
java.lang.String resourceImageFolder
ResourceType[] giveAvailables
ResourceType[] getAvailables
public IMaritimeTradeController getController()
IView
getController
in interface IView
getController
in class PanelView
public void reset()
IMaritimeTradeOverlay
reset
in interface IMaritimeTradeOverlay
public void hideGetOptions()
IMaritimeTradeOverlay
hideGetOptions
in interface IMaritimeTradeOverlay
public void hideGiveOptions()
IMaritimeTradeOverlay
hideGiveOptions
in interface IMaritimeTradeOverlay
public void selectGetOption(ResourceType selectedResource, int amount)
IMaritimeTradeOverlay
selectGetOption
in interface IMaritimeTradeOverlay
selectedResource
- The "get" resource selected by the useramount
- The amount of the specified "get" resource the user will
receive (e.g., 1)public void selectGiveOption(ResourceType selectedResource, int amount)
IMaritimeTradeOverlay
selectGiveOption
in interface IMaritimeTradeOverlay
selectedResource
- The "give" resource selected by the useramount
- The amount of the specified "give" resource the user will give
(e.g., 3)public void setStateMessage(java.lang.String message)
IMaritimeTradeOverlay
setStateMessage
in interface IMaritimeTradeOverlay
message
- The new state messagepublic void setTradeEnabled(boolean enable)
IMaritimeTradeOverlay
setTradeEnabled
in interface IMaritimeTradeOverlay
enable
- Whether or not the user may currently execute the tradepublic void setCancelEnabled(boolean enabled)
IMaritimeTradeOverlay
setCancelEnabled
in interface IMaritimeTradeOverlay
enabled
- Whether or not the user may cancel the trade operationpublic void showGetOptions(ResourceType[] enabledResources)
IMaritimeTradeOverlay
showGetOptions
in interface IMaritimeTradeOverlay
enabledResources
- Array of "get" resources that should be enabled.public void showGiveOptions(ResourceType[] enabledResources)
IMaritimeTradeOverlay
showGiveOptions
in interface IMaritimeTradeOverlay
enabledResources
- Array of "give" resources that should be enabled.public static java.awt.image.BufferedImage resize(java.awt.image.BufferedImage image, int width, int height)