|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.jaspira.gui.interaction.BasicDropRegion
public class BasicDropRegion
Basic implementation of DragAwareRegion. This implementation receives its parameters via the constructor. It can not be used for component elements that change dynamically during Dragging.
| Field Summary | |
|---|---|
protected java.lang.Object |
id
Name to identify this drop region to the drop client |
protected java.awt.Component |
origin
Origin to which the coordinates are relative |
protected InteractionClient |
parent
Drop client that this region belongs to |
protected java.lang.String |
toolTipText
Text of the Tooltip that should be displayed for this region |
| Fields inherited from interface org.openbp.jaspira.gui.interaction.DragAwareRegion |
|---|
COPY, COPY_OR_MOVE, MOVE, NONE |
| Constructor Summary | |
|---|---|
BasicDropRegion(java.lang.Object id,
InteractionClient parent,
java.awt.Component source)
Component constructor. |
|
BasicDropRegion(java.lang.Object id,
InteractionClient parent,
java.awt.geom.RectangularShape shape,
java.awt.Component origin)
Constructor for a rectangular region. |
|
| Method Summary | |
|---|---|
boolean |
canImport()
BasicDropRegion objects can always import. |
boolean |
dragEnter()
Do nothing, return true. |
boolean |
dragExit()
Do nothing, return true. |
void |
draw(java.awt.Graphics2D g)
Draws the region with the given attributes. |
java.awt.Rectangle |
getBounds()
Returns the bounding box of the region. |
CursorPrototype |
getCursor()
Gets the cursor prototype that should be used for constructing a cursor if a drag over occurs. |
java.awt.Color |
getFrameColor()
Gets the color of the frame of the region. |
java.lang.Object |
getId()
Gets the name to identify this drop region to the drop client. |
java.awt.Component |
getOrigin()
Gets the origin to which the coordinates are relative. |
java.awt.Shape |
getOverlay()
Gets the overlay shape for this region. |
java.awt.Paint |
getPaint()
Gets the fill paint for the region. |
InteractionClient |
getParent()
Gets the drop client that this region belongs to. |
java.awt.geom.RectangularShape |
getShape()
Gets the visible shape of the region. |
java.awt.Stroke |
getStroke()
Gets the stroke for the frame. |
java.lang.String |
getToolTipText()
Gets the text of the Tooltip that should be displayed for this region. |
boolean |
importData(java.awt.datatransfer.Transferable data,
java.awt.Point p)
Imports the dragged data into our parent. |
boolean |
reactsOn(int x,
int y)
Checks if the given coordinates are within the shapes region. |
void |
setCursor(CursorPrototype cursor)
Sets the cursor prototype that should be used for constructing a cursor if a drag over occurs. |
void |
setFrameColor(java.awt.Color frameColor)
Sets the color of the frame of the region. |
void |
setId(java.lang.Object id)
Sets the name to identify this drop region to the drop client. |
void |
setOrigin(java.awt.Component origin)
Sets the origin to which the coordinates are relative. |
void |
setOverlay(java.awt.Shape overlay)
Sets the overlay shape for this region. |
void |
setPaint(java.awt.Paint paint)
Sets the fill paint for the region. |
void |
setParent(InteractionClient parent)
Sets the drop client that this region belongs to. |
void |
setShape(java.awt.geom.RectangularShape shape)
Sets the visible shape of the region. |
void |
setStroke(java.awt.Stroke stroke)
Sets the stroke for the frame. |
void |
setToolTipText(java.lang.String toolTipText)
Sets the text of the Tooltip that should be displayed for this region. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Object id
protected InteractionClient parent
protected java.awt.Component origin
protected java.lang.String toolTipText
| Constructor Detail |
|---|
public BasicDropRegion(java.lang.Object id,
InteractionClient parent,
java.awt.geom.RectangularShape shape,
java.awt.Component origin)
id - Name to identify this drop region to the drop clientparent - Drop client that this region belongs toshape - Shape to represent this region. Relative to drop client origin.origin - Component to which th shape is relative to
public BasicDropRegion(java.lang.Object id,
InteractionClient parent,
java.awt.Component source)
id - Name to identify this drop region to the drop clientparent - Drop client that this region belongs tosource - Component that shall be covered by this region.
The bounds region will equals the component's bounds.| Method Detail |
|---|
public boolean importData(java.awt.datatransfer.Transferable data,
java.awt.Point p)
importData in interface DragAwareRegiondata - Data to importp - Import position in glass coordinates
public boolean canImport()
canImport in interface DragAwareRegionpublic void draw(java.awt.Graphics2D g)
draw in interface DragAwareRegiong - Graphics contextpublic java.awt.Rectangle getBounds()
getBounds in interface DragAwareRegion
public boolean reactsOn(int x,
int y)
reactsOn in interface DragAwareRegionx - Position in screen coordinatesy - Position in screen coordinatespublic boolean dragEnter()
dragEnter in interface DragAwareRegionpublic boolean dragExit()
dragExit in interface DragAwareRegionpublic java.lang.Object getId()
public void setId(java.lang.Object id)
public InteractionClient getParent()
public void setParent(InteractionClient parent)
public java.awt.geom.RectangularShape getShape()
public void setShape(java.awt.geom.RectangularShape shape)
public java.awt.Color getFrameColor()
public void setFrameColor(java.awt.Color frameColor)
public java.awt.Stroke getStroke()
public void setStroke(java.awt.Stroke stroke)
public java.awt.Paint getPaint()
public void setPaint(java.awt.Paint paint)
public CursorPrototype getCursor()
getCursor in interface DragAwareRegionpublic void setCursor(CursorPrototype cursor)
public java.awt.Shape getOverlay()
getOverlay in interface DragAwareRegionpublic void setOverlay(java.awt.Shape overlay)
public java.awt.Component getOrigin()
public void setOrigin(java.awt.Component origin)
public java.lang.String getToolTipText()
getToolTipText in interface DragAwareRegionpublic void setToolTipText(java.lang.String toolTipText)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||