ca.sqlpower.wabit.report
Class ContentBox

java.lang.Object
  extended by ca.sqlpower.object.AbstractSPObject
      extended by ca.sqlpower.wabit.AbstractWabitObject
          extended by ca.sqlpower.wabit.report.ContentBox
All Implemented Interfaces:
ca.sqlpower.object.SPObject, WabitObject

public class ContentBox
extends AbstractWabitObject

Represents a box on the page which has an absolute position and size. The content of the box is provided by a ContentRenderer implementation. Whenever the content renderer's appearance changes, this box will fire a PropertyChangeEvent with the property name "content". The old and new values will


Field Summary
 
Fields inherited from class ca.sqlpower.object.AbstractSPObject
uuid
 
Constructor Summary
ContentBox()
           
ContentBox(ContentBox contentBox)
          Copy Constructor
 
Method Summary
protected  void addChildImpl(ca.sqlpower.object.SPObject child, int index)
           
 void addRepaintListener(RepaintListener listener)
          Adds a listener to this object that will be notified when the object wants to repaint.
 boolean allowsChildren()
           
 int childPositionOffset(java.lang.Class<? extends ca.sqlpower.object.SPObject> childType)
           
 java.util.List<java.lang.Class<? extends ca.sqlpower.object.SPObject>> getAllowedChildTypes()
           
 java.awt.geom.Rectangle2D getBounds()
           
 java.util.List<WabitObject> getChildren()
          Included to complete the WabitObject implementation.
 ReportContentRenderer getContentRenderer()
           
 java.util.List<WabitObject> getDependencies()
           
 java.awt.Font getFont()
           
 double getHeight()
           
 Page getParent()
          Returns the parent of this WabitObject.
 double getWidth()
           
 double getX()
           
 double getY()
           
protected  boolean removeChildImpl(ca.sqlpower.object.SPObject child)
           
 void removeDependency(ca.sqlpower.object.SPObject dependency)
           
 void removeRepaintListener(RepaintListener listener)
           
 void repaint()
           
 void setContentRenderer(ReportContentRenderer contentRenderer)
          Sets the given content renderer as this box's provider of rendered content.
 void setFont(java.awt.Font font)
           
 void setHeight(double height)
           
 void setWidth(double width)
           
 void setX(double x)
           
 void setY(double y)
           
 
Methods inherited from class ca.sqlpower.wabit.AbstractWabitObject
cleanup, commit, equals, generateNewUUID, getSession, isForegroundThread, removeChild, rollback, runInBackground, runInForeground, toString
 
Methods inherited from class ca.sqlpower.object.AbstractSPObject
addChild, addSPListener, begin, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, getChildren, getName, getUUID, removeSPListener, setName, setParent, setUUID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ca.sqlpower.object.SPObject
addChild, addSPListener, begin, getChildren, getName, getUUID, removeSPListener, setName, setParent, setUUID
 

Constructor Detail

ContentBox

public ContentBox()

ContentBox

public ContentBox(ContentBox contentBox)
Copy Constructor

Parameters:
contentBox -
Method Detail

setContentRenderer

public void setContentRenderer(ReportContentRenderer contentRenderer)
Sets the given content renderer as this box's provider of rendered content.

Although content renderers are considered children of the content box (and this method does cause child added/removed events), a content box can only have one content renderer at a time, so if you call this method when the current content renderer is non-null, the old renderer will be replaced by the new one.

Parameters:
contentRenderer - The new content renderer to use. Can be null, which means to remove the content render and render this content box incontent.

getContentRenderer

public ReportContentRenderer getContentRenderer()

getParent

public Page getParent()
Description copied from interface: WabitObject
Returns the parent of this WabitObject. This will be null when the object is first created until it is added as a child to another object. If this object is never added as a child to another object this will remain null and the object may be treated as the root node of a WabitObject tree.

Specified by:
getParent in interface ca.sqlpower.object.SPObject
Specified by:
getParent in interface WabitObject
Overrides:
getParent in class AbstractWabitObject
Returns:
The parent of this object.

getX

public double getX()

setX

public void setX(double x)

getY

public double getY()

setY

public void setY(double y)

getWidth

public double getWidth()

setWidth

public void setWidth(double width)

getHeight

public double getHeight()

setHeight

public void setHeight(double height)

allowsChildren

public boolean allowsChildren()

childPositionOffset

public int childPositionOffset(java.lang.Class<? extends ca.sqlpower.object.SPObject> childType)

getChildren

public java.util.List<WabitObject> getChildren()
Included to complete the WabitObject implementation. For direct use of this class, it's usually better to use getContentRenderer() because there can only ever be 0 or 1 children.


getFont

public java.awt.Font getFont()

setFont

public void setFont(java.awt.Font font)

getBounds

public java.awt.geom.Rectangle2D getBounds()

getDependencies

public java.util.List<WabitObject> getDependencies()

removeDependency

public void removeDependency(ca.sqlpower.object.SPObject dependency)

removeChildImpl

protected boolean removeChildImpl(ca.sqlpower.object.SPObject child)
Specified by:
removeChildImpl in class ca.sqlpower.object.AbstractSPObject

addChildImpl

protected void addChildImpl(ca.sqlpower.object.SPObject child,
                            int index)
Overrides:
addChildImpl in class ca.sqlpower.object.AbstractSPObject

addRepaintListener

public void addRepaintListener(RepaintListener listener)
Adds a listener to this object that will be notified when the object wants to repaint.


removeRepaintListener

public void removeRepaintListener(RepaintListener listener)

repaint

public void repaint()

getAllowedChildTypes

public java.util.List<java.lang.Class<? extends ca.sqlpower.object.SPObject>> getAllowedChildTypes()


Copyright © 2009. All Rights Reserved.