Package limn.components
Class ImageView
java.lang.Object
limn.scene.Widget
limn.components.ImageView
Displays an
Image: a full-color picture, or a monochrome/mask icon
when a tint is set (the image's alpha becomes the shape,
recolored by the tint, so an icon follows the theme). ImageView.Fit controls
how the image maps into the widget bounds.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SizeonMeasure(Constraints constraints) Reports the size this widget wants withinconstraints.protected voidWidget's own background/content, in local coordinates.setFit(ImageView.Fit newFit) How the image fills its box when the two aspect ratios differ.Replaces the image, re-measuring if its natural size differs.setPreferredSize(float width, float height) Fixed preferred size in logical points (-1= natural image size).Tints the image (icon mode);nulldraws it in full color.Methods inherited from class limn.scene.Widget
acceptsTextInput, add, baselineOffset, baselineOffsetOf, caretRect, children, clipboard, clipsChildren, controlSize, cursor, declaredControlSize, declaredLayoutDirection, declaredLocale, focusArrivedByTraversal, height, hitTest, imageCursor, invalidate, invalidate, isEnabled, isFocusable, isFocused, isShowing, isVisible, layoutBox, layoutDirection, locale, localToSceneX, localToSceneY, markNeedsContainedLayout, markNeedsLayout, measure, moveChild, neutralBase, onAttached, onCharTyped, onDetached, onFileDrop, onFocusGained, onFocusLost, onKeyEvent, onLayout, onMouseEvent, onPaintOverlay, onPreedit, overlayPassesPointer, paintChildren, paintOutset, paintWidget, parent, remove, requestFocus, revealInView, scene, sceneToLocalX, sceneToLocalY, setControlSize, setCursor, setEnabled, setFocusable, setImageCursor, setInheritanceHost, setLayoutDirection, setLocale, setTooltip, setTooltip, setVisible, shapeText, textRuler, tooltip, width, x, y
-
Constructor Details
-
ImageView
Shows an image at its natural size until the layout says otherwise.
-
-
Method Details
-
setImage
Replaces the image, re-measuring if its natural size differs. UI thread only. -
setFit
How the image fills its box when the two aspect ratios differ. -
setTint
Tints the image (icon mode);nulldraws it in full color. -
setPreferredSize
Fixed preferred size in logical points (-1= natural image size). -
onMeasure
Description copied from class:WidgetReports the size this widget wants withinconstraints. Called once per layout pass, and the result is cached against the constraints and the resolved axes (size step, layout direction, locale), so it must be a pure function of them and of this widget's own state.Resolve the
ControlSizeand theLayoutDirectiononce each here and thread them down; never read either in a constructor. The locale needs no threading: it is in scope, andI18n.locale()answers it wherever text is resolved. -
onPaint
Description copied from class:WidgetWidget's own background/content, in local coordinates.
-