Package snap.view
Class View
java.lang.Object
snap.props.PropObject
snap.view.View
- All Implemented Interfaces:
PropChange.DoChange
,XMLArchiver.Archivable
- Direct Known Subclasses:
ArcView
,ColorButton
,ColorButton.ColorBoxesPane
,ColorDock
,ColorPanel.ImagePicker
,ColorWell
,CubeView
,Divider
,Explode
,ImageView
,LineView
,ParentView
,PathView
,ProgressBar
,QuickDraw
,RectView
,ScrollBar
,Separator
,ShapeView
,Slider
,StringView
,TextArea
,ThumbWheel
A standard view implementation to show graphics and handle events and form the basis of all views (buttons, sliders,
text fields, etc.).
-
Field Summary
Modifier and TypeFieldDescriptionprotected Pos
protected double
protected snap.view.ViewEffect
protected Font
protected Insets
protected Insets
protected Rect
protected boolean
protected double
protected boolean
static final ViewEvent.Type
static final String
static final String
static final String
static final String
static final String
static final Pos
static final Insets
static final Insets
static final double
static final String
static final ViewEvent.Type[]
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final ViewEvent.Type[]
static final ViewEvent.Type
static final ViewEvent.Type
static final ViewEvent.Type
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final ViewEvent.Type
static final ViewEvent.Type
static final ViewEvent.Type[]
static final ViewEvent.Type
static final ViewEvent.Type
static final ViewEvent.Type
static final ViewEvent.Type
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final ViewEvent.Type
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBinding
(Binding aBinding) Adds the individual binding to the shape's bindings list.void
addEventFilter
(EventListener aLsnr, ViewEvent.Type... theTypes) Adds an event filter.void
addEventHandler
(EventListener aLsnr, ViewEvent.Type... theTypes) Adds an event handler.protected PropObject
clone()
Standard clone implementation.boolean
contains
(double aX, double aY) Returns whether view contains point.boolean
Returns whether view contains point.boolean
containsShape
(Shape aShape) Returns whether view contains shape.protected ViewEvent
createActionEvent
(ViewEvent sourceEvent) Creates an Action event for given source event.protected void
disableEvents
(ViewEvent.Type... theTypes) Sets an array of enabled events.protected void
enableEvents
(ViewEvent.Type... theTypes) Sets an array of enabled events.protected void
fireActionEvent
(ViewEvent sourceEvent) Fires an action event for given source event (can be null).fromXML
(XMLArchiver anArchiver, XMLElement anElement) XML unarchival.getAlign()
Returns the alignment.Returns the horizontal alignment.Returns the vertical alignment.getAnim
(int aTime) Returns the anim for the given time.getAnimCleared
(int aTime) Returns a cleared anim at given time.int
Returns the anim time.double
getBestHeight
(double aW) Returns the best height for view - accounting for pref/min/max.Returns the best size.double
getBestWidth
(double aH) Returns the best width for view - accounting for pref/min/max.getBinding
(int anIndex) Returns the individual binding at given index.getBinding
(String aPropName) Returns the individual binding with the given property name.int
Returns the number of bindings.Returns the list of bindings.Returns the border.double
Returns the radius for border rounded corners.Returns the bounds.Returns the bounds inside view.Returns the bounds in parent coords.Returns the bounds shape in view coords.Returns the bounds shape in parent coords.getClip()
Returns the clip shape.Returns the clip of this view due to all parents.Returns the clip bounds due to all parents.Returns the clip bounds.getClippedRect
(Rect aRect) Returns the clipped shape for given shape.Returns the cursor.Returns the default border.Returns the default fill paint.Returns the default font.Returns effect.getEnv()
Returns the view environment.Returns the event adapter for view.getFill()
Returns fill paint.Returns the fill as color.Returns the next focus View.Returns the next focus View.getFont()
Returns the font for the view (defaults to parent font).double
Returns the height of the view.getHost()
Returns the ViewHost if this view is guest view of parent ViewHost.Returns the insets due to border and/or padding.getLean()
Returns the position this view would prefer to take when inside a pane.getLeanX()
Returns the horizontal position this view would prefer to take when inside a pane.getLeanY()
Returns the vertical position this view would prefer to take when inside a pane.Returns the transform.getLocalToParent
(View aPar) Returns the transform.Returns the spacing insets requested between parent/neighbors and the border of this view.double
Returns the view maximum height.Returns the view maximum size.double
Returns the view maximum width.double
getMaxX()
Returns the max x.double
getMaxY()
Returns the max x.double
getMidX()
Returns the mid x.double
getMidY()
Returns the mid y.double
Returns the view minimum height.protected double
Calculates the minimum height.Returns the view minimum size.double
Returns the view minimum width.protected double
Calculates the minimum width.getName()
Returns the name for the view.double
Returns the opacity of the view.double
Returns the combined opacity of this view and it's parents.getOwner()
Returns the view owner.<T> T
Returns the owner of given class.Returns the spacing insets between the border of this view and it's content.Returns the parent of this view.<T extends View>
TReturns the first parent with given class by iterating up parent hierarchy.int
Returns the number of ancestors of this view.Returns the transform from parent to local coords.getParentToLocal
(View aPar) Returns the transform from parent to local coords.Returns the physics objects that provides information for physics simulations.getPhysics
(boolean doCreate) Returns the physics objects that provides information for physics simulations.double
Returns the view preferred height.double
getPrefHeight
(double aW) Returns the view preferred height.protected double
getPrefHeightImpl
(double aW) Calculates the preferred height.Returns the view preferred size.double
Returns the view preferred width.double
getPrefWidth
(double aH) Returns the view preferred width.protected double
getPrefWidthImpl
(double aH) Calculates the preferred width.Returns a named client property.getPropDefault
(String aPropName) Override property defaults for View.getProps()
Returns the property map.getPropValue
(String aPropName) Returns the value for given prop name.Returns the substitution class name.Returns the rect of view that has been registered for repaint, expanded for focus/effects.protected Rect
getRepaintRectExpanded
(Rect aRect) Returns the given repaint rect, expanded for focus/effects.Returns the root view.double
Returns the rotation of the view in degrees.double
getScale()
Returns the scale of this view.double
Returns the scale of this view from X.double
Returns the scale of this view from Y.getSize()
Returns the view size.double
Returns the spacing for content (usually children).getText()
Returns the text value of this view.Returns the tool tip text.getToolTip
(ViewEvent anEvent) Returns a tool tip string for given event.double
Returns the translation of this view from X.double
Returns the translation of this view from Y.Returns the ViewUpdater.protected String
Returns a mapped property name.Returns the visible bounds for a view based on ancestor clips (just bound local if no clipping found).double
getWidth()
Returns the width of the view.Returns the window.double
getX()
Returns the X location of the view.getXY()
Returns the view x/y.double
getY()
Returns the Y location of the view.int
Returns the index of this view in ViewHost parent (or -1 if parent isn't host).int
Returns the index of this view in parent.protected void
Initialize Props.boolean
intersectsShape
(Shape aShape) Returns whether view intersects shape.boolean
Returns whether view can generate action events in response to certain user interactions.boolean
isAncestor
(View aView) Returns whether given view is an ancestor of this view.boolean
Returns whether view should clip to bounds.boolean
Whether view is disabled.boolean
Whether view is enabled.boolean
Returns whether this view can get focus.boolean
Returns whether this view is the RootView.FocusedView.boolean
Returns whether focus should change when traversal keys are pressed (Tab).boolean
Returns whether focus ring should be painted when view is focused.boolean
Returns whether this view should request focus when pressed.boolean
Returns whether font has been explicitly set for this view.boolean
Returns whether this view would like to grow vertically if possible when inside a pane.boolean
Returns whether this view would like to grow horizontally if possible when inside a pane.boolean
isGuest()
Returns whether view is a "guest" child of a ViewHost.boolean
Returns whether this view has a horizontal orientation.boolean
Returns whether transform to parent is simple (contains no rotate, scale, skew).boolean
Returns whether view should be included when a parent does layout.boolean
Returns whether view should be included when a parent does layout.boolean
Returns whether view maximum height is set.boolean
Returns whether view maximum width is set.boolean
Returns whether view minimum height is set.boolean
Returns whether view minimum width is set.boolean
Returns whether current mouse location is over this view.boolean
Returns whether current mouse location is over this view.boolean
Returns whether needs repaint.boolean
Returns whether view should be painted.boolean
Returns whether view can be hit by mouse.boolean
Returns whether view can be hit by mouse and visible.boolean
Returns whether preferred width is set.boolean
Returns whether preferred width is set.boolean
Returns whether view is visible and has parent that is showing.boolean
Returns whether tooltip is enabled.boolean
Returns whether this view has a vertical orientation.boolean
Returns whether this view is visible.localToParent
(double aX, double aY) Converts a point from local to parent.localToParent
(double aX, double aY, View aPar) Converts a point from local to given parent.localToParent
(Shape aShape) Converts a shape from local to parent.localToParent
(Shape aShape, View aPar) Converts a point from local to given parent.localToScreen
(double aX, double aY) Converts a point from local to parent.protected void
Main paint method.protected void
Paints background.protected void
paintFront
(Painter aPntr) Paints foreground.protected void
Called when parent font changes.parentToLocal
(double aX, double aY) Converts a point from parent to local.parentToLocal
(double aX, double aY, View aPar) Converts a point from given parent to local.parentToLocal
(Shape aShape) Converts a shape from parent to local.parentToLocal
(Shape aShape, View aView) Converts a shape from parent to local.void
Play animations deep.protected void
processEvent
(ViewEvent anEvent) Process ViewEvent.protected void
processEventAll
(ViewEvent anEvent) Top level process event method (calls filters and handlers).protected void
processEventFilters
(ViewEvent anEvent) Process ViewEvent for View EventFilters.protected void
processEventHandlers
(ViewEvent anEvent) Process ViewEvent for View EventHandlers.void
relayout()
Called to relayout.void
Called to notify parents to relayout because preferred sizes have potentially changed.removeBinding
(int anIndex) Removes the binding at the given index from view bindings list.boolean
removeBinding
(String aPropName) Removes the binding with given property name.void
removeEventFilter
(EventListener aLsnr, ViewEvent.Type... theTypes) Removes an event filter.void
removeEventHandler
(EventListener aLsnr, ViewEvent.Type... theTypes) Removes an event handler.void
repaint()
Called to register view for repaint.void
repaint
(double aX, double aY, double aW, double aH) Called to register view for repaint.void
Called to register view for repaint.protected void
repaintInParent
(Rect aRect) Called to repaint in parent for cases where transform might change.void
Tells view to request focus.void
runDelayed
(Runnable aRunnable, int aDelay) Runs the runnable after the given delay in milliseconds.void
runIntervals
(Runnable aRun, int aPeriod) Runs given runnable repeatedly every period milliseconds.void
Runs the given runnable in the next event.void
scrollToVisible
(Shape aShape) Called to scroll the given shape in this view coords to visible.void
setActionable
(boolean aValue) Sets whether view can generate action events in response to certain user interactions.void
Sets the alignment.void
Sets the horizontal alignment.void
Sets the vertical alignment.setAnimProps
(Object... propItems) Convenience to quickly set anim props.setAnimString
(String animString) Convenience to quickly set anim props.void
setAnimTimeDeep
(int aValue) Sets the anim time deep.void
Sets the border.void
Convenience to set border to given color and line width.void
setBorderRadius
(double aValue) Sets the radius for border rounded corners.void
setBounds
(double aX, double aY, double aW, double aH) Sets the bounds.void
Sets the bounds.void
setBoundsLocal
(double aX, double aY, double aW, double aH) Sets the view bounds with given rect in current local coords such that it will have that rect as new local bounds.void
Sets the clip shape.void
setClipToBounds
(boolean aValue) Sets whether view should clip to bounds.void
Sets the cursor.void
setDisabled
(boolean aValue) Sets whether view is enabled.void
Sets paint.void
setEnabled
(boolean aValue) Sets whether view is enabled.void
Sets fill paint.void
setFocusable
(boolean aValue) Sets whether this view can get focus.protected void
setFocused
(boolean aValue) Sets whether this view is the RootView.FocusedView.void
setFocusKeysEnabled
(boolean aValue) Sets whether focus should change when traversal keys are pressed (Tab).void
setFocusPainted
(boolean aValue) Sets whether focus ring should be painted when view is focused.void
setFocusWhenPressed
(boolean aValue) Sets whether this view should request focus when pressed.void
Sets the font for the view.void
setGrowHeight
(boolean aValue) Sets whether this view would like to grow vertically if possible when inside a pane.void
setGrowWidth
(boolean aValue) Sets whether this view would like to grow horizontally if possible when inside a pane.void
setHeight
(double aValue) Sets the height of the view.void
Sets the lean this view would prefer to take when inside a pane.void
Sets the horizontal lean this view would prefer to take when inside a pane.void
Sets the vertical position this view would prefer to take when inside a pane.void
setManaged
(boolean aValue) Sets whether view should be included when a parent does layout.void
setMargin
(double aTp, double aRt, double aBtm, double aLt) Sets the spacing insets requested between parent/neighbors and the border of this view.void
Sets the spacing insets requested between parent/neighbors and the border of this view.void
setMaxHeight
(double aHeight) Sets the view maximum height.void
setMaxSize
(double aWidth, double aHeight) Sets the view maximum size.void
setMaxSize
(Size aSize) Sets the view maximum size.void
setMaxWidth
(double aWidth) Sets the view maximum width.void
setMinHeight
(double aHeight) Sets the view minimum height.void
setMinSize
(double aWidth, double aHeight) Sets the view minimum size.void
setMinSize
(Size aSize) Sets the view minimum size.void
setMinWidth
(double aWidth) Sets the view minimum width.void
Sets the name for the view.void
setOpacity
(double aValue) Sets the opacity of the view.void
Sets the owner.void
setPadding
(double aTp, double aRt, double aBtm, double aLt) Sets the spacing insets between the border of this view and it's content.void
setPadding
(Insets theIns) Sets the spacing insets between the border of this view and it's content.void
setPaintable
(boolean aValue) Sets whether view should be painted.protected void
setParent
(ParentView aPar) Sets the parent.void
setPickable
(boolean aValue) Sets whether view can be hit by mouse.void
setPrefHeight
(double aHeight) Sets the view preferred height.void
setPrefSize
(double aWidth, double aHeight) Sets the view preferred size.void
setPrefSize
(Size aSize) Sets the view preferred size.void
setPrefWidth
(double aWidth) Sets the view preferred width.Puts a named client property.void
setPropValue
(String aPropName, Object aValue) Sets the value for given prop name.void
setRealClassName
(String aName) Sets the substitution class string.void
setRotate
(double theDegrees) Turn to given angle.void
setScale
(double aValue) Sets the scale of this view from Y.void
setScaleX
(double aValue) Sets the scale of this view from X.void
setScaleY
(double aValue) Sets the scale of this view from Y.protected void
setShowing
(boolean aValue) Sets whether view is showing.void
setSize
(double aW, double aH) Sets the size.void
Sets the size.void
setSizeLocal
(double aW, double aH) Sets the view size such that it maintains it's location in parent.void
Sets the size to best size.void
Sets the size to preferred size.void
setSpacing
(double aValue) Sets the spacing for content (usually children).void
Sets the text value of this view.void
setToolTip
(String aString) Sets the tool tip text.void
setToolTipEnabled
(boolean aValue) Sets whether tooltip is enabled.void
setTransX
(double aValue) Sets the translation of this view from X.void
setTransY
(double aValue) Sets the translation of this view from Y.void
setVertical
(boolean aValue) Sets whether this view has a vertical orientation.void
setVisible
(boolean aValue) Sets whether this view is visible.void
setWidth
(double aValue) Sets the width of the view.void
setX
(double aValue) Sets the X location of the view.void
setXY
(double aX, double aY) Sets the view x/y.void
setXYLocal
(double aX, double aY) Sets the view x/y with given point in current local coords such that new origin will be at that point.void
setY
(double aValue) Sets the Y location of the view.void
Stop animations deep.void
stopIntervals
(Runnable aRun) Stops running given runnable.protected void
Called when ViewTheme changes.Standard toString implementation.toXML
(XMLArchiver anArchiver) XML Archival.Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, firePropChange, firePropChange, firePropChange, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropsString, setPropValues, toString
-
Field Details
-
_align
-
_margin
-
_padding
-
_spacing
protected double _spacing -
_vertical
protected boolean _vertical -
_borderRadius
protected double _borderRadius -
_effect
protected snap.view.ViewEffect _effect -
_font
-
_showing
protected boolean _showing -
_repaintRect
-
Name_Prop
- See Also:
-
X_Prop
- See Also:
-
Y_Prop
- See Also:
-
Width_Prop
- See Also:
-
Height_Prop
- See Also:
-
TransX_Prop
- See Also:
-
TransY_Prop
- See Also:
-
Rotate_Prop
- See Also:
-
ScaleX_Prop
- See Also:
-
ScaleY_Prop
- See Also:
-
MinWidth_Prop
- See Also:
-
MinHeight_Prop
- See Also:
-
MaxWidth_Prop
- See Also:
-
MaxHeight_Prop
- See Also:
-
PrefWidth_Prop
- See Also:
-
PrefHeight_Prop
- See Also:
-
GrowWidth_Prop
- See Also:
-
GrowHeight_Prop
- See Also:
-
LeanX_Prop
- See Also:
-
LeanY_Prop
- See Also:
-
Disabled_Prop
- See Also:
-
Visible_Prop
- See Also:
-
Pickable_Prop
- See Also:
-
Paintable_Prop
- See Also:
-
Vertical_Prop
- See Also:
-
Focused_Prop
- See Also:
-
Focusable_Prop
- See Also:
-
FocusWhenPressed_Prop
- See Also:
-
Border_Prop
- See Also:
-
BorderRadius_Prop
- See Also:
-
Clip_Prop
- See Also:
-
Cursor_Prop
- See Also:
-
Effect_Prop
- See Also:
-
Fill_Prop
- See Also:
-
Font_Prop
- See Also:
-
Align_Prop
- See Also:
-
Opacity_Prop
- See Also:
-
Margin_Prop
- See Also:
-
Padding_Prop
- See Also:
-
Spacing_Prop
- See Also:
-
Managed_Prop
- See Also:
-
Parent_Prop
- See Also:
-
Showing_Prop
- See Also:
-
Text_Prop
- See Also:
-
ToolTip_Prop
- See Also:
-
DEFAULT_ALIGN
-
DEFAULT_MARGIN
-
DEFAULT_PADDING
-
DEFAULT_SPACING
public static final double DEFAULT_SPACING- See Also:
-
Action
-
KeyPress
-
KeyRelease
-
KeyType
-
MousePress
-
MouseDrag
-
MouseRelease
-
MouseEnter
-
MouseMove
-
MouseExit
-
Scroll
-
KeyEvents
-
MouseEvents
-
DragEvents
-
-
Constructor Details
-
View
public View()Constructor.
-
-
Method Details
-
getName
Returns the name for the view. -
setName
Sets the name for the view. -
getX
public double getX()Returns the X location of the view. -
setX
public void setX(double aValue) Sets the X location of the view. -
getY
public double getY()Returns the Y location of the view. -
setY
public void setY(double aValue) Sets the Y location of the view. -
getWidth
public double getWidth()Returns the width of the view. -
setWidth
public void setWidth(double aValue) Sets the width of the view. -
getHeight
public double getHeight()Returns the height of the view. -
setHeight
public void setHeight(double aValue) Sets the height of the view. -
getMidX
public double getMidX()Returns the mid x. -
getMidY
public double getMidY()Returns the mid y. -
getMaxX
public double getMaxX()Returns the max x. -
getMaxY
public double getMaxY()Returns the max x. -
getXY
Returns the view x/y. -
setXY
public void setXY(double aX, double aY) Sets the view x/y. -
getSize
Returns the view size. -
setSize
Sets the size. -
setSize
public void setSize(double aW, double aH) Sets the size. -
getBounds
Returns the bounds. -
setBounds
Sets the bounds. -
setBounds
public void setBounds(double aX, double aY, double aW, double aH) Sets the bounds. -
getBoundsLocal
Returns the bounds inside view. -
setBoundsLocal
public void setBoundsLocal(double aX, double aY, double aW, double aH) Sets the view bounds with given rect in current local coords such that it will have that rect as new local bounds. -
setXYLocal
public void setXYLocal(double aX, double aY) Sets the view x/y with given point in current local coords such that new origin will be at that point. -
setSizeLocal
public void setSizeLocal(double aW, double aH) Sets the view size such that it maintains it's location in parent. -
getBoundsParent
Returns the bounds in parent coords. -
getBoundsShape
Returns the bounds shape in view coords. -
getBoundsShapeParent
Returns the bounds shape in parent coords. -
getTransX
public double getTransX()Returns the translation of this view from X. -
setTransX
public void setTransX(double aValue) Sets the translation of this view from X. -
getTransY
public double getTransY()Returns the translation of this view from Y. -
setTransY
public void setTransY(double aValue) Sets the translation of this view from Y. -
getRotate
public double getRotate()Returns the rotation of the view in degrees. -
setRotate
public void setRotate(double theDegrees) Turn to given angle. -
getScaleX
public double getScaleX()Returns the scale of this view from X. -
setScaleX
public void setScaleX(double aValue) Sets the scale of this view from X. -
getScaleY
public double getScaleY()Returns the scale of this view from Y. -
setScaleY
public void setScaleY(double aValue) Sets the scale of this view from Y. -
getScale
public double getScale()Returns the scale of this view. -
setScale
public void setScale(double aValue) Sets the scale of this view from Y. -
getFill
Returns fill paint. -
setFill
Sets fill paint. -
getFillColor
Returns the fill as color. -
getBorder
Returns the border. -
setBorder
Sets the border. -
setBorder
Convenience to set border to given color and line width. -
getBorderRadius
public double getBorderRadius()Returns the radius for border rounded corners. -
setBorderRadius
public void setBorderRadius(double aValue) Sets the radius for border rounded corners. -
getEffect
Returns effect. -
setEffect
Sets paint. -
getOpacity
public double getOpacity()Returns the opacity of the view. -
setOpacity
public void setOpacity(double aValue) Sets the opacity of the view. -
getOpacityAll
public double getOpacityAll()Returns the combined opacity of this view and it's parents. -
isFontSet
public boolean isFontSet()Returns whether font has been explicitly set for this view. -
getFont
Returns the font for the view (defaults to parent font). -
setFont
Sets the font for the view. -
parentFontChanged
protected void parentFontChanged()Called when parent font changes. -
getCursor
Returns the cursor. -
setCursor
Sets the cursor. -
isDisabled
public boolean isDisabled()Whether view is disabled. -
setDisabled
public void setDisabled(boolean aValue) Sets whether view is enabled. -
isEnabled
public boolean isEnabled()Whether view is enabled. -
setEnabled
public void setEnabled(boolean aValue) Sets whether view is enabled. -
isClipToBounds
public boolean isClipToBounds()Returns whether view should clip to bounds. -
setClipToBounds
public void setClipToBounds(boolean aValue) Sets whether view should clip to bounds. -
getClip
Returns the clip shape. -
setClip
Sets the clip shape. -
getClipBounds
Returns the clip bounds. -
getClipAll
Returns the clip of this view due to all parents. -
getClipAllBounds
Returns the clip bounds due to all parents. -
getClippedRect
Returns the clipped shape for given shape. -
getVisRect
Returns the visible bounds for a view based on ancestor clips (just bound local if no clipping found). -
scrollToVisible
Called to scroll the given shape in this view coords to visible. -
isLocalToParentSimple
public boolean isLocalToParentSimple()Returns whether transform to parent is simple (contains no rotate, scale, skew). -
getLocalToParent
Returns the transform. -
getLocalToParent
Returns the transform. -
localToParent
Converts a point from local to parent. -
localToParent
Converts a point from local to given parent. -
localToParent
Converts a shape from local to parent. -
localToParent
Converts a point from local to given parent. -
getParentToLocal
Returns the transform from parent to local coords. -
getParentToLocal
Returns the transform from parent to local coords. -
parentToLocal
Converts a point from parent to local. -
parentToLocal
Converts a point from given parent to local. -
parentToLocal
Converts a shape from parent to local. -
parentToLocal
Converts a shape from parent to local. -
localToScreen
Converts a point from local to parent. -
contains
Returns whether view contains point. -
contains
public boolean contains(double aX, double aY) Returns whether view contains point. -
containsShape
Returns whether view contains shape. -
intersectsShape
Returns whether view intersects shape. -
getParent
Returns the parent of this view. -
setParent
Sets the parent. -
getParent
Returns the first parent with given class by iterating up parent hierarchy. -
getParentCount
public int getParentCount()Returns the number of ancestors of this view. -
isAncestor
Returns whether given view is an ancestor of this view. -
indexInParent
public int indexInParent()Returns the index of this view in parent. -
getHost
Returns the ViewHost if this view is guest view of parent ViewHost. -
isGuest
public boolean isGuest()Returns whether view is a "guest" child of a ViewHost. -
indexInHost
public int indexInHost()Returns the index of this view in ViewHost parent (or -1 if parent isn't host). -
isVisible
public boolean isVisible()Returns whether this view is visible. -
setVisible
public void setVisible(boolean aValue) Sets whether this view is visible. -
isShowing
public boolean isShowing()Returns whether view is visible and has parent that is showing. -
setShowing
protected void setShowing(boolean aValue) Sets whether view is showing. -
isPickable
public boolean isPickable()Returns whether view can be hit by mouse. -
setPickable
public void setPickable(boolean aValue) Sets whether view can be hit by mouse. -
isPickableVisible
public boolean isPickableVisible()Returns whether view can be hit by mouse and visible. -
isPaintable
public boolean isPaintable()Returns whether view should be painted. -
setPaintable
public void setPaintable(boolean aValue) Sets whether view should be painted. -
isManaged
public boolean isManaged()Returns whether view should be included when a parent does layout. -
setManaged
public void setManaged(boolean aValue) Sets whether view should be included when a parent does layout. -
isManagedVisible
public boolean isManagedVisible()Returns whether view should be included when a parent does layout. -
isMouseOver
public boolean isMouseOver()Returns whether current mouse location is over this view. -
isMouseDown
public boolean isMouseDown()Returns whether current mouse location is over this view. -
getRootView
Returns the root view. -
getWindow
Returns the window. -
getUpdater
Returns the ViewUpdater. -
getLean
Returns the position this view would prefer to take when inside a pane. -
setLean
Sets the lean this view would prefer to take when inside a pane. -
getLeanX
Returns the horizontal position this view would prefer to take when inside a pane. -
setLeanX
Sets the horizontal lean this view would prefer to take when inside a pane. -
getLeanY
Returns the vertical position this view would prefer to take when inside a pane. -
setLeanY
Sets the vertical position this view would prefer to take when inside a pane. -
isGrowWidth
public boolean isGrowWidth()Returns whether this view would like to grow horizontally if possible when inside a pane. -
setGrowWidth
public void setGrowWidth(boolean aValue) Sets whether this view would like to grow horizontally if possible when inside a pane. -
isGrowHeight
public boolean isGrowHeight()Returns whether this view would like to grow vertically if possible when inside a pane. -
setGrowHeight
public void setGrowHeight(boolean aValue) Sets whether this view would like to grow vertically if possible when inside a pane. -
isHorizontal
public boolean isHorizontal()Returns whether this view has a horizontal orientation. -
isVertical
public boolean isVertical()Returns whether this view has a vertical orientation. -
setVertical
public void setVertical(boolean aValue) Sets whether this view has a vertical orientation. -
getBindings
Returns the list of bindings. -
getBindingCount
public int getBindingCount()Returns the number of bindings. -
getBinding
Returns the individual binding at given index. -
addBinding
Adds the individual binding to the shape's bindings list. -
removeBinding
Removes the binding at the given index from view bindings list. -
getBinding
Returns the individual binding with the given property name. -
removeBinding
Removes the binding with given property name. -
getProps
Returns the property map. -
getProp
Returns a named client property. -
setProp
Puts a named client property. -
isMinWidthSet
public boolean isMinWidthSet()Returns whether view minimum width is set. -
getMinWidth
public double getMinWidth()Returns the view minimum width. -
setMinWidth
public void setMinWidth(double aWidth) Sets the view minimum width. -
isMinHeightSet
public boolean isMinHeightSet()Returns whether view minimum height is set. -
getMinHeight
public double getMinHeight()Returns the view minimum height. -
setMinHeight
public void setMinHeight(double aHeight) Sets the view minimum height. -
getMinWidthImpl
protected double getMinWidthImpl()Calculates the minimum width. -
getMinHeightImpl
protected double getMinHeightImpl()Calculates the minimum height. -
getMinSize
Returns the view minimum size. -
setMinSize
Sets the view minimum size. -
setMinSize
public void setMinSize(double aWidth, double aHeight) Sets the view minimum size. -
isMaxWidthSet
public boolean isMaxWidthSet()Returns whether view maximum width is set. -
getMaxWidth
public double getMaxWidth()Returns the view maximum width. -
setMaxWidth
public void setMaxWidth(double aWidth) Sets the view maximum width. -
isMaxHeightSet
public boolean isMaxHeightSet()Returns whether view maximum height is set. -
getMaxHeight
public double getMaxHeight()Returns the view maximum height. -
setMaxHeight
public void setMaxHeight(double aHeight) Sets the view maximum height. -
getMaxSize
Returns the view maximum size. -
setMaxSize
Sets the view maximum size. -
setMaxSize
public void setMaxSize(double aWidth, double aHeight) Sets the view maximum size. -
isPrefWidthSet
public boolean isPrefWidthSet()Returns whether preferred width is set. -
getPrefWidth
public double getPrefWidth()Returns the view preferred width. -
getPrefWidth
public double getPrefWidth(double aH) Returns the view preferred width. -
setPrefWidth
public void setPrefWidth(double aWidth) Sets the view preferred width. -
isPrefHeightSet
public boolean isPrefHeightSet()Returns whether preferred width is set. -
getPrefHeight
public double getPrefHeight()Returns the view preferred height. -
getPrefHeight
public double getPrefHeight(double aW) Returns the view preferred height. -
setPrefHeight
public void setPrefHeight(double aHeight) Sets the view preferred height. -
getPrefWidthImpl
protected double getPrefWidthImpl(double aH) Calculates the preferred width. -
getPrefHeightImpl
protected double getPrefHeightImpl(double aW) Calculates the preferred height. -
getPrefSize
Returns the view preferred size. -
setPrefSize
Sets the view preferred size. -
setPrefSize
public void setPrefSize(double aWidth, double aHeight) Sets the view preferred size. -
setSizeToPrefSize
public void setSizeToPrefSize()Sets the size to preferred size. -
getBestWidth
public double getBestWidth(double aH) Returns the best width for view - accounting for pref/min/max. -
getBestHeight
public double getBestHeight(double aW) Returns the best height for view - accounting for pref/min/max. -
getBestSize
Returns the best size. -
setSizeToBestSize
public void setSizeToBestSize()Sets the size to best size. -
getAlign
Returns the alignment. -
setAlign
Sets the alignment. -
getAlignX
Returns the horizontal alignment. -
setAlignX
Sets the horizontal alignment. -
getAlignY
Returns the vertical alignment. -
setAlignY
Sets the vertical alignment. -
getMargin
Returns the spacing insets requested between parent/neighbors and the border of this view. -
setMargin
public void setMargin(double aTp, double aRt, double aBtm, double aLt) Sets the spacing insets requested between parent/neighbors and the border of this view. -
setMargin
Sets the spacing insets requested between parent/neighbors and the border of this view. -
getPadding
Returns the spacing insets between the border of this view and it's content. -
setPadding
public void setPadding(double aTp, double aRt, double aBtm, double aLt) Sets the spacing insets between the border of this view and it's content. -
setPadding
Sets the spacing insets between the border of this view and it's content. -
getSpacing
public double getSpacing()Returns the spacing for content (usually children). -
setSpacing
public void setSpacing(double aValue) Sets the spacing for content (usually children). -
getDefaultBorder
Returns the default border. -
getDefaultFill
Returns the default fill paint. -
getDefaultFont
Returns the default font. -
getInsetsAll
Returns the insets due to border and/or padding. -
paintAll
Main paint method. -
paintBack
Paints background. -
paintFront
Paints foreground. -
getToolTip
Returns the tool tip text. -
setToolTip
Sets the tool tip text. -
isToolTipEnabled
public boolean isToolTipEnabled()Returns whether tooltip is enabled. -
setToolTipEnabled
public void setToolTipEnabled(boolean aValue) Sets whether tooltip is enabled. -
getToolTip
Returns a tool tip string for given event. -
getRealClassName
Returns the substitution class name. -
setRealClassName
Sets the substitution class string. -
relayout
public void relayout()Called to relayout. -
relayoutParent
public void relayoutParent()Called to notify parents to relayout because preferred sizes have potentially changed. -
repaint
public void repaint()Called to register view for repaint. -
repaint
Called to register view for repaint. -
repaint
public void repaint(double aX, double aY, double aW, double aH) Called to register view for repaint. -
repaintInParent
Called to repaint in parent for cases where transform might change. -
getRepaintRect
Returns the rect of view that has been registered for repaint, expanded for focus/effects. -
getRepaintRectExpanded
Returns the given repaint rect, expanded for focus/effects. -
isNeedsRepaint
public boolean isNeedsRepaint()Returns whether needs repaint. -
isFocused
public boolean isFocused()Returns whether this view is the RootView.FocusedView. -
setFocused
protected void setFocused(boolean aValue) Sets whether this view is the RootView.FocusedView. -
isFocusable
public boolean isFocusable()Returns whether this view can get focus. -
setFocusable
public void setFocusable(boolean aValue) Sets whether this view can get focus. -
isFocusWhenPressed
public boolean isFocusWhenPressed()Returns whether this view should request focus when pressed. -
setFocusWhenPressed
public void setFocusWhenPressed(boolean aValue) Sets whether this view should request focus when pressed. -
isFocusKeysEnabled
public boolean isFocusKeysEnabled()Returns whether focus should change when traversal keys are pressed (Tab). -
setFocusKeysEnabled
public void setFocusKeysEnabled(boolean aValue) Sets whether focus should change when traversal keys are pressed (Tab). -
isFocusPainted
public boolean isFocusPainted()Returns whether focus ring should be painted when view is focused. -
setFocusPainted
public void setFocusPainted(boolean aValue) Sets whether focus ring should be painted when view is focused. -
isActionable
public boolean isActionable()Returns whether view can generate action events in response to certain user interactions. -
setActionable
public void setActionable(boolean aValue) Sets whether view can generate action events in response to certain user interactions. -
requestFocus
public void requestFocus()Tells view to request focus. -
getFocusNext
Returns the next focus View. -
getFocusPrev
Returns the next focus View. -
getOwner
Returns the view owner. -
setOwner
Sets the owner. -
getOwner
Returns the owner of given class. -
getEnv
Returns the view environment. -
runLater
Runs the given runnable in the next event. -
runDelayed
Runs the runnable after the given delay in milliseconds. -
runIntervals
Runs given runnable repeatedly every period milliseconds. -
stopIntervals
Stops running given runnable. -
getText
Returns the text value of this view. -
setText
Sets the text value of this view. -
getEventAdapter
Returns the event adapter for view. -
enableEvents
Sets an array of enabled events. -
disableEvents
Sets an array of enabled events. -
addEventFilter
Adds an event filter. -
removeEventFilter
Removes an event filter. -
addEventHandler
Adds an event handler. -
removeEventHandler
Removes an event handler. -
processEventAll
Top level process event method (calls filters and handlers). -
processEventFilters
Process ViewEvent for View EventFilters. -
processEventHandlers
Process ViewEvent for View EventHandlers. -
processEvent
Process ViewEvent. -
fireActionEvent
Fires an action event for given source event (can be null). This should mostly be called in response to user input events (mouse, key) when a complete change has been made to the primary value of a control view. -
createActionEvent
Creates an Action event for given source event. -
themeChanged
protected void themeChanged()Called when ViewTheme changes. -
getAnim
Returns the anim for the given time. -
getAnimCleared
Returns a cleared anim at given time. -
setAnimString
Convenience to quickly set anim props. -
setAnimProps
Convenience to quickly set anim props. -
playAnimDeep
public void playAnimDeep()Play animations deep. -
stopAnimDeep
public void stopAnimDeep()Stop animations deep. -
getAnimTimeDeep
public int getAnimTimeDeep()Returns the anim time. -
setAnimTimeDeep
public void setAnimTimeDeep(int aValue) Sets the anim time deep. -
getPhysics
Returns the physics objects that provides information for physics simulations. -
getPhysics
Returns the physics objects that provides information for physics simulations. -
clone
Standard clone implementation.- Overrides:
clone
in classPropObject
- Throws:
CloneNotSupportedException
-
getValuePropName
Returns a mapped property name. -
initProps
Initialize Props. Override to provide custom defaults.- Overrides:
initProps
in classPropObject
-
getPropValue
Returns the value for given prop name.- Overrides:
getPropValue
in classPropObject
-
setPropValue
Sets the value for given prop name.- Overrides:
setPropValue
in classPropObject
-
getPropDefault
Override property defaults for View.- Overrides:
getPropDefault
in classPropObject
-
toXML
XML Archival.- Specified by:
toXML
in interfaceXMLArchiver.Archivable
-
fromXML
XML unarchival.- Specified by:
fromXML
in interfaceXMLArchiver.Archivable
-
toStringProps
Standard toString implementation.- Overrides:
toStringProps
in classPropObject
-