applications.proxy.graph3dVisualizer
Class ImageCanvas

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--applications.proxy.graph3dVisualizer.ImageCanvas

public class ImageCanvas
extends JPanel
implements ActionListener, LocationChangeListener, TraitsChangeListener

Description of the Class

Author:
igasp
created March 12, 2001

Inner Class Summary
 (package private) classImageCanvas.Jitter
          Description of the Class

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel

Field Summary
 protected final static StringATTRIBUTES_FONT_KEY
           
 (package private) final static StringCELEBRITY_PROFILES
           
 (package private) final static intCURSOR_CURRENT
           
 (package private) final static intCURSOR_MOVE
           
 (package private) final static intCURSOR_MOVE_NODE
           
 (package private) final static intCURSOR_ROTATE
           
 (package private) final static intCURSOR_ZOOM
           
 (package private) final static intDRAG_MODE_MOVE
           
 (package private) final static intDRAG_MODE_MOVE_NODE
           
 (package private) final static intDRAG_MODE_NONE
           
 (package private) final static intDRAG_MODE_ROTATE
           
 (package private) final static intDRAG_MODE_ZOOM
           
 private final static StringJITEM_MARKET_STRING
           
 private final static StringJITEM_MOVE_STRING
           
 private final static StringJITEM_ROTATE_STRING
           
 private final static StringJITEM_ZOOM_STRING
           
 (package private) final static StringLINK_SELECT_SOUND_NAME
           
 protected Stringm_aggregateAttributesDisplay
           
 private Mapm_backgroundImages
           
 private booleanm_bMousePressed
           
 protected Stringm_currentLocation
          Description of the Field
 private Cursor[]m_cursor
           
 private String[]m_cursorImageFilenames
           
 protected VisualizerNodem_cursorNode
          Description of the Field
 protected intm_dragMode
          Description of the Field
 protected Mapm_fontMetrics
          Description of the Field
 protected floatm_fontMultiple
          Description of the Field
 protected Mapm_fonts
          Description of the Field
 private Graph3dVisualizerm_graph3dVisualizer
           
 protected Stringm_ipAgentAttributesDisplay
          Description of the Field
 protected intm_lastDragMode
          Description of the Field
 protected doublem_lastX
          Description of the Field
 protected doublem_lastY
          Description of the Field
 protected intm_maxHeight
          Description of the Field
 protected intm_maxWidth
          Description of the Field
 protected JPopupMenum_nodePopupMenu
          Description of the Field
 protected VisualizerNodesm_nodes
          Description of the Field
 private booleanm_nodesLocked
           
 (package private) Colorm_nodeTextColor
           
 private Imagem_offscreen
           
 protected Dimensionm_offscreenSize
           
 protected JPopupMenum_popupMenu
          Description of the Field
 protected JMenuItemm_promoteUrlMenuItem
          Description of the Field
 protected VisualizerNodem_rolloverNode
          Description of the Field
 protected longm_totalSuccessfulKnowledgeHits
          Description of the Field
 private VisualizationPreferencesm_visualizationPreferences
           
 protected doublem_zeroX
          Description of the Field
 protected doublem_zeroY
          Description of the Field
 protected doublem_zoom
          Description of the Field
 (package private) final static doubleMAX_ZOOM
           
 protected final static StringMETADATA_FONT_KEY
          Description of the Field
 private final static intMETADATA_INSET_BOTTOM
           
 private final static intMETADATA_INSET_LEFT
           
 (package private) final static doubleMINIMUM_ZOOM
           
 private final static intNODE_INSETS_X
           
 private final static intNODE_INSETS_Y
           
 (package private) final static StringNODE_TEXT_COLOR_TRAIT_NAME
           
 protected final static StringNORMAL_FONT_KEY
          Description of the Field
 (package private) final static intNUM_CURSORS
           
 protected final static StringROLLOVER_FONT_KEY
          Description of the Field
 (package private) final static StringROLLOVER_FONT_SIZE_TRAIT_NAME
           
 (package private) final static StringROLLOVER_SOUND_NAME
           

Fields inherited from class javax.swing.JComponent
ui, listenerList, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, accessibleContext

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

Constructor Summary
ImageCanvas(VisualizationPreferences prefs, Graph3dVisualizer graph3dVisualizer)
          Constructor for the ImageCanvas object

Method Summary
 voidactionPerformed(ActionEvent e)
          Description of the Method
 (package private) voidcalculateStatistics(VisualizerNodes nodes)
          Description of the Method
 (package private) voidcreateFonts()
          Description of the Method
 (package private) synchronized voidcreateFonts(float scale)
          Description of the Method
 voidcreatePopupMenu()
          Description of the Method
 voiddisablePromoteUrlMenuItem()
           
 voidexitingSpace()
          Description of the Method
 protected StringgetAggregateAttributesDisplay()
          Gets the AggregateAttributesDisplay attribute of the ImageCanvas object
 StringgetAttributeDescriptionString(double value)
          Gets the AttributeDescriptionString attribute of the ImageCanvas object
 StringgetAttributesDisplayString(AgentTraits traits)
          Gets the AttributesDisplayString attribute of the ImageCanvas object
 protected MapgetBackgroundImages()
          Gets the BackgroundImages attribute of the ImageCanvas object
 protected ImagegetCurrentBackgroundImage()
          Gets the CurrentBackgroundImage attribute of the ImageCanvas object
 (package private) StringgetCurrentLocation()
          Gets the CurrentLocation attribute of the ImageCanvas object
 protected Graph3dVisualizergetGraph3dVisualizer()
          Gets the Graph3dVisualizer attribute of the ImageCanvas object
 protected StringgetIpAgentAttributesDisplay()
          Gets the IpAgentAttributesDisplay attribute of the ImageCanvas object
 protected intgetRange(double z)
          Gets the Range attribute of the ImageCanvas object
 (package private) doublegetZoom()
          Gets the Zoom attribute of the ImageCanvas object
 booleanisNodeSelected(VisualizerNode node, double x, double y)
          Gets the NodeSelected attribute of the ImageCanvas object
 voidloadCursors()
          Description of the Method
 voidlocationChanged(LocationChangeEvent e)
          Description of the Method
 (package private) voidmarket(Object datum)
          Description of the Method
 synchronized voidpaintComponent(Graphics gr)
          Description of the Method
 protected voidplayTraitedEventSound(String eventSoundName)
          Description of the Method
 voidrecenter()
          Description of the Method
 protected voidsetAggregateAttributesDisplayString(String attributesDisplay)
          Sets the AggregateAttributesDisplayString attribute of the ImageCanvas object
 protected voidsetBackgroundImages(Map backgroundImages)
          Sets the BackgroundImages attribute of the ImageCanvas object
 (package private) voidsetCurrentLocation(String currentLocation)
          Sets the CurrentLocation attribute of the ImageCanvas object
 voidsetDragMode(int dragMode)
          Sets the DragMode attribute of the ImageCanvas object
 protected voidsetGraph3dVisualizer(Graph3dVisualizer graph3dVisualizer)
          Sets the Graph3dVisualizer attribute of the ImageCanvas object
 protected voidsetIpAgentAttributesDisplayString(String attributesDisplay)
          Sets the IpAgentAttributesDisplayString attribute of the ImageCanvas object
 voidsetNodes(VisualizerNodes nodes)
          Sets the Nodes attribute of the ImageCanvas object
 synchronized voidtraitsChanged()
          Description of the Method
 (package private) voidzoom(double scale)
          Description of the Method

Methods inherited from class javax.swing.JPanel
updateUI, getUIClassID, paramString, getAccessibleContext

Methods inherited from class javax.swing.JComponent
setUI, getComponentGraphics, paintChildren, paintBorder, update, paint, printAll, print, printComponent, printChildren, printBorder, isPaintingTile, isFocusCycleRoot, isManagingFocus, setNextFocusableComponent, getNextFocusableComponent, setRequestFocusEnabled, isRequestFocusEnabled, requestFocus, grabFocus, setVerifyInputWhenFocusTarget, getVerifyInputWhenFocusTarget, setPreferredSize, getPreferredSize, setMaximumSize, getMaximumSize, setMinimumSize, getMinimumSize, isMinimumSizeSet, isPreferredSizeSet, isMaximumSizeSet, contains, setBorder, getBorder, getInsets, getInsets, getAlignmentY, setAlignmentY, getAlignmentX, setAlignmentX, setInputVerifier, getInputVerifier, getGraphics, setDebugGraphicsOptions, getDebugGraphicsOptions, registerKeyboardAction, registerKeyboardAction, unregisterKeyboardAction, getRegisteredKeyStrokes, getConditionForKeyStroke, getActionForKeyStroke, resetKeyboardActions, setInputMap, getInputMap, getInputMap, setActionMap, getActionMap, requestDefaultFocus, setVisible, hide, setEnabled, setForeground, setBackground, setFont, isFocusTraversable, processFocusEvent, processComponentKeyEvent, processKeyEvent, processKeyBinding, setToolTipText, getToolTipText, getToolTipText, getToolTipLocation, createToolTip, scrollRectToVisible, setAutoscrolls, getAutoscrolls, processMouseMotionEvent, enable, disable, getClientProperty, putClientProperty, isLightweightComponent, reshape, getBounds, getSize, getLocation, getX, getY, getWidth, getHeight, hasFocus, isOpaque, setOpaque, computeVisibleRect, getVisibleRect, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener, fireVetoableChange, addVetoableChangeListener, removeVetoableChangeListener, getTopLevelAncestor, addAncestorListener, removeAncestorListener, getListeners, addNotify, removeNotify, repaint, repaint, revalidate, isValidateRoot, isOptimizedDrawingEnabled, paintImmediately, paintImmediately, setDoubleBuffered, isDoubleBuffered, getRootPane

Methods inherited from class java.awt.Container
getComponentCount, countComponents, getComponent, getComponents, insets, add, add, add, add, add, addImpl, remove, remove, removeAll, getLayout, setLayout, doLayout, layout, invalidate, validate, validateTree, preferredSize, minimumSize, paintComponents, printComponents, addContainerListener, removeContainerListener, processEvent, processContainerEvent, deliverEvent, getComponentAt, locate, getComponentAt, findComponentAt, findComponentAt, isAncestorOf, list, list

Methods inherited from class java.awt.Component
getName, setName, getParent, getPeer, setDropTarget, getDropTarget, getGraphicsConfiguration, getTreeLock, getToolkit, isValid, isDisplayable, isVisible, isShowing, isEnabled, enable, enableInputMethods, show, show, getForeground, getBackground, getFont, getLocale, setLocale, getColorModel, getLocation, getLocationOnScreen, location, setLocation, move, setLocation, getSize, size, setSize, resize, setSize, resize, getBounds, bounds, setBounds, setBounds, isLightweight, getFontMetrics, setCursor, getCursor, paintAll, repaint, repaint, repaint, imageUpdate, createImage, createImage, prepareImage, prepareImage, checkImage, checkImage, inside, contains, dispatchEvent, postEvent, addComponentListener, removeComponentListener, addFocusListener, removeFocusListener, addHierarchyListener, removeHierarchyListener, addHierarchyBoundsListener, removeHierarchyBoundsListener, addKeyListener, removeKeyListener, addMouseListener, removeMouseListener, addMouseMotionListener, removeMouseMotionListener, addInputMethodListener, removeInputMethodListener, getInputMethodRequests, getInputContext, enableEvents, disableEvents, coalesceEvents, processComponentEvent, processMouseEvent, processInputMethodEvent, processHierarchyEvent, processHierarchyBoundsEvent, handleEvent, mouseDown, mouseDrag, mouseUp, mouseMove, mouseEnter, mouseExit, keyDown, keyUp, action, gotFocus, lostFocus, transferFocus, nextFocus, add, remove, toString, list, list, list, setComponentOrientation, getComponentOrientation

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

Field Detail

ATTRIBUTES_FONT_KEY

protected final static String ATTRIBUTES_FONT_KEY

CELEBRITY_PROFILES

final static String CELEBRITY_PROFILES

CURSOR_CURRENT

final static int CURSOR_CURRENT

CURSOR_MOVE

final static int CURSOR_MOVE

CURSOR_MOVE_NODE

final static int CURSOR_MOVE_NODE

CURSOR_ROTATE

final static int CURSOR_ROTATE

CURSOR_ZOOM

final static int CURSOR_ZOOM

DRAG_MODE_MOVE

final static int DRAG_MODE_MOVE

DRAG_MODE_MOVE_NODE

final static int DRAG_MODE_MOVE_NODE

DRAG_MODE_NONE

final static int DRAG_MODE_NONE

DRAG_MODE_ROTATE

final static int DRAG_MODE_ROTATE

DRAG_MODE_ZOOM

final static int DRAG_MODE_ZOOM

JITEM_MARKET_STRING

private final static String JITEM_MARKET_STRING

JITEM_MOVE_STRING

private final static String JITEM_MOVE_STRING

JITEM_ROTATE_STRING

private final static String JITEM_ROTATE_STRING

JITEM_ZOOM_STRING

private final static String JITEM_ZOOM_STRING

LINK_SELECT_SOUND_NAME

final static String LINK_SELECT_SOUND_NAME

m_aggregateAttributesDisplay

protected String m_aggregateAttributesDisplay

m_backgroundImages

private Map m_backgroundImages

m_bMousePressed

private boolean m_bMousePressed

m_currentLocation

protected String m_currentLocation
Description of the Field
Since:

m_cursor

private Cursor[] m_cursor

m_cursorImageFilenames

private String[] m_cursorImageFilenames

m_cursorNode

protected VisualizerNode m_cursorNode
Description of the Field
Since:

m_dragMode

protected int m_dragMode
Description of the Field
Since:

m_fontMetrics

protected Map m_fontMetrics
Description of the Field
Since:

m_fontMultiple

protected float m_fontMultiple
Description of the Field
Since:

m_fonts

protected Map m_fonts
Description of the Field
Since:

m_graph3dVisualizer

private Graph3dVisualizer m_graph3dVisualizer

m_ipAgentAttributesDisplay

protected String m_ipAgentAttributesDisplay
Description of the Field
Since:

m_lastDragMode

protected int m_lastDragMode
Description of the Field
Since:

m_lastX

protected double m_lastX
Description of the Field
Since:

m_lastY

protected double m_lastY
Description of the Field
Since:

m_maxHeight

protected int m_maxHeight
Description of the Field
Since:

m_maxWidth

protected int m_maxWidth
Description of the Field
Since:

m_nodePopupMenu

protected JPopupMenu m_nodePopupMenu
Description of the Field
Since:

m_nodes

protected VisualizerNodes m_nodes
Description of the Field
Since:

m_nodesLocked

private boolean m_nodesLocked

m_nodeTextColor

Color m_nodeTextColor

m_offscreen

private Image m_offscreen

m_offscreenSize

protected Dimension m_offscreenSize

m_popupMenu

protected JPopupMenu m_popupMenu
Description of the Field
Since:

m_promoteUrlMenuItem

protected JMenuItem m_promoteUrlMenuItem
Description of the Field
Since:

m_rolloverNode

protected VisualizerNode m_rolloverNode
Description of the Field
Since:

m_totalSuccessfulKnowledgeHits

protected long m_totalSuccessfulKnowledgeHits
Description of the Field
Since:

m_visualizationPreferences

private VisualizationPreferences m_visualizationPreferences

m_zeroX

protected double m_zeroX
Description of the Field
Since:

m_zeroY

protected double m_zeroY
Description of the Field
Since:

m_zoom

protected double m_zoom
Description of the Field
Since:

MAX_ZOOM

final static double MAX_ZOOM

METADATA_FONT_KEY

protected final static String METADATA_FONT_KEY
Description of the Field
Since:

METADATA_INSET_BOTTOM

private final static int METADATA_INSET_BOTTOM

METADATA_INSET_LEFT

private final static int METADATA_INSET_LEFT

MINIMUM_ZOOM

final static double MINIMUM_ZOOM

NODE_INSETS_X

private final static int NODE_INSETS_X

NODE_INSETS_Y

private final static int NODE_INSETS_Y

NODE_TEXT_COLOR_TRAIT_NAME

final static String NODE_TEXT_COLOR_TRAIT_NAME

NORMAL_FONT_KEY

protected final static String NORMAL_FONT_KEY
Description of the Field
Since:

NUM_CURSORS

final static int NUM_CURSORS

ROLLOVER_FONT_KEY

protected final static String ROLLOVER_FONT_KEY
Description of the Field
Since:

ROLLOVER_FONT_SIZE_TRAIT_NAME

final static String ROLLOVER_FONT_SIZE_TRAIT_NAME

ROLLOVER_SOUND_NAME

final static String ROLLOVER_SOUND_NAME
Constructor Detail

ImageCanvas

public ImageCanvas(VisualizationPreferences prefs, Graph3dVisualizer graph3dVisualizer)
Constructor for the ImageCanvas object
Parameters:
prefs - Description of Parameter
graph3dVisualizer - Description of Parameter
Since:
Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)
Description of the Method
Parameters:
e - Description of Parameter
Since:

calculateStatistics

void calculateStatistics(VisualizerNodes nodes)
Description of the Method
Parameters:
nodes - Description of Parameter
Since:

createFonts

void createFonts()
Description of the Method
Since:

createFonts

synchronized void createFonts(float scale)
Description of the Method
Parameters:
scale - Description of Parameter
Since:

createPopupMenu

public void createPopupMenu()
Description of the Method
Since:

disablePromoteUrlMenuItem

public void disablePromoteUrlMenuItem()

exitingSpace

public void exitingSpace()
Description of the Method
Since:

getAggregateAttributesDisplay

protected String getAggregateAttributesDisplay()
Gets the AggregateAttributesDisplay attribute of the ImageCanvas object
Returns: The AggregateAttributesDisplay value
Since:

getAttributeDescriptionString

public String getAttributeDescriptionString(double value)
Gets the AttributeDescriptionString attribute of the ImageCanvas object
Parameters:
value - Description of Parameter
Returns: The AttributeDescriptionString value
Since:

getAttributesDisplayString

public String getAttributesDisplayString(AgentTraits traits)
Gets the AttributesDisplayString attribute of the ImageCanvas object
Parameters:
traits - Description of Parameter
Returns: The AttributesDisplayString value
Since:

getBackgroundImages

protected Map getBackgroundImages()
Gets the BackgroundImages attribute of the ImageCanvas object
Returns: The BackgroundImages value
Since:

getCurrentBackgroundImage

protected Image getCurrentBackgroundImage()
Gets the CurrentBackgroundImage attribute of the ImageCanvas object
Returns: The CurrentBackgroundImage value
Since:

getCurrentLocation

String getCurrentLocation()
Gets the CurrentLocation attribute of the ImageCanvas object
Returns: The CurrentLocation value
Since:

getGraph3dVisualizer

protected Graph3dVisualizer getGraph3dVisualizer()
Gets the Graph3dVisualizer attribute of the ImageCanvas object
Returns: The Graph3dVisualizer value
Since:

getIpAgentAttributesDisplay

protected String getIpAgentAttributesDisplay()
Gets the IpAgentAttributesDisplay attribute of the ImageCanvas object
Returns: The IpAgentAttributesDisplay value
Since:

getRange

protected int getRange(double z)
Gets the Range attribute of the ImageCanvas object
Parameters:
z - Description of Parameter
Returns: The Range value
Since:

getZoom

double getZoom()
Gets the Zoom attribute of the ImageCanvas object
Returns: The Zoom value
Since:

isNodeSelected

public boolean isNodeSelected(VisualizerNode node, double x, double y)
Gets the NodeSelected attribute of the ImageCanvas object
Parameters:
node - Description of Parameter
x - Description of Parameter
y - Description of Parameter
Returns: The NodeSelected value
Since:

loadCursors

public void loadCursors()
Description of the Method
Since:

locationChanged

public void locationChanged(LocationChangeEvent e)
Description of the Method
Parameters:
e - Description of Parameter
Since:

market

void market(Object datum)
Description of the Method
Parameters:
datum - Description of Parameter
Since:

paintComponent

public synchronized void paintComponent(Graphics gr)
Description of the Method
Parameters:
gr - Description of Parameter
Since:

playTraitedEventSound

protected void playTraitedEventSound(String eventSoundName)
Description of the Method
Parameters:
eventSoundName - Description of Parameter
Since:

recenter

public void recenter()
Description of the Method
Since:

setAggregateAttributesDisplayString

protected void setAggregateAttributesDisplayString(String attributesDisplay)
Sets the AggregateAttributesDisplayString attribute of the ImageCanvas object
Parameters:
attributesDisplay - The new AggregateAttributesDisplayString value
Since:

setBackgroundImages

protected void setBackgroundImages(Map backgroundImages)
Sets the BackgroundImages attribute of the ImageCanvas object
Parameters:
backgroundImages - The new BackgroundImages value
Since:

setCurrentLocation

void setCurrentLocation(String currentLocation)
Sets the CurrentLocation attribute of the ImageCanvas object
Parameters:
currentLocation - The new CurrentLocation value
Since:

setDragMode

public void setDragMode(int dragMode)
Sets the DragMode attribute of the ImageCanvas object
Parameters:
dragMode - The new DragMode value
Since:

setGraph3dVisualizer

protected void setGraph3dVisualizer(Graph3dVisualizer graph3dVisualizer)
Sets the Graph3dVisualizer attribute of the ImageCanvas object
Parameters:
graph3dVisualizer - The new Graph3dVisualizer value
Since:

setIpAgentAttributesDisplayString

protected void setIpAgentAttributesDisplayString(String attributesDisplay)
Sets the IpAgentAttributesDisplayString attribute of the ImageCanvas object
Parameters:
attributesDisplay - The new IpAgentAttributesDisplayString value
Since:

setNodes

public void setNodes(VisualizerNodes nodes)
Sets the Nodes attribute of the ImageCanvas object
Parameters:
nodes - The new Nodes value
Since:

traitsChanged

public synchronized void traitsChanged()
Description of the Method
Since:

zoom

void zoom(double scale)
Description of the Method
Parameters:
scale - Description of Parameter
Since: