org.openbp.cockpit.modeler.figures.tag
Class AbstractTagFigure

java.lang.Object
  extended by CH.ifa.draw.standard.AbstractFigure
      extended by CH.ifa.draw.standard.CompositeFigure
          extended by org.openbp.cockpit.modeler.figures.tag.AbstractTagFigure
All Implemented Interfaces:
CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.FigureChangeListener, CH.ifa.draw.util.Storable, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, ChildFigure, Expandable, ShadowDropper, UpdatableFigure, LayoutableTag, VisualElement, InteractionClient
Direct Known Subclasses:
HorizontalRotatingTagFigure, StraightTagFigure

public abstract class AbstractTagFigure
extends CH.ifa.draw.standard.CompositeFigure
implements LayoutableTag, CH.ifa.draw.framework.FigureChangeListener, ShadowDropper, Expandable, ChildFigure, VisualElement, UpdatableFigure

An AbstractTagFigure represents a single tag. It is graphically represented by its presentation figure and can contain any amount of subFigures. The subFigures are layouted by using an Layouter. Contents can be divided using SpacerFigures and SeparatorFigures, the former is also used to create an offset to the center. Each Tag cotains an origin, around which rotating is resolved, a current angle, its layouter, its presentationFigure and its contents. Contents of the are represented by TagContent objects which contain the contained figure as well as its content type. The content state of the tag is actually the definition which content types are visible, all applicable stati being binary ORed to form the content state.

Author:
Stephan Moritz
See Also:
Serialized Form

Nested Class Summary
 class AbstractTagFigure.TagContent
          Simple class that combines a figure object with additional information, i\.e\. about the type of the figure.
 
Field Summary
protected  double angle
          Angle of the tag
protected  java.util.List content
          Actual content of the tag (contains TagContent objects)
static int CONTENT_DATA
          Content that refers to the flow of data
static int CONTENT_FLOW
          Content that refers to flow of control
static int CONTENT_ICON
          Icon content
static int CONTENT_INTERACTION
          Flag for interaction-related content
static int CONTENT_STATIC
          Flag for static content
static int CONTENT_TEXT
          Static text content or similar
static int CONTENT_USER1
          Content that refers to the flow of data
static int CONTENT_USER2
          Content that refers to the flow of data
protected  int contentState
          Content state of the tag
protected  int currentContentState
          Current (decorated) content state of the tag
static java.lang.String DECO_TAGCONTENTTYPE
          Decoration key for the content type (used with Integer objects)
protected  TagLayouter layouter
          The layouter is responsible for laying out the tag content
protected  java.awt.Point origin
          The center from which the tag emerges in world coordinates.
protected  VisualElement parent
          Containing figure
protected  XFigure presentationFigure
          Presentation-figure (the tag itself)
protected  CH.ifa.draw.framework.Figure shadowFigure
          Represents the figure's shadow
protected  int visualStatus
          Visual status as defined by VisualElement
 
Fields inherited from class CH.ifa.draw.standard.CompositeFigure
_nHighestZ, _nLowestZ, fFigures
 
Fields inherited from interface org.openbp.cockpit.modeler.figures.VisualElement
VISUAL_DISPLAY_ALL, VISUAL_DND_PARTICIPANT, VISUAL_VISIBLE
 
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
 
Constructor Summary
AbstractTagFigure(VisualElement parent, java.lang.Object modelObject)
          Constructor.
 
Method Summary
 void addContent(CH.ifa.draw.framework.Figure newFigure, int type)
          Adds a figure with a given content type to the content list of this tag.
 void addContentAt(CH.ifa.draw.framework.Figure newFigure, int index, int type)
          Adds a figure with a given content type to the content list of this tag at the given position.
 void applyContentState()
          Rebuilds the child figure list of the tag according to the (decorated) tag content state from the content list of the tag.
 void basicDisplayBox(java.awt.Point origin, java.awt.Point corner)
           
protected  void basicMoveBy(int dx, int dy)
           
protected  void basicSetAngle(double angle)
          Sets the angle to the given one.
 boolean canConnect()
           
 void changed()
           
 void checkDecoratedContentState()
          Rebuilds the tag content of the decorated content state differs from the current content state.
 java.awt.Rectangle compactDisplayBox()
          Returns the display box of the presentation figure.
 CH.ifa.draw.framework.Connector connectorAt(int x, int y)
           
 boolean containsPoint(int x, int y)
           
protected  XFigure createPresentationFigure()
          Creates the presentation figure of this tag.
 Orientation determine2WayOrientation(boolean vertical)
          Determines the 2-way orientation of the tag figure.
 int determineDecoratedContentState()
          Gets the tag content state after decoration.
 java.awt.Rectangle displayBox()
           
 void dragActionTriggered(java.lang.Object regionId, java.awt.Point p)
          Called to signal additional actions, such as hovering for a certain time over the region.
 void dragEnded(java.awt.datatransfer.Transferable transferable)
          called when a dragging has ended.
 void dragStarted(java.awt.datatransfer.Transferable transferable)
          Called when a dragging has been started.
 void draw(java.awt.Graphics g)
          Saves the transformation, draws the tag and restores the transformation.
 CH.ifa.draw.framework.Figure findFigure(int x, int y)
           
 CH.ifa.draw.framework.Figure findFigureInside(int x, int y)
           
 java.util.List getAllDropRegions(java.util.List flavors, java.awt.datatransfer.Transferable data, java.awt.event.MouseEvent mouseEvent)
          Returns a list of all regions of this client AND possible sub clients.
 java.util.List getAllImportersAt(java.awt.Point p)
          Returns all importers which will be accepted at the given point by this client or one of its sub clients.
 double getAngle()
          Gets the rotation angle.
 CH.ifa.draw.framework.Figure getCenterFigure()
          Gets the figure that forms the center of the rotation (usually the parent).
 java.awt.Rectangle getCenterFigureBox()
          Returns the display box of the center figure or null.
 java.util.List getContent()
           
 CH.ifa.draw.framework.Figure getContentFigureAt(int pos)
          Gets the content figure (visible or not) at the specified position
 int getContentState()
          Gets the tag content state.
 ProcessDrawing getDrawing()
          Gets the drawing the element is a part of.
 java.util.List getDropRegions(java.util.List flavors, java.awt.datatransfer.Transferable data, java.awt.event.MouseEvent mouseEvent)
          Returns a list of drop regions of this client that are compatible with the provided data flavors.
 java.awt.Color getFillColor()
           
 java.util.List getImportersAt(java.awt.Point p)
          Returns all importers which will be accepted at the given point by this client.
 TagLayouter getLayouter()
          Gets the the layouter is responsible for laying out the tag content.
 int getNumberOfContents()
          Gets the number of content objects (visible or not) of this tag.
 java.awt.Point getOrigin()
          Gets the origin.
 CH.ifa.draw.framework.Figure getParent()
          Gets the parent figure of this figure.
 VisualElement getParentElement()
          Gets parent element of this element, if any.
 CH.ifa.draw.framework.Figure getPresentationFigure()
          Gets the presentation figure of this element.
 CH.ifa.draw.framework.Figure getShadow()
          Returns the shadow figure of this object.
 java.util.List getSubClients()
          Returns subordinate clients of this client.
 int getVisualStatus()
          Gets the visual status as defined by VisualElement
 boolean handleEvent(VisualElementEvent event)
          Handler method that is called for handling events.
 java.util.Vector handles()
          We do not want any handles, so we return an empty vector.
 boolean importData(java.lang.Object regionId, java.awt.datatransfer.Transferable data, java.awt.Point p)
          Imports the given transferable into the given region.
protected  void initContent(java.lang.Object modelObject)
          Creates the content of this tag.
protected  void initPresentationFigure()
          Initializes the presentation figure and its shadow.
protected  void initShadow()
          Creates the shadow figure of the tag's presentation figure.
protected  void initTagLayouter()
          Creates the layouter for this tag.
 void invalidate()
           
 boolean isVerticalOrientation()
          Checks if the orientation of the tag is vertical or horizontal.
 boolean isVisible()
          Gets the flag if the element is currently visible.
 void layoutTag()
          Layouts the tag.
 void moveContent(int oldIndex, int newIndex)
          Moves content from old to new index.
protected  java.awt.Rectangle positionDisplayBox(java.awt.Rectangle rect)
          Positions the display box of the tag relative to its parent figure.
 void read(CH.ifa.draw.util.StorableInput dr)
           
 void setAngle(double angle)
          Sets the rotation angle.
 void setContentState(int contentState)
          Sets and applies the tag content state.
 void setDrawing(ProcessDrawing processDrawing)
          Sets the drawing the element is a part of.
 void setFillColor(java.awt.Color color)
           
 void setLayouter(TagLayouter layouter)
          Sets the the layouter is responsible for laying out the tag content.
 void setOrigin(java.awt.Point origin)
          Sets the origin.
 void setParent(CH.ifa.draw.framework.Figure parent)
          Sets the parent figure of this figure.
 void setVisible(boolean visible)
          Sets the flag if the element is currently visible.
 void setVisualStatus(int visualStatus)
          Sets the visual status as defined by VisualElement
 void updateFigure()
          Causes all UpdatableFigure children to updateFigure.
 void updatePresentationFigure()
          Updates (reinitializes) the presentation figure.
 void write(CH.ifa.draw.util.StorableOutput dw)
           
 
Methods inherited from class CH.ifa.draw.standard.CompositeFigure
add, addAll, addAll, bringToFront, draw, figureAt, figureChanged, figureCount, figureInvalidated, figureRemoved, figureRequestRemove, figureRequestUpdate, figures, figures, figuresReverse, findFigure, findFigure, findFigureInsideWithout, findFigureWithout, getFigureFromLayer, getLayer, includes, init, orphan, orphanAll, orphanAll, release, remove, removeAll, removeAll, removeAll, replace, sendToBack, sendToLayer
 
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, center, clone, connectedTextLocator, connectionInsets, connectorVisibility, decompose, displayBox, displayBox, getAttribute, getZValue, isEmpty, listener, moveBy, removeFigureChangeListener, removeFromContainer, setAttribute, setZValue, size, willChange
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface CH.ifa.draw.framework.FigureChangeListener
figureChanged, figureInvalidated, figureRemoved, figureRequestRemove, figureRequestUpdate
 
Methods inherited from interface CH.ifa.draw.framework.Figure
addFigureChangeListener, addToContainer, center, clone, connectedTextLocator, connectionInsets, connectorVisibility, decompose, displayBox, displayBox, figures, getAttribute, getZValue, includes, isEmpty, listener, moveBy, release, removeFigureChangeListener, removeFromContainer, setAttribute, setZValue, size, willChange
 

Field Detail

DECO_TAGCONTENTTYPE

public static final java.lang.String DECO_TAGCONTENTTYPE
Decoration key for the content type (used with Integer objects)

See Also:
Constant Field Values

CONTENT_ICON

public static final int CONTENT_ICON
Icon content

See Also:
Constant Field Values

CONTENT_TEXT

public static final int CONTENT_TEXT
Static text content or similar

See Also:
Constant Field Values

CONTENT_FLOW

public static final int CONTENT_FLOW
Content that refers to flow of control

See Also:
Constant Field Values

CONTENT_DATA

public static final int CONTENT_DATA
Content that refers to the flow of data

See Also:
Constant Field Values

CONTENT_USER1

public static final int CONTENT_USER1
Content that refers to the flow of data

See Also:
Constant Field Values

CONTENT_USER2

public static final int CONTENT_USER2
Content that refers to the flow of data

See Also:
Constant Field Values

CONTENT_INTERACTION

public static final int CONTENT_INTERACTION
Flag for interaction-related content

See Also:
Constant Field Values

CONTENT_STATIC

public static final int CONTENT_STATIC
Flag for static content

See Also:
Constant Field Values

parent

protected VisualElement parent
Containing figure


presentationFigure

protected XFigure presentationFigure
Presentation-figure (the tag itself)


shadowFigure

protected CH.ifa.draw.framework.Figure shadowFigure
Represents the figure's shadow


content

protected java.util.List content
Actual content of the tag (contains TagContent objects)


layouter

protected TagLayouter layouter
The layouter is responsible for laying out the tag content


angle

protected double angle
Angle of the tag


origin

protected java.awt.Point origin
The center from which the tag emerges in world coordinates. Usually the center of the parent figure.


contentState

protected int contentState
Content state of the tag


currentContentState

protected int currentContentState
Current (decorated) content state of the tag


visualStatus

protected int visualStatus
Visual status as defined by VisualElement

Constructor Detail

AbstractTagFigure

public AbstractTagFigure(VisualElement parent,
                         java.lang.Object modelObject)
Constructor.

Parameters:
parent - Parent
modelObject - Model object this tag represents or null
Method Detail

initPresentationFigure

protected void initPresentationFigure()
Initializes the presentation figure and its shadow.


createPresentationFigure

protected XFigure createPresentationFigure()
Creates the presentation figure of this tag. By default, this is an XRoundRectangleFigure

Returns:
The presentation figure

initShadow

protected void initShadow()
Creates the shadow figure of the tag's presentation figure.


initTagLayouter

protected void initTagLayouter()
Creates the layouter for this tag. By default, this is a HorizontalLayouter


initContent

protected void initContent(java.lang.Object modelObject)
Creates the content of this tag. By default, this method does nothing.

Parameters:
modelObject - Model object this tag represents or null

getContent

public java.util.List getContent()

addContent

public void addContent(CH.ifa.draw.framework.Figure newFigure,
                       int type)
Adds a figure with a given content type to the content list of this tag. You should call applyContentState() to apply the content to the list of displayed figures according to the current content state of the tag.

Parameters:
newFigure - The figure to add
type - The content type of the figure to add

addContentAt

public void addContentAt(CH.ifa.draw.framework.Figure newFigure,
                         int index,
                         int type)
Adds a figure with a given content type to the content list of this tag at the given position. You should call applyContentState() to apply the content to the list of displayed figures according to the current content state of the tag.

Parameters:
newFigure - The figure to add
index - Position to insert the new figure at (0 = at the beginning)
type - The content type of the figure to add

moveContent

public void moveContent(int oldIndex,
                        int newIndex)
Moves content from old to new index.


getNumberOfContents

public int getNumberOfContents()
Gets the number of content objects (visible or not) of this tag.


getContentFigureAt

public CH.ifa.draw.framework.Figure getContentFigureAt(int pos)
Gets the content figure (visible or not) at the specified position


checkDecoratedContentState

public void checkDecoratedContentState()
Rebuilds the tag content of the decorated content state differs from the current content state.


applyContentState

public void applyContentState()
Rebuilds the child figure list of the tag according to the (decorated) tag content state from the content list of the tag.


setContentState

public void setContentState(int contentState)
Sets and applies the tag content state.


getContentState

public int getContentState()
Gets the tag content state.


determineDecoratedContentState

public int determineDecoratedContentState()
Gets the tag content state after decoration. The returned content state will be retrieved using the DecorationMgr The DECO_TAGCONTENTTYPE key will be used and the Integer value of the content state as returned by getContentState() will be passed to the registered decorators as value.


isVerticalOrientation

public boolean isVerticalOrientation()
Checks if the orientation of the tag is vertical or horizontal.


basicDisplayBox

public void basicDisplayBox(java.awt.Point origin,
                            java.awt.Point corner)
Specified by:
basicDisplayBox in interface CH.ifa.draw.framework.Figure
Specified by:
basicDisplayBox in class CH.ifa.draw.standard.AbstractFigure

basicMoveBy

protected void basicMoveBy(int dx,
                           int dy)
Overrides:
basicMoveBy in class CH.ifa.draw.standard.CompositeFigure

handles

public java.util.Vector handles()
We do not want any handles, so we return an empty vector.

Specified by:
handles in interface CH.ifa.draw.framework.Figure
Specified by:
handles in class CH.ifa.draw.standard.AbstractFigure

connectorAt

public CH.ifa.draw.framework.Connector connectorAt(int x,
                                                   int y)
Specified by:
connectorAt in interface CH.ifa.draw.framework.Figure
Overrides:
connectorAt in class CH.ifa.draw.standard.AbstractFigure

displayBox

public java.awt.Rectangle displayBox()
Specified by:
displayBox in interface CH.ifa.draw.framework.Figure
Specified by:
displayBox in class CH.ifa.draw.standard.AbstractFigure

draw

public void draw(java.awt.Graphics g)
Saves the transformation, draws the tag and restores the transformation.

Specified by:
draw in interface CH.ifa.draw.framework.Figure
Overrides:
draw in class CH.ifa.draw.standard.CompositeFigure

changed

public void changed()
Specified by:
changed in interface CH.ifa.draw.framework.Figure
Overrides:
changed in class CH.ifa.draw.standard.AbstractFigure

invalidate

public void invalidate()
Specified by:
invalidate in interface CH.ifa.draw.framework.Figure
Overrides:
invalidate in class CH.ifa.draw.standard.AbstractFigure

containsPoint

public boolean containsPoint(int x,
                             int y)
Specified by:
containsPoint in interface CH.ifa.draw.framework.Figure
Overrides:
containsPoint in class CH.ifa.draw.standard.AbstractFigure

canConnect

public boolean canConnect()
Specified by:
canConnect in interface CH.ifa.draw.framework.Figure
Overrides:
canConnect in class CH.ifa.draw.standard.AbstractFigure

findFigure

public CH.ifa.draw.framework.Figure findFigure(int x,
                                               int y)
Overrides:
findFigure in class CH.ifa.draw.standard.CompositeFigure

findFigureInside

public CH.ifa.draw.framework.Figure findFigureInside(int x,
                                                     int y)
Specified by:
findFigureInside in interface CH.ifa.draw.framework.Figure
Overrides:
findFigureInside in class CH.ifa.draw.standard.CompositeFigure

layoutTag

public void layoutTag()
Layouts the tag. Invoked everytime something changes the tag (moving, resize, rotate). Does the following:
- layout/determine the size of the content
- set the origin of the content point in tag coordinates
- determine own size
- determine appropriate size for the presentation figure
- create display boxes for both and transform them to world coordinates

Specified by:
layoutTag in interface LayoutableTag

getLayouter

public TagLayouter getLayouter()
Gets the the layouter is responsible for laying out the tag content.

Specified by:
getLayouter in interface LayoutableTag

setLayouter

public void setLayouter(TagLayouter layouter)
Sets the the layouter is responsible for laying out the tag content.

Specified by:
setLayouter in interface LayoutableTag

positionDisplayBox

protected java.awt.Rectangle positionDisplayBox(java.awt.Rectangle rect)
Positions the display box of the tag relative to its parent figure.

Parameters:
rect - Rectangle object that contains the size of the figure
Returns:
The new display box rectangle of the presentation figure

getOrigin

public java.awt.Point getOrigin()
Gets the origin.


setOrigin

public void setOrigin(java.awt.Point origin)
Sets the origin.


getAngle

public double getAngle()
Gets the rotation angle.


setAngle

public void setAngle(double angle)
Sets the rotation angle.


getCenterFigure

public CH.ifa.draw.framework.Figure getCenterFigure()
Gets the figure that forms the center of the rotation (usually the parent).


basicSetAngle

protected void basicSetAngle(double angle)
Sets the angle to the given one.


determine2WayOrientation

public Orientation determine2WayOrientation(boolean vertical)
Determines the 2-way orientation of the tag figure.

Parameters:
vertical - true: Return LEFT or RIGHT
false: Return TOP or BOTTOM
Returns:
Orientation.RIGHT/Orientation.BOTTOM/Orientation.LEFT/Orientation.TOP

getCenterFigureBox

public java.awt.Rectangle getCenterFigureBox()
Returns the display box of the center figure or null. Considers Expandable center figures also.

Returns:
The box or null if there is no center figure

compactDisplayBox

public java.awt.Rectangle compactDisplayBox()
Returns the display box of the presentation figure.

Specified by:
compactDisplayBox in interface Expandable

setDrawing

public void setDrawing(ProcessDrawing processDrawing)
Description copied from interface: VisualElement
Sets the drawing the element is a part of.

Specified by:
setDrawing in interface VisualElement

getDrawing

public ProcessDrawing getDrawing()
Description copied from interface: VisualElement
Gets the drawing the element is a part of.

Specified by:
getDrawing in interface VisualElement

getParentElement

public VisualElement getParentElement()
Description copied from interface: VisualElement
Gets parent element of this element, if any.

Specified by:
getParentElement in interface VisualElement

getPresentationFigure

public CH.ifa.draw.framework.Figure getPresentationFigure()
Description copied from interface: VisualElement
Gets the presentation figure of this element.

Specified by:
getPresentationFigure in interface VisualElement
Returns:
The presentation figure
Note that this can be the visual element itself if it does not have a separate presentation figure

updatePresentationFigure

public void updatePresentationFigure()
Description copied from interface: VisualElement
Updates (reinitializes) the presentation figure.

Specified by:
updatePresentationFigure in interface VisualElement

isVisible

public boolean isVisible()
Description copied from interface: VisualElement
Gets the flag if the element is currently visible.

Specified by:
isVisible in interface VisualElement

setVisible

public void setVisible(boolean visible)
Description copied from interface: VisualElement
Sets the flag if the element is currently visible.

Specified by:
setVisible in interface VisualElement

getVisualStatus

public int getVisualStatus()
Gets the visual status as defined by VisualElement


setVisualStatus

public void setVisualStatus(int visualStatus)
Sets the visual status as defined by VisualElement


handleEvent

public boolean handleEvent(VisualElementEvent event)
Description copied from interface: VisualElement
Handler method that is called for handling events. Events can be cursor events, selection events etc.

Specified by:
handleEvent in interface VisualElement
Parameters:
event - Event that desribes the event
Returns:
true: The event was handled by the element.
false: No special handling, perform the default handling.

updateFigure

public void updateFigure()
Causes all UpdatableFigure children to updateFigure.

Specified by:
updateFigure in interface UpdatableFigure

getParent

public CH.ifa.draw.framework.Figure getParent()
Description copied from interface: ChildFigure
Gets the parent figure of this figure.

Specified by:
getParent in interface ChildFigure
Returns:
The parent or null if the figure does not have a parent

setParent

public void setParent(CH.ifa.draw.framework.Figure parent)
Description copied from interface: ChildFigure
Sets the parent figure of this figure.

Specified by:
setParent in interface ChildFigure
Parameters:
parent - The parent or null if the figure does not have a parent

getShadow

public CH.ifa.draw.framework.Figure getShadow()
Description copied from interface: ShadowDropper
Returns the shadow figure of this object.

Specified by:
getShadow in interface ShadowDropper
Returns:
The shadow figure or null if this object does not have a shadow

setFillColor

public void setFillColor(java.awt.Color color)

getFillColor

public java.awt.Color getFillColor()

read

public void read(CH.ifa.draw.util.StorableInput dr)
Specified by:
read in interface CH.ifa.draw.util.Storable
Overrides:
read in class CH.ifa.draw.standard.CompositeFigure

write

public void write(CH.ifa.draw.util.StorableOutput dw)
Specified by:
write in interface CH.ifa.draw.util.Storable
Overrides:
write in class CH.ifa.draw.standard.CompositeFigure

dragActionTriggered

public void dragActionTriggered(java.lang.Object regionId,
                                java.awt.Point p)
Description copied from interface: InteractionClient
Called to signal additional actions, such as hovering for a certain time over the region.

Specified by:
dragActionTriggered in interface InteractionClient
Parameters:
regionId - Id of the region to import into (see BasicDropRegion.getId)
p - Current mouse position in screen coordinates

dragStarted

public void dragStarted(java.awt.datatransfer.Transferable transferable)
Description copied from interface: InteractionClient
Called when a dragging has been started.

Specified by:
dragStarted in interface InteractionClient
Parameters:
transferable - Transferable to be dragged

dragEnded

public void dragEnded(java.awt.datatransfer.Transferable transferable)
Description copied from interface: InteractionClient
called when a dragging has ended.

Specified by:
dragEnded in interface InteractionClient
Parameters:
transferable - Transferable that has been dragged

getAllDropRegions

public java.util.List getAllDropRegions(java.util.List flavors,
                                        java.awt.datatransfer.Transferable data,
                                        java.awt.event.MouseEvent mouseEvent)
Description copied from interface: InteractionClient
Returns a list of all regions of this client AND possible sub clients.

Specified by:
getAllDropRegions in interface InteractionClient
Parameters:
flavors - List of data flavors to check
data - Transferable to import
mouseEvent - Mouse event that initiated the drag action
Returns:
A list of DragAwareRegion object or null if the drop client or one of its sub clients cannot satisfy at least one of the supplied data flavors

getDropRegions

public java.util.List getDropRegions(java.util.List flavors,
                                     java.awt.datatransfer.Transferable data,
                                     java.awt.event.MouseEvent mouseEvent)
Description copied from interface: InteractionClient
Returns a list of drop regions of this client that are compatible with the provided data flavors.

Specified by:
getDropRegions in interface InteractionClient
Parameters:
flavors - List of data flavors to check
data - Transferable to be imported
mouseEvent - Mouse event that initiated the drag action
Returns:
A list of DragAwareRegion object or null if the drop client cannot satisfy at least one of the supplied data flavors.
The list will contain only regions that belong directly to this drop client.

getImportersAt

public java.util.List getImportersAt(java.awt.Point p)
Description copied from interface: InteractionClient
Returns all importers which will be accepted at the given point by this client.

Specified by:
getImportersAt in interface InteractionClient
Parameters:
p - Current mouse position in screen coordinates
Returns:
A list of Importer objects or null

getAllImportersAt

public java.util.List getAllImportersAt(java.awt.Point p)
Description copied from interface: InteractionClient
Returns all importers which will be accepted at the given point by this client or one of its sub clients.

Specified by:
getAllImportersAt in interface InteractionClient
Parameters:
p - Current mouse position in screen coordinates
Returns:
A list of Importer objects or null

getSubClients

public java.util.List getSubClients()
Description copied from interface: InteractionClient
Returns subordinate clients of this client.

Specified by:
getSubClients in interface InteractionClient
Returns:
A list of InteractionClient objects or null if this drop client doesn't have sub drop clients

importData

public boolean importData(java.lang.Object regionId,
                          java.awt.datatransfer.Transferable data,
                          java.awt.Point p)
Description copied from interface: InteractionClient
Imports the given transferable into the given region.

Specified by:
importData in interface InteractionClient
Parameters:
regionId - Id of the region to import into (see BasicDropRegion.getId)
data - Transferable to import
p - Drop point in glass coordinates
Returns:
true The data was successfully imported.
false An error occured while importing the data.


Copyright © 2011. All Rights Reserved.