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

## ru.biosoft.graphics
Class View

Direct Known Subclasses:
  CompositeView, HtmlView, ImageView, LineView, ShapeView, TextView

public abstract class View

Base class for vizualization.

Field Summary
`final static int` | `ACTIVE` Bit field of type.It is set, if the view can be selected.
`final static int` | `BASELINE` Alignment mode.
`final static int` | `BOTTOM` Alignment mode.
`final static int` | `CENTER` Alignment mode.
`final static int` | `HIDE` Bit field of type.It is set, if the view has visible state.
`final static int` | `LEFT` Alignment mode.
`final static int` | `RIGHT` Alignment mode.
`final static int` | `TOP` Alignment mode.

Constructor Summary
`View(Shape shape)` Constructs View using specified Shape

Method Summary
`Rectangle` | `getBounds()` Returns an integer Rectangle that completely encloses the `View`.
`Object` | `getModel()` Returns model of view
`Shape` | `getShape()` Returns shape of `View`.
`boolean` | `intersects(Rectangle rect)` Tests if this View's shape intersects the interior of a specified rectangle.
`boolean` | `isActive()` Returns `true` if view is active
`boolean` | `isVisible()` Returns `true` if view is visible
`abstract void` | `move(int x, int y)` Moves View to the new location using specified offsets.
`void` | `move(Point offset)` Moves View to the new location using specified offset.
`void` | `paint(Graphics2D g2)` Paints this view on specified Graphics2D.
`void` | `scale(double sx, double sy)` Scales view in relation to old values.
`void` | `setActive(boolean isActive)` Sets active state of view
`void` | `setLocation(int x, int y)` Set the location of the upper left corner of the view x, y coordinates.
`void` | `setLocation(Point pt)` Set the location of the upper left corner of the view x, y coordinates.
`void` | `setModel(Object model)` Sets model of view
`void` | `setToScale(double factorX, double factorY)` Scales view absolutely.
`void` | `setVisible(boolean isVisible)` Sets visible state of view
`void` | `updateBounds()` Synchronizes the `Rectangle` rectangle returned by getBounds() with view.

Field Detail

### ACTIVE

    public final static int ACTIVE

  Bit field of type.It is set, if the view can be selected.

### BASELINE

    public final static int BASELINE

  Alignment mode.

### BOTTOM

    public final static int BOTTOM

  Alignment mode.

### CENTER

    public final static int CENTER

  Alignment mode.

### HIDE

    public final static int HIDE

  Bit field of type.It is set, if the view has visible state.

### LEFT

    public final static int LEFT

  Alignment mode.

### RIGHT

    public final static int RIGHT

  Alignment mode.

### TOP

    public final static int TOP

  Alignment mode.

Constructor Detail

### View

    public View(Shape shape)

  Constructs View using specified Shape
  Parameters:
    shape - Shape of view
  See Also:
    Shape

Method Detail

### getBounds

    public Rectangle getBounds()

  Returns an integer Rectangle that completely encloses the `View`.
  Returns: an integer Rectangle that completely encloses the `View`.

### getModel

    public Object getModel()

  Returns model of view
  Returns: model of view
  See Also:
    model

### getShape

    public Shape getShape()

  Returns shape of `View`.
  Returns: Shape of the `View`.

### intersects

    public boolean intersects(Rectangle rect)

  Tests if this View's shape intersects the interior of a specified rectangle.
  Parameters:
    rect - specified rectangle
  Returns: `true` if intersects,`false` otherwise

### isActive

    public boolean isActive()

  Returns `true` if view is active
  Returns: `true` if view is active

### isVisible

    public boolean isVisible()

  Returns `true` if view is visible
  Returns: `true` if view is visible

### move

    public abstract void move(int x, int y)

  Moves View to the new location using specified offsets.
  Parameters:
    x - offset along the X axis direction.
    y - offset along the Y axis direction.

### move

    public void move(Point offset)

  Moves View to the new location using specified offset.
  Parameters:
    offset - Point that units both coordinates.

### paint

    public void paint(Graphics2D g2)

  Paints this view on specified Graphics2D.
  Parameters:
    g2 - specified Graphics2D.

### scale

    public void scale(double sx, double sy)

  Scales view in relation to old values.
  Parameters:
    sx - the factor by which coordinates are scaled along the X axis direction
    sy - the factor by which coordinates are scaled along the Y axis direction

### setActive

    public void setActive(boolean isActive)

  Sets active state of view
  Parameters:
    isActive - new active value

### setLocation

    public void setLocation(int x, int y)

  Set the location of the upper left corner of the view x, y coordinates.
  Parameters:
    x - new coordinate along X axis
    y - new coordinate along Y axis

### setLocation

    public void setLocation(Point pt)

  Set the location of the upper left corner of the view x, y coordinates.
  Parameters:
    pt - Point of new location

### setModel

    public void setModel(Object model)

  Sets model of view
  Parameters:
    model - New model
  See Also:
    model

### setToScale

    public void setToScale(double factorX, double factorY)

  Scales view absolutely.
  Parameters:
    factorX - sets factor along the X axis direction
    factorY - sets factor along the Y axis direction

### setVisible

    public void setVisible(boolean isVisible)

  Sets visible state of view
  Parameters:
    isVisible - new value of visible flag

### updateBounds

    public void updateBounds()

  Synchronizes the `Rectangle` rectangle returned by getBounds() with view. Base implementation of method does nothing.

Association Links

to Class java.awt.Shape

  Shape of view

to Class java.awt.geom.AffineTransform

  Affine transformer of view

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

BOTTOM