LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.table
Class LyJTableScrollPaneLayout

java.lang.Object
  extended by javax.swing.ScrollPaneLayout
      extended by leon.view.win.swing.table.LyJTableScrollPaneLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.io.Serializable, javax.swing.ScrollPaneConstants
Direct Known Subclasses:
LyJTableScrollPaneLayout.UIResource

public class LyJTableScrollPaneLayout
extends javax.swing.ScrollPaneLayout

This class lays out a LyJTableScrollPane. It manages a column footer component.

See Also:
Serialized Form

Nested Class Summary
static class LyJTableScrollPaneLayout.UIResource
          The UI resource version of ScrollPaneLayout.
 
Field Summary
static java.lang.String __VERSION
           
static java.lang.String COLUMN_FOOTER
          The id of the column footer.
static int MAX_PREFERRED_HEIGHT
          Deprecated. no longer used.
 
Fields inherited from interface javax.swing.ScrollPaneConstants
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
 
Constructor Summary
LyJTableScrollPaneLayout()
           
 
Method Summary
 void addLayoutComponent(java.lang.String s, java.awt.Component c)
          Adds the specified component to the layout.
 javax.swing.JViewport getColumnFooter()
          Gets the JViewport object that is the column footer.
 java.awt.Dimension getCustomizedScrollablePreferredSize(java.awt.Component view)
          Overload to have a customized scrollable preferred size.
 void layoutContainer(java.awt.Container parent)
          Lays out the scrollpane.
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          The preferred size of a ScrollPane is the size of the insets, plus the preferred size of the viewport, plus the preferred size of the visible headers, plus the preferred size of the scrollbars that will appear given the current view and the current scrollbar displayPolicies.
 void removeLayoutComponent(java.awt.Component c)
          (non-Javadoc).
 void setScreenSize(int[] screenSize)
          Set the screen dimension used to compute preferred size of the table.
 void syncWithScrollPane(javax.swing.JScrollPane sp)
          This method must be called after setting a JScrollPanes layout manager.
 
Methods inherited from class javax.swing.ScrollPaneLayout
getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorderBounds, minimumLayoutSize, setHorizontalScrollBarPolicy, setVerticalScrollBarPolicy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

COLUMN_FOOTER

public static final java.lang.String COLUMN_FOOTER
The id of the column footer.

See Also:
Constant Field Values

MAX_PREFERRED_HEIGHT

public static int MAX_PREFERRED_HEIGHT
Deprecated. no longer used.
Maximum height of the table preferred size.

Constructor Detail

LyJTableScrollPaneLayout

public LyJTableScrollPaneLayout()
Method Detail

syncWithScrollPane

public void syncWithScrollPane(javax.swing.JScrollPane sp)
This method must be called after setting a JScrollPanes layout manager. It initializes all of the internal fields that are ordinarily set by addLayoutComponent().
For example:
      ScrollPaneLayout mySPLayout = new ScrollPanelLayout() {
          public void layoutContainer(Container p) {
              super.layoutContainer(p);
              // do some extra work here ...
          }
      };
      scrollpane.setLayout(mySPLayout):
      mySPLayout.syncWithScrollPane(scrollpane);
 

This method is overriden to set the column footer to the given JScrollPane column footer if it is a LyJTableScrollPane.

Overrides:
syncWithScrollPane in class javax.swing.ScrollPaneLayout

addLayoutComponent

public void addLayoutComponent(java.lang.String s,
                               java.awt.Component c)
Adds the specified component to the layout. The layout is identified using one of: Overriden to add COLUMN_FOOTER treatment.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Overrides:
addLayoutComponent in class javax.swing.ScrollPaneLayout
Parameters:
s - the component identifier
c - the the component to be added

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component c)
(non-Javadoc).

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Overrides:
removeLayoutComponent in class javax.swing.ScrollPaneLayout
See Also:
LayoutManager.removeLayoutComponent(java.awt.Component)

getColumnFooter

public javax.swing.JViewport getColumnFooter()
Gets the JViewport object that is the column footer.

Returns:
the JViewport object that is the column footer

setScreenSize

public void setScreenSize(int[] screenSize)
Set the screen dimension used to compute preferred size of the table.

Parameters:
screenSize - the screen dimension.

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
The preferred size of a ScrollPane is the size of the insets, plus the preferred size of the viewport, plus the preferred size of the visible headers, plus the preferred size of the scrollbars that will appear given the current view and the current scrollbar displayPolicies.
Overriden to manage our own prefered size.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Overrides:
preferredLayoutSize in class javax.swing.ScrollPaneLayout
Parameters:
parent - the Container that will be laid out
Returns:
a Dimension object specifying the preferred size of the viewport and any scrollbars.
See Also:
ViewportLayout, LayoutManager

layoutContainer

public void layoutContainer(java.awt.Container parent)
Lays out the scrollpane. The positioning of components depends on the following constraints:

Specified by:
layoutContainer in interface java.awt.LayoutManager
Overrides:
layoutContainer in class javax.swing.ScrollPaneLayout
Parameters:
parent - the Container to lay out

getCustomizedScrollablePreferredSize

public java.awt.Dimension getCustomizedScrollablePreferredSize(java.awt.Component view)
Overload to have a customized scrollable preferred size.

Parameters:
view - the view
Returns:
the prefered size if he view has one, (0,0) otherwise

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com