se.sics.tasim.viewer
Class AgentView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by se.sics.tasim.viewer.AgentView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public abstract class AgentView
extends javax.swing.JComponent

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.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int BOTH_AXIS
           
static int X_AXIS
           
static int Y_AXIS
           
 
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.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
AgentView()
           
 
Method Summary
protected  javax.swing.JScrollPane createScrollPane(javax.swing.JComponent component)
           
protected  javax.swing.JScrollPane createScrollPane(javax.swing.JComponent component, java.lang.String title)
           
protected  javax.swing.JScrollPane createScrollPane(javax.swing.JComponent component, java.lang.String title, boolean horizontalScrollbar)
           
abstract  void dataUpdated(int type, float value)
           
abstract  void dataUpdated(int type, int value)
           
abstract  void dataUpdated(int type, long value)
           
abstract  void dataUpdated(int type, java.lang.String value)
           
abstract  void dataUpdated(int type, Transportable value)
           
protected  ConfigManager getConfig()
          Information retrieval and utilities for sub classes
protected  java.awt.Rectangle getConfigBounds(java.lang.String name)
           
protected  java.awt.Rectangle getConfigBounds(java.lang.String name, java.awt.Rectangle bounds)
           
protected  java.awt.Color getConfigColor(java.lang.String name, java.lang.String sub)
           
protected  java.awt.Color getConfigColor(java.lang.String name, java.lang.String sub, java.awt.Color defaultColor)
           
protected  java.awt.Point getConfigPoint(java.lang.String name)
           
protected  java.awt.Point getConfigPoint(java.lang.String name, java.awt.Point point)
           
protected  java.lang.String getConfigProperty(java.lang.String prop)
           
protected  java.lang.String getConfigProperty(java.lang.String prop, java.lang.String defaultValue)
           
 int getConnectionAxis()
           
 int getConnectionDistance()
           
 java.awt.Point getConnectionPoint(int type, int x, int y, boolean isTarget)
           
 java.awt.Point getConnectionPoint(int type, int toX, int toY, boolean isTarget, java.awt.Point cache)
           
protected  javax.swing.JComponent getDialog()
           
 javax.swing.Icon getIcon()
           
protected  javax.swing.Icon getIcon(java.lang.String iconName)
           
 int getIndex()
           
 java.awt.Dimension getMinimumSize()
           
 java.lang.String getName()
           
 java.awt.Dimension getPreferredSize()
          Size handling
 int getRole()
           
 java.lang.String getRoleName()
           
protected  boolean handleMenu(java.awt.event.MouseEvent event)
           
protected abstract  void initialized()
           
protected  void layoutComponent(java.lang.String name, javax.swing.JComponent c)
           
protected  void nextPhase(int phase)
          Called when the simulation panel enters a new phase
protected  void nextTimeUnit(long serverTime, int timeUnit)
          Called when a new simulation day starts (if the simulation supports the day notion).
protected  void paintComponent(java.awt.Graphics g)
          Paint handling
 void setConnectionAxis(int axis)
           
 void setConnectionDistance(int connectionDistance)
           
 void setIcon(javax.swing.Icon agentIcon)
           
protected  void showDialog(javax.swing.JComponent dialog)
           
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, updateUI
 
Methods inherited from class java.awt.Container
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, 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, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

X_AXIS

public static final int X_AXIS
See Also:
Constant Field Values

Y_AXIS

public static final int Y_AXIS
See Also:
Constant Field Values

BOTH_AXIS

public static final int BOTH_AXIS
See Also:
Constant Field Values
Constructor Detail

AgentView

public AgentView()
Method Detail

handleMenu

protected boolean handleMenu(java.awt.event.MouseEvent event)

initialized

protected abstract void initialized()

getIndex

public int getIndex()

getName

public java.lang.String getName()
Overrides:
getName in class java.awt.Component

getRole

public int getRole()

getRoleName

public java.lang.String getRoleName()

getIcon

public javax.swing.Icon getIcon()

setIcon

public void setIcon(javax.swing.Icon agentIcon)

getConnectionAxis

public int getConnectionAxis()

setConnectionAxis

public void setConnectionAxis(int axis)

getConnectionDistance

public int getConnectionDistance()

setConnectionDistance

public void setConnectionDistance(int connectionDistance)

getConnectionPoint

public java.awt.Point getConnectionPoint(int type,
                                         int x,
                                         int y,
                                         boolean isTarget)

getConnectionPoint

public java.awt.Point getConnectionPoint(int type,
                                         int toX,
                                         int toY,
                                         boolean isTarget,
                                         java.awt.Point cache)

getConfig

protected ConfigManager getConfig()
Information retrieval and utilities for sub classes


getIcon

protected javax.swing.Icon getIcon(java.lang.String iconName)

getConfigProperty

protected java.lang.String getConfigProperty(java.lang.String prop)

getConfigProperty

protected java.lang.String getConfigProperty(java.lang.String prop,
                                             java.lang.String defaultValue)

getConfigPoint

protected java.awt.Point getConfigPoint(java.lang.String name)

getConfigPoint

protected java.awt.Point getConfigPoint(java.lang.String name,
                                        java.awt.Point point)

getConfigBounds

protected java.awt.Rectangle getConfigBounds(java.lang.String name)

getConfigBounds

protected java.awt.Rectangle getConfigBounds(java.lang.String name,
                                             java.awt.Rectangle bounds)

getConfigColor

protected java.awt.Color getConfigColor(java.lang.String name,
                                        java.lang.String sub)

getConfigColor

protected java.awt.Color getConfigColor(java.lang.String name,
                                        java.lang.String sub,
                                        java.awt.Color defaultColor)

layoutComponent

protected void layoutComponent(java.lang.String name,
                               javax.swing.JComponent c)

createScrollPane

protected javax.swing.JScrollPane createScrollPane(javax.swing.JComponent component)

createScrollPane

protected javax.swing.JScrollPane createScrollPane(javax.swing.JComponent component,
                                                   java.lang.String title)

createScrollPane

protected javax.swing.JScrollPane createScrollPane(javax.swing.JComponent component,
                                                   java.lang.String title,
                                                   boolean horizontalScrollbar)

showDialog

protected void showDialog(javax.swing.JComponent dialog)

getDialog

protected javax.swing.JComponent getDialog()

getPreferredSize

public java.awt.Dimension getPreferredSize()
Size handling

Overrides:
getPreferredSize in class javax.swing.JComponent

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

paintComponent

protected void paintComponent(java.awt.Graphics g)
Paint handling

Overrides:
paintComponent in class javax.swing.JComponent

dataUpdated

public abstract void dataUpdated(int type,
                                 int value)

dataUpdated

public abstract void dataUpdated(int type,
                                 long value)

dataUpdated

public abstract void dataUpdated(int type,
                                 float value)

dataUpdated

public abstract void dataUpdated(int type,
                                 java.lang.String value)

dataUpdated

public abstract void dataUpdated(int type,
                                 Transportable value)

nextPhase

protected void nextPhase(int phase)
Called when the simulation panel enters a new phase

Parameters:
phase - the current simulation phase

nextTimeUnit

protected void nextTimeUnit(long serverTime,
                            int timeUnit)
Called when a new simulation day starts (if the simulation supports the day notion).

Parameters:
serverTime - the current server time
timeUnit - the current simulation date


Copyright © 2007-2009 Association for Trading Agent Research. All Rights Reserved.