edu.jhu.ece.iacl.jist.pipeline.gui
Class PipeInternalFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JInternalFrame
                  extended by edu.jhu.ece.iacl.jist.pipeline.gui.PipeInternalFrame
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class PipeInternalFrame
extends javax.swing.JInternalFrame
implements java.awt.event.KeyListener, java.beans.PropertyChangeListener

Internal frame to display graph of pipeline.

Author:
Blake Lucas
See Also:
Serialized Form

Nested Class Summary
 class PipeInternalFrame.EventRedirector
          The Class EventRedirector.
 
Nested classes/interfaces inherited from class javax.swing.JInternalFrame
javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 javax.swing.Action collapse
          The expand.
 javax.swing.Action copy
          The expand.
 javax.swing.Action cut
          The expand.
 javax.swing.Action expand
          The expand.
protected  JGraphFoldingManager foldingManager
          The folding manager.
protected  PipeJGraph graph
          The graph.
 javax.swing.Action group
          The expand.
 javax.swing.Action paste
          The expand.
 javax.swing.Action redo
          The expand.
 javax.swing.Action remove
          The expand.
 javax.swing.Action toback
          The expand.
 javax.swing.Action tofront
          The expand.
protected  javax.swing.JToolBar toolbar
          The toolbar.
 javax.swing.Action undo
          The expand.
protected  GraphUndoManager undoManager
          The undo manager.
 javax.swing.Action ungroup
          The expand.
 
Fields inherited from class javax.swing.JInternalFrame
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
 
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 javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PipeInternalFrame(java.lang.String name)
          Default constructor.
 
Method Summary
 boolean close()
          Close current frame.
protected  PipeJGraph createGraph()
          Create graph and install listeners.
protected  javax.swing.JToolBar createToolBar()
          Create toolbar to manipulate graph.
 void dispose()
          Dispose of graph.
 void fireActionPerformed(javax.swing.Action act)
          Fire action performed.
 javax.swing.Action getCopy()
          Gets the copy.
 javax.swing.Action getCut()
          Gets the cut.
 PipeJGraph getGraph()
          Gets the graph.
 javax.swing.Action getPaste()
          Gets the paste.
 PipeLayout getPipelineLayout()
          Get layout for frame.
 javax.swing.Action getRemove()
          Gets the remove.
 javax.swing.Action getToback()
          Gets the toback.
 javax.swing.Action getTofront()
          Gets the tofront.
 void group(java.lang.Object[] cells)
          Group cells together.
 void insert(DraggableNode node)
          Insert draggable node into graph.
 void insert(DraggableNode node, java.awt.Point cursorLocationBis)
          Insert node into graph.
protected  void installListeners(JGraph graph)
          Install listeners.
 void internalFrameActivated(javax.swing.event.InternalFrameEvent arg0)
          Internal frame activated.
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void propertyChange(java.beans.PropertyChangeEvent evt)
          Refresh parameter view if frame has been selected.
 void redo()
          Redo the last Change to the Model or the View.
 void select()
          Select this frame.
 void setCopy(javax.swing.Action copy)
          Sets the copy.
 void setCut(javax.swing.Action cut)
          Sets the cut.
 void setEnabled(boolean enabled)
          Set whether pipeline is editable.
 void setPaste(javax.swing.Action paste)
          Sets the paste.
 void setPipelineLayout(PipeLayout layout, javax.swing.ProgressMonitor monitor)
          Set layout for graph.
 void setRemove(javax.swing.Action remove)
          Sets the remove.
 void setTitle(java.lang.String title)
           
 void setToback(javax.swing.Action toback)
          Sets the toback.
 void setTofront(javax.swing.Action tofront)
          Sets the tofront.
 void toBack(java.lang.Object[] c)
          Sends the Specified Cells to Back.
 void toFront(java.lang.Object[] c)
          Brings the Specified Cells to Front.
 void undo()
          Undo the last Change to the Model or the View.
 void ungroup(java.lang.Object[] cells)
          Ungroup the Groups in Cells and Select the Children.
protected  void uninstallListeners(JGraph graph)
          Uninstall listeners.
protected  void updateHistoryButtons()
          Update Undo/Redo Button State based on Undo Manager.
 void valueChanged(GraphSelectionEvent e)
           
 
Methods inherited from class javax.swing.JInternalFrame
addImpl, addInternalFrameListener, createRootPane, doDefaultCloseAction, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getFrameIcon, getGlassPane, getInternalFrameListeners, getJMenuBar, getLastCursor, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setCursor, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setUI, show, toBack, toFront, 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, 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, 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, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, 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, 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, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

graph

protected PipeJGraph graph
The graph.


undoManager

protected GraphUndoManager undoManager
The undo manager.


toolbar

protected javax.swing.JToolBar toolbar
The toolbar.


undo

public javax.swing.Action undo
The expand.


redo

public javax.swing.Action redo
The expand.


remove

public javax.swing.Action remove
The expand.


group

public javax.swing.Action group
The expand.


ungroup

public javax.swing.Action ungroup
The expand.


tofront

public javax.swing.Action tofront
The expand.


toback

public javax.swing.Action toback
The expand.


cut

public javax.swing.Action cut
The expand.


copy

public javax.swing.Action copy
The expand.


paste

public javax.swing.Action paste
The expand.


collapse

public javax.swing.Action collapse
The expand.


expand

public javax.swing.Action expand
The expand.


foldingManager

protected JGraphFoldingManager foldingManager
The folding manager.

Constructor Detail

PipeInternalFrame

public PipeInternalFrame(java.lang.String name)
Default constructor.

Parameters:
name - frame name
Method Detail

close

public boolean close()
Close current frame.

Returns:
true, if close

createGraph

protected PipeJGraph createGraph()
Create graph and install listeners.

Returns:
the pipe j graph

createToolBar

protected javax.swing.JToolBar createToolBar()
Create toolbar to manipulate graph.

Returns:
the j tool bar

dispose

public void dispose()
Dispose of graph.

Overrides:
dispose in class javax.swing.JInternalFrame

fireActionPerformed

public void fireActionPerformed(javax.swing.Action act)
Fire action performed.

Parameters:
act - the act

getCopy

public javax.swing.Action getCopy()
Gets the copy.

Returns:
Returns the copy.

getCut

public javax.swing.Action getCut()
Gets the cut.

Returns:
Returns the cut.

getGraph

public PipeJGraph getGraph()
Gets the graph.

Returns:
the graph

getPaste

public javax.swing.Action getPaste()
Gets the paste.

Returns:
Returns the paste.

getPipelineLayout

public PipeLayout getPipelineLayout()
Get layout for frame.

Returns:
the pipeline layout

getRemove

public javax.swing.Action getRemove()
Gets the remove.

Returns:
Returns the remove.

getToback

public javax.swing.Action getToback()
Gets the toback.

Returns:
Returns the toback.

getTofront

public javax.swing.Action getTofront()
Gets the tofront.

Returns:
Returns the tofront.

group

public void group(java.lang.Object[] cells)
Group cells together.

Parameters:
cells - the cells

insert

public void insert(DraggableNode node)
Insert draggable node into graph.

Parameters:
node - the node

insert

public void insert(DraggableNode node,
                   java.awt.Point cursorLocationBis)
Insert node into graph.

Parameters:
node - the node
cursorLocationBis - cursor location

installListeners

protected void installListeners(JGraph graph)
Install listeners.

Parameters:
graph - the graph

internalFrameActivated

public void internalFrameActivated(javax.swing.event.InternalFrameEvent arg0)
Internal frame activated.

Parameters:
arg0 - the arg0

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Refresh parameter view if frame has been selected.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
evt - the evt

redo

public void redo()
Redo the last Change to the Model or the View.


select

public void select()
Select this frame.


setCopy

public void setCopy(javax.swing.Action copy)
Sets the copy.

Parameters:
copy - The copy to set.

setCut

public void setCut(javax.swing.Action cut)
Sets the cut.

Parameters:
cut - The cut to set.

setEnabled

public void setEnabled(boolean enabled)
Set whether pipeline is editable. This will effect the parameter panel and module panel too.

Overrides:
setEnabled in class javax.swing.JComponent
Parameters:
enabled - the enabled

setPaste

public void setPaste(javax.swing.Action paste)
Sets the paste.

Parameters:
paste - The paste to set.

setPipelineLayout

public void setPipelineLayout(PipeLayout layout,
                              javax.swing.ProgressMonitor monitor)
Set layout for graph.

Parameters:
layout - the layout
monitor - the monitor

setRemove

public void setRemove(javax.swing.Action remove)
Sets the remove.

Parameters:
remove - The remove to set.

setToback

public void setToback(javax.swing.Action toback)
Sets the toback.

Parameters:
toback - The toback to set.

setTofront

public void setTofront(javax.swing.Action tofront)
Sets the tofront.

Parameters:
tofront - The tofront to set.

toBack

public void toBack(java.lang.Object[] c)
Sends the Specified Cells to Back.

Parameters:
c - cells

toFront

public void toFront(java.lang.Object[] c)
Brings the Specified Cells to Front.

Parameters:
c - the c

undo

public void undo()
Undo the last Change to the Model or the View.


ungroup

public void ungroup(java.lang.Object[] cells)
Ungroup the Groups in Cells and Select the Children.

Parameters:
cells - the cells

uninstallListeners

protected void uninstallListeners(JGraph graph)
Uninstall listeners.

Parameters:
graph - the graph

updateHistoryButtons

protected void updateHistoryButtons()
Update Undo/Redo Button State based on Undo Manager.


valueChanged

public void valueChanged(GraphSelectionEvent e)

setTitle

public void setTitle(java.lang.String title)
Overrides:
setTitle in class javax.swing.JInternalFrame