net.sf.freecol.client.gui.panel
Class ProductionMultiplesLabel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by net.sf.freecol.client.gui.panel.ProductionMultiplesLabel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public final class ProductionMultiplesLabel
extends javax.swing.JComponent

The ProductionLabel represents Goods that are produced in a WorkLocation or Settlement. It is similar to the GoodsLabel.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
ProductionMultiplesLabel(java.util.List<AbstractGoods> goods, Canvas parent)
          Allow labels to include multiple goods.
 
Method Summary
 boolean drawPlus()
          Get the DrawPlus value.
 Canvas getCanvas()
          Returns the parent Canvas object.
 int getCompressedWidth()
          Get the CompressedWidth value.
 int getDisplayNumber()
          Get the DisplayNumber value.
 javax.swing.ImageIcon getGoodsIcon()
          Get the GoodsIcon value.
 int getMaxGoodsIcons()
          Get the MaxGoodsIcons value.
 int getMaximumIconHeight()
          Need to determine the tallest icon TODO: Why does this use the image instead of the Icon like width??
 int getMaximumIconWidth()
          Need to determine what the phatest icon is
 int getMaximumProduction()
          Get the MaximumProduction value.
 java.awt.Dimension getPreferredSize()
          Overrides the getPreferredSize method.
 int getPreferredWidth()
          Returns only the width component of the preferred size.
 int getProduction()
          Get the Production value.
 int getStockNumber()
          Get the stockNumber value.
 java.lang.String getToolTipPrefix()
          Get the ToolTipPrefix value.
 boolean isCentered()
          Get the Centered value.
 void paintComponent(java.awt.Graphics g)
          Paints this ProductionLabel.
 void setCentered(boolean newCentered)
          Set the Centered value.
 void setCompressedWidth(int newCompressedWidth)
          Set the CompressedWidth value.
 void setDisplayNumber(int newDisplayNumber)
          Set the DisplayNumber value.
 void setDrawPlus(boolean newDrawPlus)
          Set the DrawPlus value.
 void setGoodsIcon(javax.swing.ImageIcon newGoodsIcon)
          Set the GoodsIcon value.
 void setMaxGoodsIcons(int newMaxGoodsIcons)
          Set the MaxGoodsIcons value.
 void setMaximumProduction(int newMaximumProduction)
          Set the MaximumProduction value.
 void setProduction(int newProduction)
          Set the Production value.
 void setStockNumber(int newStockNumber)
          Set the stockNumber value.
 void setToolTipPrefix(java.lang.String newToolTipPrefix)
          Set the ToolTipPrefix value.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProductionMultiplesLabel

public ProductionMultiplesLabel(java.util.List<AbstractGoods> goods,
                                Canvas parent)
Allow labels to include multiple goods. This is especially useful for Food.

Parameters:
goods - The goods to display.
parent -
Method Detail

getToolTipPrefix

public java.lang.String getToolTipPrefix()
Get the ToolTipPrefix value.

Returns:
a String value

setToolTipPrefix

public void setToolTipPrefix(java.lang.String newToolTipPrefix)
Set the ToolTipPrefix value.

Parameters:
newToolTipPrefix - The new ToolTipPrefix value.

getCanvas

public Canvas getCanvas()
Returns the parent Canvas object.

Returns:
This ProductionLabel's Canvas.

getDisplayNumber

public int getDisplayNumber()
Get the DisplayNumber value.

Returns:
an int value

setDisplayNumber

public void setDisplayNumber(int newDisplayNumber)
Set the DisplayNumber value.

Parameters:
newDisplayNumber - The new DisplayNumber value.

getGoodsIcon

public javax.swing.ImageIcon getGoodsIcon()
Get the GoodsIcon value.

Returns:
an ImageIcon value

setGoodsIcon

public void setGoodsIcon(javax.swing.ImageIcon newGoodsIcon)
Set the GoodsIcon value.

Parameters:
newGoodsIcon - The new GoodsIcon value.

getProduction

public int getProduction()
Get the Production value.

Returns:
an int value

setProduction

public void setProduction(int newProduction)
Set the Production value.

Parameters:
newProduction - The new Production value.

getMaximumProduction

public int getMaximumProduction()
Get the MaximumProduction value.

Returns:
an int value

setMaximumProduction

public void setMaximumProduction(int newMaximumProduction)
Set the MaximumProduction value.

Parameters:
newMaximumProduction - The new MaximumProduction value.

getMaxGoodsIcons

public int getMaxGoodsIcons()
Get the MaxGoodsIcons value.

Returns:
an int value

setMaxGoodsIcons

public void setMaxGoodsIcons(int newMaxGoodsIcons)
Set the MaxGoodsIcons value.

Parameters:
newMaxGoodsIcons - The new MaxGoodsIcons value.

getStockNumber

public int getStockNumber()
Get the stockNumber value. used to Show stored items in ReportColonyPanel

Returns:
an int value

setStockNumber

public void setStockNumber(int newStockNumber)
Set the stockNumber value. used to Show stored items in ReportColonyPanel

Parameters:
newStockNumber - The new StockNumber value.

drawPlus

public boolean drawPlus()
Get the DrawPlus value.

Returns:
a boolean value

setDrawPlus

public void setDrawPlus(boolean newDrawPlus)
Set the DrawPlus value.

Parameters:
newDrawPlus - The new DrawPlus value.

isCentered

public boolean isCentered()
Get the Centered value.

Returns:
a boolean value

setCentered

public void setCentered(boolean newCentered)
Set the Centered value.

Parameters:
newCentered - The new Centered value.

getCompressedWidth

public int getCompressedWidth()
Get the CompressedWidth value.

Returns:
an int value

setCompressedWidth

public void setCompressedWidth(int newCompressedWidth)
Set the CompressedWidth value.

Parameters:
newCompressedWidth - The new CompressedWidth value.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides the getPreferredSize method.

Overrides:
getPreferredSize in class javax.swing.JComponent
Returns:
a Dimension value

getPreferredWidth

public int getPreferredWidth()
Returns only the width component of the preferred size.

Returns:
an int value

getMaximumIconWidth

public int getMaximumIconWidth()
Need to determine what the phatest icon is

Returns:
the width

getMaximumIconHeight

public int getMaximumIconHeight()
Need to determine the tallest icon TODO: Why does this use the image instead of the Icon like width??

Returns:
the height

paintComponent

public void paintComponent(java.awt.Graphics g)
Paints this ProductionLabel.

Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
g - The graphics context in which to do the painting.