|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.ui.ItemView
de.enough.polish.ui.ContainerView
de.enough.polish.ui.containerviews.FishEyeContainerView
public class FishEyeContainerView
Arranges the items in a single row and scales items down.
Activate this view by specifying view-type: fisheye in the ChoiceGroup's, Container's or List's style.
Further attributes are:
fisheyeview-scale: 60%;fisheyeview-scale-end: 30%;fisheyeview-alpha-end: 80;fisheyeview-alpha-end: 80;Example:
.myList {
view-type: fisheye;
fisheyeview-remove-text: true;
fisheyeview-scale-start: 70%;
fisheyeview-scale-end: 40%;
fisheyeview-alpha-start: 200;
fisheyeview-alpha-end: 100;
background-color: green;
padding: 5;
}
Copyright Enough Software 2007 - 2010
history
June 21, 2007 - rob creation
| Field Summary | |
|---|---|
protected int[] |
currentTranslucencies
|
protected int |
endTranslucency
|
protected Background |
focusedBackground
|
protected Border |
focusedBorder
|
protected int |
focusedDirection
|
protected StringItem |
focusedLabel
|
protected Style |
focusedStyle
|
protected int |
focusedWidth
|
protected boolean |
includeAllItems
|
protected boolean |
isRemoveText
|
protected boolean |
isShowTextInTitle
|
protected String[] |
labels
|
protected int |
maxItemHeight
|
protected int |
maxVisibleItems
|
protected int[][] |
originalRgbData
|
protected int[] |
originalRgbDataWidths
|
protected int |
referenceFocusedIndex
|
protected int[] |
referenceXCenterPositions
|
protected int[] |
referenceYCenterPositions
|
protected int |
scaleFactor
|
protected int |
scaleFactorEnd
|
protected int[][] |
shownRgbData
|
protected int[] |
shownRgbDataHeights
|
protected int[] |
shownRgbDataWidths
|
protected int |
startTranslucency
|
protected int[] |
targetTranslucencies
|
protected int[] |
targetXCenterPositions
|
protected int[] |
targetYCenterPositions
|
| Fields inherited from class de.enough.polish.ui.ItemView |
|---|
availableHeight, availableWidth, contentHeight, contentWidth, isFocused, isLayoutCenter, isLayoutRight, layout, paddingHorizontal, paddingVertical, parentItem |
| Constructor Summary | |
|---|---|
FishEyeContainerView()
Creates a new fish eye view |
|
| Method Summary | |
|---|---|
void |
animate(long currentTime,
ClippingRegion repaintRegion)
Animates this item. |
protected int |
calculateCurrent(int current,
int target)
Used within the animate() method to move a position or alpha value towards a target position/alpha. |
protected void |
defocus(Style originalStyle)
Notifies this view that the parent container is not focused anymore. |
void |
focus(Style focusstyle,
int direction)
Sets the focus to this container view. |
Style |
focusItem(int focIndex,
Item item,
int direction,
Style focStyle)
Focuses the given item and retrieves the previous style of that item. |
protected static int |
getDistance(int i,
int focused,
int length)
Retrieves the distance between the given index and the focused element witin the list. |
protected int |
getScaleFactor(int distance,
int length)
Obtains the scaling factor for the given distance from the center item. |
boolean |
handlePointerDragged(int x,
int y)
Handles the event when a pointer has been dragged to the specified position. |
boolean |
handlePointerPressed(int x,
int y)
Handles pointer pressed events. |
boolean |
handlePointerTouchDown(int x,
int y)
Handles a touch down/press event. |
protected void |
initContent(Item parentContainerItem,
int firstLineWidth,
int availWidth,
int availHeight)
Initializes this container view. |
protected void |
initItemArrangement(int lineWidth,
int availHeight,
Item[] myItems,
int length,
int maxWidth,
int maxHeight)
Arranges the items in this view. |
protected boolean |
isValid(Item parent,
Style style)
Implementation that are valid only for specific item classes can override this method so that they cannot be accidently attached to unsupported classes. |
boolean |
isVerticalLayout()
Checks if this ContainerView arranges its child items vertically. |
protected void |
paintContent(Container container,
Item[] myItems,
int x,
int y,
int leftBorder,
int rightBorder,
int clipX,
int clipY,
int clipWidth,
int clipHeight,
Graphics g)
Paints the content of this container view. |
protected void |
paintItem(Item item,
int index,
int x,
int y,
int leftBorder,
int rightBorder,
int clipX,
int clipY,
int clipWidth,
int clipHeight,
Graphics g)
Paints this item at the specified position. |
void |
releaseResources()
Releases all resources that are not required to keep the state of this view. |
protected void |
setStyle(Style style)
Sets the style for this view. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int[] targetXCenterPositions
protected int[] referenceXCenterPositions
protected int[] targetYCenterPositions
protected int[] referenceYCenterPositions
protected boolean isRemoveText
protected boolean includeAllItems
protected String[] labels
protected transient StringItem focusedLabel
protected transient int[][] originalRgbData
protected int[] originalRgbDataWidths
protected transient int[][] shownRgbData
protected int[] shownRgbDataWidths
protected int[] shownRgbDataHeights
protected int scaleFactor
protected int scaleFactorEnd
protected int startTranslucency
protected int endTranslucency
protected int[] targetTranslucencies
protected int[] currentTranslucencies
protected int referenceFocusedIndex
protected transient Background focusedBackground
protected Border focusedBorder
protected Style focusedStyle
protected int focusedDirection
protected int focusedWidth
protected int maxItemHeight
protected boolean isShowTextInTitle
protected int maxVisibleItems
| Constructor Detail |
|---|
public FishEyeContainerView()
| Method Detail |
|---|
public void animate(long currentTime,
ClippingRegion repaintRegion)
ItemView
animate in class ContainerViewcurrentTime - the current time in millisecondsrepaintRegion - the repaint area that needs to be updated when this item is animatedItem.getAbsoluteX(),
Item.getAbsoluteY()
protected static int getDistance(int i,
int focused,
int length)
i - the indexfocused - the index of the focused elementlength - the length of the list
protected int calculateCurrent(int current,
int target)
current - the current valuetarget - the target value
protected boolean isValid(Item parent,
Style style)
ItemView
isValid in class ContainerViewparent - the parent itemstyle - the style
protected void initContent(Item parentContainerItem,
int firstLineWidth,
int availWidth,
int availHeight)
ContainerView
initContent in class ContainerViewparentContainerItem - the Container which uses this view, use parent.getItems() for retrieving all items.firstLineWidth - the maximum width of the first lineavailWidth - the maximum width of any following linesavailHeight - the maximum height of the viewItemView.contentWidth,
ItemView.contentHeight
protected void initItemArrangement(int lineWidth,
int availHeight,
Item[] myItems,
int length,
int maxWidth,
int maxHeight)
lineWidth - the available line widthavailHeight - the available height in pixelsmyItems - all itemslength - the number of itemsmaxWidth - the maximum width of one itemmaxHeight - the maximum height of one item
protected int getScaleFactor(int distance,
int length)
distance - the distance to the central/focused item - an item next to the focused item has the distance 0.length - the number of items of the parent container
protected void defocus(Style originalStyle)
ItemView
defocus in class ItemVieworiginalStyle - the previous used style, may be null.
public void focus(Style focusstyle,
int direction)
ItemView
focus in class ItemViewfocusstyle - the appropriate style.direction - the direction from the which the focus is gained,
either Canvas.UP, Canvas.DOWN, Canvas.LEFT, Canvas.RIGHT or 0.
When 0 is given, the direction is unknown.1
public Style focusItem(int focIndex,
Item item,
int direction,
Style focStyle)
ContainerView
focusItem in class ContainerViewfocIndex - the index of the itemitem - the item which should be focuseddirection - the direction, either Canvas.DOWN, Canvas.RIGHT, Canvas.UP, Canvas.LEFT or 0.focStyle - the new style for the focused item
protected void paintContent(Container container,
Item[] myItems,
int x,
int y,
int leftBorder,
int rightBorder,
int clipX,
int clipY,
int clipWidth,
int clipHeight,
Graphics g)
ContainerView
paintContent in class ContainerViewcontainer - the parent containermyItems - the items that should be paintedx - the left start positiony - the upper start positionleftBorder - the left border, nothing must be painted left of this positionrightBorder - the right border, nothing must be painted right of this positionclipX - absolute horizontal clipping startclipY - absolute verical clipping startclipWidth - clipping widthclipHeight - clipping heightg - the Graphics on which this item should be painted.
protected void paintItem(Item item,
int index,
int x,
int y,
int leftBorder,
int rightBorder,
int clipX,
int clipY,
int clipWidth,
int clipHeight,
Graphics g)
ContainerView
paintItem in class ContainerViewitem - the item that needs to be paintedindex - the index of the itemx - the horizontal position of the itemy - the vertical position of the itemleftBorder - the left borderrightBorder - the right borderclipX - absolute horizontal clipping startclipY - absolute verical clipping startclipWidth - clipping widthclipHeight - clipping heightg - the graphics contextprotected void setStyle(Style style)
ContainerView
setStyle in class ContainerViewstyle - the stylepublic void releaseResources()
ItemView
releaseResources in class ContainerView
public boolean handlePointerDragged(int x,
int y)
ItemView//#if polish.hasPointerEvents
handlePointerDragged in class ItemViewx - the x position of the event relative to the item's horizontal left edgey - the y position of the event relative to the item's vertical top edge
public boolean handlePointerPressed(int x,
int y)
ItemView//#if polish.hasPointerEvents
handlePointerPressed in class ContainerViewx - the x position of the event relative to the item's horizontal left edgey - the y position of the event relative to the item's vertical top edge
public boolean handlePointerTouchDown(int x,
int y)
ItemView
handlePointerTouchDown in class ContainerViewx - the horizontal pixel position of the touch event relative to the parent item's left positiony - the vertical pixel position of the touch event relative to the parent item's top position
public boolean isVerticalLayout()
ContainerView
isVerticalLayout in class ContainerView
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||