ca.sqlpower.architect.swingui.olap
Class DimensionPane

java.lang.Object
  extended by ca.sqlpower.architect.swingui.PlayPenComponent
      extended by ca.sqlpower.architect.swingui.ContainerPane<T,C>
          extended by ca.sqlpower.architect.swingui.olap.OLAPPane<MondrianModel.Dimension,OLAPObject>
              extended by ca.sqlpower.architect.swingui.olap.DimensionPane
All Implemented Interfaces:
LayoutNode, Selectable, java.awt.dnd.DragSourceListener, java.util.EventListener

public class DimensionPane
extends OLAPPane<MondrianModel.Dimension,OLAPObject>

Visual representation of a dimension. It keeps its sections in sync with the hierarchies of the Dimension object, and the items in each section are the levels of the corresponding hierarchy.


Nested Class Summary
 class DimensionPane.HierarchySection
           
 
Field Summary
 
Fields inherited from class ca.sqlpower.architect.swingui.olap.OLAPPane
sections, selectedSections
 
Fields inherited from class ca.sqlpower.architect.swingui.ContainerPane
ITEM_INDEX_NONE, ITEM_INDEX_TITLE, margin, model, selectedItems
 
Fields inherited from class ca.sqlpower.architect.swingui.PlayPenComponent
backgroundColor, componentPreviouslySelected, foregroundColor, selected
 
Constructor Summary
DimensionPane(MondrianModel.Dimension m, PlayPenContentPane parent)
           
 
Method Summary
 ca.sqlpower.swingui.DataEntryPanel createEditDialog(PlayPenCoordinate<MondrianModel.Dimension,OLAPObject> coord)
          Creates a edit dialog for the OLAPObject that is at the location represented by the given coordinate.
protected  java.util.List<OLAPObject> filterDroppableItems(java.util.List<OLAPObject> items)
          Accepts a clump of items that have been dragged from elsewhere (normally the tree or another pane).
 DimensionPane.HierarchySection findSection(MondrianModel.Hierarchy hierarchy)
          Returns the HierarchySection that contains the given hierarchy.
protected  java.util.List<OLAPObject> getItems()
          Returns a list of the items to be displayed with the model.
protected  java.util.List<OLAPObject> getItemsFromCoordinates(java.util.List<PlayPenCoordinate<? extends OLAPObject,? extends OLAPObject>> coords)
          Returns a list of OLAPObjects that correspond to the given PlayPenCoordinates.
 java.util.List<MondrianModel.Level> getSelectedLevels()
          Returns a list of levels which are selected.
 java.lang.String toString()
           
protected  void transferInvalidIndexItem(OLAPObject item, PaneSection<OLAPObject> insertSection)
          Handle Drag and Drop transfer for items with invalid index.
 void updateUI()
           
 
Methods inherited from class ca.sqlpower.architect.swingui.olap.OLAPPane
bestImportFlavor, createTransferableForSelection, deselectSection, dndRemoveAndAdd, dragEnter, dragExit, dragOver, drop, dropActionChanged, getInboundEdges, getInsertionPoint, getName, getOutboundEdges, getPopup, getSections, getSelectedCoordinates, getSelectedSections, getUI, handleMouseEvent, isSectionSelected, pointToItemIndex, pointToPPCoordinate, selectNone, selectSection, setInsertionPoint
 
Methods inherited from class ca.sqlpower.architect.swingui.ContainerPane
addItemSelectionListener, deSelectEverythingElse, deselectItem, deselectItem, dragDropEnd, dragEnter, dragExit, dragOver, dropActionChanged, fireItemsDeselected, fireItemsSelected, getLocationOnScreen, getMargin, getModel, getNodeName, getSelectedItemIndex, getSelectedItems, isDashed, isItemSelected, isItemSelected, isRounded, removeItemSelectionListener, selectItem, selectItem, setDashed, setMargin, setRounded, setSelected
 
Methods inherited from class ca.sqlpower.architect.swingui.PlayPenComponent
addPropertyChangeListener, addPropertyChangeListener, addSelectionListener, contains, firePropertyChange, firePropertyChange, fireSelectionEvent, getBackgroundColor, getBounds, getBounds, getFont, getFontMetrics, getFontRenderContext, getForegroundColor, getHeight, getInsets, getLocation, getLocation, getParent, getPlayPen, getPreferredLocation, getPreferredSize, getSize, getToolTipText, getWidth, getX, getY, isOpaque, isSelected, paint, removePropertyChangeListener, removeSelectionListener, repaint, repaint, repaint, revalidate, setBackgroundColor, setBounds, setBoundsImpl, setForegroundColor, setInsets, setLocation, setLocation, setOpaque, setSize, setToolTipText, setUI, showPopup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ca.sqlpower.architect.layout.LayoutNode
getBounds, getBounds, getHeight, getLocation, getWidth, getX, getY, setBounds, setLocation, setLocation
 

Constructor Detail

DimensionPane

public DimensionPane(MondrianModel.Dimension m,
                     PlayPenContentPane parent)
Method Detail

getItems

protected java.util.List<OLAPObject> getItems()
Description copied from class: ContainerPane
Returns a list of the items to be displayed with the model.

Specified by:
getItems in class ContainerPane<MondrianModel.Dimension,OLAPObject>

updateUI

public void updateUI()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

createEditDialog

public ca.sqlpower.swingui.DataEntryPanel createEditDialog(PlayPenCoordinate<MondrianModel.Dimension,OLAPObject> coord)
                                                    throws ArchitectException
Description copied from class: OLAPPane
Creates a edit dialog for the OLAPObject that is at the location represented by the given coordinate.

Specified by:
createEditDialog in class OLAPPane<MondrianModel.Dimension,OLAPObject>
Parameters:
coord - Containas information about the OLAPObject that the edit dialog should be created for.
Returns:
A DataEntryPanel for editting the OLAPObject, null if location is invalid.
Throws:
ArchitectException - If creating an edit dialog failed.

filterDroppableItems

protected java.util.List<OLAPObject> filterDroppableItems(java.util.List<OLAPObject> items)
Description copied from class: OLAPPane
Accepts a clump of items that have been dragged from elsewhere (normally the tree or another pane). Implementations of this method are free to pick and choose which items to import.

This method will always be called by the superclass in the context of a compound edit on the schema this pane's model belongs to.

Specified by:
filterDroppableItems in class OLAPPane<MondrianModel.Dimension,OLAPObject>
Parameters:
items - The items that were dropped.
Returns:
The list of items that can be dropped on this pane. It will be some subset of the given list of items.

findSection

public DimensionPane.HierarchySection findSection(MondrianModel.Hierarchy hierarchy)
Returns the HierarchySection that contains the given hierarchy. Returns null if it was not found.


getSelectedLevels

public java.util.List<MondrianModel.Level> getSelectedLevels()
Returns a list of levels which are selected.


getItemsFromCoordinates

protected java.util.List<OLAPObject> getItemsFromCoordinates(java.util.List<PlayPenCoordinate<? extends OLAPObject,? extends OLAPObject>> coords)
Description copied from class: OLAPPane
Returns a list of OLAPObjects that correspond to the given PlayPenCoordinates.

Overrides:
getItemsFromCoordinates in class OLAPPane<MondrianModel.Dimension,OLAPObject>
Parameters:
coords - The list of PlayPenCoordinates to convert.
Returns:
A list of OLAPObjects that correspond to the given PlayPenCoordinates.

transferInvalidIndexItem

protected void transferInvalidIndexItem(OLAPObject item,
                                        PaneSection<OLAPObject> insertSection)
Description copied from class: OLAPPane
Handle Drag and Drop transfer for items with invalid index.

Overrides:
transferInvalidIndexItem in class OLAPPane<MondrianModel.Dimension,OLAPObject>
Parameters:
item - The item to be transferred.
insertSection - The section to be inserted into.


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca