com.ericsson.tic.vi
Class ViewPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.ericsson.tic.vi.ViewPanel
All Implemented Interfaces:
ActionListener, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class ViewPanel
extends JPanel
implements MouseMotionListener, MouseWheelListener, MouseListener, ActionListener, KeyListener

The view Panel is the most important GUI component. It creates an OpenGL Canvas (or GLJPanel) and keeps track of view specific variables.

Version:
1.0 (2008-12-03)
Author:
Sami Matilainen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 Animator animator
          The animator calls the canvas for graphics updates.
 int[] barData
          determines which data sets to use for bars.
 boolean barsOn
          If true, the bars are set to visible.
 int[] barsSelectedIndex
          Keeps track of the selected index in a combobox.
 boolean brushingMarkersOn
          If true, brushing Markers will be drawn.
 Camera camera
          The camera associated with this view.
 GLJPanel canvas
          The actual panel holding the OpenGL canvas.
private  JCheckBoxMenuItem cbMenuItem
          A menu item.
 JMenuItem closeMenuItem
          A menu item.
 boolean defaultNodeColorsOn
          If true, the default colors are used for the nodes.
private  JFileChooser fileChooser
          A file chooser dialogue.
 boolean globePhasingIn
          If true, the globe view is phasing in.
 boolean globePhasingOut
          If true, the globe view is phasing out.
 boolean globeViewOn
          If true, the globe view is currently on.
 boolean graphNodesOn
          If true, the nodes are set to visible.
 boolean graphRelationsOn
          If true, the relations are set to visible.
 int[] histData
          determines which data sets to use for histograms.
 int[] histSelectedIndex
          Keeps track of the selected index in a combobox.
 int id
          The unique identifier for this view.
 boolean labelsOn
          If true, labels are rendererd.
 boolean levelNodeShadingOn
          If true, nodes will be shaded by their level.
 boolean limitRendering
          If true, rendering is limited.
private  JMenuItem menuItem
          A menu item.
 GraphNode[] nodeArr
          An array of nodes.
 GraphNode[] nodeArrFull
          An array of nodes.
 GraphNode[] nodeArrSubset
          An array of nodes.
 int nodeData
          determines which data set to use for nodes.
 boolean[] nodeOfLevelOn
          Not used.
 boolean[] nodeOfTypeOn
          Determines which node types are visible.
 GraphNodeRel[] nodeRelArr
          An array of relations.
 GraphNodeRel[] nodeRelArrFull
          An array of relations.
 GraphNodeRel[] nodeRelArrSubset
          An array of relations.
 int nodeSelectedIndex
          Keeps track of the selected index in a combobox.
 boolean nodesMovingToGlobeTarget
          If true, the nodes are moving to their targets in the globe view.
 boolean nodesMovingToPlaneTarget
          If true, the nodes are moving to their targets in the plane view.
 boolean picking
          If true, the user has clicked the view and we have entered picking mode.
 boolean planePhasingIn
          If true, the plane view is phasing in.
 boolean planePhasingOut
          If true, the plane view is phasing out.
 boolean planeViewOn
          If true, the plane view is currently on.
private  JPopupMenu popupMenu
          A pop-up menu.
 int relData
          determines which data set to use for relationships.
 int relSelectedIndex
          Keeps track of the selected index in a combobox.
 Renderer renderer
          The eventlistener which listens to calls from the OpenGL engine.
 SplitViewPanel splitParent
          The split view which is the gui parent of this ViewPanel.
private  JMenu subMenuLevel
          A menu.
private  JMenu subMenuSubset
          A menu.
private  JMenu subMenuType
          A menu.
 boolean subsetEmpty
          If true the subset is empty.
 boolean subsetOn
          If true, the subset is active.
 boolean texturesOn
          If true, the textures will be drawn.
 JButton texturesOnButton
          A button.
 boolean transitionStateOn
          If true, the view is in a transitional state moving from one form to another.
 JButton viewModeButton
          A button.
 boolean viewTitleOn
          True if the view titles are turned on.
 
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
ViewPanel(int id, SplitViewPanel splitParent)
          Creates a View Panel.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Called when an ActionEvent is triggered.
private  void createSubset()
          Creates a subset of the selected nodes.
 void createSubset(int[] save)
          Creates a subset from the array specified in a save file.
 void initComboBoxIndexes()
          Initializes the combo box indexes.
 void keyPressed(KeyEvent e)
          Called when a keyboard key is pressed.
 void keyReleased(KeyEvent e)
          Called when a keyboard key is released.
 void keyTyped(KeyEvent e)
          Called when a keyboard key is typed.
 void mouseClicked(MouseEvent e)
          Called when a MouseEvent is triggered.
 void mouseDragged(MouseEvent e)
          Called when the mouse is dragged.
 void mouseEntered(MouseEvent e)
          Called when a MouseEvent is triggered.
 void mouseExited(MouseEvent e)
          Called when a MouseEvent is triggered.
 void mouseMoved(MouseEvent e)
          Called when a MouseEvent is triggered.
 void mousePressed(MouseEvent e)
          Called when the mouse is pressed.
 void mouseReleased(MouseEvent e)
          Called when the mouse is released.
 void mouseWheelMoved(MouseWheelEvent e)
          Called when the mousewheel is scrolled.
 void renewID()
          Renew the ID of this view.
 void updateLabelTargets()
          Updates the targets of all labels.
 void updateNodeTargets()
          Updates the targets of all nodes.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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
 
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, getName, 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

canvas

public GLJPanel canvas
The actual panel holding the OpenGL canvas.


animator

public Animator animator
The animator calls the canvas for graphics updates.


renderer

public Renderer renderer
The eventlistener which listens to calls from the OpenGL engine.


id

public int id
The unique identifier for this view.


camera

public Camera camera
The camera associated with this view.


viewModeButton

public JButton viewModeButton
A button.


texturesOnButton

public JButton texturesOnButton
A button.


splitParent

public SplitViewPanel splitParent
The split view which is the gui parent of this ViewPanel.


transitionStateOn

public boolean transitionStateOn
If true, the view is in a transitional state moving from one form to another.


globePhasingIn

public boolean globePhasingIn
If true, the globe view is phasing in.


globePhasingOut

public boolean globePhasingOut
If true, the globe view is phasing out.


planePhasingIn

public boolean planePhasingIn
If true, the plane view is phasing in.


planePhasingOut

public boolean planePhasingOut
If true, the plane view is phasing out.


nodesMovingToPlaneTarget

public boolean nodesMovingToPlaneTarget
If true, the nodes are moving to their targets in the plane view.


nodesMovingToGlobeTarget

public boolean nodesMovingToGlobeTarget
If true, the nodes are moving to their targets in the globe view.


globeViewOn

public boolean globeViewOn
If true, the globe view is currently on.


planeViewOn

public boolean planeViewOn
If true, the plane view is currently on.


graphNodesOn

public boolean graphNodesOn
If true, the nodes are set to visible.


graphRelationsOn

public boolean graphRelationsOn
If true, the relations are set to visible.


barsOn

public boolean barsOn
If true, the bars are set to visible.


picking

public boolean picking
If true, the user has clicked the view and we have entered picking mode.


brushingMarkersOn

public boolean brushingMarkersOn
If true, brushing Markers will be drawn.


texturesOn

public boolean texturesOn
If true, the textures will be drawn.


nodeData

public int nodeData
determines which data set to use for nodes.


barData

public int[] barData
determines which data sets to use for bars.


histData

public int[] histData
determines which data sets to use for histograms.


relData

public int relData
determines which data set to use for relationships.


viewTitleOn

public boolean viewTitleOn
True if the view titles are turned on.


nodeOfLevelOn

public boolean[] nodeOfLevelOn
Not used.


nodeOfTypeOn

public boolean[] nodeOfTypeOn
Determines which node types are visible.


nodeArr

public GraphNode[] nodeArr
An array of nodes.


nodeRelArr

public GraphNodeRel[] nodeRelArr
An array of relations.


nodeArrFull

public GraphNode[] nodeArrFull
An array of nodes.


nodeRelArrFull

public GraphNodeRel[] nodeRelArrFull
An array of relations.


nodeArrSubset

public GraphNode[] nodeArrSubset
An array of nodes. This is a subset of the full topology.


nodeRelArrSubset

public GraphNodeRel[] nodeRelArrSubset
An array of relations. This is a subset of the full topology.


popupMenu

private JPopupMenu popupMenu
A pop-up menu.


subMenuType

private JMenu subMenuType
A menu.


subMenuLevel

private JMenu subMenuLevel
A menu.


subMenuSubset

private JMenu subMenuSubset
A menu.


menuItem

private JMenuItem menuItem
A menu item.


cbMenuItem

private JCheckBoxMenuItem cbMenuItem
A menu item.


closeMenuItem

public JMenuItem closeMenuItem
A menu item.


fileChooser

private JFileChooser fileChooser
A file chooser dialogue.


limitRendering

public boolean limitRendering
If true, rendering is limited.


labelsOn

public boolean labelsOn
If true, labels are rendererd.


subsetOn

public boolean subsetOn
If true, the subset is active.


subsetEmpty

public boolean subsetEmpty
If true the subset is empty.


nodeSelectedIndex

public int nodeSelectedIndex
Keeps track of the selected index in a combobox.


relSelectedIndex

public int relSelectedIndex
Keeps track of the selected index in a combobox.


barsSelectedIndex

public int[] barsSelectedIndex
Keeps track of the selected index in a combobox.


histSelectedIndex

public int[] histSelectedIndex
Keeps track of the selected index in a combobox.


defaultNodeColorsOn

public boolean defaultNodeColorsOn
If true, the default colors are used for the nodes.


levelNodeShadingOn

public boolean levelNodeShadingOn
If true, nodes will be shaded by their level.

Constructor Detail

ViewPanel

public ViewPanel(int id,
                 SplitViewPanel splitParent)
Creates a View Panel.

Parameters:
id - the id of this view.
splitParent - the parent SplitViewPanel of this view.
Method Detail

initComboBoxIndexes

public void initComboBoxIndexes()
Initializes the combo box indexes. Used for the GUI.


updateNodeTargets

public void updateNodeTargets()
Updates the targets of all nodes.


updateLabelTargets

public void updateLabelTargets()
Updates the targets of all labels.


renewID

public void renewID()
Renew the ID of this view.


mouseDragged

public void mouseDragged(MouseEvent e)
Called when the mouse is dragged. Calls the appropriate function in the camera.

Specified by:
mouseDragged in interface MouseMotionListener
Parameters:
e - The MouseEvent that was triggered.

mousePressed

public void mousePressed(MouseEvent e)
Called when the mouse is pressed. Calls the appropriate function in the camera.

Specified by:
mousePressed in interface MouseListener
Parameters:
e - The MouseEvent that was triggered.

mouseReleased

public void mouseReleased(MouseEvent e)
Called when the mouse is released. Calls the appropriate function in the camera.

Specified by:
mouseReleased in interface MouseListener
Parameters:
e - The MouseEvent that was triggered.

mouseWheelMoved

public void mouseWheelMoved(MouseWheelEvent e)
Called when the mousewheel is scrolled. Calls the appropriate function in the camera.

Specified by:
mouseWheelMoved in interface MouseWheelListener
Parameters:
e - The MouseEvent that was triggered.

mouseClicked

public void mouseClicked(MouseEvent e)
Called when a MouseEvent is triggered.

Specified by:
mouseClicked in interface MouseListener
Parameters:
e - The MouseEvent which triggered the event.

mouseMoved

public void mouseMoved(MouseEvent e)
Called when a MouseEvent is triggered.

Specified by:
mouseMoved in interface MouseMotionListener
Parameters:
e - The MouseEvent which triggered the event.

mouseExited

public void mouseExited(MouseEvent e)
Called when a MouseEvent is triggered.

Specified by:
mouseExited in interface MouseListener
Parameters:
e - The MouseEvent which triggered the event.

mouseEntered

public void mouseEntered(MouseEvent e)
Called when a MouseEvent is triggered.

Specified by:
mouseEntered in interface MouseListener
Parameters:
e - The MouseEvent which triggered the event.

keyPressed

public void keyPressed(KeyEvent e)
Called when a keyboard key is pressed.

Specified by:
keyPressed in interface KeyListener
Parameters:
e - The KeyEvent which was triggered.

keyReleased

public void keyReleased(KeyEvent e)
Called when a keyboard key is released.

Specified by:
keyReleased in interface KeyListener
Parameters:
e - The KeyEvent which was triggered.

keyTyped

public void keyTyped(KeyEvent e)
Called when a keyboard key is typed.

Specified by:
keyTyped in interface KeyListener
Parameters:
e - The KeyEvent which was triggered.

actionPerformed

public void actionPerformed(ActionEvent e)
Called when an ActionEvent is triggered.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - The ActionEvent which triggered the event.

createSubset

private void createSubset()
Creates a subset of the selected nodes.


createSubset

public void createSubset(int[] save)
Creates a subset from the array specified in a save file.