|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.architect.swingui.PlayPenComponent
ca.sqlpower.architect.swingui.ContainerPane<T,C>
T - Class of the modelC - Class of the an item.public abstract class ContainerPane<T,C>
A playpen component that represents a model with a list of individually selectable items.
| Field Summary | |
|---|---|
static int |
ITEM_INDEX_NONE
A special item index that means "no location." |
static int |
ITEM_INDEX_TITLE
A special item index that represents the titlebar area. |
protected java.awt.Insets |
margin
How many pixels should be left between the surrounding box and the item name labels. |
protected T |
model
|
protected java.util.Set<C> |
selectedItems
Tracks which items in this container are currently selected. |
| Fields inherited from class ca.sqlpower.architect.swingui.PlayPenComponent |
|---|
backgroundColor, componentPreviouslySelected, foregroundColor, selected |
| Constructor Summary | |
|---|---|
protected |
ContainerPane(PlayPenContentPane parent)
|
| Method Summary | |
|---|---|
void |
addItemSelectionListener(ItemSelectionListener<T,C> listener)
|
java.awt.datatransfer.DataFlavor |
bestImportFlavor(javax.swing.JComponent c,
java.awt.datatransfer.DataFlavor[] flavors)
Chooses the best import flavour from the flavors array for importing into c. |
abstract java.awt.datatransfer.Transferable |
createTransferableForSelection()
Creates a Transferable representation of the currently-selected items. |
protected void |
deSelectEverythingElse(java.awt.event.MouseEvent evt)
Deselects everything except the selected item. |
void |
deselectItem(C item)
Deselects the given item. |
void |
deselectItem(int i)
Deselects the item, if i < 0, selectNone() is called. |
void |
dragDropEnd(java.awt.dnd.DragSourceDropEvent dsde)
|
void |
dragEnter(java.awt.dnd.DragSourceDragEvent dsde)
|
void |
dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
Called while a drag operation is ongoing, when the mouse pointer enters the operable part of the drop site for the DropTarget registered with this listener. |
void |
dragExit(java.awt.dnd.DragSourceEvent dse)
|
void |
dragExit(java.awt.dnd.DropTargetEvent dte)
Called while a drag operation is ongoing, when the mouse pointer has exited the operable part of the drop site for the DropTarget registered with this listener. |
void |
dragOver(java.awt.dnd.DragSourceDragEvent dsde)
|
void |
dragOver(java.awt.dnd.DropTargetDragEvent dtde)
Called when a drag operation is ongoing, while the mouse pointer is still over the operable part of the drop site for the DropTarget registered with this listener. |
void |
drop(java.awt.dnd.DropTargetDropEvent dtde)
Called when the drag operation has terminated with a drop on the operable part of the drop site for the DropTarget registered with this listener. |
void |
dropActionChanged(java.awt.dnd.DragSourceDragEvent dsde)
|
void |
dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
Called if the user has modified the current drop gesture. |
protected void |
fireItemsDeselected(java.util.Set<C> items)
|
protected void |
fireItemsSelected(java.util.Set<C> items)
|
protected abstract java.util.List<C> |
getItems()
Returns a list of the items to be displayed with the model. |
java.awt.Point |
getLocationOnScreen()
|
java.awt.Insets |
getMargin()
Gets the value of margin |
T |
getModel()
|
java.lang.String |
getNodeName()
Simple implementation for LayoutNode interface. |
int |
getSelectedItemIndex()
Returns the index of the first selected item, or ITEM_INDEX_NONE if there are no selected items. |
java.util.List<C> |
getSelectedItems()
Returns a list of the items that are currently in the selection that also currently exist in the model. |
void |
handleMouseEvent(java.awt.event.MouseEvent evt)
Performs the component specific actions for the given MouseEvent. |
boolean |
isDashed()
Indicates whether the lines are dashed/normal. |
boolean |
isItemSelected(C item)
Returns true if the given item was selected in this container pane since the last time selectNone() was called, even if it has
subsequently been removed from the model. |
boolean |
isItemSelected(int i)
Returns true if the item at the given index is selected. |
boolean |
isRounded()
Indicates whether the corners are rounded. |
abstract int |
pointToItemIndex(java.awt.Point p)
Deprecated. |
void |
removeItemSelectionListener(ItemSelectionListener<T,C> listener)
|
void |
selectItem(C item)
Selects the item, firing an ItemSelectionEvent. |
void |
selectItem(int i)
Selects the item, firing an ItemSelectionEvent. |
void |
selectNone()
Deselects all items in this ContainerPane. |
void |
setDashed(boolean isDashed)
Sets whether the lines are dashed. |
void |
setMargin(java.awt.Insets argMargin)
Sets the value of margin |
void |
setRounded(boolean isRounded)
Sets whether the corners are rounded. |
void |
setSelected(boolean isSelected,
int multiSelectType)
Overridden so that the items get deselected when the whole container is deselected. |
| 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, getName, getParent, getPlayPen, getPopup, getPreferredLocation, getPreferredSize, getSize, getToolTipText, getUI, 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, toString, wait, wait, wait |
| Methods inherited from interface ca.sqlpower.architect.layout.LayoutNode |
|---|
getBounds, getBounds, getHeight, getInboundEdges, getLocation, getOutboundEdges, getWidth, getX, getY, setBounds, setLocation, setLocation |
| Field Detail |
|---|
public static final int ITEM_INDEX_TITLE
public static final int ITEM_INDEX_NONE
protected T model
protected java.awt.Insets margin
protected final java.util.Set<C> selectedItems
| Constructor Detail |
|---|
protected ContainerPane(PlayPenContentPane parent)
| Method Detail |
|---|
public T getModel()
getModel in class PlayPenComponentpublic void handleMouseEvent(java.awt.event.MouseEvent evt)
PlayPenComponent
handleMouseEvent in class PlayPenComponentprotected void deSelectEverythingElse(java.awt.event.MouseEvent evt)
public java.awt.Point getLocationOnScreen()
public void setMargin(java.awt.Insets argMargin)
argMargin - Value to assign to this.marginpublic java.awt.Insets getMargin()
protected abstract java.util.List<C> getItems()
public boolean isRounded()
public void setRounded(boolean isRounded)
public boolean isDashed()
public void setDashed(boolean isDashed)
public void setSelected(boolean isSelected,
int multiSelectType)
setSelected in interface SelectablesetSelected in class PlayPenComponentisSelected - The new selection state for this componentmultiSelectType - One of the type codes from SelectionEvent.@Deprecated public abstract int pointToItemIndex(java.awt.Point p)
public void selectNone()
public void deselectItem(int i)
selectNone() is called.
i - index to getItems()public void deselectItem(C item)
item - the item to deselect.public void selectItem(int i)
selectNone() is called.
i - index to getItems()public void selectItem(C item)
item - The item to select.public boolean isItemSelected(int i)
i - index from getItems()public boolean isItemSelected(C item)
selectNone() was called, even if it has
subsequently been removed from the model. This comes in handy in event
listeners that want to know if a recently-removed item was selected at
the time it was removed.
item - The item to check
public java.util.List<C> getSelectedItems()
isItemSelected(Object).
public int getSelectedItemIndex()
ITEM_INDEX_NONE if there are no selected items.
protected void fireItemsSelected(java.util.Set<C> items)
protected void fireItemsDeselected(java.util.Set<C> items)
public void addItemSelectionListener(ItemSelectionListener<T,C> listener)
public void removeItemSelectionListener(ItemSelectionListener<T,C> listener)
public void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
NOTE: This method is expected to be called from the PlayPen's dragOver method (not directly by Swing), and as such the DropTargetContext (and the mouse co-ordinates) will be of the PlayPen.
public void dragExit(java.awt.dnd.DropTargetEvent dte)
NOTE: This method is expected to be called from the PlayPen's dragOver method (not directly by Swing), and as such the DropTargetContext (and the mouse co-ordinates) will be of the PlayPen.
public void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
NOTE: This method is expected to be called from the PlayPen's dragOver method (not directly by Swing), and as such the DropTargetContext (and the mouse co-ordinates) will be of the PlayPen.
public void drop(java.awt.dnd.DropTargetDropEvent dtde)
NOTE: This method is expected to be called from the PlayPen's dragOver method (not directly by Swing), and as such the DropTargetContext (and the mouse co-ordinates) will be of the PlayPen.
public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
public java.awt.datatransfer.DataFlavor bestImportFlavor(javax.swing.JComponent c,
java.awt.datatransfer.DataFlavor[] flavors)
public void dragEnter(java.awt.dnd.DragSourceDragEvent dsde)
dragEnter in interface java.awt.dnd.DragSourceListenerpublic void dragOver(java.awt.dnd.DragSourceDragEvent dsde)
dragOver in interface java.awt.dnd.DragSourceListenerpublic void dropActionChanged(java.awt.dnd.DragSourceDragEvent dsde)
dropActionChanged in interface java.awt.dnd.DragSourceListenerpublic void dragExit(java.awt.dnd.DragSourceEvent dse)
dragExit in interface java.awt.dnd.DragSourceListenerpublic void dragDropEnd(java.awt.dnd.DragSourceDropEvent dsde)
dragDropEnd in interface java.awt.dnd.DragSourceListenerpublic abstract java.awt.datatransfer.Transferable createTransferableForSelection()
public java.lang.String getNodeName()
getNodeName in interface LayoutNode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||