de.upb.swt.epctools.plugin.editor
Class EpctoolsSplitter

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by de.upb.swt.epctools.plugin.editor.EpctoolsSplitter
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

 class EpctoolsSplitter
extends org.eclipse.swt.widgets.Composite


Nested Class Summary
(package private)  class EpctoolsSplitter.SashPainter
           
 
Field Summary
private static int DRAG_MINIMUM
           
private  org.eclipse.swt.widgets.Control[] m_controls
           
private  int m_fixed_size
           
protected  java.beans.PropertyChangeSupport m_listeners
          PropertyChangeSupport
private  org.eclipse.swt.widgets.Control m_max_control
           
private  int m_orientation
           
private  org.eclipse.swt.widgets.Listener m_sash_listener
           
private  org.eclipse.swt.widgets.Sash[] m_sashes
           
private static java.lang.String MAINTAIN_SIZE
           
private static int SASH_WIDTH
           
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
EpctoolsSplitter(org.eclipse.swt.widgets.Composite parent, int style)
          Initialization
 
Method Summary
 void addFixedSizeChangeListener(java.beans.PropertyChangeListener listener)
          This function adds a listener to "this" list of listener
private static int checkStyle(int style)
          This function returns the style of the splitter
 org.eclipse.swt.graphics.Point computeSize(int w_hint, int h_hint, boolean changed)
           
protected  void firePropertyChange(int old_value, int new_value)
          This function sends a message to all listeners
private  org.eclipse.swt.widgets.Control[] getControls(boolean m_only_visible)
          This function returns an array with all controls
 int getFixedSize()
          This function returns the size (width or height, depending of the orientation of the splitter) of the left most area.
 org.eclipse.swt.widgets.Control getMaximizedControl()
          This function returns the control that currently is maximized in the SashForm; this value may be null.
 int getOrientation()
          This function answers SWT.HORIZONTAL if the controls in the SashForm are laid out side by side, SWT.VERTICAL if the controls in the SashForm are laid out top to bottom.
 void layout(boolean changed)
           
 void maintainSize(org.eclipse.swt.widgets.Control c)
          This function takes care of the control size values.
private  void onDragSash(org.eclipse.swt.widgets.Event event)
          This function is called when the splitting beam has been moved.
(package private)  void paint(org.eclipse.swt.widgets.Sash sash, org.eclipse.swt.graphics.GC gc)
          This function paints the splitter to the screen.
 void removeFixedSizeChangeListener(java.beans.PropertyChangeListener listener)
          This function removes a listener
 void setFixedSize(int m_new_size)
          This function sets the size of the left area (see getFixedSize() for more information).
 void setLayout(org.eclipse.swt.widgets.Layout layout)
           
 void setMaximizedControl(org.eclipse.swt.widgets.Control control)
          This function specifies the control that should take up the entire client area of the SashForm.
 void setOrientation(int orientation)
          This function sets the orientation of the splitter.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SASH_WIDTH

private static final int SASH_WIDTH
See Also:
Constant Field Values

DRAG_MINIMUM

private static final int DRAG_MINIMUM
See Also:
Constant Field Values

MAINTAIN_SIZE

private static final java.lang.String MAINTAIN_SIZE
See Also:
Constant Field Values

m_fixed_size

private int m_fixed_size

m_orientation

private int m_orientation

m_sashes

private org.eclipse.swt.widgets.Sash[] m_sashes

m_controls

private org.eclipse.swt.widgets.Control[] m_controls

m_max_control

private org.eclipse.swt.widgets.Control m_max_control

m_sash_listener

private org.eclipse.swt.widgets.Listener m_sash_listener

m_listeners

protected java.beans.PropertyChangeSupport m_listeners
PropertyChangeSupport

Constructor Detail

EpctoolsSplitter

public EpctoolsSplitter(org.eclipse.swt.widgets.Composite parent,
                        int style)
Initialization

Method Detail

addFixedSizeChangeListener

public void addFixedSizeChangeListener(java.beans.PropertyChangeListener listener)
This function adds a listener to "this" list of listener


firePropertyChange

protected void firePropertyChange(int old_value,
                                  int new_value)
This function sends a message to all listeners


removeFixedSizeChangeListener

public void removeFixedSizeChangeListener(java.beans.PropertyChangeListener listener)
This function removes a listener


getFixedSize

public int getFixedSize()
This function returns the size (width or height, depending of the orientation of the splitter) of the left most area.


setFixedSize

public void setFixedSize(int m_new_size)
This function sets the size of the left area (see getFixedSize() for more information).


checkStyle

private static int checkStyle(int style)
This function returns the style of the splitter


computeSize

public org.eclipse.swt.graphics.Point computeSize(int w_hint,
                                                  int h_hint,
                                                  boolean changed)
Overrides:
computeSize in class org.eclipse.swt.widgets.Composite

getOrientation

public int getOrientation()
This function answers SWT.HORIZONTAL if the controls in the SashForm are laid out side by side, SWT.VERTICAL if the controls in the SashForm are laid out top to bottom.


getMaximizedControl

public org.eclipse.swt.widgets.Control getMaximizedControl()
This function returns the control that currently is maximized in the SashForm; this value may be null.


getControls

private org.eclipse.swt.widgets.Control[] getControls(boolean m_only_visible)
This function returns an array with all controls


layout

public void layout(boolean changed)
Overrides:
layout in class org.eclipse.swt.widgets.Composite

maintainSize

public void maintainSize(org.eclipse.swt.widgets.Control c)
This function takes care of the control size values.


paint

void paint(org.eclipse.swt.widgets.Sash sash,
           org.eclipse.swt.graphics.GC gc)
This function paints the splitter to the screen.


onDragSash

private void onDragSash(org.eclipse.swt.widgets.Event event)
This function is called when the splitting beam has been moved.


setOrientation

public void setOrientation(int orientation)
This function sets the orientation of the splitter. If orientation is SWT.HORIZONTAL, lay the controls in the SashForm out side by side. If orientation is SWT.VERTICAL, lay the controls in the SashForm out top to bottom.


setLayout

public void setLayout(org.eclipse.swt.widgets.Layout layout)
Overrides:
setLayout in class org.eclipse.swt.widgets.Composite

setMaximizedControl

public void setMaximizedControl(org.eclipse.swt.widgets.Control control)
This function specifies the control that should take up the entire client area of the SashForm. If one control has been maximized, and this method is called with a different control, the previous control will be minimized and the new control will be maximized.. if the value of control is null, the SashForm will minimize all controls and return to the default layout where all controls are laid out separated by sashes.