|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
de.upb.swtpra05.group03.companycontrol.TradePanel
The Trade Panel, placed in the Control Panel, is used to Buy and Sell Shuttles.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
private javax.swing.border.TitledBorder |
buyBorder
loweretched border for the inner panel buyPanel |
private javax.swing.JPanel |
buyPanel
inner panel for buying a shuttle |
private javax.swing.JLabel |
buyShuttleAtLabel
label for the stationComboBox |
private javax.swing.JButton |
buyShuttleButton
button for buying a shuttle |
private boolean |
chosenShuttleMoving
set true if the chosen shuttle is moving and not standing at a station |
private javax.swing.JOptionPane |
errorMessage
this option pane shows a message when the user forgot to enter a minimum (maximum) price before pressing the "sell shuttle" ("buy shuttle") button. |
private javax.swing.JLabel |
forMaximumLabel
label for the maxPriceTextField |
private javax.swing.JLabel |
forMinimumLabel
label for the minPriceTextField |
private java.awt.GridBagConstraints |
gbc
the GridBagLayoutConstraints |
private javax.swing.JTextField |
maxPriceTextField
text field to enter the maximum price to buy a shuttle for |
private javax.swing.JTextField |
minPriceTextField
text field to enter the minimum price to sell a shuttle for |
private javax.swing.JFrame |
optionPaneFrame
the frame of the option pane |
private javax.swing.border.Border |
paneBorder
loweretched border for the panel |
private CompanyMainControl |
refControl
reference on the CompanyMainControl |
private javax.swing.border.TitledBorder |
sellBorder
loweretched border for the inner panel sellPanel |
private javax.swing.JPanel |
sellPanel
inner panel for selling a shuttle |
private javax.swing.JButton |
sellShuttleButton
button for selling a shuttle |
private javax.swing.JLabel |
sellShuttleLabel
label for the shuttleComboBox |
private static long |
serialVersionUID
Comment for serialVersionUID |
private javax.swing.JComboBox |
shuttleComboBox
combo box that contains all the company's shuttle to choose which shuttle to sell |
private javax.swing.JComboBox |
stationComboBox
combo box that contains all the stations to choose where to buy a shuttle |
private javax.swing.border.TitledBorder |
titledBorder
Border with title "Shuttle Trades" |
| Fields inherited from class javax.swing.JPanel |
|
| 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.Container |
|
| 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 | |
TradePanel(CompanyMainControl refControl)
The constructor sets the layout of the trade panel and the action commands and listeners of the buttons and text fields |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
This method is called when the user presses one of the buttons or presses |
void |
reset()
This method is called by ControlPanel when the Company Control is disconnected from the kernel and it is called by this class itself when initializing to have clear boxes. |
private void |
setGbc(int row,
int column,
int width,
int height,
double weighty,
double weightx,
int fill)
setting some layout values |
void |
setShuttleItem(java.lang.String shuttle,
int revenue)
This method is called by ControlPanel when a user marks a row in the ShuttleTable. |
void |
setStationItem(java.lang.String station,
int sellsFor)
This method is called by ControlPanel when a user marks a row in the StockTable. |
void |
setWaitState()
This method is called by ControlPanel when the CompanyControlClient starts to connect to the Kernel. |
void |
updateShuttleComboBox(java.lang.String[] entries)
This method is called by ControlPanel when the items of the shuttle combo box shall be updated because of changings. the given entries are the new items of the combo box. |
void |
updateStationComboBox(java.lang.String[] entries)
This method is called by ControlPanel when the items of the station combo box shall be updated because of changings. the given entries are the new items of the combo box. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private static final long serialVersionUID
serialVersionUID
private CompanyMainControl refControl
private java.awt.GridBagConstraints gbc
private javax.swing.border.Border paneBorder
private javax.swing.border.TitledBorder titledBorder
private javax.swing.JPanel buyPanel
private javax.swing.border.TitledBorder buyBorder
private javax.swing.JPanel sellPanel
private javax.swing.border.TitledBorder sellBorder
private javax.swing.JTextField maxPriceTextField
private javax.swing.JTextField minPriceTextField
private javax.swing.JButton buyShuttleButton
private javax.swing.JButton sellShuttleButton
private javax.swing.JComboBox stationComboBox
private javax.swing.JComboBox shuttleComboBox
private javax.swing.JLabel buyShuttleAtLabel
private javax.swing.JLabel forMaximumLabel
private javax.swing.JLabel sellShuttleLabel
private javax.swing.JLabel forMinimumLabel
private javax.swing.JOptionPane errorMessage
private javax.swing.JFrame optionPaneFrame
private boolean chosenShuttleMoving
| Constructor Detail |
public TradePanel(CompanyMainControl refControl)
refControl - reference on the CompanyMainControl| Method Detail |
public void reset()
public void setWaitState()
public void setStationItem(java.lang.String station,
int sellsFor)
station - the marked stationsellsFor - the price the station sells a shuttle for
public void setShuttleItem(java.lang.String shuttle,
int revenue)
shuttle - the marked stationrevenue - the sale revenue of the shuttle at its current positionpublic void updateShuttleComboBox(java.lang.String[] entries)
entries - contains the new itemspublic void updateStationComboBox(java.lang.String[] entries)
entries - contains the new item
private void setGbc(int row,
int column,
int width,
int height,
double weighty,
double weightx,
int fill)
row - column - width - height - fill - weightx - weighty - public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenere - the ActionEvent that lead to the call of this method.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||