Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.common.awt
Class SplitterPanel  view SplitterPanel download SplitterPanel.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended bycom.flexstor.common.awt.SplitterPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

public class SplitterPanel
extends java.awt.Panel
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

A basic panel that supports a VERTICAL or HORIZONTAL splitter that may be moved with the mouse. This panel also supports a split type of NONE that will show the panel without a splitter. Ths splitter type may be changed by calling setSplitterType().

Version:
3.0

Nested Class Summary
(package private)  class SplitterPanel.Splitter
           
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  boolean bAutoLayout
           
private  java.awt.Component c1
           
private  java.awt.Component c2
           
private  SplitterPanel.Splitter fixed_splitter
           
static int HORIZONTAL
           
private  java.awt.Insets i1
           
private  java.awt.Insets i2
           
private static java.awt.Insets idefault
           
private  SplitterPanel.Splitter move_splitter
           
static int NONE
           
private  int outerH
           
private  int outerW
           
private  int splitX
           
private  int splitY
           
static int VERTICAL
           
 
Fields inherited from class java.awt.Panel
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SplitterPanel(int nSplitType)
          Creates a splitter panel with the desired splitter type.
 
Method Summary
 void doLayout()
          Layout the components in this container.
 java.awt.Component getComponent1()
          Returns the top component (HORIZONTAL splitter), the right component (VERTICAL splitter), or the only component (NONE spliter type).
 java.awt.Component getComponent2()
          Returns the bottom component (HORIZONTAL splitter) or left component (VERTICAL splitter).
 java.awt.Dimension getMinimumSize()
          Returns the minimum size of this container.
 java.awt.Dimension getPreferredSize()
          Returns the preferred size of this container.
 int getSplitLocation()
          Returns the current splitter location, or -1 if there is no current splitter.
 int getSplitterType()
          Returns the current splitter type.
 void mouseClicked(java.awt.event.MouseEvent e)
          This method is called when the mouse is clicked (pressed and released in short succession) on a component.
 void mouseDragged(java.awt.event.MouseEvent e)
          This method is called when the mouse is moved over a component while a button has been pressed.
 void mouseEntered(java.awt.event.MouseEvent e)
          This method is called when the mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent e)
          This method is called when the mouse exits a component.
 void mouseMoved(java.awt.event.MouseEvent e)
          This method is called when the mouse is moved over a component while no button is pressed.
 void mousePressed(java.awt.event.MouseEvent e)
          This method is called when the mouse is pressed over a component.
 void mouseReleased(java.awt.event.MouseEvent e)
          This method is called when the mouse is released over a component.
 void setAutoLayout(boolean bAutoLayout)
          Enables or disables the automatic calling of the doLayout() method after a call is made to setComponent1(), setComponent2(), or setSplitterType().
 void setBounds(int x, int y, int width, int height)
          Sets the bounding rectangle for this component to the specified values.
 void setComponent1(java.awt.Component c)
          Sets the top component (HORIZONTAL splitter), the right component (VERTICAL splitter), or the only component (NONE spliter type).
 void setComponent1Insets(java.awt.Insets i)
          Sets insets for the top component (HORIZONTAL splitter), the right component (VERTICAL splitter), or the only component (NONE spliter type).
 void setComponent2(java.awt.Component c)
          Sets the bottom component (HORIZONTAL splitter) or left component (VERTICAL splitter).
 void setComponent2Insets(java.awt.Insets i)
          Sets insets for the bottom component (HORIZONTAL splitter) or left component (VERTICAL splitter).
 void setSplitLocation(int nLoc)
          Sets the current splitter location.
 void setSplitterType(int nType)
          Sets the current splitter type.
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
See Also:
Constant Field Values

HORIZONTAL

public static final int HORIZONTAL
See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
See Also:
Constant Field Values

idefault

private static final java.awt.Insets idefault

outerW

private int outerW

outerH

private int outerH

splitX

private int splitX

splitY

private int splitY

bAutoLayout

private boolean bAutoLayout

i1

private java.awt.Insets i1

i2

private java.awt.Insets i2

c1

private java.awt.Component c1

c2

private java.awt.Component c2

move_splitter

private SplitterPanel.Splitter move_splitter

fixed_splitter

private SplitterPanel.Splitter fixed_splitter
Constructor Detail

SplitterPanel

public SplitterPanel(int nSplitType)
Creates a splitter panel with the desired splitter type.

Method Detail

setAutoLayout

public void setAutoLayout(boolean bAutoLayout)
Enables or disables the automatic calling of the doLayout() method after a call is made to setComponent1(), setComponent2(), or setSplitterType(). Calling setAutoLayout(false) may improve performance when more than one of these methods are called one after another, but you must rember to manually call doLayout() to in order to get this panel to properly repaint itself.


setComponent1

public void setComponent1(java.awt.Component c)
Sets the top component (HORIZONTAL splitter), the right component (VERTICAL splitter), or the only component (NONE spliter type).


setComponent2

public void setComponent2(java.awt.Component c)
Sets the bottom component (HORIZONTAL splitter) or left component (VERTICAL splitter).


setComponent1Insets

public void setComponent1Insets(java.awt.Insets i)
Sets insets for the top component (HORIZONTAL splitter), the right component (VERTICAL splitter), or the only component (NONE spliter type).


setComponent2Insets

public void setComponent2Insets(java.awt.Insets i)
Sets insets for the bottom component (HORIZONTAL splitter) or left component (VERTICAL splitter).


getComponent1

public java.awt.Component getComponent1()
Returns the top component (HORIZONTAL splitter), the right component (VERTICAL splitter), or the only component (NONE spliter type).


getComponent2

public java.awt.Component getComponent2()
Returns the bottom component (HORIZONTAL splitter) or left component (VERTICAL splitter).


getSplitterType

public int getSplitterType()
Returns the current splitter type.


setSplitterType

public void setSplitterType(int nType)
Sets the current splitter type.


getSplitLocation

public int getSplitLocation()
Returns the current splitter location, or -1 if there is no current splitter.


setSplitLocation

public void setSplitLocation(int nLoc)
Sets the current splitter location.


setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Description copied from class: java.awt.Component
Sets the bounding rectangle for this component to the specified values. Note that these coordinates are relative to the parent, not to the screen.


getMinimumSize

public java.awt.Dimension getMinimumSize()
Description copied from class: java.awt.Container
Returns the minimum size of this container.


getPreferredSize

public java.awt.Dimension getPreferredSize()
Description copied from class: java.awt.Container
Returns the preferred size of this container.


doLayout

public void doLayout()
Description copied from class: java.awt.Container
Layout the components in this container.


mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseMotionListener
This method is called when the mouse is moved over a component while a button has been pressed.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse is pressed over a component.

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse is released over a component.

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseMotionListener
This method is called when the mouse is moved over a component while no button is pressed.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse is clicked (pressed and released in short succession) on a component.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse enters a component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse exits a component.

Specified by:
mouseExited in interface java.awt.event.MouseListener