Class DragWell
All Packages Class Hierarchy This Package Previous Next Index
Class DragWell
public class netscape.application.DragWell
extends netscape.application.View
implements netscape.application.DragSource
{
/* Constructors
*/
public DragWell();
public DragWell(Rect);
public DragWell(int, int, int, int);
/* Methods
*/
public Border border();
public Object data();
public String dataType();
public void decode(Decoder);
public void describeClassInfo(ClassInfo);
public void dragWasAccepted(DragSession);
public boolean dragWasRejected(DragSession);
public void drawView(Graphics);
public void encode(Encoder);
public Image image();
public boolean isEnabled();
public boolean isTransparent();
public boolean mouseDown(MouseEvent);
public void setBorder(Border);
public void setData(Object);
public void setDataType(String);
public void setEnabled(boolean);
public void setImage(Image);
public View sourceView(DragSession);
}
View subclass that vends drag-and-droppable items. Unless changed, the
DragWell vends the same data each time the user clicks and drags from
the DragWell.
Constructors
DragWell
public DragWell()
- Constructs a DragWell with origin (0, 0) and zero width
and height
DragWell
public DragWell(Rect rect)
- Constructs a DragWell with bounds rect.
DragWell
public DragWell(int x,
int y,
int width,
int height)
- Constructs a DragWell
with bounds (x, y, width, height).
Methods
isTransparent
public boolean isTransparent()
- Overriden to return false.
- Overrides:
- isTransparent in class View
setImage
public void setImage(Image anImage)
- Sets the DragWell's Image, the Image it displays within its bounds,
and then calls its
draw() method to redraw it. If you do not want to immediately
redraw the DragWell, you should first call its
disableDrawing() method.
- See Also:
- disableDrawing
image
public Image image()
- Returns the DragWell's Image.
- See Also:
- setImage
setDataType
public void setDataType(String dataType)
- Sets the type of the data represented by the DragWell's Image.
- See Also:
- setDataType
dataType
public String dataType()
- Returns the type of the data represented by the DragWell's Image.
- See Also:
- setDataType
setData
public void setData(Object anObject)
- Sets the object represented by the DragWell's Image. When the user
clicks the DragWell, the DragWell initiates a DragSession displaying
the DragWell's Image and containing the DragWell's data.
data
public Object data()
- Returns the object represented by the DragWell's Image.
- See Also:
- setData
setEnabled
public void setEnabled(boolean flag)
- Disables or enables the DragWell, and calls draw() to redraw it.
A disabled DragWell does not respond to mouse clicks.
If you do not want to immediately
redraw the DragWell, you should first call its
disableDrawing() method.
- See Also:
- disableDrawing
isEnabled
public boolean isEnabled()
- Returns true if the DragWell is enabled.
- See Also:
- setEnabled
setBorder
public void setBorder(Border newBorder)
- Sets the DragWell's Border.
- See Also:
- Border
border
public Border border()
- Returns the DragWell's Border.
- See Also:
- setBorder
mouseDown
public boolean mouseDown(MouseEvent event)
- Initiates a DragSession where the user can drag the DragWell's
data, unless the DragWell is disabled (in which case nothing
happens).
- Returns:
- false if disabled, true otherwise.
- Overrides:
- mouseDown in class View
- See Also:
- setEnabled
drawView
public void drawView(Graphics g)
- Draws the DragWell by drawing its Border, filled with the DragWell's
Image.
- Overrides:
- drawView in class View
sourceView
public View sourceView(DragSession session)
- DragSource support method.
- See Also:
- sourceView
dragWasAccepted
public void dragWasAccepted(DragSession session)
- DragSource support method.
- See Also:
- dragAccepted
dragWasRejected
public boolean dragWasRejected(DragSession session)
- DragSource support method.
- See Also:
- dragRejected
describeClassInfo
public void describeClassInfo(ClassInfo info)
- Describes the DragWell class' information.
- Overrides:
- describeClassInfo in class View
- See Also:
- describeClassInfo
encode
public void encode(Encoder encoder) throws CodingException
- Encodes the DragWell instance.
- Overrides:
- encode in class View
- See Also:
- encode
decode
public void decode(Decoder decoder) throws CodingException
- Decodes the DragWell instance.
- Overrides:
- decode in class View
- See Also:
- decode
All Packages Class Hierarchy This Package Previous Next Index