org.ssonet.examples.catalog.customer
Class Customer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--javax.swing.JApplet
                                |
                                +--org.ssonet.examples.catalog.customer.Customer
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable

public class Customer
extends javax.swing.JApplet

creates a Customer

See Also:
Serialized Form

Field Summary
 javax.swing.JFrame frame
           
 java.lang.String name
           
static org.ssonet.examples.catalog.customer.OrderPanel orderPanel
           
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
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
Customer()
          creates a customer with standard name
Customer(java.lang.String n)
          creates a customer with name n
 
Method Summary
 boolean getCatalog(org.ssonet.examples.catalog.net.CatalogFile catalogFile)
          Writes the catalogFile into the local catalog "catalog.zip" in the directory ./data After that the local catalog will be loaded into the OrderPanel.
 java.awt.Dimension getSize()
           
 void init()
          creates the order frame, adds the menu and loads the local catalog
static void main(java.lang.String[] argv)
          main customer procedure Creates a JFrame and a customer with the name supplied.
 boolean requestCatalog(javax.swing.JFrame parentFrame, java.lang.String merchantName, java.lang.String merchantHost, int merchantHostPort)
          Sends a catalog order to the merchanthost at the merchantHostPort.
 boolean sendOrder(javax.swing.JFrame parentFrame, java.lang.String merchantHost, int merchantHostPort, org.ssonet.examples.catalog.net.Order order)
          Sends an order to the merchanthost at the merchantHostPort.
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, 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

name

public java.lang.String name

orderPanel

public static org.ssonet.examples.catalog.customer.OrderPanel orderPanel

frame

public javax.swing.JFrame frame
Constructor Detail

Customer

public Customer()
creates a customer with standard name


Customer

public Customer(java.lang.String n)
creates a customer with name n

Method Detail

init

public void init()
creates the order frame, adds the menu and loads the local catalog

Overrides:
init in class java.applet.Applet

sendOrder

public boolean sendOrder(javax.swing.JFrame parentFrame,
                         java.lang.String merchantHost,
                         int merchantHostPort,
                         org.ssonet.examples.catalog.net.Order order)
Sends an order to the merchanthost at the merchantHostPort. The parentFrame is necessary for the modal representation of the AnimatedOrderDialog. Returns true if action was successful, otherwise false.


requestCatalog

public boolean requestCatalog(javax.swing.JFrame parentFrame,
                              java.lang.String merchantName,
                              java.lang.String merchantHost,
                              int merchantHostPort)
Sends a catalog order to the merchanthost at the merchantHostPort. The parentFrame is necessary for the modal representation of the AnimatedOrderDialog. Returns true if action was successful, otherwise false.


getCatalog

public boolean getCatalog(org.ssonet.examples.catalog.net.CatalogFile catalogFile)
Writes the catalogFile into the local catalog "catalog.zip" in the directory ./data After that the local catalog will be loaded into the OrderPanel. Returns true if action was successful, otherwise false.


getSize

public java.awt.Dimension getSize()
Overrides:
getSize in class java.awt.Component

main

public static void main(java.lang.String[] argv)
main customer procedure Creates a JFrame and a customer with the name supplied. If no name was supplied, the name "Standard customer" will be used. The created customer will be assigned to a JFrame. The customer will be initialized and the JFrame will be packed. That means, that the components of the JFrame will be displayed in their preferred size. Last but not least the JFrame will be displayed. System-Property "ssonet_userdir" is set to the username.



Copyright © 2003 DRIM Team. All Rights Reserved.