Package org.pushingpixels.lafwidget.contrib.blogofbug.swing.layout

# Class OffsetCaroselLayout

java.lang.Object
org.pushingpixels.lafwidget.contrib.blogofbug.swing.layout.CaroselLayout
org.pushingpixels.lafwidget.contrib.blogofbug.swing.layout.OffsetCaroselLayout

All Implemented Interfaces:
  `ActionListener`, `LayoutManager`, `EventListener`

public class OffsetCaroselLayout extends CaroselLayout
Offsets a normal carousel layout be a fixed amount allowing it be "moved" around the screen.

## Field Summary

### Fields inherited from class org.pushingpixels.lafwidget.contrib.blogofbug.swing.layout.CaroselLayout

`additionalData, components, numberOfItems, rotationalOffset, targetOffset`

## Constructor Summary

Constructors
Constructor
Description
`OffsetCaroselLayout(Container forContainer)`
Creates a new instance of OffsetCaroselLayout

## Method Summary

Modifier and Type
Method
Description
`protected Point`
`calculateCenter(Insets insets, int width, int height, int widest)`
Determines the center of the carousel based on the dimensions of the container
`protected Dimension`
`getCarouselRadius(Container target, Insets insets, int width, int height, int widestComponent)`
Determines how "wide" the carousel should be drawn based on the side of the container the layout is laying out
`void`
`setFrontMostComponent(Component component)`
Over-rides the normal setFrontMostComponent to move the selected component to 3 o'clock instead of 6 o'clock
`protected boolean`
`shouldHide(Component comp, double angle, double scale)`
Overrides the normal layout method to determine if the object is offscreen and can therefore be ignored (giving a performance gain).

### Methods inherited from class org.pushingpixels.lafwidget.contrib.blogofbug.swing.layout.CaroselLayout

`actionPerformed, addLayoutComponent, finalizeLayoutImmediately, getAngle, getComponentCount, getComponentIndex, getNeutralContentWidth, getNextComponent, getPosition, getPreviousComponent, getScale, isAnimating, layoutContainer, minimumLayoutSize, moveComponentTo, preferredLayoutSize, recalculateCarosel, recalculateVisibleItems, removeLayoutComponent, setAngle, setDepthBasedAlpha, setNeutralContentWidth, setTarget`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### OffsetCaroselLayout

public OffsetCaroselLayout(Container forContainer)
Creates a new instance of OffsetCaroselLayout

Parameters:
  `forContainer` - The container to associate the layout with.

## Method Details

### shouldHide

protected boolean shouldHide(Component comp, double angle, double scale)
Overrides the normal layout method to determine if the object is offscreen and can therefore be ignored (giving a performance gain). In addition, it will adjust the alpha of the component based on its distance from 3'oclock (or 15:00 if you use a 24-hour compass)

Overrides:
  `shouldHide` in class `CaroselLayout`
Parameters:
  `comp` - The component to consider
  `angle` - Its position on the carousel.
  `scale` - The scale (applied to size) of the image, that is, how far from the observer is it
Returns:
  True if it should be hidden, false if it should not

### getCarouselRadius

protected Dimension getCarouselRadius(Container target, Insets insets, int width, int height, int widestComponent)
Determines how "wide" the carousel should be drawn based on the side of the container the layout is laying out

Overrides:
  `getCarouselRadius` in class `CaroselLayout`
Parameters:
  `target` - The container the radius should be calculated for
  `insets` - Any insets of the container
  `width` - The width of the container
  `height` - The height of the container
  `widestComponent` - The widest component
Returns:
  The size (in a bounding box) of the carousel

### calculateCenter

protected Point calculateCenter(Insets insets, int width, int height, int widest)
Determines the center of the carousel based on the dimensions of the container

Overrides:
  `calculateCenter` in class `CaroselLayout`
Parameters:
  `insets` - The container insets
  `width` - Width of the container
  `height` - The height of the container
  `widest` - width of the container
Returns:
  A point representing the new center

### setFrontMostComponent

public void setFrontMostComponent(Component component)
Over-rides the normal setFrontMostComponent to move the selected component to 3 o'clock instead of 6 o'clock

Overrides:
  `setFrontMostComponent` in class `CaroselLayout`
Parameters:
  `component` - The component to move to the 'front'