Package com.biglybt.ui.swt.mainwindow
Class MainStatusBar.CLabelPadding
- java.lang.Object
-
- org.eclipse.swt.widgets.Widget
-
- org.eclipse.swt.widgets.Control
-
- org.eclipse.swt.widgets.Scrollable
-
- org.eclipse.swt.widgets.Composite
-
- org.eclipse.swt.widgets.Canvas
-
- com.biglybt.ui.swt.mainwindow.MainStatusBar.CLabelPadding
-
- All Implemented Interfaces:
java.util.EventListener
,org.eclipse.swt.events.PaintListener
,org.eclipse.swt.graphics.Drawable
,org.eclipse.swt.internal.SWTEventListener
- Direct Known Subclasses:
MainStatusBar.UpdateableCLabel
- Enclosing class:
- MainStatusBar
public class MainStatusBar.CLabelPadding extends org.eclipse.swt.widgets.Canvas implements org.eclipse.swt.events.PaintListener
CLabel that shrinks to fit text after a specific period of time. Makes textual changes less jumpy
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.graphics.Image
bgImage
private boolean
hovering
private org.eclipse.swt.graphics.Image
image
private static int
KEEPWIDTHFOR_MS
private int
lastWidth
private java.lang.String
text
private java.lang.String
tooltip_text
private long
widthSetOn
-
Constructor Summary
Constructors Constructor Description CLabelPadding(org.eclipse.swt.widgets.Composite parent, int style)
Default Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.graphics.Point
computeSize(int wHint, int hHint)
org.eclipse.swt.graphics.Point
computeSize(int wHint, int hHint, boolean changed)
org.eclipse.swt.graphics.Point
computeSize(int wHint, int hHint, boolean changed, boolean realWidth)
org.eclipse.swt.graphics.Image
getBackgroundImage()
org.eclipse.swt.graphics.Image
getImage()
java.lang.String
getText()
java.lang.String
getToolTipText()
void
layoutNow()
void
paintControl(org.eclipse.swt.events.PaintEvent e)
void
reset()
void
setBackgroundImage(org.eclipse.swt.graphics.Image image)
void
setImage(org.eclipse.swt.graphics.Image image)
void
setText(java.lang.String text)
void
setToolTipText(java.lang.String str)
-
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME
-
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
-
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
-
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isAutoScalable, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
-
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
-
-
-
-
Field Detail
-
lastWidth
private int lastWidth
-
widthSetOn
private long widthSetOn
-
KEEPWIDTHFOR_MS
private static final int KEEPWIDTHFOR_MS
- See Also:
- Constant Field Values
-
text
private java.lang.String text
-
tooltip_text
private java.lang.String tooltip_text
-
hovering
private boolean hovering
-
image
private org.eclipse.swt.graphics.Image image
-
bgImage
private org.eclipse.swt.graphics.Image bgImage
-
-
Method Detail
-
setToolTipText
public void setToolTipText(java.lang.String str)
- Overrides:
setToolTipText
in classorg.eclipse.swt.widgets.Control
-
getToolTipText
public java.lang.String getToolTipText()
- Overrides:
getToolTipText
in classorg.eclipse.swt.widgets.Control
-
paintControl
public void paintControl(org.eclipse.swt.events.PaintEvent e)
- Specified by:
paintControl
in interfaceorg.eclipse.swt.events.PaintListener
-
computeSize
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint)
- Overrides:
computeSize
in classorg.eclipse.swt.widgets.Control
-
computeSize
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed)
- Overrides:
computeSize
in classorg.eclipse.swt.widgets.Control
-
computeSize
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed, boolean realWidth)
-
setImage
public void setImage(org.eclipse.swt.graphics.Image image)
-
getImage
public org.eclipse.swt.graphics.Image getImage()
-
setBackgroundImage
public void setBackgroundImage(org.eclipse.swt.graphics.Image image)
- Overrides:
setBackgroundImage
in classorg.eclipse.swt.widgets.Control
-
getBackgroundImage
public org.eclipse.swt.graphics.Image getBackgroundImage()
- Overrides:
getBackgroundImage
in classorg.eclipse.swt.widgets.Control
-
getText
public java.lang.String getText()
-
setText
public void setText(java.lang.String text)
-
reset
public void reset()
-
layoutNow
public void layoutNow()
-
-