Class ncsa.horizon.awt.LineSelection
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.horizon.awt.LineSelection

java.lang.Object
   |
   +----java.awt.Rectangle
           |
           +----ncsa.horizon.awt.Line
                   |
                   +----ncsa.horizon.awt.LineSelection

public class LineSelection
extends Line
A user-selected line segment for a Component. The LineSelection can be created, moved, resized, etc. by calling the appropriate methods. It is up to the calling application to implement the user action interface to the routines. E.g., create the LineSelection on mouse button down, extend the size on mouse drag, and return a completed LineSelection on mouse up.

The LineSelection neither generates nor receives events. It can be thought of as a simple decorational widget than knows its location and state, can draw itself given a graphics context, and can be manipulated and queried through method calls. It is the responsibility of the parent component to ask the Cursor to draw/redraw itself.


Constructor Index

 o LineSelection(Component)
Create a LineSelection in the default style and size.
 o LineSelection(int, int, Component)
Create a LineSelection beginning at the specified point.
 o LineSelection(int, int, int, int, Component)
Create a LineSelection beginning with the specified vertex and dimensions.
 o LineSelection(Point, Component)
Create a LineSelection beginning at the specified point.

Method Index

 o draw(Graphics)
Draw the LineSelection at its current location.
 o getColor()
Get the color of this LineSelection.
 o getThickness()
Get the current LineSelection's line thickness.
 o hide()
 o isVisible()
Tell if the LineSelection is visible
 o move(int, int)
Move this LineSelection to the coordinate (x,y) in the parent's coordinate space.
 o setColor(Color)
Set the color for this LineSelection.
 o setThickness(int)
Set the thickness for this LineSelection.
 o show(boolean)
Show or hide this LineSelection according t

Constructors

 o LineSelection
  public LineSelection(Component _component)
Create a LineSelection in the default style and size. The Line selected is start at (0. 0), with x, y component 0, 0.
Parameters:
_component - The component to attach the LineSelection to.
 o LineSelection
  public LineSelection(Point p,
                       Component _component)
Create a LineSelection beginning at the specified point.
Parameters:
p - The point defining a vertex of the region.
_component - The component to attach the LineSelection to.
 o LineSelection
  public LineSelection(int _x,
                       int _y,
                       Component _component)
Create a LineSelection beginning at the specified point.
Parameters:
x - The x value of the location of one vertex of the region.
y - The y value of the location of one vertex of the region.
_component - The component to attach the LineSelection to.
 o LineSelection
  public LineSelection(int _x,
                       int _y,
                       int _width,
                       int _height,
                       Component _component)
Create a LineSelection beginning with the specified vertex and dimensions.
Parameters:
x - The x value of the location of one vertex of the region.
y - The y value of the location of one vertex of the region.
width - The width of the region.
height - The height of the region.
_component - The component to attach the LineSelection to.

Methods

 o draw
  public void draw(Graphics g)
Draw the LineSelection at its current location. It is the responsibility of the applet/application to draw the LineSelection at the appropriate times, e.g., inside the component's update() and/or paint() method. This gives maximum flexibility for double buffering, etc.
Parameters:
g - The Graphics context to use for drawing.
Overrides:
draw in class Line
 o getColor
  public Color getColor()
Get the color of this LineSelection.
Returns:
The Color used to draw the LineSelection.
 o getThickness
  public int getThickness()
Get the current LineSelection's line thickness.
Returns:
The thicknes of the LineSelection.
 o hide
  public void hide()
 o isVisible
  public boolean isVisible()
Tell if the LineSelection is visible
 o move
  public void move(int _x,
                   int _y)
Move this LineSelection to the coordinate (x,y) in the parent's coordinate space. This calls the repaint() method of the LineSelection's component, which is ultimately responsible for calling the LineSelectio's draw() method.
Parameters:
_x - the x coordinate
_y - the y coordinate
Overrides:
move in class Rectangle
 o setColor
  public void setColor(Color color)
Set the color for this LineSelection. The associated component will repaint.
Parameters:
color - The Color to use to draw the LineSelection.
 o setThickness
  public void setThickness(int thickness)
Set the thickness for this LineSelection. The associated component will repaint.
Parameters:
thickness - Thickness to set.
 o show
  public void show(boolean b)
Show or hide this LineSelection according t
Parameters:
t - true to show, false to hide

All Packages  Class Hierarchy  This Package  Previous  Next  Index