de.uni_paderborn.fujaba.fsa.swing
Class OvalLayout.TempLayout

java.lang.Object
  extended byde.uni_paderborn.fujaba.fsa.swing.OvalLayout.TempLayout
Enclosing class:
OvalLayout

private class OvalLayout.TempLayout
extends java.lang.Object

Container for a layout that has been calculated but not yet applied to the components.

Version:
$Revision: 1.13 $
Author:
$Author: lowende $

Field Summary
private  OvalLayout.ComponentInfo[] componentInfos
          The calculated layout for the components
private  java.awt.Dimension ovalDim
          The calculated dimensions of the oval
private  int yDiff
          The differences between the current and the optimal y coordinates are stored here by isComponentInsideOval()
private  int yDiffNumber
          The number of yDiffs counted
 
Constructor Summary
(package private) OvalLayout.TempLayout(java.awt.Container container)
          Layouts the components in the given container and returns the layout result in form of a ComponentInfo array.
private OvalLayout.TempLayout(java.awt.Container container, boolean secondTry, int shift)
          Layouts the components in the given container and returns the layout result in form of a ComponentInfo array.
 
Method Summary
(package private)  OvalLayout.ComponentInfo[] getComponentInfos()
          Returns the calculated layout for the components
(package private)  java.awt.Dimension getOvalDim()
          Returns the calculated dimensions of the oval
 int getYDiff()
          Returns the average yDiff (the differences between the current and the optimal y coordinates) calculated by isComponentInsideOval().
private  int isComponentInsideOval(OvalLayout.ComponentInfo componentInfo, java.awt.Dimension ovalSize)
          Checks whether the given componentInfo is completely contained in the oval specified by ovalSize.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ovalDim

private java.awt.Dimension ovalDim
The calculated dimensions of the oval


componentInfos

private OvalLayout.ComponentInfo[] componentInfos
The calculated layout for the components


yDiff

private int yDiff
The differences between the current and the optimal y coordinates are stored here by isComponentInsideOval()


yDiffNumber

private int yDiffNumber
The number of yDiffs counted

Constructor Detail

OvalLayout.TempLayout

OvalLayout.TempLayout(java.awt.Container container)
Layouts the components in the given container and returns the layout result in form of a ComponentInfo array. Note that the array may contain null elements for components that are not visible. The calculated dimension for the oval can be queried with getOvalDim() . The treeLock of the container must already be obtained by the calling method.

Parameters:
container - container to create layout for

OvalLayout.TempLayout

private OvalLayout.TempLayout(java.awt.Container container,
                              boolean secondTry,
                              int shift)
Layouts the components in the given container and returns the layout result in form of a ComponentInfo array. Note that the array may contain null elements for components that are not visible. The calculated dimension for the oval can be queried with getOvalDim() . The treeLock of the container must already be obtained by the calling method.

Parameters:
container - container to create layout for
secondTry - is the algorithm alreagy recursing?
shift - number of pixels to shift all components either up or down in the layout. This may increase the component size.
Method Detail

getOvalDim

java.awt.Dimension getOvalDim()
Returns the calculated dimensions of the oval

Returns:
the calculated dimensions of the oval

getComponentInfos

OvalLayout.ComponentInfo[] getComponentInfos()
Returns the calculated layout for the components

Returns:
the calculated layout for the components

getYDiff

public int getYDiff()
Returns the average yDiff (the differences between the current and the optimal y coordinates) calculated by isComponentInsideOval().

Returns:
The yDiff value

isComponentInsideOval

private int isComponentInsideOval(OvalLayout.ComponentInfo componentInfo,
                                  java.awt.Dimension ovalSize)
Checks whether the given componentInfo is completely contained in the oval specified by ovalSize. If it fits, -1 is returned, otherwise the width of the oval that can contain the component at its current position.

Parameters:
componentInfo - No description provided
ovalSize - No description provided
Returns:
The componentInsideOval value