org.openbp.jaspira.gui.interaction
Class ViewDropRegion

java.lang.Object
  extended by org.openbp.jaspira.gui.interaction.BasicDropRegion
      extended by org.openbp.jaspira.gui.interaction.ViewDropRegion
All Implemented Interfaces:
DragAwareRegion

public class ViewDropRegion
extends BasicDropRegion

Drop region that takes works on a view component. Takes into account the particularities of JScrollPane wrapping the view.

Author:
Stephan Moritz

Field Summary
protected  java.awt.Rectangle clipRect
          Clip rectangle
 
Fields inherited from class org.openbp.jaspira.gui.interaction.BasicDropRegion
id, origin, parent, toolTipText
 
Fields inherited from interface org.openbp.jaspira.gui.interaction.DragAwareRegion
COPY, COPY_OR_MOVE, MOVE, NONE
 
Constructor Summary
ViewDropRegion(java.lang.Object id, InteractionClient parent, java.awt.geom.RectangularShape shape, java.awt.Component origin)
          Convenience constructor.
 
Method Summary
 void draw(java.awt.Graphics2D g)
          Draws the region with the given attributes.
 boolean reactsOn(int x, int y)
          Checks if the given coordinates are within the shapes region.
 
Methods inherited from class org.openbp.jaspira.gui.interaction.BasicDropRegion
canImport, dragEnter, dragExit, getBounds, getCursor, getFrameColor, getId, getOrigin, getOverlay, getPaint, getParent, getShape, getStroke, getToolTipText, importData, setCursor, setFrameColor, setId, setOrigin, setOverlay, setPaint, setParent, setShape, setStroke, setToolTipText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clipRect

protected java.awt.Rectangle clipRect
Clip rectangle

Constructor Detail

ViewDropRegion

public ViewDropRegion(java.lang.Object id,
                      InteractionClient parent,
                      java.awt.geom.RectangularShape shape,
                      java.awt.Component origin)
Convenience constructor.

Method Detail

reactsOn

public boolean reactsOn(int x,
                        int y)
Checks if the given coordinates are within the shapes region.

Specified by:
reactsOn in interface DragAwareRegion
Overrides:
reactsOn in class BasicDropRegion
Parameters:
x - Position in screen coordinates
y - Position in screen coordinates

draw

public void draw(java.awt.Graphics2D g)
Draws the region with the given attributes.

Specified by:
draw in interface DragAwareRegion
Overrides:
draw in class BasicDropRegion
Parameters:
g - Graphics context


Copyright © 2011. All Rights Reserved.