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.
-
LineSelection(Component)
- Create a LineSelection in the default style and size.
-
LineSelection(int, int, Component)
- Create a LineSelection beginning at the specified point.
-
LineSelection(int, int, int, int, Component)
- Create a LineSelection beginning with the specified vertex and dimensions.
-
LineSelection(Point, Component)
- Create a LineSelection beginning at the specified point.
-
draw(Graphics)
- Draw the LineSelection at its current location.
-
getColor()
- Get the color of this LineSelection.
-
getThickness()
- Get the current LineSelection's line thickness.
-
hide()
-
-
isVisible()
- Tell if the LineSelection is visible
-
move(int, int)
- Move this LineSelection to the coordinate (x,y) in the parent's coordinate
space.
-
setColor(Color)
- Set the color for this LineSelection.
-
setThickness(int)
- Set the thickness for this LineSelection.
-
show(boolean)
- Show or hide this LineSelection according t
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.
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.
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.
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.
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
getColor
public Color getColor()
- Get the color of this LineSelection.
- Returns:
- The Color used to draw the LineSelection.
getThickness
public int getThickness()
- Get the current LineSelection's line thickness.
- Returns:
- The thicknes of the LineSelection.
hide
public void hide()
isVisible
public boolean isVisible()
- Tell if the LineSelection is visible
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
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.
setThickness
public void setThickness(int thickness)
- Set the thickness for this LineSelection. The associated component
will repaint.
- Parameters:
- thickness - Thickness to set.
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