samples.javaclient.analyzer
Class DimensionExplorer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bysamples.javaclient.analyzer.DimensionExplorer
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class DimensionExplorer
extends javax.swing.JPanel
implements java.awt.event.ActionListener, java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener

The Members tab in the Sidebar. This Explorer presents an OLAPDimensionListPanel that displays the members of a dimension. Users can select the members and add them to the selection for that dimension in the active worksheet. Or, users can replace the current selection in the worksheet with the members that are selected in the dimension list.

The dimension list displays the members of one dimension. This Explorer presents a combo box of different dimensions that are available, from which users choose the dimension they want to work with.

This Explorer maintains an internal list of dimensions that are in the queries of open views in the Analyzer application. This class uses a vector of DimensionExplorer.DimensionInfo objects, which store information about each dimension, such as its name, its unique ID, and so on.

When a user opens or creates a worksheet, the application passes the query of the worksheet to this Explorer. If the query has dimensions whose information is not already in the vector of DimensionInfo objects, then this Explorer adds a DimensionInfo to the vector. See addDimensions(oracle.dss.dataSource.client.QueryClient). For dimensions that are in the list, this Explorer increments a usage count. When a user closes a worksheet, the application decrements the count for each dimension in the query of the closed worksheet. When the count reaches 0, the Explorer removes the DimensionInfo from the vector. See removeDimensions(oracle.dss.dataSource.client.QueryClient).

The setQuery(oracle.dss.dataSource.client.QueryClient) method specifies the query whose selections will be changed by user actions in this Explorer. The Analyzer application calls setQuery whenever the user selects a worksheet to make it the active worksheet.

The applyDimListSelection() method applies the dimension members that are selected in this Explorer to the selection for the dimension in the active query.

See Also:
Serialized Form

Nested Class Summary
private  class DimensionExplorer.DimensionInfo
          Information about a dimension.
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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  javax.swing.JComboBox actions
          Drop-down list for what to do with the selected members.
private static java.lang.String ADD
          "Add selected members" text for the actions combo box.
private static java.lang.String APPLY_BUTTON_TEXT
          Text for the Go button.
private static java.lang.String DIMENSION_DESCRIPTION
          Instruction text.
private  boolean isExplorerVisible
          Is this Explorer visible?
private  javax.swing.JButton m_applyButton
          Go button.
private  javax.swing.JComboBox m_dimensionCombo
          Drop-down list of dimensions whose members to display.
private  java.util.Vector m_dimensions
          Vector for DimensionExplorer.DimensionInfo objects.
private  oracle.dss.datautil.gui.dimensionList.OLAPDimensionListPanel m_dimList
          The dimension list that this Explorer displays.
private  java.awt.GridBagConstraints m_dimListConstraints
          Layout constraintes for the dimension list.
private  java.awt.dnd.DragSource m_dragSource
          DragSource object for drag-and-drop support.
private  oracle.dss.metadataManager.client.MetadataManager m_metadataManager
          The MetadataManager for this Explorer.
private  javax.swing.JPanel m_middlePanel
          Panel for the dimension list.
private  java.lang.String m_notAvailableText
          Text to display when no worksheets are open.
private  java.awt.Frame m_parentFrame
          The parent frame for this Explorer.
private  oracle.dss.dataSource.client.QueryClient m_query
          The active query, which is modified when the user clicks Go or drags members to a worksheet.
private  oracle.bali.ewt.text.MultiLineLabel notAvail
          Label for m_notAvailableText.
private static java.lang.String OPTION_TITLE
          Label for the actions combo box: "Update selected document:"
private static java.lang.String REPLACE
          "Replace with selected memebers" text for the actions combo box.
 
Fields inherited from class javax.swing.JPanel
 
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.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DimensionExplorer(java.awt.Frame parentFrame)
          Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Responds to user clicks in this Explorer.
 void addDimensions(oracle.dss.dataSource.client.QueryClient query)
          Adds dimensions to the list of dimensions in this Explorer, as necessary.
 void applyDimListSelection()
          Applies the selected dimension members to the related query.
 void dragDropEnd(java.awt.dnd.DragSourceDropEvent dsde)
          Null implementation for DragSourceListener.
 void dragEnter(java.awt.dnd.DragSourceDragEvent dsde)
          Null implementation for DragSourceListener.
 void dragExit(java.awt.dnd.DragSourceEvent dse)
          Null implementation for DragSourceListener.
 void dragGestureRecognized(java.awt.dnd.DragGestureEvent dge)
          Responds to dragging.
 void dragOver(java.awt.dnd.DragSourceDragEvent dsde)
          Null implementation for DragSourceListener.
 void dropActionChanged(java.awt.dnd.DragSourceDragEvent dsde)
          Null implementation for DragSourceListener.
 int getDimensionIndex(java.lang.String dimensionUniqueID)
          Gets the index for a dimension in the list of dimensions.
private  oracle.dss.datautil.gui.dimensionList.OLAPDimensionListPanel getDimList(int dimension)
          Creates an OLAPDimensionListPanel for a dimension.
 java.awt.dnd.DragSource getDragSource()
          Gets the drag source for this Explorer.
 oracle.dss.metadataManager.client.MetadataManager getMetadataManager()
          Gets the MetadataManager that this Explorer uses.
 oracle.dss.dataSource.client.QueryClient getQuery()
          Gets the query for this Explorer.
 boolean inDimensionList(java.lang.String dimensionUniqueID)
          Indicates whether a dimension is in the list of dimensions.
 void initializeExplorer()
          Initializes the user interface for this Explorer.
 void removeDimensions(oracle.dss.dataSource.client.QueryClient query)
          Removes unused dimensions from the list of dimensions.
 void setDragSource(java.awt.dnd.DragSource dragSource)
          Sets the drag source for this Explorer.
 void setMetadataManager(oracle.dss.metadataManager.client.MetadataManager metadataManager)
          Sets the MetadataManager for this Explorer.
private  void setNotAvailable()
          Displays a Not Available message in the Explorer.
 void setQuery(oracle.dss.dataSource.client.QueryClient query)
          Sets the active query for this Explorer.
private  void updateExplorer()
          Updates the user interface for this Explorer.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isExplorerVisible

private boolean isExplorerVisible
Is this Explorer visible?


ADD

private static final java.lang.String ADD
"Add selected members" text for the actions combo box.

See Also:
Constant Field Values

REPLACE

private static final java.lang.String REPLACE
"Replace with selected memebers" text for the actions combo box.

See Also:
Constant Field Values

OPTION_TITLE

private static final java.lang.String OPTION_TITLE
Label for the actions combo box: "Update selected document:"

See Also:
Constant Field Values

APPLY_BUTTON_TEXT

private static final java.lang.String APPLY_BUTTON_TEXT
Text for the Go button.

See Also:
Constant Field Values

m_dragSource

private java.awt.dnd.DragSource m_dragSource
DragSource object for drag-and-drop support.


m_query

private oracle.dss.dataSource.client.QueryClient m_query
The active query, which is modified when the user clicks Go or drags members to a worksheet.


m_metadataManager

private oracle.dss.metadataManager.client.MetadataManager m_metadataManager
The MetadataManager for this Explorer. This is the application's MetadataManager.


m_dimList

private oracle.dss.datautil.gui.dimensionList.OLAPDimensionListPanel m_dimList
The dimension list that this Explorer displays.


m_dimensionCombo

private javax.swing.JComboBox m_dimensionCombo
Drop-down list of dimensions whose members to display.


actions

private javax.swing.JComboBox actions
Drop-down list for what to do with the selected members. Users can either add members to the current selection or replace the current selection with the members.


m_notAvailableText

private java.lang.String m_notAvailableText
Text to display when no worksheets are open.


DIMENSION_DESCRIPTION

private static final java.lang.String DIMENSION_DESCRIPTION
Instruction text. Currently not displayed.

See Also:
Constant Field Values

notAvail

private oracle.bali.ewt.text.MultiLineLabel notAvail
Label for m_notAvailableText. This object makes it possible to set font attributes.


m_parentFrame

private java.awt.Frame m_parentFrame
The parent frame for this Explorer. (The Analyzer class.)


m_applyButton

private javax.swing.JButton m_applyButton
Go button.


m_middlePanel

private javax.swing.JPanel m_middlePanel
Panel for the dimension list.


m_dimListConstraints

private java.awt.GridBagConstraints m_dimListConstraints
Layout constraintes for the dimension list.


m_dimensions

private java.util.Vector m_dimensions
Vector for DimensionExplorer.DimensionInfo objects.

See Also:
addDimensions(oracle.dss.dataSource.client.QueryClient), removeDimensions(oracle.dss.dataSource.client.QueryClient)
Constructor Detail

DimensionExplorer

public DimensionExplorer(java.awt.Frame parentFrame)
Constructor. Sets the DimensionExplorer to "Not Available" state.

Parameters:
parentFrame - The Analyzer main application frame.
Method Detail

inDimensionList

public boolean inDimensionList(java.lang.String dimensionUniqueID)
Indicates whether a dimension is in the list of dimensions.

Parameters:
dimensionUniqueID - The unique ID for the dimension.
Returns:
true if the dimension is in the list, false if it is not.

getDimensionIndex

public int getDimensionIndex(java.lang.String dimensionUniqueID)
Gets the index for a dimension in the list of dimensions. The index represents the position of the dimension in the m_dimensions vector and in the m_dimensionCombo drop-down.

Parameters:
dimensionUniqueID - The unique ID for the dimension whose index you want.
Returns:
The index of the dimension in the list of dimensions, or -1 if the dimension is not in the list.
See Also:
m_dimensions, m_dimensionCombo

getDragSource

public java.awt.dnd.DragSource getDragSource()
Gets the drag source for this Explorer.

Returns:
The drag source.

setDragSource

public void setDragSource(java.awt.dnd.DragSource dragSource)
Sets the drag source for this Explorer.

Parameters:
dragSource - The drag source to set on this Explorer.

getDimList

private oracle.dss.datautil.gui.dimensionList.OLAPDimensionListPanel getDimList(int dimension)
Creates an OLAPDimensionListPanel for a dimension. An OLAPDimensionListPanel supports the display of hierarchies. This method shows how to construct the panel and how to set it up as a drag source component.

The initializeExplorer method calls this method to create a dimension list for the default dimension. After that, this method is called to create a dimension list for the dimension that is selected in the combo box.

Parameters:
dimension - The index of the dimension whose members to display. The index is the index in the m_dimensions vector and in m_dimensionCombo.
See Also:
m_dimensions, m_dimensionCombo, initializeExplorer()

applyDimListSelection

public void applyDimListSelection()
Applies the selected dimension members to the related query. This method checks to see whether the user has selected any dimension members, and whether the user has chosen adding or replacing in the actions JComboBox.

If the user has selected adding, then this method adds the selected members to the members in the selection.

If the user has selected replacing, then this method removes all steps from the selection and adds the selected members to the selection.

See Also:
actions

setQuery

public void setQuery(oracle.dss.dataSource.client.QueryClient query)
Sets the active query for this Explorer. Members that are selected in this Explorer will be applied to this query.

The addDimensions method calls this method. The Analyzer.addWorksheet method calls addDimensions when the user opens or creates a worksheet. The Analyzer.setActiveWorksheet method calls this method when the user selects a worksheet.

Parameters:
query - The query for this Explorer.
See Also:
addDimensions(oracle.dss.dataSource.client.QueryClient), Analyzer.addWorksheet(java.lang.String, oracle.dss.dataView.Dataview, boolean, int, int, int, int), Analyzer.setActiveWorksheet(samples.javaclient.analyzer.Worksheet)

getQuery

public oracle.dss.dataSource.client.QueryClient getQuery()
Gets the query for this Explorer. This is the query whose selections are altered by the user's interaction with this Explorer.

Returns:
The query for this Explorer.

setMetadataManager

public void setMetadataManager(oracle.dss.metadataManager.client.MetadataManager metadataManager)
Sets the MetadataManager for this Explorer. Analyzer.initializeUI calls this method to set the application's MetadataManager on this Explorer. This Explorer uses the MetadataManager to get information about the dimensions in the query.

Parameters:
metadataManager - The MetadataManager that the application uses.
See Also:
addDimensions(oracle.dss.dataSource.client.QueryClient)

getMetadataManager

public oracle.dss.metadataManager.client.MetadataManager getMetadataManager()
Gets the MetadataManager that this Explorer uses. This should be the same MetadataManager that the rest of the application uses.

Returns:
The MetadataManager for this Explorer.

setNotAvailable

private void setNotAvailable()
Displays a Not Available message in the Explorer. This is called when there is not a valid query to operate on.


initializeExplorer

public void initializeExplorer()
Initializes the user interface for this Explorer. This method:
  1. Creates a dimension list for a default dimension.
  2. Sets the combo box of dimensions to the default dimension.
  3. Adds a listener to the combo box.
  4. Adds the Go button.
  5. Sets the choices in the Add or Replace combo box.
  6. Lays out all the components.


updateExplorer

private void updateExplorer()
Updates the user interface for this Explorer. This is normally called when the user selects a dimension in the combo box.

This method removes the current dimension list and sets a dimension list for the newly selected dimension.


removeDimensions

public void removeDimensions(oracle.dss.dataSource.client.QueryClient query)
Removes unused dimensions from the list of dimensions. This method decrements the usage counter for each dimension. The usage counter tracks the number of views whose queries include this dimension. If the count is zero after decrementing, then this method removes the dimension from the list.

This method is called from the Analyzer.removeWorksheet method.

Parameters:
query - The query that is no longer used.
See Also:
Analyzer.removeWorksheet(samples.javaclient.analyzer.Worksheet)

addDimensions

public void addDimensions(oracle.dss.dataSource.client.QueryClient query)
Adds dimensions to the list of dimensions in this Explorer, as necessary. This method updates the list of dimensions, adding any dimensions that are in the specified query and not already in the list of dimensions. If the specified query is the first query in the application, then this method also initializes this Explorer.

The Analyzer.addWorksheet method calls this method when a user opens or creates a worksheet.

Parameters:
query - The query whose dimensions to add to this Explorer.
See Also:
Analyzer.addWorksheet(java.lang.String, oracle.dss.dataView.Dataview, boolean, int, int, int, int)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Responds to user clicks in this Explorer. This method responds when a user selects a different dimension and when a user clicks the Go button.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - Information about the user action.
See Also:
updateExplorer(), applyDimListSelection()

dragGestureRecognized

public void dragGestureRecognized(java.awt.dnd.DragGestureEvent dge)
Responds to dragging.

Specified by:
dragGestureRecognized in interface java.awt.dnd.DragGestureListener
Parameters:
dge - Information about the drag gesture.

dragEnter

public void dragEnter(java.awt.dnd.DragSourceDragEvent dsde)
Null implementation for DragSourceListener.

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

dragOver

public void dragOver(java.awt.dnd.DragSourceDragEvent dsde)
Null implementation for DragSourceListener.

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

dropActionChanged

public void dropActionChanged(java.awt.dnd.DragSourceDragEvent dsde)
Null implementation for DragSourceListener.

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

dragExit

public void dragExit(java.awt.dnd.DragSourceEvent dse)
Null implementation for DragSourceListener.

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

dragDropEnd

public void dragDropEnd(java.awt.dnd.DragSourceDropEvent dsde)
Null implementation for DragSourceListener.

Specified by:
dragDropEnd in interface java.awt.dnd.DragSourceListener