Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class ncsa.horizon.awt.LineOfInterest

java.lang.Object
  |
  +--ncsa.horizon.awt.LineOfInterest

public class LineOfInterest
extends java.lang.Object
implements SelectionGraphics
A user-selected line segment for a Component.

The LineOfInterest 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 LineOfInterest on mouse button down, extend the size on mouse drag, and return a completed LineOfInterest on mouse up.

The LineOfInterest 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.


Field Summary
int height
           
int width
           
int x
           
int y
           
 
Constructor Summary
LineOfInterest()
          Create a LineOfInterest in the default style and size.
LineOfInterest(java.awt.Component _component)
          Create a LineOfInterest in the default style and size.
LineOfInterest(java.awt.Point p, java.awt.Component _component)
          Create a LineOfInterest beginning at the specified point.
LineOfInterest(int _x, int _y, java.awt.Component _component)
          Create a LineOfInterest beginning at the specified point.
LineOfInterest(int _x, int _y, int _width, int _height, java.awt.Component _component)
          Create a LineOfInterest beginning with the specified vertex and dimensions.
 
Method Summary
void draw(java.awt.Graphics g)
          Draw the LineOfInterest at its current location.
void drop()
          grab the line
void drop(int x, int y)
          grab the line at a specific point
java.awt.Color getColor()
          Get the color of this LineOfInterest.
Line getLine()
          return this LineOfInterest as a Line to show its geographic attributes.
java.awt.Point getOrigin()
          get the location of the Marker.
java.awt.Dimension getSize()
          get the size of the Marker
int getThickness()
          Get the current LineOfInterest's line thickness.
void grab()
          grab the line
void grab(int x, int y)
          grab the line at a specific point
void grow(int _x, int _y)
          grow the line to the given point
void hide()
          Deprecated. Hide the LineOfInterest from view.
boolean isGrabbed()
          return true if the line has been grabbed
boolean isVisible()
          Tell if the LineOfInterest is visible
int length()
          Return line length.
void move(int _x, int _y)
          Move this LineOfInterest to the coordinate (x,y) in the parent's coordinate space.
void resize(int delta_x, int delta_y)
          resize the line
void setColor(java.awt.Color color)
          Set the color for this LineOfInterest.
void setComponent(java.awt.Component component)
          Set the component.
void setOrigin(java.awt.Point p)
          set the location of the Marker.
void setSize(java.awt.Dimension d)
          set the size of the Marker
void setSize(int width, int height)
          set the size of the Marker
void setThickness(int thickness)
          Set the thickness for this LineOfInterest.
void setVisible(boolean b)
          set whether the line is visible
void show(boolean b)
          Deprecated. Show or hide this LineOfInterest according t
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

x

protected int x

y

protected int y

width

protected int width

height

protected int height
Constructor Detail

LineOfInterest

public LineOfInterest()
Create a LineOfInterest in the default style and size. The Line selected is start at (0. 0), with x, y component 0, 0. It is not attached to any Component.

LineOfInterest

public LineOfInterest(java.awt.Component _component)
Create a LineOfInterest 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 LineOfInterest to.

LineOfInterest

public LineOfInterest(java.awt.Point p,
                      java.awt.Component _component)
Create a LineOfInterest beginning at the specified point.
Parameters:
p - The point defining a vertex of the region.
_component - The component to attach the LineOfInterest to.

LineOfInterest

public LineOfInterest(int _x,
                      int _y,
                      java.awt.Component _component)
Create a LineOfInterest 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 LineOfInterest to.

LineOfInterest

public LineOfInterest(int _x,
                      int _y,
                      int _width,
                      int _height,
                      java.awt.Component _component)
Create a LineOfInterest 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 LineOfInterest to.
Method Detail

draw

public void draw(java.awt.Graphics g)
Draw the LineOfInterest at its current location. It is the responsibility of the applet/application to draw the LineOfInterest 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.

getColor

public java.awt.Color getColor()
Get the color of this LineOfInterest.
Specified by:
getColor in interface SelectionGraphics
Returns:
The Color used to draw the LineOfInterest.

getOrigin

public java.awt.Point getOrigin()
get the location of the Marker.
Specified by:
getOrigin in interface SelectionGraphics

setOrigin

public void setOrigin(java.awt.Point p)
set the location of the Marker. This is equivalent to move().
Specified by:
setOrigin in interface SelectionGraphics

getLine

public Line getLine()
return this LineOfInterest as a Line to show its geographic attributes.

getThickness

public int getThickness()
Get the current LineOfInterest's line thickness.
Specified by:
getThickness in interface SelectionGraphics
Returns:
The thicknes of the LineOfInterest.

setVisible

public void setVisible(boolean b)
set whether the line is visible
Specified by:
setVisible in interface SelectionGraphics

hide

public void hide()
Deprecated. use setVisible()
Hide the LineOfInterest from view.

isVisible

public boolean isVisible()
Tell if the LineOfInterest is visible
Specified by:
isVisible in interface SelectionGraphics

move

public void move(int _x,
                 int _y)
Move this LineOfInterest to the coordinate (x,y) in the parent's coordinate space. This calls the repaint() method of the LineOfInterest's component, which is ultimately responsible for calling the LineSelectio's draw() method.
Parameters:
_x - the x coordinate
_y - the y coordinate

setColor

public void setColor(java.awt.Color color)
Set the color for this LineOfInterest. The associated component will repaint.
Specified by:
setColor in interface SelectionGraphics
Parameters:
color - The Color to use to draw the LineOfInterest.

setComponent

public void setComponent(java.awt.Component component)
Set the component.

setThickness

public void setThickness(int thickness)
Set the thickness for this LineOfInterest. The associated component will repaint.
Specified by:
setThickness in interface SelectionGraphics
Parameters:
thickness - Thickness to set.

show

public void show(boolean b)
Deprecated. use setVisible()
Show or hide this LineOfInterest according t
Parameters:
t - true to show, false to hide

length

public int length()
Return line length.
Returns:
length of this Line.

grab

public void grab()
grab the line

grab

public void grab(int x,
                 int y)
grab the line at a specific point

isGrabbed

public boolean isGrabbed()
return true if the line has been grabbed

drop

public void drop()
grab the line

drop

public void drop(int x,
                 int y)
grab the line at a specific point

grow

public final void grow(int _x,
                       int _y)
grow the line to the given point

getSize

public java.awt.Dimension getSize()
get the size of the Marker
Specified by:
getSize in interface SelectionGraphics

setSize

public void setSize(java.awt.Dimension d)
set the size of the Marker
Specified by:
setSize in interface SelectionGraphics

setSize

public void setSize(int width,
                    int height)
set the size of the Marker

resize

public void resize(int delta_x,
                   int delta_y)
resize the line

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD