Class OffsetCaroselLayout
- java.lang.Object
-
- org.pushingpixels.radiance.theming.extras.internal.contrib.blogofbug.swing.layout.CaroselLayout
-
- org.pushingpixels.radiance.theming.extras.internal.contrib.blogofbug.swing.layout.OffsetCaroselLayout
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.LayoutManager
,java.util.EventListener
public class OffsetCaroselLayout extends CaroselLayout
Offsets a normal carousel layout be a fixed amount allowing it be "moved" around the screen.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.pushingpixels.radiance.theming.extras.internal.contrib.blogofbug.swing.layout.CaroselLayout
CaroselLayout.CaroselPosition
-
-
Field Summary
-
Fields inherited from class org.pushingpixels.radiance.theming.extras.internal.contrib.blogofbug.swing.layout.CaroselLayout
additionalData, components, numberOfItems, rotationalOffset, targetOffset
-
-
Constructor Summary
Constructors Constructor Description OffsetCaroselLayout(java.awt.Container forContainer)
Creates a new instance of OffsetCaroselLayout
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.Point
calculateCenter(java.awt.Insets insets, int width, int height, int widest)
Determines the center of the carousel based on the dimensions of the containerprotected java.awt.Dimension
getCarouselRadius(java.awt.Container target, java.awt.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 outvoid
setFrontMostComponent(java.awt.Component component)
Over-rides the normal setFrontMostComponent to move the selected component to 3 o'clock instead of 6 o'clockprotected boolean
shouldHide(java.awt.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.radiance.theming.extras.internal.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
-
-
-
-
Method Detail
-
shouldHide
protected boolean shouldHide(java.awt.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 classCaroselLayout
- Parameters:
comp
- The component to considerangle
- 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 java.awt.Dimension getCarouselRadius(java.awt.Container target, java.awt.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 classCaroselLayout
- Parameters:
target
- The container the radius should be calculated forinsets
- Any insets of the containerwidth
- The width of the containerheight
- The height of the containerwidestComponent
- The widest component- Returns:
- The size (in a bounding box) of the carousel
-
calculateCenter
protected java.awt.Point calculateCenter(java.awt.Insets insets, int width, int height, int widest)
Determines the center of the carousel based on the dimensions of the container- Overrides:
calculateCenter
in classCaroselLayout
- Parameters:
insets
- The container insetswidth
- Width of the containerheight
- The height of the containerwidest
- width of the container- Returns:
- A point representing the new center
-
setFrontMostComponent
public void setFrontMostComponent(java.awt.Component component)
Over-rides the normal setFrontMostComponent to move the selected component to 3 o'clock instead of 6 o'clock- Overrides:
setFrontMostComponent
in classCaroselLayout
- Parameters:
component
- The component to move to the 'front'
-
-