samples.javaclient.analyzer
Class Analyzer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended byjavax.swing.JFrame
                      extended bysamples.javaclient.analyzer.Analyzer
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.awt.dnd.DropTargetListener, java.util.EventListener, java.awt.image.ImageObserver, javax.swing.event.InternalFrameListener, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class Analyzer
extends javax.swing.JFrame
implements java.awt.dnd.DropTargetListener, javax.swing.event.InternalFrameListener, java.awt.event.ActionListener

The main class for the Ad Hoq Analysis Tool sample application. This class constructs the user interface for the application. The main user interface includes:

This class also instantiates an AnalyzerConnection for the application, and it uses the connection for access to managers that the application needs, such as the MetadataManager and the QueryManager.

Crosstabs and graphs that users create in Analyzer are contained in Worksheet objects.

This class listens for clicks in the menus and toolbars, and it calls methods that respond to those clicks. For example, choosing the New item on the File menu brings up a NewPresentationWizard. This class instantiates that wizard object and runs it.

This class has support for drag-and-drop in its implementation of the DropTargetListener interface. In its implementation of the InternalFrameListener interface, this class supports a multiple-document interface.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private static java.lang.String ATTEMPT_CONNECT
          Status: Attemping to connect.
private  javax.swing.JButton btnCB
          Calculation button for toolbar.
private  javax.swing.JToggleButton btnCrosstab
          Crosstab button for toolbar.
private  javax.swing.JButton btnEdit
          Edit button for toolbar.
private  javax.swing.JToggleButton btnGraph
          Graph button for toolbar.
private  javax.swing.JButton btnNew
          New button for toolbar.
private  javax.swing.JButton btnOpen
          Open button for toolbar.
private  javax.swing.JButton btnPrint
          Print button for toolbar.
private  javax.swing.JButton btnQB
          QueryBuilder button for toolbar.
private  javax.swing.JButton btnSave
          Save button for toolbar.
private static java.lang.String CONNECTED
          Status: Connected.
private static java.lang.String DIMENSION_EXPLORER
          The title of the Dimension Explorer: "Members".
private static java.lang.String FAVORITES_EXPLORER
          The title of the Favorites Explorer: "Saved Selections".
private static java.lang.String FILE
          File menu: "&File".
private static java.lang.String FILE_CONNECT
          Connect item on the File menu: "&Connect...".
private static java.lang.String FILE_DISCONNECT
          Disconnect item on the File menu: "&Disconnect...".
private static java.lang.String FILE_EXIT
          Exit item on the File menu: "E&xit...".
private static java.lang.String FILE_EXPORT
          Export item on the File menu: "&Export...".
private static java.lang.String FILE_NEW
          New item on the File menu: "&New...".
private static java.lang.String FILE_OPEN
          Open item on the File menu: "&Open...".
private static java.lang.String FILE_PRINT
          Print item on the File menu: "&Print...".
private static java.lang.String FILE_SAVE
          Save item on the File menu: "&Save".
private static java.lang.String FILE_SAVEAS
          Save As item on the File menu: "Save &As...".
private static java.lang.String HELP
          Help menu: "&Help".
private static java.lang.String HELP_ABOUT
          About item on the Help menu: "&About".
private  javax.swing.JMenuItem m_aboutMenu
          About item on the Help menu.
private  Analyzer m_analyzer
          Application class.
private  boolean m_autoconnect
          Do we automatically connect to the database?
private  java.awt.event.MouseAdapter m_catalogListener
          Listener for mouse clicks in the Catalog Explorer.
private  AnalyzerConnection m_connection
          AnalyzerConnection, which encapsulates information about connections.
private  javax.swing.JDesktopPane m_desktop
          Desktop.
private  DimensionExplorer m_dimensionExplorer
          The dimension explorer, where users can select dimension members and drag them to a view.
private  FavoritesExplorer m_favoritesExplorer
          The favorites explorer, where users can select saved selections and drag them to a view.
private  javax.swing.JMenuBar m_menubar
          The menu bar.
private  javax.swing.JMenuItem m_mnuCB
          Insert Calculation item on the Tools menu.
private  javax.swing.JMenuItem m_mnuConnect
          Connect item in File menu.
private  javax.swing.JRadioButtonMenuItem m_mnuCrosstab
          Crosstab item on the View menu.
private  javax.swing.JMenuItem m_mnuDisconnect
          Disconnect item in File menu.
private  javax.swing.JMenuItem m_mnuExit
          Exit item in File menu.
private  javax.swing.JMenuItem m_mnuExport
          Export item in File menu.
private  javax.swing.JMenu m_mnuFile
          File menu.
private  javax.swing.JMenuItem m_mnuFmtGraph
          Format Graph item on the Tools menu.
private  javax.swing.JRadioButtonMenuItem m_mnuGraph
          Graph item on the View menu.
private  javax.swing.JMenuItem m_mnuGraphType
          Graph Type item on the Tools menu.
private  javax.swing.JMenu m_mnuHelp
          Help menu.
private  javax.swing.JMenuItem m_mnuHorizontal
          Tile Horizontal item on the Window menu.
private  javax.swing.JMenuItem m_mnuNew
          New item in File menu.
private  javax.swing.JMenuItem m_mnuOpen
          Open item in File menu.
private  javax.swing.JMenuItem m_mnuPrint
          Print item in File menu.
private  javax.swing.JMenuItem m_mnuQB
          Edit Query item on the Tools menu.
private  javax.swing.JMenuItem m_mnuSave
          Save item in File menu.
private  javax.swing.JMenuItem m_mnuSaveAs
          Save As item in File menu.
private  javax.swing.JMenu m_mnuTools
          Tools menu.
private  javax.swing.JMenuItem m_mnuVertical
          Tile Vertical item on the Window menu.
private  javax.swing.JMenu m_mnuView
          View menu.
private  javax.swing.JMenu m_mnuWindow
          Window menu.
private  Sidebar m_sidebar
          The sidebar.
private  javax.swing.JSplitPane m_splitpane
          Splitter that contains the sidebar and the desktop.
private  oracle.bali.ewt.statusBar.StatusBar m_statusBar
          The status bar.
private  javax.swing.JLabel m_statusText
          Text for the status bar.
private  oracle.dss.graph.gui.GraphToolBar m_toolBar
          Toolbar.
private  ToolbarFormatListener m_toolbarFormatListener
          Listener for changes made to a view through the toolbar.
private  AnalyzerUtilities m_util
          Analyzer utilities, which displays dialogs, runs the QueryBuilder and the CalcBuilder, and handles errors.
private  java.awt.event.MouseAdapter m_viewMouseListener
          Listener for mouse clicks in views.
private  Worksheet m_worksheet
          Active worksheet.
private  CatalogExplorer m_worksheetExplorer
          The worksheet explorer, where users can select the active worksheet.
private static java.lang.String NOT_CONNECTED
          Status: Not connected.
private static java.lang.String TILE_HORIZONTAL
          Tile Horizontal item on the Window menu: "Tile &Horizontal".
private static java.lang.String TILE_VERTICAL
          Tile Vertical item on the Window menu: "Tile &Vertical".
private static java.lang.String TITLE
          Application title: "BI Beans Sample - Ad Hoc Analysis Tool".
private static java.lang.String TOOLS
          Tools menu: "&Tools".
private static java.lang.String TOOLS_CB
          Insert Calculation item on the Tools menu: "Insert &Calculation...".
private static java.lang.String TOOLS_FORMATGRAPH
          Format Graph item on the Tools menu: "&Format Graph...".
private static java.lang.String TOOLS_GRAPHTYPE
          Graph Type item on the Tools menu: "&Graph Type...".
private static java.lang.String TOOLS_QB
          Edit Query item on the Tools menu: "Edit &Query...".
private static java.lang.String UNTITLED
          The title of a new worksheet: "Untitled".
private static java.lang.String VERSION
          Version of this sample application.
private static java.lang.String VIEW
          View menu: "&View".
static java.lang.String VIEW_CROSSTAB
          View type: Crosstab.
static java.lang.String VIEW_GRAPH
          View type: Graph.
private static java.lang.String WINDOW
          Window menu: "&Window".
private static java.lang.String WORKSHEET_EXPLORER
          The title of the Worksheet Explorer: "Worksheets".
 
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
Analyzer(java.lang.String title, java.lang.String autoConnect)
          Constructor for Analyzer.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Handles all of the application's menu and custom toolbar events.
 void addWorksheet(java.lang.String name, oracle.dss.dataView.Dataview dv, boolean isDirty, int x, int y, int width, int height)
          Adds a worksheet to the desktop.
 void disconnectCleanUp()
          Updates the user interface after the user disconnects.
 void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
          Null implementation for DropTargetListener.
 void dragExit(java.awt.dnd.DropTargetEvent dte)
          Null implementation for DropTargetListener.
 void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
          Null implementation for DropTargetListener.
 void drop(java.awt.dnd.DropTargetDropEvent dtde)
          Examines the drag operation and changes the cursor.
 void drop1(java.awt.dnd.DropTargetDropEvent dtde)
          Examines the drag operation and changes the cursor.
 void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
          Null implementation for DropTargetListener.
 void enableMenus()
          Enables menus and toolbar buttons, based on the current state of the application.
private  void exit()
          Cleans up and exits.
 Worksheet getActiveWorksheet()
          Returns the Worksheet object that is currently in focus.
 AnalyzerConnection getConnection()
          Returns the Analyzer connection object for the current connection.
 javax.swing.JDesktopPane getDesktop()
          Retrieves the Analyzer desktop.
 java.lang.String getDragSourceData(java.awt.dnd.DropTargetDropEvent dtde, java.lang.String typeOrObject)
          Drag/drop support for the application.
 Sidebar getSidebar()
          Retrieves the sidebar for this Analyzer.
protected  oracle.bali.ewt.statusBar.StatusBar getStatusBar()
          Retrieves the status bar used by this Analyzer.
 oracle.dss.graph.gui.GraphToolBar getToolBar()
          Retrieves the Analyzer toolbar.
 java.lang.String getVersion()
          Returns the version number of this application.
 void initializeUI()
          Initializes the Explorers and the menu.
 void internalFrameActivated(javax.swing.event.InternalFrameEvent e)
          Sets the active worksheet for this Analyzer.
 void internalFrameClosed(javax.swing.event.InternalFrameEvent e)
          Cleans up when a worksheet has been closed.
 void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
          Offers the user a chance to save a changed worksheet.
 void internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
          Null implementation for InternalFrameListener.
 void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
          Null implementation for InternalFrameListener.
 void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
          Null implementation for InternalFrameListener.
 void internalFrameOpened(javax.swing.event.InternalFrameEvent e)
          Null implementation for InternalFrameListener.
protected  void jbInit()
          Initializes the user interface.
static void main(java.lang.String[] args)
          Main method for Analyzer.
private  void newPresentation()
          Runs the New Presentation wizard and creates a worksheet for the presentation.
 void removeAllWorksheets()
          Removes all worksheets from the desktop.
 void removeWorksheet(Worksheet worksheet)
          Removes a worksheet from the desktop.
private  void save()
          Saves the active presentation.
 void setActiveWorksheet(Worksheet worksheet)
          Sets a worksheet as the active worksheet.
private  void setDataviewType(java.lang.String viewType)
          Sets the view type for the active worksheet to a Graph or a Crosstab.
 void setStatusBarMessage(java.lang.String message)
          Sets the message that the status bar displays.
 void setVisible(boolean visible)
          Overrides the setVisible method from JComponent to allow the centering of the Analyzer before displaying it.
private  void showAboutDialog()
          Displays the About dialog.
private  void showConnectDialog()
          Displays a connection dialog box that asks the user for connection information.
private  void showDisconnectDialog()
          Displays a confirmation dialog asking if the user wants to disconnect.
private  void tileWorksheets(java.lang.String tile)
          Tiles the windows horizontally or vertically in the desktop.
 void updateListOfWorksheets()
          Updates the list of open windows in the Window menu.
 
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, 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

VERSION

private static final java.lang.String VERSION
Version of this sample application.

See Also:
Constant Field Values

TITLE

private static final java.lang.String TITLE
Application title: "BI Beans Sample - Ad Hoc Analysis Tool". This constant is passed to the constructor for this class in the main method.

See Also:
main(java.lang.String[]), Constant Field Values

UNTITLED

private static final java.lang.String UNTITLED
The title of a new worksheet: "Untitled".

See Also:
newPresentation(), Constant Field Values

WORKSHEET_EXPLORER

private static final java.lang.String WORKSHEET_EXPLORER
The title of the Worksheet Explorer: "Worksheets". This constant is passed to the constructor for WorksheetExplorer.

See Also:
jbInit(), Constant Field Values

FAVORITES_EXPLORER

private static final java.lang.String FAVORITES_EXPLORER
The title of the Favorites Explorer: "Saved Selections". This constant is passed to the constructor for FavoritesExplorer.

See Also:
jbInit(), Constant Field Values

DIMENSION_EXPLORER

private static final java.lang.String DIMENSION_EXPLORER
The title of the Dimension Explorer: "Members". This constant is passed to the constructor for DimensionExplorer.

See Also:
jbInit(), Constant Field Values

FILE

private static final java.lang.String FILE
File menu: "&File".

See Also:
jbInit(), Constant Field Values

TOOLS

private static final java.lang.String TOOLS
Tools menu: "&Tools".

See Also:
jbInit(), Constant Field Values

HELP

private static final java.lang.String HELP
Help menu: "&Help".

See Also:
jbInit(), Constant Field Values

HELP_ABOUT

private static final java.lang.String HELP_ABOUT
About item on the Help menu: "&About".

See Also:
jbInit(), Constant Field Values

FILE_NEW

private static final java.lang.String FILE_NEW
New item on the File menu: "&New...".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

FILE_OPEN

private static final java.lang.String FILE_OPEN
Open item on the File menu: "&Open...".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

FILE_SAVE

private static final java.lang.String FILE_SAVE
Save item on the File menu: "&Save".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

FILE_SAVEAS

private static final java.lang.String FILE_SAVEAS
Save As item on the File menu: "Save &As...".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

FILE_PRINT

private static final java.lang.String FILE_PRINT
Print item on the File menu: "&Print...".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

FILE_EXPORT

private static final java.lang.String FILE_EXPORT
Export item on the File menu: "&Export...".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

FILE_CONNECT

private static final java.lang.String FILE_CONNECT
Connect item on the File menu: "&Connect...".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

FILE_DISCONNECT

private static final java.lang.String FILE_DISCONNECT
Disconnect item on the File menu: "&Disconnect...".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

FILE_EXIT

private static final java.lang.String FILE_EXIT
Exit item on the File menu: "E&xit...".

See Also:
jbInit(), exit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

WINDOW

private static final java.lang.String WINDOW
Window menu: "&Window".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

TILE_HORIZONTAL

private static final java.lang.String TILE_HORIZONTAL
Tile Horizontal item on the Window menu: "Tile &Horizontal".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

TILE_VERTICAL

private static final java.lang.String TILE_VERTICAL
Tile Vertical item on the Window menu: "Tile &Vertical".

See Also:
actionPerformed(java.awt.event.ActionEvent), jbInit(), Constant Field Values

TOOLS_QB

private static final java.lang.String TOOLS_QB
Edit Query item on the Tools menu: "Edit &Query...".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

TOOLS_CB

private static final java.lang.String TOOLS_CB
Insert Calculation item on the Tools menu: "Insert &Calculation...".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

TOOLS_GRAPHTYPE

private static final java.lang.String TOOLS_GRAPHTYPE
Graph Type item on the Tools menu: "&Graph Type...".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

TOOLS_FORMATGRAPH

private static final java.lang.String TOOLS_FORMATGRAPH
Format Graph item on the Tools menu: "&Format Graph...".

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), Constant Field Values

VIEW

private static final java.lang.String VIEW
View menu: "&View".

See Also:
jbInit(), Constant Field Values

VIEW_GRAPH

public static final java.lang.String VIEW_GRAPH
View type: Graph. Label for the Graph item on the View menu: "&Graph". Also identifies the graph view type in the view type tool in the toolbar.

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), setDataviewType(java.lang.String), Constant Field Values

VIEW_CROSSTAB

public static final java.lang.String VIEW_CROSSTAB
View type: Crosstab. Label for the Crosstab item on the View menu: "&Crosstab". Also identifies the crosstab view type in the view type tool in the toolbar.

See Also:
jbInit(), actionPerformed(java.awt.event.ActionEvent), setDataviewType(java.lang.String), Constant Field Values

CONNECTED

private static final java.lang.String CONNECTED
Status: Connected. The status bar displays this message when a connection is successful.

See Also:
enableMenus(), Constant Field Values

NOT_CONNECTED

private static final java.lang.String NOT_CONNECTED
Status: Not connected. The status bar displays this message before a connection is made and when a connection attempt is unsuccessful.

See Also:
jbInit(), enableMenus(), Constant Field Values

ATTEMPT_CONNECT

private static final java.lang.String ATTEMPT_CONNECT
Status: Attemping to connect. The status bar displays this message during a connection attempt.

See Also:
jbInit(), Constant Field Values

m_autoconnect

private boolean m_autoconnect
Do we automatically connect to the database?


m_worksheet

private Worksheet m_worksheet
Active worksheet.


m_desktop

private javax.swing.JDesktopPane m_desktop
Desktop. The desktop is the area where worksheets appear. The desktop and the sidebar are contained in a splitter.

See Also:
jbInit()

m_toolBar

private oracle.dss.graph.gui.GraphToolBar m_toolBar
Toolbar. The toolbar is a GraphToolBar with some added tools.

See Also:
jbInit(), enableMenus()

m_statusText

private javax.swing.JLabel m_statusText
Text for the status bar.


m_statusBar

private oracle.bali.ewt.statusBar.StatusBar m_statusBar
The status bar.


m_sidebar

private Sidebar m_sidebar
The sidebar. The sidebar is a JPanel for the Explorers. The sidebar and the desktop are contained in a splitter.

See Also:
jbInit(), CatalogExplorer, DimensionExplorer, FavoritesExplorer

m_worksheetExplorer

private CatalogExplorer m_worksheetExplorer
The worksheet explorer, where users can select the active worksheet. This explorer is contained in the sidebar.

See Also:
jbInit()

m_favoritesExplorer

private FavoritesExplorer m_favoritesExplorer
The favorites explorer, where users can select saved selections and drag them to a view.

See Also:
jbInit()

m_dimensionExplorer

private DimensionExplorer m_dimensionExplorer
The dimension explorer, where users can select dimension members and drag them to a view.

See Also:
jbInit()

m_splitpane

private javax.swing.JSplitPane m_splitpane
Splitter that contains the sidebar and the desktop.

See Also:
jbInit()

m_connection

private AnalyzerConnection m_connection
AnalyzerConnection, which encapsulates information about connections.

See Also:
Analyzer(java.lang.String, java.lang.String), jbInit(), initializeUI(), showConnectDialog(), showDisconnectDialog(), newPresentation(), enableMenus(), getConnection(), exit()

m_util

private AnalyzerUtilities m_util
Analyzer utilities, which displays dialogs, runs the QueryBuilder and the CalcBuilder, and handles errors.


m_menubar

private javax.swing.JMenuBar m_menubar
The menu bar.


m_mnuFile

private javax.swing.JMenu m_mnuFile
File menu.

See Also:
jbInit()

m_mnuNew

private javax.swing.JMenuItem m_mnuNew
New item in File menu.

See Also:
jbInit()

m_mnuOpen

private javax.swing.JMenuItem m_mnuOpen
Open item in File menu.

See Also:
jbInit()

m_mnuSave

private javax.swing.JMenuItem m_mnuSave
Save item in File menu.

See Also:
jbInit()

m_mnuSaveAs

private javax.swing.JMenuItem m_mnuSaveAs
Save As item in File menu.

See Also:
jbInit()

m_mnuPrint

private javax.swing.JMenuItem m_mnuPrint
Print item in File menu.

See Also:
jbInit()

m_mnuExport

private javax.swing.JMenuItem m_mnuExport
Export item in File menu.

See Also:
jbInit()

m_mnuConnect

private javax.swing.JMenuItem m_mnuConnect
Connect item in File menu.

See Also:
jbInit()

m_mnuDisconnect

private javax.swing.JMenuItem m_mnuDisconnect
Disconnect item in File menu.

See Also:
jbInit()

m_mnuExit

private javax.swing.JMenuItem m_mnuExit
Exit item in File menu.

See Also:
jbInit()

m_mnuTools

private javax.swing.JMenu m_mnuTools
Tools menu.

See Also:
jbInit()

m_mnuQB

private javax.swing.JMenuItem m_mnuQB
Edit Query item on the Tools menu.

See Also:
jbInit()

m_mnuCB

private javax.swing.JMenuItem m_mnuCB
Insert Calculation item on the Tools menu.

See Also:
jbInit()

m_mnuGraphType

private javax.swing.JMenuItem m_mnuGraphType
Graph Type item on the Tools menu.

See Also:
jbInit()

m_mnuFmtGraph

private javax.swing.JMenuItem m_mnuFmtGraph
Format Graph item on the Tools menu.

See Also:
jbInit()

m_mnuWindow

private javax.swing.JMenu m_mnuWindow
Window menu.

See Also:
jbInit()

m_mnuHorizontal

private javax.swing.JMenuItem m_mnuHorizontal
Tile Horizontal item on the Window menu.

See Also:
jbInit()

m_mnuVertical

private javax.swing.JMenuItem m_mnuVertical
Tile Vertical item on the Window menu.

See Also:
jbInit()

m_mnuView

private javax.swing.JMenu m_mnuView
View menu.

See Also:
jbInit()

m_mnuGraph

private javax.swing.JRadioButtonMenuItem m_mnuGraph
Graph item on the View menu.

See Also:
jbInit()

m_mnuCrosstab

private javax.swing.JRadioButtonMenuItem m_mnuCrosstab
Crosstab item on the View menu.

See Also:
jbInit()

m_mnuHelp

private javax.swing.JMenu m_mnuHelp
Help menu.

See Also:
jbInit()

m_aboutMenu

private javax.swing.JMenuItem m_aboutMenu
About item on the Help menu.

See Also:
jbInit()

btnNew

private javax.swing.JButton btnNew
New button for toolbar.

See Also:
jbInit()

btnOpen

private javax.swing.JButton btnOpen
Open button for toolbar.

See Also:
jbInit()

btnEdit

private javax.swing.JButton btnEdit
Edit button for toolbar.

See Also:
jbInit()

btnCB

private javax.swing.JButton btnCB
Calculation button for toolbar.

See Also:
jbInit()

btnQB

private javax.swing.JButton btnQB
QueryBuilder button for toolbar.

See Also:
jbInit()

btnPrint

private javax.swing.JButton btnPrint
Print button for toolbar.

See Also:
jbInit()

btnSave

private javax.swing.JButton btnSave
Save button for toolbar.

See Also:
jbInit()

btnGraph

private javax.swing.JToggleButton btnGraph
Graph button for toolbar.

See Also:
jbInit()

btnCrosstab

private javax.swing.JToggleButton btnCrosstab
Crosstab button for toolbar.

See Also:
jbInit()

m_toolbarFormatListener

private ToolbarFormatListener m_toolbarFormatListener
Listener for changes made to a view through the toolbar.


m_catalogListener

private java.awt.event.MouseAdapter m_catalogListener
Listener for mouse clicks in the Catalog Explorer.


m_viewMouseListener

private java.awt.event.MouseAdapter m_viewMouseListener
Listener for mouse clicks in views.


m_analyzer

private Analyzer m_analyzer
Application class.

Constructor Detail

Analyzer

public Analyzer(java.lang.String title,
                java.lang.String autoConnect)
Constructor for Analyzer. The application starts in one of two ways:
  1. Prompts the user for database connection details.
  2. Automatically connects to the database based on settings found in the AnalyzerTemplate.XML file. To change the autoconnect settings, simply update the information using the Settings menu item on the BIDesigner in JDeveloper.

Parameters:
title - The title of the JFrame.
autoConnect - Should the application automatically connect to the database? Pass "autoconnect" to have the application use parameters in analyzerTemplate.xml. By default, the application prompts the user for connection details.
Method Detail

main

public static void main(java.lang.String[] args)
Main method for Analyzer. This method instantiates an Analyzer, passing the title and the parameter value to the constructor.

See Also:
Analyzer(java.lang.String, java.lang.String)

setVisible

public void setVisible(boolean visible)
Overrides the setVisible method from JComponent to allow the centering of the Analyzer before displaying it.

Parameters:
visible - true to make Analyzer visible. false to hide it.

getStatusBar

protected oracle.bali.ewt.statusBar.StatusBar getStatusBar()
Retrieves the status bar used by this Analyzer. The status bar contains messages like "Connected", "Attempting to connect...", and so on.

Returns:
The status bar for this Analyzer.

getSidebar

public Sidebar getSidebar()
Retrieves the sidebar for this Analyzer. The sidebar contains the three Explorers: Worksheets, Saved Selections, Members.


getToolBar

public oracle.dss.graph.gui.GraphToolBar getToolBar()
Retrieves the Analyzer toolbar. The Analyzer toolbar is a GraphToolBar that has added tools.

Returns:
The Analyzer toolbar.
See Also:
jbInit()

getDesktop

public javax.swing.JDesktopPane getDesktop()
Retrieves the Analyzer desktop. This is the area where crosstabs and graphs are displayed.

Returns:
The Analyzer desktop object.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Handles all of the application's menu and custom toolbar events.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - Information about the action that the user performed.

jbInit

protected void jbInit()
Initializes the user interface. This method instantiates the connection and utility objects and sets them on this Analyzer. Then this method:
  1. Creates menus and menu items and adds them to a menu bar.
  2. Creates buttons and adds them to a Graph toolbar to make the Analyzer toolbar.
  3. Creates a status bar.
  4. Creates the desktop as a multi-document interface window.
  5. Enables drag-drop support.
  6. Creates the sidebar and adds Explorers to it.
  7. Creates a JSplitPane and adds the desktop and the sidebar to it.
  8. Puts the toolbar, the JSplitPane, and the status bar in a border layout manager.


setDataviewType

private void setDataviewType(java.lang.String viewType)
Sets the view type for the active worksheet to a Graph or a Crosstab.

Parameters:
viewType - A contant that identifies the view type. Valid constants are VIEW_GRAPH and VIEW_CROSSTAB.
See Also:
VIEW_GRAPH, VIEW_CROSSTAB

showAboutDialog

private void showAboutDialog()
Displays the About dialog. This method is called when a user chooses the About item from the Help menu.

See Also:
AnalyzerAboutDialog

showConnectDialog

private void showConnectDialog()
Displays a connection dialog box that asks the user for connection information. This method then calls the initializeUI method to initialize explorers and menus.

See Also:
initializeUI(), AnalyzerConnection.showConnectDialog(javax.swing.JFrame)

initializeUI

public void initializeUI()
Initializes the Explorers and the menu. This method gets the MetadataManager and the root folder from the connection and sets them on the Explorers that need them. It then calls the enableMenus method to update the menus appropriately.

See Also:
enableMenus()

showDisconnectDialog

private void showDisconnectDialog()
Displays a confirmation dialog asking if the user wants to disconnect. This method is called when the user chooses the Disconnect item from the File menu.

See Also:
AnalyzerConnection.showDisconnectDialog(javax.swing.JFrame)

disconnectCleanUp

public void disconnectCleanUp()
Updates the user interface after the user disconnects. This method removes all worksheets. It sets the query in the Favorites Explorer to null, and it sets the MetadataManager of the Catalog Explorer to null.

See Also:
removeAllWorksheets(), FavoritesExplorer.setQuery(oracle.dss.dataSource.client.QueryClient), CatalogExplorer.setMetadataManager(oracle.dss.metadataManager.client.MetadataManager)

newPresentation

private void newPresentation()
Runs the New Presentation wizard and creates a worksheet for the presentation. This method is called when a user chooses New from the File menu.

See Also:
NewPresentationWizard, addWorksheet(java.lang.String, oracle.dss.dataView.Dataview, boolean, int, int, int, int)

exit

private void exit()
Cleans up and exits. This method is called when the user selects Exit from the File menu or when the user closes the main window.

See Also:
removeAllWorksheets()

enableMenus

public void enableMenus()
Enables menus and toolbar buttons, based on the current state of the application.


updateListOfWorksheets

public void updateListOfWorksheets()
Updates the list of open windows in the Window menu.


addWorksheet

public void addWorksheet(java.lang.String name,
                         oracle.dss.dataView.Dataview dv,
                         boolean isDirty,
                         int x,
                         int y,
                         int width,
                         int height)
Adds a worksheet to the desktop. This method also updates the list of open worksheets, and it updates the list of dimensions in the Dimension Explorer. This method is called when the New Presentation wizard runs successfully.

Parameters:
name - Fully qualified name of the data presentation. This becomes the title of the worksheet.
dv - The Dataview object that will be added to the worksheet.
isDirty - true if the Dataview is dirty (needs to be saved), false if no changes have been made since the last save. A new Dataview from the Presentation wizard is dirty.
x - The horizontal position for the view in the desktop.
y - The vertical position for the view in the desktop.
width - The width of the view.
height - The height of the view.
See Also:
newPresentation(), Worksheet

removeWorksheet

public void removeWorksheet(Worksheet worksheet)
Removes a worksheet from the desktop. This method also does the following clean-up tasks:
  1. Updates the Explorers
  2. Updates menus


removeAllWorksheets

public void removeAllWorksheets()
Removes all worksheets from the desktop. This method is called when the user disconnects from the database.


save

private void save()
Saves the active presentation.

See Also:
AnalyzerUtilities.showSaveAsDialog(), AnalyzerUtilities.saveView(java.lang.String, oracle.dss.dataView.Dataview)

getActiveWorksheet

public Worksheet getActiveWorksheet()
Returns the Worksheet object that is currently in focus.


setActiveWorksheet

public void setActiveWorksheet(Worksheet worksheet)
Sets a worksheet as the active worksheet. This method sets the Query from the worksheet's view on the FavoritesExplorer and the DimensionExplorer, so the Explorers act upon the right query. This method also updates menus and toolbars.

Parameters:
worksheet - The worksheet object to make active.
See Also:
enableMenus(), FavoritesExplorer, DimensionExplorer

setStatusBarMessage

public void setStatusBarMessage(java.lang.String message)
Sets the message that the status bar displays. The status bar is located at the bottom of the application frame.

Parameters:
message - The message to display in the status bar.

getVersion

public java.lang.String getVersion()
Returns the version number of this application.

Returns:
Version number (e.g. 1.0.4).

getConnection

public AnalyzerConnection getConnection()
Returns the Analyzer connection object for the current connection.

Returns:
The connection object for this Analyzer.

tileWorksheets

private void tileWorksheets(java.lang.String tile)
Tiles the windows horizontally or vertically in the desktop.

Parameters:
tile - The orientation for tiling. Valid values are Analyzer.TILE_HORIZONTAL or Analyzer.TILE_VERTICAL.
See Also:
TILE_HORIZONTAL, TILE_VERTICAL

getDragSourceData

public java.lang.String getDragSourceData(java.awt.dnd.DropTargetDropEvent dtde,
                                          java.lang.String typeOrObject)
Drag/drop support for the application. This method interrogates the DropTargetDropEvent and pulls out key information. The drop methods call this method.

Parameters:
typeOrObject - The type of information to return. "TYPE" retrieves the type of Explorer the object is being dragged from. "OBJECT" retrieves the the actual object that is being dragged and dropped.
Returns:
The name of the item being dragged and dropped.

dragEnter

public void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
Null implementation for DropTargetListener.

Specified by:
dragEnter in interface java.awt.dnd.DropTargetListener

dragOver

public void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
Null implementation for DropTargetListener.

Specified by:
dragOver in interface java.awt.dnd.DropTargetListener

dropActionChanged

public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
Null implementation for DropTargetListener.

Specified by:
dropActionChanged in interface java.awt.dnd.DropTargetListener

dragExit

public void dragExit(java.awt.dnd.DropTargetEvent dte)
Null implementation for DropTargetListener.

Specified by:
dragExit in interface java.awt.dnd.DropTargetListener

drop1

public void drop1(java.awt.dnd.DropTargetDropEvent dtde)
Examines the drag operation and changes the cursor. If the object being dragged is above an invalid drop target, the cursor changes.

Favorites and Dimension Members can be dropped on a dataview. Worksheets can be dropped on the desktop.

Parameters:
dtde - Information about the drag-drop operation.

drop

public void drop(java.awt.dnd.DropTargetDropEvent dtde)
Examines the drag operation and changes the cursor. If the object being dragged is above an invalid drop target, the cursor changes.

Favorites and Dimension Members can be dropped on a dataview. Worksheets can be dropped on the desktop.

Specified by:
drop in interface java.awt.dnd.DropTargetListener
Parameters:
dtde - Information about the drag-drop operation.

internalFrameActivated

public void internalFrameActivated(javax.swing.event.InternalFrameEvent e)
Sets the active worksheet for this Analyzer. This method is called when a user clicks on the frame for the worksheet. This is required so that various operations will work properly, including Saving, Printing, Exporting, and so on.

Specified by:
internalFrameActivated in interface javax.swing.event.InternalFrameListener
Parameters:
e - The InternalFrameEvent that identifies the activated internal frame.
See Also:
setActiveWorksheet(samples.javaclient.analyzer.Worksheet)

internalFrameClosed

public void internalFrameClosed(javax.swing.event.InternalFrameEvent e)
Cleans up when a worksheet has been closed.

Specified by:
internalFrameClosed in interface javax.swing.event.InternalFrameListener
Parameters:
e - The InternalFrameEvent that identifies the worksheet to remove.
See Also:
removeWorksheet(samples.javaclient.analyzer.Worksheet)

internalFrameOpened

public void internalFrameOpened(javax.swing.event.InternalFrameEvent e)
Null implementation for InternalFrameListener.

Specified by:
internalFrameOpened in interface javax.swing.event.InternalFrameListener

internalFrameClosing

public void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
Offers the user a chance to save a changed worksheet. This method checks to see if the worksheet has been changed since it was last saved. If it has been changed, then this method prompts the user to save the worksheet.

Specified by:
internalFrameClosing in interface javax.swing.event.InternalFrameListener
Parameters:
e - The InternalFrameEvent that identifies the worksheet that is being closed.
See Also:
save(), Worksheet.isDirty()

internalFrameIconified

public void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
Null implementation for InternalFrameListener.

Specified by:
internalFrameIconified in interface javax.swing.event.InternalFrameListener

internalFrameDeiconified

public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
Null implementation for InternalFrameListener.

Specified by:
internalFrameDeiconified in interface javax.swing.event.InternalFrameListener

internalFrameDeactivated

public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
Null implementation for InternalFrameListener.

Specified by:
internalFrameDeactivated in interface javax.swing.event.InternalFrameListener