ca.sqlpower.architect.swingui
Class AbstractPlacer

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by ca.sqlpower.architect.swingui.AbstractPlacer
All Implemented Interfaces:
PlayPen.CancelableListener, java.awt.event.MouseListener, java.util.EventListener

public abstract class AbstractPlacer
extends java.awt.event.MouseAdapter
implements PlayPen.CancelableListener

A generic class for placing arbitrary playpen components in the playpen when the user releases the mouse button.


Field Summary
protected  PlayPen playpen
           
 
Constructor Summary
protected AbstractPlacer(PlayPen playpen)
          Creates a new table placer for the given table pane.
 
Method Summary
 void cancel()
          Implements PlayPen.CancelableListener by canceling this place operation.
 void dirtyup()
          Activates this TablePlacer by attaching it to the play pen.
protected abstract  java.lang.String getEditDialogTitle()
          Returns the title for the edit dialog that pops up after place() has been called, if place() returns a data entry panel.
 void mouseReleased(java.awt.event.MouseEvent e)
           
abstract  ca.sqlpower.swingui.DataEntryPanel place(java.awt.Point p)
          Performs the specific placement operation based on the mouse click.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseEntered, mouseExited, mousePressed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

playpen

protected final PlayPen playpen
Constructor Detail

AbstractPlacer

protected AbstractPlacer(PlayPen playpen)
Creates a new table placer for the given table pane. Once constructed, you have to activate this instance by calling dirtyup().

Parameters:
tp - The new tablepane to add when the user clicks the mouse
Method Detail

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class java.awt.event.MouseAdapter

getEditDialogTitle

protected abstract java.lang.String getEditDialogTitle()
Returns the title for the edit dialog that pops up after place() has been called, if place() returns a data entry panel. If place() never returns a panel, it's ok for this method to return null.


place

public abstract ca.sqlpower.swingui.DataEntryPanel place(java.awt.Point p)
                                                  throws ArchitectException
Performs the specific placement operation based on the mouse click. This should add both to the PlayPen itself as well as the business model.

Parameters:
p - The point to place at, in logical playpen coordinates.
Returns:
The data entry panel to show. This it convenient if you want to pop up an editor for the newly-placed component. If you don't want an editor to pop up, simply return null.
Throws:
ArchitectException

cancel

public void cancel()
Implements PlayPen.CancelableListener by canceling this place operation.

Specified by:
cancel in interface PlayPen.CancelableListener

dirtyup

public void dirtyup()
Activates this TablePlacer by attaching it to the play pen. This table placer will clean itself up when the mouse button is pressed and released, or when the user cancels on the playpen, whichever comes first.



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