Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## AppletInterface
Class OwnershipFrame

    java.lang.Object
      java.awt.Component
          amber.server.component.ComponentHandler
              amber.server.component.PanelHandler
                  amber.server.panel.BasePanel
                      amber.server.panel.BaseFrame
                          AppletInterface.OwnershipFrame

All Implemented Interfaces:
  java.awt.event.ActionListener, amber.server.application.ApplicationInterface, amber.awt.event.ComponentWindowListener, amber.server.panel.ContainerHandler, java.util.EventListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable

public class OwnershipFrame
extends amber.server.panel.BaseFrame
implements amber.awt.event.ComponentWindowListener, java.awt.event.ActionListener

Author:
  student This class is being used for displaying information about a selected owned stock.
See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class java.awt.Component
`java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

Field Summary
`private amber.server.component.FloatButtonHandler` | `btnOk`
`int` | `FRAMEHEIGHT`
`int` | `FRAMEWIDTH`
`private java.lang.String` | `index`
`private amber.server.component.LabelHandler` | `lblAvgCost`
`private amber.server.component.LabelHandler` | `lblDateLastPurchased`
`private amber.server.component.LabelHandler` | `lblHigh`
`private amber.server.component.LabelHandler` | `lblLastPurchaseAmount`
`private amber.server.component.LabelHandler` | `lblLastPurchaseQty`
`private amber.server.component.LabelHandler` | `lblLastPurchaseRate`
`private amber.server.component.LabelHandler` | `lblLow`
`private amber.server.component.LabelHandler` | `lblMain` Declare the components used in this frame.
`private amber.server.component.LabelHandler` | `lblStockCode`
`private amber.server.component.LabelHandler` | `lblStockName`
`private amber.server.component.LabelHandler` | `lblTotalCost`
`private amber.server.component.LabelHandler` | `lblTotalQty`
`private java.awt.Font` | `level1`
`private java.awt.Font` | `level2`
`private StockOwnership_Data[]` | `owned`
`private Stock_Data[]` | `totalstocks`
`private User_Data` | `userdata`

Fields inherited from class amber.server.panel.BaseFrame
`title`

Fields inherited from class amber.server.panel.BasePanel
`autoDoLayoutState, xOffset, yOffset`

Fields inherited from class amber.server.component.PanelHandler
`AddOperation, autoRedrawState, defaultSpecialKeyCodes, defaultSpecialModifiers, drawOperations, InsertOperation, PaintPanel, PanelNextAvailableCommand, postInPacketListeners, preInPacketListeners, RemoveAllOperations, RemoveOperation, ReplaceOperation, SetBorder, SetReDraw, SetSpecialKeys, specialKeyCodesCache, SpecialKeyEvent, specialKeyModifierCache`

Fields inherited from class amber.server.component.ComponentHandler
`actionCommand, active, ApplicationId, CancelReturn, dataEncoder, DefaultTimeout, enabledState, encoderBytes, id, InvalidId, MaximumId, NoReturn, OkCancelType, OkReturn, OkType, OkYesReturn, parentPage, responsePackets, timeoutValue, UnchangeableInvalidId, visibleState, YesNoCancelType, YesNoType, YesReturn`

Fields inherited from class java.awt.Component
`BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

Fields inherited from interface amber.server.panel.ContainerHandler
`AddComponent, AutoDoLayout, ForceDoLayout, GetInsets, GetInsetsResponse, NextAvailableCommand, RemoveAllComponents, RemoveComponent, SetBounds`

Fields inherited from interface java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

Constructor Summary
`OwnershipFrame()` This is the constructor for OwnershipFrame.java
`OwnershipFrame(amber.server.application.ApplicationInterface appHandler)` The initialising constructor.
`OwnershipFrame(amber.server.application.ApplicationInterface appHandler, java.lang.String i)` The initialising constructor.
`OwnershipFrame(int id, amber.server.application.ApplicationInterface appHandler)` The initialising constructor.

Method Summary
`void` | `actionPerformed(java.awt.event.ActionEvent e)`
`private java.lang.String` | `calculateAverage(java.lang.String cost, java.lang.String q)` This utility method is being used for calculating the average cost of shares.
`boolean` | `canClose()` This function determines if the panel can be closed.
`protected void` | `defineComponents()` This function is called to define the components which are a part of this panel.
`void` | `fillControls()` This function would normally never need to be called, but is required to be defined as it is called internally.
`private StockOwnership_Data` | `getOwnershipStock(java.lang.String name)` This utility method is being used for retrieving stock ownership details.
`private Stock_Data` | `getStock(java.lang.String name)` Method: getStock This utility method is being used for getting stock details specified by the stock name.
`protected StockTradingApplication` | `getStockTradingApplication()` This method is being used for getting the parent application.
`double` | `round(double x, int dec)` This utility method is being used for rounding a given double to a specified number of decimal places.
`void` | `saveData()` This function is called to save any required information in the panel.
`void` | `windowActivated(amber.awt.event.ComponentWindowEvent arg0)`
`void` | `windowClosed(amber.awt.event.ComponentWindowEvent arg0)`
`void` | `windowClosing(amber.awt.event.ComponentWindowEvent arg0)`
`void` | `windowDeactivated(amber.awt.event.ComponentWindowEvent arg0)`
`void` | `windowDeiconified(amber.awt.event.ComponentWindowEvent arg0)`
`void` | `windowIconified(amber.awt.event.ComponentWindowEvent arg0)`
`void` | `windowOpened(amber.awt.event.ComponentWindowEvent arg0)`

Methods inherited from class amber.server.panel.BaseFrame
`getPanelType, getTitle, isVisible, setActive, setBounds, setBounds, setInternalBounds, setInternalBounds, setInternalLocation, setInternalLocation, setInternalSize, setInternalSize, setLocation, setLocation, setSize, setSize, setTitle, setVisible, toBack, toFront`

Methods inherited from class amber.server.panel.BasePanel
`add, addComponent, addInPostPacketListener, addInPrePacketListener, buildComponent, buildComponent, doPanelLayout, fireInPostPacketPerformed, fireInPrePacketPerformed, forwardPacket, getAutoDoLayout, getComponents, getComponentStructure, getInsets, getPanelComponent, getPanelComponentAt, getPanelComponentAt, getPanelComponentAt, getPanelComponentAt, getPanelGroup, isMyId, isSelected, matchComponentToControl, matchIdToControl, processCurrentPacket, recreatePanel, remove, removeComponent, removeInPostPacketListener, removeInPrePacketListener, setAutoDoLayout, setBounds, setBounds, setComponentBaseOffset, setLocation, setLocation, setPanelGroup, setPanelLocation, setPanelLocation, setSelected, setSelectedInternal, setSize, setSize, setUpComponent`

Methods inherited from class amber.server.component.PanelHandler
`addComponent, addComponent, addDraw3DRect, addDrawArc, addDrawImage, addDrawImage, addDrawImage, addDrawImage, addDrawLine, addDrawOval, addDrawPolygon, addDrawPolyline, addDrawRect, addDrawRoundRect, addDrawString, addDrawString, addFill3DRect, addFillArc, addFillOval, addFillPolygon, addFillRect, addFillRoundRect, addOperation, addSetClip, addSetColour, addSetFont, addSetPaintMode, addSetXORMode, addSpecialKeyListener, disableSpecialKeyEvents, enableSpecialKeyEvents, getDrawOperations, getSpecialKeyCodes, handlePacket, handleToIndex, insertDraw3DRect, insertDrawArc, insertDrawImage, insertDrawImage, insertDrawImage, insertDrawImage, insertDrawLine, insertDrawPolygon, insertDrawPolyline, insertDrawRect, insertDrawRoundRect, insertDrawString, insertDrawString, insertFill3DRect, insertFill3DRect, insertFillArc, insertFillOval, insertFillPolygon, insertFillRect, insertFillRoundRect, insertOperation, insertSetClip, insertSetColour, insertSetFont, insertSetPaintMode, insertSetXORMode, performSetBounds, performSetLocation, performSetSize, processEvent, processSpecialKeyEvent, removeAllComponents, removeAllDrawOperations, removeDrawOperation, removeSpecialKeyListener, repaintPanel, replaceDraw3DRect, replaceDrawArc, replaceDrawImage, replaceDrawImage, replaceDrawImage, replaceDrawImage, replaceDrawLine, replaceDrawPolygon, replaceDrawPolyline, replaceDrawRect, replaceDrawRoundRect, replaceDrawString, replaceDrawString, replaceFill3DRect, replaceFill3DRect, replaceFillArc, replaceFillOval, replaceFillPolygon, replaceFillRect, replaceFillRoundRect, replaceOperation, replaceSetClip, replaceSetColour, replaceSetFont, replaceSetPaintMode, replaceSetXORMode, resetState, setAutoRepaint, setBorder, setSpecialKeyCodes, setSpecialKeyEventState`

Methods inherited from class amber.server.component.ComponentHandler
`addActionListener, addCloseable, addComponentListener, addEventMask, addFocusListener, addItemListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addReceivedPacket, addTextListener, addWindowListener, booleanToInt, createDataInput, directPacket, displayMessageBox, fireWindowActivated, fireWindowClosed, fireWindowClosing, fireWindowDeactivated, fireWindowDeiconified, fireWindowEvent, fireWindowIconified, fireWindowOpened, forceComponentGetUrl, forceComponentGetUrl, forwardEventPacket, generateActionEvent, generateFocusEvent, generateItemEvent, generateKeyEvent, generateMouseEvent, getActionCommand, getAllCloseable, getBounds, getDataEncoderStream, getDefaultParameters, getEncoderStream, getEventMask, getFontCharacteristics, getFontCharacteristics, getFontCharacteristics, getFontCharacteristics, getFontStyle, getId, getLocation, getLog, getMaximumSize, getMinimumSize, getModalObject, getParentApplication, getParentContainer, getParentServer, getPreferredSize, getRemoteProperties, getResponsePacket, getSelectedObjects, getSize, getSizeCharacteristics, getTimeout, getToolTip, getValidId, getX, getY, handleMessages, internalForwardPacket, internalGetBounds, intToBoolean, isActive, isApplicationActive, isComponentModal, isConnected, isEnabled, isSpecialPacket, processActionEvent, processApplicationPacket, processComponentEvent, processFocusEvent, processItemEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processNormalResponse, processTextEvent, queryMessageBox, removeActionListener, removeCloseable, removeComponentListener, removeEventMask, removeFocusListener, removeItemListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removeTextListener, removeToolTip, removeWindowListener, requestFocus, restart, sendPacket, sendPacketAndBlock, sendPacketAndBlock, sendPendingPackets, setActionCommand, setBackground, setComponentModal, setConnectedState, setCursor, setEnabled, setEventMask, setFont, setFont, setFontStyle, setForeground, setForegroundBackground, setId, setLog, setModalObject, setParentApplication, setParentContainer, setParentServer, setRemoteProperties, setTimeout, setToolTip, setX, setY, shutDown, shutDownClient, shutDownClient, start`

Methods inherited from class java.awt.Component
`action, add, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, getWidth, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setName, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### btnOk

    private amber.server.component.FloatButtonHandler btnOk

### FRAMEHEIGHT

    public final int FRAMEHEIGHT

See Also:
  Constant Field Values

### FRAMEWIDTH

    public final int FRAMEWIDTH

See Also:
  Constant Field Values

### index

    private java.lang.String index

### lblAvgCost

    private amber.server.component.LabelHandler lblAvgCost

### lblDateLastPurchased

    private amber.server.component.LabelHandler lblDateLastPurchased

### lblHigh

    private amber.server.component.LabelHandler lblHigh

### lblLastPurchaseAmount

    private amber.server.component.LabelHandler lblLastPurchaseAmount

### lblLastPurchaseQty

    private amber.server.component.LabelHandler lblLastPurchaseQty

### lblLastPurchaseRate

    private amber.server.component.LabelHandler lblLastPurchaseRate

### lblLow

    private amber.server.component.LabelHandler lblLow

### lblMain

    private amber.server.component.LabelHandler lblMain

  Declare the components used in this frame.

### lblStockCode

    private amber.server.component.LabelHandler lblStockCode

### lblStockName

    private amber.server.component.LabelHandler lblStockName

### lblTotalCost

    private amber.server.component.LabelHandler lblTotalCost

### lblTotalQty

    private amber.server.component.LabelHandler lblTotalQty

### level1

    private java.awt.Font level1

### level2

    private java.awt.Font level2

### owned

    private StockOwnership_Data[] owned

### totalstocks

    private Stock_Data[] totalstocks

### userdata

    private User_Data userdata

Constructor Detail

### OwnershipFrame

    public OwnershipFrame()

  This is the constructor for OwnershipFrame.java

### OwnershipFrame

    public OwnershipFrame(amber.server.application.ApplicationInterface appHandler)

  The initialising constructor.

Parameters:
  `appHandler` - The handle to the main ApplicationInterface which handles the functions of the overall application.

### OwnershipFrame

    public OwnershipFrame(amber.server.application.ApplicationInterface appHandler,
                          java.lang.String i)

  The initialising constructor.

Parameters:
  `appHandler` - The handle to the main ApplicationInterface which handles the functions of the overall application.

### OwnershipFrame

    public OwnershipFrame(int id,
                          amber.server.application.ApplicationInterface appHandler)

  The initialising constructor.

Parameters:
  `id` - The int containing the id of the corresponding remote component residing on the browser.
  `appHandler` - The handle to the main ApplicationInterface which handles the functions of the overall application.

Method Detail

### actionPerformed

    public void actionPerformed(java.awt.event.ActionEvent e)

  Specified by:
    `actionPerformed` in interface `java.awt.event.ActionListener`

### calculateAverage

    private java.lang.String calculateAverage(java.lang.String cost,
                                              java.lang.String q)

  This utility method is being used for calculating the average cost of shares.

  Parameters:
    `cost` - The total amount spent on shares.
    `q` - The number of shares bought.
  Returns:
    String The average cost of each share.

### canClose

    public boolean canClose()

  This function determines if the panel can be closed. The derived panels must determine if this panel can close. If this is not possible the function should return false.

  Specified by:
    `canClose` in interface `amber.server.panel.ContainerHandler`
  Returns:
    boolean false if it is not possible to close this panel.

### defineComponents

    protected void defineComponents()

  This function is called to define the components which are a part of this panel. This function is called by the constructor to set up the normal static components and their locations. This method is required.

### fillControls

    public void fillControls()

  This function would normally never need to be called, but is required to be defined as it is called internally. Its specific purpose is to set the controls to a known state once they are created.

  Specified by:
    `fillControls` in interface `amber.server.panel.ContainerHandler`

### getOwnershipStock

    private StockOwnership_Data getOwnershipStock(java.lang.String name)

  This utility method is being used for retrieving stock ownership details.

  Parameters:
    `name` - The name of stock ownership for which the details are to be retrieved.
  Returns:
    StockOwnership_Data The stock ownership details.

### getStock

    private Stock_Data getStock(java.lang.String name)

  Method: getStock This utility method is being used for getting stock details specified by the stock name.

  Parameters:
    `name` - The name of the stock details are to be retrived for.
  Returns:
    Stock_Data The stock details.

### getStockTradingApplication

    protected StockTradingApplication getStockTradingApplication()

  This method is being used for getting the parent application.

  Returns:
    StockTradingApplication The parent application.

### round

    public double round(double x,
                        int dec)

  This utility method is being used for rounding a given double to a specified number of decimal places.

  Parameters:
    `x` - The orginal double to be rounded.
    `dec` - The number of decimal places to be rounded to.
  Returns:
    double The rounded double.

### saveData

    public void saveData()

  This function is called to save any required information in the panel. This function is called externally when another panel wishes to take over the base panel or when closing the panel. This function need not actually do something.

  Specified by:
    `saveData` in interface `amber.server.panel.ContainerHandler`

### windowActivated

    public void windowActivated(amber.awt.event.ComponentWindowEvent arg0)

  Specified by:
    `windowActivated` in interface `amber.awt.event.ComponentWindowListener`

### windowClosed

    public void windowClosed(amber.awt.event.ComponentWindowEvent arg0)

  Specified by:
    `windowClosed` in interface `amber.awt.event.ComponentWindowListener`

### windowClosing

    public void windowClosing(amber.awt.event.ComponentWindowEvent arg0)

  Specified by:
    `windowClosing` in interface `amber.awt.event.ComponentWindowListener`

### windowDeactivated

    public void windowDeactivated(amber.awt.event.ComponentWindowEvent arg0)

  Specified by:
    `windowDeactivated` in interface `amber.awt.event.ComponentWindowListener`

### windowDeiconified

    public void windowDeiconified(amber.awt.event.ComponentWindowEvent arg0)

  Specified by:
    `windowDeiconified` in interface `amber.awt.event.ComponentWindowListener`

### windowIconified

    public void windowIconified(amber.awt.event.ComponentWindowEvent arg0)

  Specified by:
    `windowIconified` in interface `amber.awt.event.ComponentWindowListener`

### windowOpened

    public void windowOpened(amber.awt.event.ComponentWindowEvent arg0)

  Specified by:
    `windowOpened` in interface `amber.awt.event.ComponentWindowListener`

Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD