upidiff.gui
Class UpidiffGUI

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--upidiff.gui.UpidiffGUI
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, RootPaneContainer, Serializable, WindowConstants

public class UpidiffGUI
extends JFrame

This class contains the main parts of the graphical user interface.

Author:
ajung, bmeurer, kasbar
See Also:
Serialized Form

Nested Class Summary
(package private)  class UpidiffGUI.ActionAdapter
          This inner class models the Actionlistener for this GUI.
(package private)  class UpidiffGUI.ScrollTogetherNew
           
(package private)  class UpidiffGUI.ScrollTogetherOld
           
(package private)  class UpidiffGUI.WindowClosingAdapter
          This inner class models a windowlistener and therefore extends the WindowAdapter
 
Field Summary
private  UpidiffGUI.ActionAdapter actionAdapter
           
private  JPanel barPanel
           
private  BorderLayout borderLayoutPanelNew
           
private  BorderLayout borderLayoutPanelOld
           
private  BorderLayout borderLayoutStatusBar
           
private  BorderLayout borderLayoutToolbarPanel
           
private  JButton buttonCloser
           
private  JButton buttonCopy
           
private  JButton buttonCut
           
private  JButton buttonGC
           
private  JButton buttonKeepLeft
           
private  JButton buttonKeepRight
           
private  JButton buttonManDiff
           
private  JButton buttonMerge
           
private  JButton buttonNext
           
private  JButton buttonOpen
           
private  JButton buttonPaste
           
private  JButton buttonPrev
           
private  JButton buttonSave
           
private  JToggleButton buttonTogetherScrolling
           
private  JButton buttonUndoCloser
           
private  Catalog catalog
           
private  JPanel diffPanel
           
private  FlowLayout flowLayoutToolbarPanel
           
private  BorderLayout innerMergeBorderLayout
           
private  boolean ispressedToggelButton
           
private  JTextPane linePaneMerge
           
private  JTextPane linePaneNew
           
private  JTextPane linePaneOld
           
private  Object lock
           
private  BorderLayout mainBorderLayout
           
private  JSplitPane mainSplitPane
           
private  JMenuBar menuBar
           
private  JMenu menuEdit
           
private  JMenu menuFile
           
private  JMenu menuHelp
           
private  JMenuItem menuItemAbout
           
private  JMenuItem menuItemCopy
           
private  JMenuItem menuItemCut
           
private  JMenuItem menuItemDiff
           
private  JMenuItem menuItemMerge
           
private  JMenuItem menuItemOpen
           
private  JMenuItem menuItemOptions
           
private  JMenuItem menuItemPaste
           
private  JMenuItem menuItemQuit
           
private  JMenuItem menuItemSave
           
private  JMenu menuProject
           
private  BorderLayout mergeBorderLayout
           
private  JPanel mergeInnerPanel
           
private  JPanel mergePanel
           
private  GridLayout mergePanelGrid
           
private  JPanel panelNew
           
private  JPanel panelOld
           
private  JProgressBar progressGC
           
private  JScrollBar scrollBarNew
           
private  JScrollBar scrollBarOld
           
private  JScrollPane scrollPaneMerge
           
private  JScrollPane scrollPaneNew
           
private  JScrollPane scrollPaneOld
           
private  JLabel statusBarLabel
           
private  JPanel statusBarPanel
           
private  JLabel textNewName
           
private  JLabel textOldName
           
private  JTextPane textPaneMerge
           
private  JTextPane textPaneNew
           
private  JTextPane textPaneOld
           
private  JToolBar toolBarEdit
           
private  JToolBar toolBarFile
           
private  JToolBar toolBarGC
           
private  JToolBar toolBarMerge
           
private  JPanel toolbarPanel
           
private  JToolBar toolBarProject
           
private  VisualDiff visualDiff
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
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, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
UpidiffGUI()
          Default constructor.
 
Method Summary
private  void initGui()
          This Methode initialises the GUI
private  void mergeNext(int whose)
          Merges the next change.
 void openFiles(InputSource source1, InputSource source2)
          This Methode opens the two files given by name
private  void resetTranslatableStrings()
          Used to set translatable strings on the dialog components.
private  void saveMergedDocument()
          Saves the merged document.
private  void startMerge()
          This Methode starts the merge process.
private  void updateGC()
          Updates the Garbage collector display.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

mainBorderLayout

private BorderLayout mainBorderLayout

borderLayoutPanelOld

private BorderLayout borderLayoutPanelOld

borderLayoutPanelNew

private BorderLayout borderLayoutPanelNew

mergeBorderLayout

private BorderLayout mergeBorderLayout

innerMergeBorderLayout

private BorderLayout innerMergeBorderLayout

borderLayoutToolbarPanel

private BorderLayout borderLayoutToolbarPanel

borderLayoutStatusBar

private BorderLayout borderLayoutStatusBar

flowLayoutToolbarPanel

private FlowLayout flowLayoutToolbarPanel

mergePanelGrid

private GridLayout mergePanelGrid

diffPanel

private JPanel diffPanel

mergePanel

private JPanel mergePanel

panelOld

private JPanel panelOld

panelNew

private JPanel panelNew

mergeInnerPanel

private JPanel mergeInnerPanel

barPanel

private JPanel barPanel

toolbarPanel

private JPanel toolbarPanel

statusBarPanel

private JPanel statusBarPanel

statusBarLabel

private JLabel statusBarLabel

mainSplitPane

private JSplitPane mainSplitPane

scrollPaneOld

private JScrollPane scrollPaneOld

scrollPaneNew

private JScrollPane scrollPaneNew

scrollPaneMerge

private JScrollPane scrollPaneMerge

textPaneOld

private JTextPane textPaneOld

textPaneMerge

private JTextPane textPaneMerge

textPaneNew

private JTextPane textPaneNew

linePaneOld

private JTextPane linePaneOld

linePaneNew

private JTextPane linePaneNew

linePaneMerge

private JTextPane linePaneMerge

textOldName

private JLabel textOldName

textNewName

private JLabel textNewName

toolBarFile

private JToolBar toolBarFile

toolBarEdit

private JToolBar toolBarEdit

toolBarProject

private JToolBar toolBarProject

toolBarMerge

private JToolBar toolBarMerge

toolBarGC

private JToolBar toolBarGC

menuBar

private JMenuBar menuBar

menuFile

private JMenu menuFile

menuEdit

private JMenu menuEdit

menuProject

private JMenu menuProject

menuHelp

private JMenu menuHelp

menuItemOpen

private JMenuItem menuItemOpen

menuItemSave

private JMenuItem menuItemSave

menuItemQuit

private JMenuItem menuItemQuit

menuItemCut

private JMenuItem menuItemCut

menuItemCopy

private JMenuItem menuItemCopy

menuItemPaste

private JMenuItem menuItemPaste

menuItemDiff

private JMenuItem menuItemDiff

menuItemMerge

private JMenuItem menuItemMerge

menuItemOptions

private JMenuItem menuItemOptions

menuItemAbout

private JMenuItem menuItemAbout

buttonOpen

private JButton buttonOpen

buttonSave

private JButton buttonSave

buttonPaste

private JButton buttonPaste

buttonCopy

private JButton buttonCopy

buttonCut

private JButton buttonCut

buttonManDiff

private JButton buttonManDiff

buttonMerge

private JButton buttonMerge

buttonPrev

private JButton buttonPrev

buttonNext

private JButton buttonNext

buttonKeepLeft

private JButton buttonKeepLeft

buttonKeepRight

private JButton buttonKeepRight

buttonCloser

private JButton buttonCloser

buttonUndoCloser

private JButton buttonUndoCloser

buttonTogetherScrolling

private JToggleButton buttonTogetherScrolling

progressGC

private JProgressBar progressGC

buttonGC

private JButton buttonGC

visualDiff

private VisualDiff visualDiff

actionAdapter

private UpidiffGUI.ActionAdapter actionAdapter

catalog

private Catalog catalog

lock

private Object lock

ispressedToggelButton

private boolean ispressedToggelButton

scrollBarOld

private JScrollBar scrollBarOld

scrollBarNew

private JScrollBar scrollBarNew
Constructor Detail

UpidiffGUI

public UpidiffGUI()
Default constructor. Creates the main Upidiff Graphical User Interface.

Method Detail

initGui

private void initGui()
              throws Exception
This Methode initialises the GUI

Throws:
Exception - Hands over Exceptions from the GUI-Elements

updateGC

private void updateGC()
Updates the Garbage collector display.


resetTranslatableStrings

private void resetTranslatableStrings()
Used to set translatable strings on the dialog components.


startMerge

private void startMerge()
This Methode starts the merge process.


openFiles

public void openFiles(InputSource source1,
                      InputSource source2)
               throws Exception
This Methode opens the two files given by name

Parameters:
source1 - First input source to read.
source2 - Second input source to read.
Throws:
Exception - In case of none existence of the files.

mergeNext

private void mergeNext(int whose)
Merges the next change. If the currently merged change was the last change to merge, the merge buttons are disabled and the save functionality is enabled.

Parameters:
whose - Which variant to merge.

saveMergedDocument

private void saveMergedDocument()
Saves the merged document.