org.zaval.lw
Interface Layoutable

All Known Subinterfaces:
Drawable, LayoutContainer, LwComponent, LwComposite, LwContainer, LwDesktop, LwLayer

public interface Layoutable

This is basic interface for components that are going to be laidout with the library layout managers. The main purpose of the interface to separate layouting functionality from the lightweight component functionality. It means that it is possible to re-use the set of layout managers that is provided with the library for any other components. It just necessary to implement the interface.


Method Summary
 java.awt.Rectangle getBounds()
          Gets the bounds of this component.
 int getHeight()
          Gets the height of this component.
 java.awt.Insets getInsets()
          Determines the insets of this component.
 java.awt.Point getLocation()
          Gets the location of this component point specifying the component top-left corner.
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of this component.
 java.awt.Dimension getSize()
          Returns a size of this component.
 int getWidth()
          Gets the width of this component.
 int getX()
          Gets the x location of this component specifying the component top-left corner.
 int getY()
          Gets the y location of this component specifying the component top-left corner.
 boolean isVisible()
          Determines if this component is visible.
 void setLocation(int x, int y)
          Sets a new location for this component.
 void setSize(int w, int h)
          Sets the specified size for this component.
 

Method Detail

getLocation

public java.awt.Point getLocation()
Gets the location of this component point specifying the component top-left corner. The location is relative to the parent component coordinate space.
Returns:
an instance of Point representing the top-left corner of the component bounds in the coordinate space of the component parent.

getX

public int getX()
Gets the x location of this component specifying the component top-left corner. The location is relative to the parent component coordinate space.
Returns:
an x coordinate representing the top-left corner of the component bounds in the coordinate space of the component parent.

getY

public int getY()
Gets the y location of this component specifying the component top-left corner. The location is relative to the parent component coordinate space.
Returns:
an y coordinate representing the top-left corner of the component bounds in the coordinate space of the component parent.

getWidth

public int getWidth()
Gets the width of this component.
Returns:
a width of the component.

getHeight

public int getHeight()
Gets the height of this component.
Returns:
a height of the component.

setLocation

public void setLocation(int x,
                        int y)
Sets a new location for this component. The top-left corner of the new location is specified by the x and y parameters in the coordinate space of this component parent.
Parameters:
x - the x-coordinate of the new location top-left corner in the parent coordinate space.
y - the y-coordinate of the new location top-left corner in the parent's coordinate space.

getSize

public java.awt.Dimension getSize()
Returns a size of this component. The size is reperesented with java.awt.Dimension class.
Returns:
a Dimension object that indicates the size of this component.

setSize

public void setSize(int w,
                    int h)
Sets the specified size for this component.
Parameters:
width - the width of this component.
height - the height of this component.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of this component.
Returns:
a dimension object indicating this component preferred size.

isVisible

public boolean isVisible()
Determines if this component is visible. The component is visible if the visibility flag is true.
Returns:
true if the component is visible; false otherwise.

getBounds

public java.awt.Rectangle getBounds()
Gets the bounds of this component. The bounds is represented with java.awt.Rectangle class.
Returns:
a rectangle indicating this component's bounds.

getInsets

public java.awt.Insets getInsets()
Determines the insets of this component. Take care that insets for lightweight components differ from Java AWT components. The lightweight insets defines indents from "left", "top", "right" and "bottom" of the component view.
Returns:
an insets of this component.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org