com.alee.extended.statusbar
Class WebMemoryBar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLabel
                  extended by com.alee.laf.label.WebLabel
                      extended by com.alee.extended.statusbar.WebMemoryBar
All Implemented Interfaces:
LanguageMethods, ShapeProvider, Styleable, FontMethods<WebLabel>, SizeMethods<WebLabel>, SwingMethods, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants

public class WebMemoryBar
extends WebLabel
implements ShapeProvider, SizeMethods<WebLabel>

User: mgarin Date: 10.10.11 Time: 17:51

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JLabel
javax.swing.JLabel.AccessibleJLabel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 boolean drawBorder
           
 boolean fillBackground
           
static java.lang.String THREAD_NAME
           
 
Fields inherited from class javax.swing.JLabel
labelFor
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WebMemoryBar()
           
 
Method Summary
 void addMemoryBarListener(MemoryBarListener listener)
           
 void doGC()
           
 void fireGcCalled()
           
 void fireGcCompleted()
           
 java.awt.Color getAllocatedBorderColor()
           
 java.awt.Color getAllocatedDisabledBorderColor()
           
 long getAllocatedMemory()
           
 int getLeftRightSpacing()
           
 long getMaxMemory()
           
protected  java.lang.String getMemoryBarText()
           
protected  java.lang.String getMemoryBarTooltipText()
           
 javax.swing.ImageIcon getMemoryIcon()
           
 int getMinimumHeight()
          Returns component minimum height.
 int getMinimumWidth()
          Returns component minimum width.
 int getPreferredHeight()
          Returns component preferred height.
 java.awt.Dimension getPreferredSize()
          Returns component preferred size.
 int getPreferredWidth()
          Returns component preferred width.
 int getRefreshRate()
           
 int getRound()
           
 int getShadeWidth()
           
 int getTooltipDelay()
           
 java.awt.Color getUsedBorderColor()
           
 java.awt.Color getUsedFillColor()
           
 long getUsedMemory()
           
 boolean isAllowGcAction()
           
 boolean isDrawBorder()
           
 boolean isFillBackground()
           
 boolean isShowMaximumMemory()
           
 boolean isShowTooltip()
           
protected  void paintComponent(java.awt.Graphics g)
           
 java.awt.Shape provideShape()
          Returns component shape.
 void removeMemoryBarListener(MemoryBarListener listener)
           
 void setAllocatedBorderColor(java.awt.Color allocatedBorderColor)
           
 void setAllocatedDisabledBorderColor(java.awt.Color allocatedDisabledBorderColor)
           
 void setAllowGcAction(boolean allowGcAction)
           
 void setDrawBorder(boolean drawBorder)
           
 void setFillBackground(boolean fillBackground)
           
 void setLeftRightSpacing(int leftRightSpacing)
           
 void setMemoryIcon(javax.swing.ImageIcon memoryIcon)
           
 WebMemoryBar setMinimumHeight(int minimumHeight)
          Sets component minimum height.
 WebMemoryBar setMinimumWidth(int minimumWidth)
          Sets component minimum width.
 WebMemoryBar setPreferredHeight(int preferredHeight)
          Sets component preferred height.
 WebMemoryBar setPreferredWidth(int preferredWidth)
          Sets component preferred width.
 void setRefreshRate(int refreshRate)
           
 void setRound(int round)
           
 void setShadeWidth(int shadeWidth)
           
 void setShowMaximumMemory(boolean showMaximumMemory)
           
 void setShowTooltip(boolean showTooltip)
           
 void setTooltipDelay(int tooltipDelay)
           
 void setUsedBorderColor(java.awt.Color usedBorderColor)
           
 void setUsedFillColor(java.awt.Color usedFillColor)
           
protected  void updateMemory()
           
 
Methods inherited from class com.alee.laf.label.WebLabel
changeFontSize, createTranslatedLabel, createTranslatedLabel, createTranslatedLabel, createTranslatedLabel, createTranslatedLabel, createTranslatedLabel, createTranslatedLabel, createTranslatedLabel, getFontName, getFontSize, getMargin, getPainter, getShadeColor, getStyleId, getTransparency, getWebUI, isBoldFont, isDrawShade, isItalicFont, isLanguageSet, isPlainFont, removeLanguage, removeLanguageUpdater, setBoldFont, setBoldFont, setDrawShade, setFontName, setFontSize, setFontSizeAndStyle, setFontSizeAndStyle, setFontStyle, setFontStyle, setItalicFont, setItalicFont, setLanguage, setLanguageUpdater, setMargin, setMargin, setMargin, setPainter, setPlainFont, setPlainFont, setShadeColor, setStyleId, setTransparency, updateLanguage, updateLanguage, updateUI
 
Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

THREAD_NAME

public static final java.lang.String THREAD_NAME
See Also:
Constant Field Values

drawBorder

public boolean drawBorder

fillBackground

public boolean fillBackground
Constructor Detail

WebMemoryBar

public WebMemoryBar()
Method Detail

doGC

public void doGC()

updateMemory

protected void updateMemory()

getMemoryBarText

protected java.lang.String getMemoryBarText()

getMemoryBarTooltipText

protected java.lang.String getMemoryBarTooltipText()

getRefreshRate

public int getRefreshRate()

setRefreshRate

public void setRefreshRate(int refreshRate)

getRound

public int getRound()

setRound

public void setRound(int round)

getShadeWidth

public int getShadeWidth()

setShadeWidth

public void setShadeWidth(int shadeWidth)

getAllocatedBorderColor

public java.awt.Color getAllocatedBorderColor()

setAllocatedBorderColor

public void setAllocatedBorderColor(java.awt.Color allocatedBorderColor)

getAllocatedDisabledBorderColor

public java.awt.Color getAllocatedDisabledBorderColor()

setAllocatedDisabledBorderColor

public void setAllocatedDisabledBorderColor(java.awt.Color allocatedDisabledBorderColor)

getUsedBorderColor

public java.awt.Color getUsedBorderColor()

setUsedBorderColor

public void setUsedBorderColor(java.awt.Color usedBorderColor)

getUsedFillColor

public java.awt.Color getUsedFillColor()

setUsedFillColor

public void setUsedFillColor(java.awt.Color usedFillColor)

getLeftRightSpacing

public int getLeftRightSpacing()

setLeftRightSpacing

public void setLeftRightSpacing(int leftRightSpacing)

isDrawBorder

public boolean isDrawBorder()

setDrawBorder

public void setDrawBorder(boolean drawBorder)

isFillBackground

public boolean isFillBackground()

setFillBackground

public void setFillBackground(boolean fillBackground)

isAllowGcAction

public boolean isAllowGcAction()

setAllowGcAction

public void setAllowGcAction(boolean allowGcAction)

isShowTooltip

public boolean isShowTooltip()

setShowTooltip

public void setShowTooltip(boolean showTooltip)

getAllocatedMemory

public long getAllocatedMemory()

getUsedMemory

public long getUsedMemory()

getMaxMemory

public long getMaxMemory()

getMemoryIcon

public javax.swing.ImageIcon getMemoryIcon()

setMemoryIcon

public void setMemoryIcon(javax.swing.ImageIcon memoryIcon)

getTooltipDelay

public int getTooltipDelay()

setTooltipDelay

public void setTooltipDelay(int tooltipDelay)

isShowMaximumMemory

public boolean isShowMaximumMemory()

setShowMaximumMemory

public void setShowMaximumMemory(boolean showMaximumMemory)

provideShape

public java.awt.Shape provideShape()
Description copied from interface: ShapeProvider
Returns component shape.

Specified by:
provideShape in interface ShapeProvider
Returns:
component shape

paintComponent

protected void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

addMemoryBarListener

public void addMemoryBarListener(MemoryBarListener listener)

removeMemoryBarListener

public void removeMemoryBarListener(MemoryBarListener listener)

fireGcCalled

public void fireGcCalled()

fireGcCompleted

public void fireGcCompleted()

getPreferredWidth

public int getPreferredWidth()
Returns component preferred width.

Specified by:
getPreferredWidth in interface SizeMethods<WebLabel>
Overrides:
getPreferredWidth in class WebLabel
Returns:
component preferred width

setPreferredWidth

public WebMemoryBar setPreferredWidth(int preferredWidth)
Sets component preferred width. Pass -1 to let component choose preferred width on its own.

Specified by:
setPreferredWidth in interface SizeMethods<WebLabel>
Overrides:
setPreferredWidth in class WebLabel
Parameters:
preferredWidth - new component preferred width
Returns:
modified component

getPreferredHeight

public int getPreferredHeight()
Returns component preferred height.

Specified by:
getPreferredHeight in interface SizeMethods<WebLabel>
Overrides:
getPreferredHeight in class WebLabel
Returns:
component preferred height

setPreferredHeight

public WebMemoryBar setPreferredHeight(int preferredHeight)
Sets component preferred height. Pass -1 to let component choose preferred height on its own.

Specified by:
setPreferredHeight in interface SizeMethods<WebLabel>
Overrides:
setPreferredHeight in class WebLabel
Parameters:
preferredHeight - new component preferred height
Returns:
modified component

getMinimumWidth

public int getMinimumWidth()
Returns component minimum width.

Specified by:
getMinimumWidth in interface SizeMethods<WebLabel>
Overrides:
getMinimumWidth in class WebLabel
Returns:
component minimum width

setMinimumWidth

public WebMemoryBar setMinimumWidth(int minimumWidth)
Sets component minimum width. Pass -1 to let component choose minimum width on its own.

Specified by:
setMinimumWidth in interface SizeMethods<WebLabel>
Overrides:
setMinimumWidth in class WebLabel
Parameters:
minimumWidth - new component minimum width
Returns:
modified component

getMinimumHeight

public int getMinimumHeight()
Returns component minimum height.

Specified by:
getMinimumHeight in interface SizeMethods<WebLabel>
Overrides:
getMinimumHeight in class WebLabel
Returns:
component minimum height

setMinimumHeight

public WebMemoryBar setMinimumHeight(int minimumHeight)
Sets component minimum height. Pass -1 to let component choose minimum height on its own.

Specified by:
setMinimumHeight in interface SizeMethods<WebLabel>
Overrides:
setMinimumHeight in class WebLabel
Parameters:
minimumHeight - new component minimum height
Returns:
modified component

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns component preferred size.

Specified by:
getPreferredSize in interface SizeMethods<WebLabel>
Overrides:
getPreferredSize in class WebLabel
Returns:
component preferred size