de.saar.chorus.ubench.gui
Class JGraphTab

Object
  extended by Component
      extended by Container
          extended by JComponent
              extended by JPanel
                  extended by JScrollableJGraph
                      extended by JGraphTab
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
JDomGraphTab, JSolvedFormTab

public abstract class JGraphTab
extends JScrollableJGraph

A JPanel displaying a JGraph, either a dominance graph or a solved form, and providing several informations on the graph needed by other GUI-classes. Everything what can be set up independent from the kind of graph to display (dominance graph or solved form) is initialised here.

Author:
Alexander Koller, Michaela Regneri
See Also:
JDomGraphTab, JSolvedFormTab, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JGraphTab(JDomGraph jdg, DomGraph dg, String name, CommandListener lis, NodeLabels lab)
          A new JGraphTab
 
Method Summary
abstract  JGraphTab clone()
           
 void displayChart()
           
 void fitGraph()
          Scales the graph so as to fit in the recent window.
 void focusChart()
           
 String getBarCode()
           
 JFrame getChartViewer()
           
 JDomGraph getCloneOfGraph()
           
 String getDefaultName()
           
 DomGraph getDomGraph()
           
 JDomGraph getGraph()
           
 String getGraphName()
           
 double getGraphScale()
           
 CommandListener getListener()
           
 NodeLabels getNodeLabels()
           
 Preferences getRecentLayout()
           
 SolvedFormIterator getSolvedFormIterator()
           
 long getSolvedForms()
           
 JPanel getStatusBar()
           
 boolean hasVisibleChartViewer()
           
 boolean isEmpty()
           
 int numGraphNodes()
           
 void repaintIfNecessary()
          Repaints the graph if its layout is not consistent with the recent layout preferences.
 void resetLayout()
          Resets the layout to its initial version.
 void setBarCode(String barCode)
           
 void setDefaultName(String defaultName)
           
 void setDomGraph(DomGraph domGraph)
           
 void setGraph(JDomGraph graph)
           
 void setGraphName(String graphName)
           
 void setGraphScale(double scale)
          Scales the graph with the given factor.
 void setListener(CommandListener listener)
           
 void setNodeLabels(NodeLabels nodeLabels)
           
 void setRecentLayout(Preferences recentLayout)
           
 void setSolvedFormIterator(SolvedFormIterator solvedFormIterator)
           
 void setSolvedForms(long solvedForms)
           
 void setStatusBar(JPanel statusBar)
           
 void updateRecentLayout()
          Updates the graph's layout preferences by adopting the recent global layout preferences.
 
Methods inherited from class JScrollableJGraph
resetSlider
 
Methods inherited from class JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, 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, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class 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, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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 Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JGraphTab

public JGraphTab(JDomGraph jdg,
                 DomGraph dg,
                 String name,
                 CommandListener lis,
                 NodeLabels lab)
A new JGraphTab

Parameters:
jdg - the graph to display as JDomGraph
dg - the underlying DomGraph
name - the tab's name
lis - the ActionListener for this tab
lab - storage for the nodelables of the graph to display
Method Detail

clone

public abstract JGraphTab clone()
Overrides:
clone in class Object

getGraph

public JDomGraph getGraph()
Returns:
graph the JDomGraph

getSolvedForms

public long getSolvedForms()
Returns:
solvedForms the number of solved forms

getNodeLabels

public NodeLabels getNodeLabels()
Returns:
nodeLabels the NodeLabels object

fitGraph

public void fitGraph()
Scales the graph so as to fit in the recent window.


getBarCode

public String getBarCode()
Returns:
Returns the barCode.

setGraphScale

public void setGraphScale(double scale)
Scales the graph with the given factor.

Parameters:
scale - the scale factor

getGraphScale

public double getGraphScale()
Returns:
the scale (percentage of the original one)

getDefaultName

public String getDefaultName()
Returns:
Returns the defaultName.

setDefaultName

public void setDefaultName(String defaultName)
Parameters:
defaultName - The defaultName to set.

getDomGraph

public DomGraph getDomGraph()
Returns:
Returns the domGraph.

setDomGraph

public void setDomGraph(DomGraph domGraph)
Parameters:
domGraph - The domGraph to set.

getGraphName

public String getGraphName()
Returns:
Returns the graphName.

setGraphName

public void setGraphName(String graphName)
Parameters:
graphName - The graphName to set.

getListener

public CommandListener getListener()
Returns:
Returns the listener.

setListener

public void setListener(CommandListener listener)
Parameters:
listener - The listener to set.

getRecentLayout

public Preferences getRecentLayout()
Returns:
Returns the recentLayout.

getSolvedFormIterator

public SolvedFormIterator getSolvedFormIterator()
Returns:
Returns the solvedFormIterator.

setSolvedFormIterator

public void setSolvedFormIterator(SolvedFormIterator solvedFormIterator)
Parameters:
solvedFormIterator - The solvedFormIterator to set.

getStatusBar

public JPanel getStatusBar()
Returns:
Returns the statusBar.

setStatusBar

public void setStatusBar(JPanel statusBar)
Parameters:
statusBar - The statusBar to set.

setBarCode

public void setBarCode(String barCode)
Parameters:
barCode - The barCode to set.

setGraph

public void setGraph(JDomGraph graph)
Parameters:
graph - The graph to set.

setNodeLabels

public void setNodeLabels(NodeLabels nodeLabels)
Parameters:
nodeLabels - The nodeLabels to set.

setSolvedForms

public void setSolvedForms(long solvedForms)
Parameters:
solvedForms - The solvedForms to set.

setRecentLayout

public void setRecentLayout(Preferences recentLayout)
Parameters:
recentLayout - The recentLayout to set.

repaintIfNecessary

public void repaintIfNecessary()
Repaints the graph if its layout is not consistent with the recent layout preferences.


updateRecentLayout

public void updateRecentLayout()
Updates the graph's layout preferences by adopting the recent global layout preferences.


numGraphNodes

public int numGraphNodes()
Returns:
number of the graph's nodes

getCloneOfGraph

public JDomGraph getCloneOfGraph()
Returns:
a clone of the displayed graph

resetLayout

public void resetLayout()
Resets the layout to its initial version.


displayChart

public void displayChart()

isEmpty

public boolean isEmpty()
Returns:
true if the graph to display cannot be drawn

hasVisibleChartViewer

public boolean hasVisibleChartViewer()
Returns:
Returns the hasActiveChartViewer.

getChartViewer

public JFrame getChartViewer()

focusChart

public void focusChart()