org.zaval.lw.grid
Class LwGridCaption

java.lang.Object
  |
  +--org.zaval.util.ValidationObject
        |
        +--org.zaval.lw.LwCanvas
              |
              +--org.zaval.lw.grid.LwGridCaption
All Implemented Interfaces:
Cursorable, Drawable, java.util.EventListener, Layoutable, LwComponent, LwMouseMotionListener, Validationable

public class LwGridCaption
extends LwCanvas
implements LwMouseMotionListener, Cursorable

This component is used as the top grid component caption with a custom views. The list below desribes basic features of the component:


Field Summary
static int DEF_ROWHEIGHT
          The default row height.
 
Fields inherited from class org.zaval.lw.LwCanvas
bits, height, insets, parent, psHeight, psWidth, skins, width, x, y
 
Fields inherited from class org.zaval.util.ValidationObject
isValidFlag
 
Constructor Summary
LwGridCaption(LwGridMetrics m)
          Constructs the object with the specified grid metrics.
 
Method Summary
protected  java.awt.Dimension calcPreferredSize()
          Gets the "pure" preferred size for this component.
 void endDragged(LwMouseMotionEvent e)
          Invoked when the mouse ends dragged.
 int getCursorType(LwComponent target, int x, int y)
          Gets the cursor type for the specified location of the given component.
 java.lang.Object getTitle(int col)
          Gets the title value for the specified column.
 void mouseDragged(LwMouseMotionEvent e)
          Invoked when a mouse button is pressed on a component and then dragged.
 void mouseMoved(LwMouseMotionEvent e)
          Invoked when the mouse pointer has been moved on a light weight component (with no buttons no down).
 void paint(java.awt.Graphics g)
          Paints this component.
 void putTitle(int col, java.lang.Object title)
          Sets the given title value for the specified column.
protected  void recalc()
          Invoked with validate method only if the component is not valid.
 void setBorderView(LwView v)
          Sets the specified view to render the caption border.
 void setViewProvider(LwGridViewProvider p)
          Sets the specified view provider.
 void startDragged(LwMouseMotionEvent e)
          Invoked when the mouse starts dragged.
 
Methods inherited from class org.zaval.lw.LwCanvas
canHaveFocus, getBackground, getBounds, getHeight, getInsets, getLocation, getLwComponentAt, getLwParent, getOrigin, getPreferredSize, getSize, getViewMan, getVisiblePart, getWidth, getX, getY, hasFocus, invalidate, isEnabled, isOpaque, isVisible, repaint, repaint, requestFocus, setBackground, setEnabled, setInsets, setLocation, setLwParent, setOpaque, setPSSize, setSize, setViewMan, setVisible, toString, update, validate, viewManChanged, vrp
 
Methods inherited from class org.zaval.util.ValidationObject
isValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zaval.util.Validationable
isValid
 

Field Detail

DEF_ROWHEIGHT

public static final int DEF_ROWHEIGHT
The default row height.
Constructor Detail

LwGridCaption

public LwGridCaption(LwGridMetrics m)
Constructs the object with the specified grid metrics.
Parameters:
m - the specified grid metrics.
Method Detail

setBorderView

public void setBorderView(LwView v)
Sets the specified view to render the caption border.
Parameters:
p - the specified view .

setViewProvider

public void setViewProvider(LwGridViewProvider p)
Sets the specified view provider. The provider defines cells views for the caption component. The class sets LwDefViews as the default view provider.
Parameters:
p - the specified view provider.

getTitle

public java.lang.Object getTitle(int col)
Gets the title value for the specified column.
Parameters:
col - the specified column.
Returns:
a title value.

putTitle

public void putTitle(int col,
                     java.lang.Object title)
Sets the given title value for the specified column. It is possible to use null value as the title value.
Parameters:
col - the specified column.
title - the specified title value.

startDragged

public void startDragged(LwMouseMotionEvent e)
Description copied from interface: LwMouseMotionListener
Invoked when the mouse starts dragged.
Specified by:
startDragged in interface LwMouseMotionListener
Following copied from interface: org.zaval.lw.event.LwMouseMotionListener
Parameters:
e - the specified mouse motion event.

endDragged

public void endDragged(LwMouseMotionEvent e)
Description copied from interface: LwMouseMotionListener
Invoked when the mouse ends dragged.
Specified by:
endDragged in interface LwMouseMotionListener
Following copied from interface: org.zaval.lw.event.LwMouseMotionListener
Parameters:
e - the specified mouse motion event.

mouseDragged

public void mouseDragged(LwMouseMotionEvent e)
Description copied from interface: LwMouseMotionListener
Invoked when a mouse button is pressed on a component and then dragged. Mouse drag events will continue to be delivered to the component where the first originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).
Specified by:
mouseDragged in interface LwMouseMotionListener
Following copied from interface: org.zaval.lw.event.LwMouseMotionListener
Parameters:
e - the specified mouse motion event.

mouseMoved

public void mouseMoved(LwMouseMotionEvent e)
Description copied from interface: LwMouseMotionListener
Invoked when the mouse pointer has been moved on a light weight component (with no buttons no down).
Specified by:
mouseMoved in interface LwMouseMotionListener
Following copied from interface: org.zaval.lw.event.LwMouseMotionListener
Parameters:
e - the specified mouse motion event.

getCursorType

public int getCursorType(LwComponent target,
                         int x,
                         int y)
Description copied from interface: Cursorable
Gets the cursor type for the specified location of the given component. It is supposed to use set of cursors that is provided with java.awt.Cursor class.
Specified by:
getCursorType in interface Cursorable
Following copied from interface: org.zaval.lw.Cursorable
Parameters:
target - the given component.
x - the x coordinate of the location.
y - the y coordinate of the location.
Returns:
a cursor type.

paint

public void paint(java.awt.Graphics g)
Description copied from class: LwCanvas
Paints this component. You can use the method to define a face of the component
Overrides:
paint in class LwCanvas
Following copied from class: org.zaval.lw.LwCanvas
Parameters:
g - the graphics context to be used for painting.

recalc

protected void recalc()
Description copied from class: LwCanvas
Invoked with validate method only if the component is not valid. The method shoud be overrided to calculate metrical characteristics of the component to minimize computation time of the preferred size for the component. For example, you can calculate a preferred size inside the method and just return it by calcPreferredSize method.
Overrides:
recalc in class LwCanvas

calcPreferredSize

protected java.awt.Dimension calcPreferredSize()
Description copied from class: LwCanvas
Gets the "pure" preferred size for this component. The method should be overrided to define the component preferred size. Don't use insets to calculate the preferred size, the insets will be added with getPreferredSize method.
Overrides:
calcPreferredSize in class LwCanvas
Following copied from class: org.zaval.lw.LwCanvas
Returns:
a "pure" preferred size.


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