ca.sqlpower.architect.swingui.olap
Class OLAPPaneUI<T extends OLAPObject,C extends OLAPObject>

java.lang.Object
  extended by ca.sqlpower.architect.swingui.ContainerPaneUI
      extended by ca.sqlpower.architect.swingui.olap.OLAPPaneUI<T,C>
All Implemented Interfaces:
PlayPenComponentUI, java.io.Serializable
Direct Known Subclasses:
BasicCubePaneUI, BasicDimensionPaneUI, BasicVirtualCubePaneUI

public abstract class OLAPPaneUI<T extends OLAPObject,C extends OLAPObject>
extends ContainerPaneUI

Does all of the generic painting and event handling that applies to all "pane" type components in the OLAP play pen.

Our plan is to eventually move all the generic stuff up into ContainerPaneUI so that BasicTablePaneUI can get simpler.

See Also:
Serialized Form

Field Summary
protected  ca.sqlpower.architect.swingui.olap.OLAPPaneUI.ModelEventHandler modelEventHandler
           
protected  OLAPPane<T,C> olapPane
           
protected  ca.sqlpower.architect.swingui.olap.OLAPPaneUI.PaneEventHandler paneEventHandler
           
 
Constructor Summary
OLAPPaneUI()
           
 
Method Summary
 boolean contains(java.awt.Point p)
           
 int firstItemIndex(PaneSection<? extends C> sect)
          Returns the index of the first item in the given section.
 java.awt.Dimension getPreferredSize()
          Calculates and returns the ideal size for this OLAPPane.
 void installUI(PlayPenComponent c)
           
 void paint(java.awt.Graphics2D g2)
           
 int pointToItemIndex(java.awt.Point p)
          Deprecated. 
 PlayPenCoordinate<T,C> pointToPPCoordinate(java.awt.Point p)
          Translates the given point into a PlayPenCoordinate.
 void revalidate()
           
 PaneSection<? extends C> toSectionLocation(java.awt.Point point, boolean editPoint)
          Looks up the section that the given point resides in, and may translate the given point so that it is relative to the top left corner of the returned section.
 void uninstallUI(PlayPenComponent c)
           
 
Methods inherited from class ca.sqlpower.architect.swingui.ContainerPaneUI
paintInsertionPoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

olapPane

protected OLAPPane<T extends OLAPObject,C extends OLAPObject> olapPane

modelEventHandler

protected final ca.sqlpower.architect.swingui.olap.OLAPPaneUI.ModelEventHandler modelEventHandler

paneEventHandler

protected final ca.sqlpower.architect.swingui.olap.OLAPPaneUI.PaneEventHandler paneEventHandler
Constructor Detail

OLAPPaneUI

public OLAPPaneUI()
Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()
Calculates and returns the ideal size for this OLAPPane. If you override or change the paint(Graphics2D) or #drawSection(PaneSection, Graphics2D, ContainerPane, int) methods, you will have to override this method as well to compensate.


installUI

public void installUI(PlayPenComponent c)

uninstallUI

public void uninstallUI(PlayPenComponent c)

paint

public void paint(java.awt.Graphics2D g2)

contains

public boolean contains(java.awt.Point p)

revalidate

public void revalidate()

toSectionLocation

public PaneSection<? extends C> toSectionLocation(java.awt.Point point,
                                                  boolean editPoint)
Looks up the section that the given point resides in, and may translate the given point so that it is relative to the top left corner of the returned section. If the given point is not in any section, the return value will be null and the p will not have been modified.

Parameters:
point - The point in overall component coordinates. This point will be modified if this method returns non-null and editPoint is true.
editPoint - If the given point should be edited or not.
Returns:
The section the given point is located in, plus the passed-in point may have been translated.

pointToItemIndex

@Deprecated
public int pointToItemIndex(java.awt.Point p)
Deprecated. 

Description copied from class: ContainerPaneUI
This delegate method is specified by OLAPPane.pointToItemIndex(Point) Subclass of DimensionPaneUI will implement this method to calculate column index given a point on the playpenComponent.

Specified by:
pointToItemIndex in class ContainerPaneUI

pointToPPCoordinate

public PlayPenCoordinate<T,C> pointToPPCoordinate(java.awt.Point p)
Translates the given point into a PlayPenCoordinate.

Parameters:
p - The point to be translated.
Returns:
The PlayPenCoordinate that represents the point.

firstItemIndex

public int firstItemIndex(PaneSection<? extends C> sect)
Returns the index of the first item in the given section.

Parameters:
sect - A section in this pane.
Returns:


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