org.zaval.lw
Class LwSplitPan

java.lang.Object
  |
  +--org.zaval.util.ValidationObject
        |
        +--org.zaval.lw.LwCanvas
              |
              +--org.zaval.lw.LwPanel
                    |
                    +--org.zaval.lw.LwSplitPan
All Implemented Interfaces:
Cursorable, Drawable, java.util.EventListener, Layoutable, LayoutContainer, LwComponent, LwComposite, LwContainer, LwLayout, LwMouseMotionListener, Validationable

public class LwSplitPan
extends LwPanel
implements LwMouseMotionListener, LwComposite, Cursorable, LwLayout

This split panel component is used to divide the container area into two resizeable areas. The container area can be divided by horizontal splitter or vertical splitter. The component implements and use special layout manager, so don't try to redefine the layout manager with any other.


Fields inherited from class org.zaval.lw.LwPanel
children
 
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
LwSplitPan(LwComponent f, LwComponent s)
          Constructs a split panel with the specified child components for the two splitter areas.
LwSplitPan(LwComponent f, LwComponent s, int o)
          Constructs a split panel with the specified child components for the two splitter areas and the given splitter type.
 
Method Summary
 java.awt.Dimension calcPreferredSize(LayoutContainer c)
          Calculates the preferred size dimension for the layout container.
 boolean catchInput(LwComponent child)
          Checks if input events for the specified child component should be caught.
 void componentAdded(java.lang.Object obj, Layoutable c, int index)
          Invoked when the specified layoutable component is added to the layout container (that uses the layout manager).
 void componentRemoved(Layoutable c, int index)
          Invoked when the specified layoutable component is removed from the layout container, that uses the layout manager.
 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.
protected  LwLayout getDefaultLayout()
          Gets the default layout manager that is set with the container during initialization.
 LwComponent getGripper()
          Gets the component that has been laid as the gripper.
 int getGripperLoc()
          Gets the gripper component location.
 int getOrientation()
          Gets the splitter type.
 void layout(LayoutContainer target)
          Lays out the child layoutable components inside the layout container.
 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 setGap(int g)
          Sets the specified gap.
 void setGripperLoc(int l)
          Sets the specified gripper component location.
 void setOrientation(int o)
          Sets the specified orientation.
 void startDragged(LwMouseMotionEvent e)
          Invoked when the mouse starts dragged.
 boolean stretchGripper()
          Tests if the gripper element is stretched over all available splitter room.
 void stretchGripper(boolean b)
          Sets the gripper element to be stretched or not over all available room.
 
Methods inherited from class org.zaval.lw.LwPanel
add, add, calcPreferredSize, count, get, getLayoutOffset, getLwComponentAt, getLwLayout, indexOf, insert, insert, invalidate, paintOnTop, recalc, remove, remove, removeAll, setBackground, setLwLayout, setOpaque, toFront, updateCashedPs
 
Methods inherited from class org.zaval.lw.LwCanvas
canHaveFocus, getBackground, getBounds, getHeight, getInsets, getLocation, getLwParent, getOrigin, getPreferredSize, getSize, getViewMan, getVisiblePart, getWidth, getX, getY, hasFocus, isEnabled, isOpaque, isVisible, paint, repaint, repaint, requestFocus, setEnabled, setInsets, setLocation, setLwParent, 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.lw.LwContainer
add, add, getLwLayout, indexOf, insert, paintOnTop, remove, removeAll, setLwLayout
 
Methods inherited from interface org.zaval.lw.LwComponent
canHaveFocus, getLwComponentAt, getLwParent, getViewMan, getVisiblePart, setBackground, setEnabled, setLwParent, setViewMan, setVisible
 
Methods inherited from interface org.zaval.lw.Drawable
getBackground, getOrigin, isEnabled, isOpaque, paint, repaint, repaint, setOpaque, update
 
Methods inherited from interface org.zaval.util.Validationable
invalidate, isValid, validate
 
Methods inherited from interface org.zaval.lw.Layoutable
getBounds, getHeight, getInsets, getLocation, getPreferredSize, getSize, getWidth, getX, getY, isVisible, setLocation, setSize
 
Methods inherited from interface org.zaval.lw.LayoutContainer
count, get, getLayoutOffset
 

Constructor Detail

LwSplitPan

public LwSplitPan(LwComponent f,
                  LwComponent s)
Constructs a split panel with the specified child components for the two splitter areas. The split panel will use LwToolkit.VERTICAL splitter as default.
Parameters:
f - the first child component.
s - the second child component.

LwSplitPan

public LwSplitPan(LwComponent f,
                  LwComponent s,
                  int o)
Constructs a split panel with the specified child components for the two splitter areas and the given splitter type.
Parameters:
f - the first child component.
s - the second child component.
d - the splitter type. The splitter type can have LwToolkit.VERTICAL or LwToolkit.HORIZONTAL value.
Method Detail

setGap

public void setGap(int g)
Sets the specified gap. The gap defines horizontal and vertical indents between child components and the container border.
Parameters:
g - the specified gap.

getOrientation

public int getOrientation()
Gets the splitter type.
Returns:
a splitter type.

setOrientation

public void setOrientation(int o)
Sets the specified orientation. It is possible to use LwToolkit.VERTICAL or LwToolkit.HORIZONTAL as the property value.
Parameters:
o - the specified orientation.

stretchGripper

public boolean stretchGripper()
Tests if the gripper element is stretched over all available splitter room.
Returns:
true if the gripper element is stretched over all available room.

stretchGripper

public void stretchGripper(boolean b)
Sets the gripper element to be stretched or not over all available room.
Parameters:
b - use true to stretch the gripper element over all available room.

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.

catchInput

public boolean catchInput(LwComponent child)
Description copied from interface: LwComposite
Checks if input events for the specified child component should be caught.
Specified by:
catchInput in interface LwComposite
Following copied from interface: org.zaval.lw.LwComposite
Parameters:
child - the specified child component.
Returns:
true if input events for the child component should be caught by this component; false otherwise.

getGripper

public LwComponent getGripper()
Gets the component that has been laid as the gripper.
Returns:
a gripper component.

setGripperLoc

public void setGripperLoc(int l)
Sets the specified gripper component location.
Parameters:
l - the specified gripper component location.

getGripperLoc

public int getGripperLoc()
Gets the gripper component location.
Returns:
a gripper component location.

calcPreferredSize

public java.awt.Dimension calcPreferredSize(LayoutContainer c)
Calculates the preferred size dimension for the layout container. The method calculates "pure" preferred size, it means that an insets of the container is not considered.
Specified by:
calcPreferredSize in interface LwLayout
Parameters:
c - the layout container.

layout

public void layout(LayoutContainer target)
Lays out the child layoutable components inside the layout container.
Specified by:
layout in interface LwLayout
Parameters:
target - the layout container that needs to be laid out.

componentAdded

public void componentAdded(java.lang.Object obj,
                           Layoutable c,
                           int index)
Description copied from interface: LwLayout
Invoked when the specified layoutable component is added to the layout container (that uses the layout manager). The specified constraints, layoutable component and child index are passed as arguments into the method.
Specified by:
componentAdded in interface LwLayout
Following copied from interface: org.zaval.lw.LwLayout
Parameters:
id - the layoutable component constraints.
lw - the layoutable component that has been added.
index - the child index.

componentRemoved

public void componentRemoved(Layoutable c,
                             int index)
Description copied from interface: LwLayout
Invoked when the specified layoutable component is removed from the layout container, that uses the layout manager.
Specified by:
componentRemoved in interface LwLayout
Following copied from interface: org.zaval.lw.LwLayout
Parameters:
lw - the layoutable component that has been removed.
index - the child component index.

getDefaultLayout

protected LwLayout getDefaultLayout()
Description copied from class: LwPanel
Gets the default layout manager that is set with the container during initialization. This implementation of the method returns LwRastLayout as the default layout manager, the layout manager is got as a static object by "layout.raster" key.
Overrides:
getDefaultLayout in class LwPanel
Following copied from class: org.zaval.lw.LwPanel
Returns:
a layout manager.


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