net.sf.farrago.plannerviz
Class FarragoPlanVisualizer
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
net.sf.farrago.plannerviz.FarragoPlanVisualizer
- All Implemented Interfaces:
- WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, RelOptListener
public class FarragoPlanVisualizer
- extends JApplet
- implements RelOptListener, WindowListener
FarragoPlanVizualizer uses JGraph to visualize the machinations
of the planner.
- Version:
- $Id: //open/dev/farrago/examples/plannerviz/src/net/sf/farrago/plannerviz/FarragoPlanVisualizer.java#14 $
- Author:
- John V. Sichi
- See Also:
- Serialized Form
Methods inherited from class javax.swing.JApplet |
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.applet.Applet |
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
tracer
private static final Logger tracer
STATE_CRAWLING
private static final int STATE_CRAWLING
- See Also:
- Constant Field Values
STATE_STEPPING
private static final int STATE_STEPPING
- See Also:
- Constant Field Values
STATE_WALKING
private static final int STATE_WALKING
- See Also:
- Constant Field Values
STATE_RUNNING
private static final int STATE_RUNNING
- See Also:
- Constant Field Values
STATE_FLYING
private static final int STATE_FLYING
- See Also:
- Constant Field Values
STATE_CLOSED
private static final int STATE_CLOSED
- See Also:
- Constant Field Values
DETAIL_LOGICAL
private static final int DETAIL_LOGICAL
- See Also:
- Constant Field Values
DETAIL_PHYSICAL
private static final int DETAIL_PHYSICAL
- See Also:
- Constant Field Values
DETAIL_PHYSIOLOGICAL
private static final int DETAIL_PHYSIOLOGICAL
- See Also:
- Constant Field Values
state
private int state
detail
private int detail
currentGenerationNumber
private int currentGenerationNumber
stepVar
private Object stepVar
frame
private JFrame frame
scrollPane
private JScrollPane scrollPane
graph
private org.jgraph.JGraph graph
graphView
private org.jgraph.graph.GraphLayoutCache graphView
graphAdapter
private org.jgrapht.ext.JGraphModelAdapter graphAdapter
graphModel
private org.jgrapht.graph.ListenableDirectedGraph<FarragoPlanVisualizer.VisualVertex,FarragoPlanVisualizer.VisualEdge> graphModel
status
private JMenuItem status
physicalEquivMap
private org.jgraph.algebra.UnionFind physicalEquivMap
logicalEquivMap
private org.jgraph.algebra.UnionFind logicalEquivMap
scale
private double scale
rels
private Set<RelNode> rels
objToVertexMap
private Map<Object,FarragoPlanVisualizer.VisualVertex> objToVertexMap
normalVertexAttributes
private org.jgraph.graph.AttributeMap normalVertexAttributes
newVertexAttributes
private org.jgraph.graph.AttributeMap newVertexAttributes
oldVertexAttributes
private org.jgraph.graph.AttributeMap oldVertexAttributes
finalVertexAttributes
private org.jgraph.graph.AttributeMap finalVertexAttributes
highlightList
private List<FarragoPlanVisualizer.VisualVertex> highlightList
ruleName
private String ruleName
FarragoPlanVisualizer
public FarragoPlanVisualizer()
addStateButton
private void addStateButton(JMenuBar menuBar,
String name,
int newState)
addZoomButton
private void addZoomButton(JMenuBar menuBar,
String name,
double factor)
changeState
private void changeState(int newState)
windowClosing
public void windowClosing(WindowEvent e)
- Specified by:
windowClosing
in interface WindowListener
windowClosed
public void windowClosed(WindowEvent e)
- Specified by:
windowClosed
in interface WindowListener
windowOpened
public void windowOpened(WindowEvent e)
- Specified by:
windowOpened
in interface WindowListener
windowIconified
public void windowIconified(WindowEvent e)
- Specified by:
windowIconified
in interface WindowListener
windowDeiconified
public void windowDeiconified(WindowEvent e)
- Specified by:
windowDeiconified
in interface WindowListener
windowActivated
public void windowActivated(WindowEvent e)
- Specified by:
windowActivated
in interface WindowListener
windowDeactivated
public void windowDeactivated(WindowEvent e)
- Specified by:
windowDeactivated
in interface WindowListener
relChosen
public void relChosen(RelOptListener.RelChosenEvent event)
- Description copied from interface:
RelOptListener
- Notifies this listener that a relational expression has been chosen as
part of the final implementation of the query plan. After the plan is
copmlete, this is called one more time with null for the rel.
- Specified by:
relChosen
in interface RelOptListener
- Parameters:
event
- details about the event
relDiscarded
public void relDiscarded(RelOptListener.RelDiscardedEvent event)
- Description copied from interface:
RelOptListener
- Notifies this listener that a relational expression is no longer of
interest to the planner.
- Specified by:
relDiscarded
in interface RelOptListener
- Parameters:
event
- details about the event
relEquivalenceFound
public void relEquivalenceFound(RelOptListener.RelEquivalenceEvent event)
- Description copied from interface:
RelOptListener
- Notifies this listener that a relational expression has been registered
with a particular equivalence class after an equivalence has been either
detected or asserted. Equivalence classes may be either logical (all
expressions which yield the same result set) or physical (all expressions
which yield the same result set with a particular calling convention).
- Specified by:
relEquivalenceFound
in interface RelOptListener
- Parameters:
event
- details about the event
ruleAttempted
public void ruleAttempted(RelOptListener.RuleAttemptedEvent event)
- Description copied from interface:
RelOptListener
- Notifies this listener that an optimizer rule is being applied to a
particular relational expression. This rule is called twice; once before
the rule is invoked, and once after. Note that the rel attribute of the
event is always the old expression.
- Specified by:
ruleAttempted
in interface RelOptListener
- Parameters:
event
- details about the event
ruleProductionSucceeded
public void ruleProductionSucceeded(RelOptListener.RuleProductionEvent event)
- Description copied from interface:
RelOptListener
- Notifies this listener that an optimizer rule has been successfully
applied to a particular relational expression, resulting in a new
equivalent expression (relEquivalenceFound will also be called unless the
new expression is identical to an existing one). This rule is called
twice; once before registration of the new rel, and once after. Note that
the rel attribute of the event is always the new expression; to get the
old expression, use event.getRuleCall().rels[0].
- Specified by:
ruleProductionSucceeded
in interface RelOptListener
- Parameters:
event
- details about the event
setStatus
private void setStatus(String text)
highlightRuleVertices
private void highlightRuleVertices(RelOptListener.RuleProductionEvent event)
includeRel
private boolean includeRel(RelNode rel)
isConverterRel
private boolean isConverterRel(RelNode rel)
highlightVertex
private void highlightVertex(FarragoPlanVisualizer.VisualVertex vertex,
org.jgraph.graph.AttributeMap attributes)
paintVertex
private void paintVertex(FarragoPlanVisualizer.VisualVertex vertex,
org.jgraph.graph.AttributeMap map)
updateGraph
private void updateGraph()
waitForInput
private void waitForInput()
makeVertex
private FarragoPlanVisualizer.VisualVertex makeVertex(Object obj)
makeEdge
private FarragoPlanVisualizer.VisualEdge makeEdge(FarragoPlanVisualizer.VisualVertex v1,
FarragoPlanVisualizer.VisualVertex v2,
String label)
init
public void init()
- Overrides:
init
in class Applet