C
- component typeU
- component UI typeD
- decoration typepublic class ProgressBarPainter<C extends JProgressBar,U extends WProgressBarUI,D extends IDecoration<C,D>> extends AbstractDecorationPainter<C,U,D> implements IProgressBarPainter<C,U>, ChangeListener
JProgressBar
component.
It is used as WProgressBarUI
default painter.Modifier and Type | Field and Description |
---|---|
protected Dimension |
minimumContentSize
Style settings.
|
protected IProgressPainter |
progressPainter
Progress line painter.
|
protected IProgressTextPainter |
progressTextPainter
Progress text painter.
|
protected int |
value
Cached last progress bar value.
|
ancestor, containerListener, current, DECORATION_BORDER_PROPERTY, DECORATION_STATES_PROPERTY, decorationCache, decorations, focused, focusStateTracker, hierarchyTracker, hover, hoverStateTracker, inFocusedParent, inFocusedParentAncestorListener, inFocusedParentTracker, inHoveredParent, inHoveredParentAncestorListener, inHoveredParentTracker, neighboursTracker, stateDecorationCache, states
component, installed, ltr, propertyChangeListener, sectionPainters, ui
Constructor and Description |
---|
ProgressBarPainter() |
Modifier and Type | Method and Description |
---|---|
List<String> |
getDecorationStates()
Returns current component decoration states.
|
protected Dimension |
getMinimumContentSize()
Returns minimum content area size.
|
Dimension |
getPreferredSize()
Returns preferred size required for proper painting of the view provided by this painter.
|
protected List<SectionPainter<C,U>> |
getSectionPainters()
Returns
SectionPainter s used by this painter or null if none are used. |
protected void |
installProgressBarValueListeners()
Installs custom
JProgressBar value listeners which will perform decoration state updates when needed. |
protected void |
installPropertiesAndListeners()
Installs properties and listeners used by this
Painter implementation. |
protected boolean |
isHorizontal()
Returns whether or not progress bar is horizontal.
|
protected void |
paintContent(Graphics2D g2d,
C c,
U ui,
Rectangle bounds)
Paints additional custom content provided by this painter.
|
protected void |
paintProgress(Graphics2D g2d,
Rectangle bounds)
Paints progress line.
|
protected void |
paintText(Graphics2D g2d,
Rectangle bounds)
Paints progress bar text.
|
protected void |
propertyChanged(String property,
Object oldValue,
Object newValue)
Informs about
AbstractPainter.component property change. |
void |
stateChanged(ChangeEvent e) |
protected void |
uninstallProgressBarValueListeners()
Uninstalls custom
JProgressBar value listeners. |
protected void |
uninstallPropertiesAndListeners()
Uninstalls properties and listeners used by this
Painter implementation. |
afterInstall, afterUninstall, beforeUninstall, childrenChanged, collectDecorationStates, contains, deactivateLastDecoration, focusChanged, getBaseline, getBaselineResizeBehavior, getBorder, getDecoration, getDecorations, getDecorationsKey, hierarchyChanged, hoverChanged, installBorderListeners, installChildrenListeners, installFocusListeners, installHoverListeners, installInFocusedParentListeners, installInHoveredParentListeners, isDecorationAvailable, isEnabled, isFocused, isHover, isInFocusedParent, isInHoveredParent, isOpaque, isOpaqueDecorated, isOpaqueUndecorated, isPlainBackgroundRequired, orientationChange, paint, provideShape, uninstallBorderListeners, uninstallChildrenListeners, uninstallFocusListeners, uninstallHoverListeners, uninstallInFocusedParentListeners, uninstallInHoveredParentListeners, updateDecorationState, updateFocusListeners, updateHoverListeners, updateInFocusedParent, updateInHoveredParent, usesContainerView, usesFocusedView, usesHierarchyBasedView, usesHoverView, usesInFocusedParentView, usesInHoveredParentView, usesState, usesState
asList, beforeInstall, borderChange, getCompleteBorder, getInstalledSectionPainters, install, installPropertyChangeListener, installSectionPainter, installSectionPainters, isInstalled, isSectionPainter, isSettingsUpdateAllowed, paintSection, repaint, repaint, repaint, revalidate, saveOrientation, uninstall, uninstallPropertyChangeListener, uninstallSectionPainter, uninstallSectionPainters, updateAll, updateBorder, updateOpacity, updateOrientation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contains, getBaseline, getBaselineResizeBehavior, install, isInstalled, isOpaque, paint, uninstall
protected Dimension minimumContentSize
@DefaultPainter(value=ProgressPainter.class) protected IProgressPainter progressPainter
@DefaultPainter(value=ProgressTextPainter.class) protected IProgressTextPainter progressTextPainter
protected transient int value
@Nullable protected List<SectionPainter<C,U>> getSectionPainters()
AbstractPainter
SectionPainter
s used by this painter or null
if none are used.
Do not return any null
SectionPainter
s here, it will cause an exception.
You can use AbstractPainter.asList(SectionPainter[])
method to conveniently form a list filtering out null
s.getSectionPainters
in class AbstractPainter<C extends JProgressBar,U extends WProgressBarUI>
SectionPainter
s used by this painter or null
if none are usedprotected void installPropertiesAndListeners()
AbstractPainter
Painter
implementation.
Override this method instead of AbstractPainter.install(JComponent, ComponentUI)
to install additional properties and listeners.installPropertiesAndListeners
in class AbstractDecorationPainter<C extends JProgressBar,U extends WProgressBarUI,D extends IDecoration<C,D>>
protected void uninstallPropertiesAndListeners()
AbstractPainter
Painter
implementation.
Override this method instead of AbstractPainter.uninstall(JComponent, ComponentUI)
to uninstall additional properties and listeners.uninstallPropertiesAndListeners
in class AbstractDecorationPainter<C extends JProgressBar,U extends WProgressBarUI,D extends IDecoration<C,D>>
protected void propertyChanged(@NotNull String property, @Nullable Object oldValue, @Nullable Object newValue)
AbstractPainter
AbstractPainter.component
property change.propertyChanged
in class AbstractDecorationPainter<C extends JProgressBar,U extends WProgressBarUI,D extends IDecoration<C,D>>
property
- modified propertyoldValue
- old property valuenewValue
- new property valueprotected void installProgressBarValueListeners()
JProgressBar
value listeners which will perform decoration state updates when needed.protected void uninstallProgressBarValueListeners()
JProgressBar
value listeners.public void stateChanged(@NotNull ChangeEvent e)
stateChanged
in interface ChangeListener
@NotNull public List<String> getDecorationStates()
IDecorationPainter
getDecorationStates
in interface IDecorationPainter<C extends JProgressBar,U extends WProgressBarUI,D extends IDecoration<C,D>>
getDecorationStates
in class AbstractDecorationPainter<C extends JProgressBar,U extends WProgressBarUI,D extends IDecoration<C,D>>
protected void paintContent(@NotNull Graphics2D g2d, @NotNull C c, @NotNull U ui, @NotNull Rectangle bounds)
AbstractDecorationPainter
paintContent
in class AbstractDecorationPainter<C extends JProgressBar,U extends WProgressBarUI,D extends IDecoration<C,D>>
g2d
- graphics contextc
- painted componentui
- painted component UIbounds
- painting boundsprotected void paintProgress(@NotNull Graphics2D g2d, @NotNull Rectangle bounds)
g2d
- graphics contextbounds
- painting boundsprotected void paintText(@NotNull Graphics2D g2d, @NotNull Rectangle bounds)
g2d
- graphics contextbounds
- painting bounds@NotNull protected Dimension getMinimumContentSize()
protected boolean isHorizontal()
@NotNull public Dimension getPreferredSize()
Painter
getPreferredSize
in interface Painter<C extends JProgressBar,U extends WProgressBarUI>
getPreferredSize
in class AbstractDecorationPainter<C extends JProgressBar,U extends WProgressBarUI,D extends IDecoration<C,D>>
Copyright © 2020. All rights reserved.