com.touchgraph.graphlayout
Class GLPanel

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.touchgraph.graphlayout.GLPanel
All Implemented Interfaces:
TGScrollPane, ImageObserver, MenuContainer, Serializable, Accessible

public class GLPanel
extends JPanel
implements TGScrollPane

GLPanel contains code for adding scrollbars and interfaces to the TGPanel The "GL" prefix indicates that this class is GraphLayout specific, and will probably need to be rewritten for other applications.

Version:
1.21 $Id: GLPanel.java,v 3.0 2004/07/24 13:21:12 altheim Exp $
Author:
Alexander Shapiro
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.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 JPopupMenu glPopup
           
 HVScroll hvScroll
           
 HyperScroll hyperScroll
           
 String localityLabel
           
 LocalityScroll localityScroll
           
 String rotateLabel
           
 RotateScroll rotateScroll
           
 Hashtable scrollBarHash
           
protected  TGLensSet tgLensSet
           
protected  TGPanel tgPanel
           
protected  TGUIManager tgUIManager
           
 String zoomLabel
           
 ZoomScroll zoomScroll
           
 
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
GLPanel()
          Default constructor.
GLPanel(Color color)
          Constructor with a Color to be used for UI background.
 
Method Summary
 void addUIs()
           
 void buildLens()
           
 void buildPanel()
           
 JPopupMenu getGLPopup()
          Deprecated. use getPopupMenu() instead.
 HVScroll getHVScroll()
          Return the HVScroll used with this GLPanel.
 int getHyperbolicDistortion()
          Return the hyperbolic (aka "fisheye") distortion of this TGScrollPane.
 HyperScroll getHyperScroll()
          Return the HyperScroll used with this GLPanel.
 int getLocalityRadius()
          Return the locality radius of this GLPanel.
 LocalityScroll getLocalityScroll()
          Return the LocalityScroll used with this GLPanel.
 Point getOffset()
          Return the horizontal and vertical offset position as a Point.
 JPopupMenu getPopupMenu()
          Return the JPopupMenu used to toggle display of the controls.
 RotateScroll getRotateScroll()
          Return the RotateScroll used with this GLPanel.
 int getRotationAngle()
          Return the rotation angle of this GLPanel.
 TGPanel getTGPanel()
          Return the TGPanel used with this GLPanel.
 ZoomScroll getZoomScroll()
          Return the ZoomScroll used with this GLPanel.
 int getZoomValue()
          Return the zoom value of this GLPanel.
 void initialize()
          Initialize panel, lens, and establish a random graph as a demonstration.
 void keyPressed(KeyEvent event)
          An action method indicating a key event has occurred.
static void main(String[] args)
           
 void nodeClicked(Node node, MouseEvent e)
          An action method that indicates that the Node node has been clicked.
 void nodeDoubleClicked(Node node, MouseEvent e)
          An action method that indicates that the Node node has been double-clicked.
 void randomGraph()
           
protected  JPanel scrollSelectPanel(String[] scrollBarNames)
           
 void setHyperbolicDistortion(int value)
          Set the hyperbolic (aka "fisheye") distortion of this TGScrollPane (allowable values between 0 to 108).
 void setLocalityRadius(int radius)
          Set the locality radius of this TGScrollPane (allowable values between 0 to 4, or LocalityUtils.INFINITE_LOCALITY_RADIUS).
 void setOffset(Point p)
          Sets the horizontal offset to p.x, and the vertical offset to p.y given a Point p.
 void setRotationAngle(int angle)
          Set the rotation angle of this GLPanel (allowable values between 0 to 359).
 void setZoomValue(int zoomValue)
          Set the zoom value of this GLPanel (allowable values between -100 to 100).
 
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, 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, 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

zoomLabel

public String zoomLabel

rotateLabel

public String rotateLabel

localityLabel

public String localityLabel

hvScroll

public HVScroll hvScroll

zoomScroll

public ZoomScroll zoomScroll

hyperScroll

public HyperScroll hyperScroll

rotateScroll

public RotateScroll rotateScroll

localityScroll

public LocalityScroll localityScroll

glPopup

public JPopupMenu glPopup

scrollBarHash

public Hashtable scrollBarHash

tgPanel

protected TGPanel tgPanel

tgLensSet

protected TGLensSet tgLensSet

tgUIManager

protected TGUIManager tgUIManager
Constructor Detail

GLPanel

public GLPanel()
Default constructor.


GLPanel

public GLPanel(Color color)
Constructor with a Color to be used for UI background.

Method Detail

initialize

public void initialize()
Initialize panel, lens, and establish a random graph as a demonstration.


getTGPanel

public TGPanel getTGPanel()
Return the TGPanel used with this GLPanel.

Specified by:
getTGPanel in interface TGScrollPane

keyPressed

public void keyPressed(KeyEvent event)
An action method indicating a key event has occurred. The KeyEvent event may include information about modifier keys.

Specified by:
keyPressed in interface TGScrollPane

nodeClicked

public void nodeClicked(Node node,
                        MouseEvent e)
An action method that indicates that the Node node has been clicked. The MouseEvent e is ignored in this class.

Specified by:
nodeClicked in interface TGScrollPane

nodeDoubleClicked

public void nodeDoubleClicked(Node node,
                              MouseEvent e)
An action method that indicates that the Node node has been double-clicked. This would be subclassed to provide a specific reaction.

Specified by:
nodeDoubleClicked in interface TGScrollPane

getHVScroll

public HVScroll getHVScroll()
Return the HVScroll used with this GLPanel.

Specified by:
getHVScroll in interface TGScrollPane

setOffset

public void setOffset(Point p)
Sets the horizontal offset to p.x, and the vertical offset to p.y given a Point p.

Specified by:
setOffset in interface TGScrollPane

getOffset

public Point getOffset()
Return the horizontal and vertical offset position as a Point.

Specified by:
getOffset in interface TGScrollPane

getZoomScroll

public ZoomScroll getZoomScroll()
Return the ZoomScroll used with this GLPanel.

Specified by:
getZoomScroll in interface TGScrollPane

setZoomValue

public void setZoomValue(int zoomValue)
Set the zoom value of this GLPanel (allowable values between -100 to 100).

Specified by:
setZoomValue in interface TGScrollPane

getZoomValue

public int getZoomValue()
Return the zoom value of this GLPanel.

Specified by:
getZoomValue in interface TGScrollPane

getRotateScroll

public RotateScroll getRotateScroll()
Return the RotateScroll used with this GLPanel.

Specified by:
getRotateScroll in interface TGScrollPane

setRotationAngle

public void setRotationAngle(int angle)
Set the rotation angle of this GLPanel (allowable values between 0 to 359).

Specified by:
setRotationAngle in interface TGScrollPane

getRotationAngle

public int getRotationAngle()
Return the rotation angle of this GLPanel.

Specified by:
getRotationAngle in interface TGScrollPane

getLocalityScroll

public LocalityScroll getLocalityScroll()
Return the LocalityScroll used with this GLPanel.

Specified by:
getLocalityScroll in interface TGScrollPane

setLocalityRadius

public void setLocalityRadius(int radius)
Set the locality radius of this TGScrollPane (allowable values between 0 to 4, or LocalityUtils.INFINITE_LOCALITY_RADIUS).

Specified by:
setLocalityRadius in interface TGScrollPane

getLocalityRadius

public int getLocalityRadius()
Return the locality radius of this GLPanel.

Specified by:
getLocalityRadius in interface TGScrollPane

getHyperScroll

public HyperScroll getHyperScroll()
Return the HyperScroll used with this GLPanel.

Specified by:
getHyperScroll in interface TGScrollPane

setHyperbolicDistortion

public void setHyperbolicDistortion(int value)
Set the hyperbolic (aka "fisheye") distortion of this TGScrollPane (allowable values between 0 to 108).

Specified by:
setHyperbolicDistortion in interface TGScrollPane

getHyperbolicDistortion

public int getHyperbolicDistortion()
Return the hyperbolic (aka "fisheye") distortion of this TGScrollPane.

Specified by:
getHyperbolicDistortion in interface TGScrollPane

getPopupMenu

public JPopupMenu getPopupMenu()
Return the JPopupMenu used to toggle display of the controls. This is part of the TGScrollPane API.

Specified by:
getPopupMenu in interface TGScrollPane

getGLPopup

public JPopupMenu getGLPopup()
Deprecated. use getPopupMenu() instead.

Return the JPopupMenu used to toggle display of the controls.


buildLens

public void buildLens()

buildPanel

public void buildPanel()

scrollSelectPanel

protected JPanel scrollSelectPanel(String[] scrollBarNames)

addUIs

public void addUIs()

randomGraph

public void randomGraph()
                 throws TGException
Throws:
TGException

main

public static void main(String[] args)


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.