Class VControl

Direct Known Subclasses:
VButton, VLabel, VNative, VPanel, VSpacer

public abstract class VControl
extends java.lang.Object
A VControl is a class wich wraps an SWT Button to create a widget that acts as much like a native Button as possible while adding the following features:
  • The appearance of Label when the mouse is not over it and it does not have the focus or selection (if style is SWT.TOGGLE).
  • Can fit seemlessly into a larger visual piece - simple set the image to that of its background and adjust the image's offset if necessary.
  • Can draw polygons and ovals.
  • Can center or otherwise align its visual display (text, image, polygon or oval).
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  VControl.Type  
  • Field Summary

    Modifier and Type Field Description
    (package private) background  
    (package private) bounds  
    static boolean carbon
    true if the platform is Carbon, false otherwise
    (package private) org.eclipse.swt.widgets.Composite composite  
    (package private) boolean customToolTip  
    (package private) java.util.Map<java.lang.String,​java.lang.Object> dataMap  
    (package private) boolean disposed  
    (package private) fill  
    (package private) font  
    (package private) foreground  
    static boolean gtk
    true if the platform is GTK, false otherwise
    (package private) image  
    (package private) org.eclipse.swt.layout.GridData layoutData  
    (package private) java.util.Map<java.lang.Integer,​java.util.List<org.eclipse.swt.widgets.Listener>> listeners  
    (package private) int marginBottom  
    (package private) int marginLeft  
    (package private) int marginRight  
    (package private) int marginTop  
    (package private) org.eclipse.swt.widgets.Menu menu  
    (package private) IControlPainter painter  
    (package private) VPanel parent  
    (package private) int[] points  
    (package private) boolean scaleImage  
    (package private) boolean square  
    static int STATE_ACTIVE  
    static int STATE_ENABLED  
    static int STATE_MOUSE_DOWN  
    static int STATE_SELECTED  
    (package private) SvgDocument svg  
    (package private) java.lang.String text  
    (package private) java.lang.String tooltipText  
    (package private) int visibility  
    static boolean win32
    true if the platform is Win32, false otherwise
    (package private) int xAlign  
    (package private) int yAlign  
  • Constructor Summary

    Constructor Description
    VControl​(VPanel panel, int style)
    Javadoc out of date // TODO: update javadoc
  • Method Summary

    Modifier and Type Method Description
    (package private) void activate()  
    (package private) void addListener​(int eventType)  
    void addListener​(int eventType, org.eclipse.swt.widgets.Listener listener)  
    (package private) void attachListeners​(boolean keyListeners) computeSize​(int wHint, int hHint) computeSize​(int wHint, int hHint, boolean changed)  
    protected static boolean containsControl​(org.eclipse.swt.widgets.Control control, org.eclipse.swt.widgets.Composite composite)  
    org.eclipse.swt.widgets.Menu createMenu()  
    (package private) void deactivate()  
    (package private) void detachListeners​(boolean keyListeners)  
    void dispose()  
    protected void filterEvent​(org.eclipse.swt.widgets.Event event) getBackground() getBounds() getClientArea() getClientSize()  
    org.eclipse.swt.widgets.Composite getComposite()  
    org.eclipse.swt.widgets.Control getControl()  
    java.lang.Object getData​(java.lang.Enum<?> name)  
    <T> T getData​(java.lang.Enum<?> name, java.lang.Class<T> clazz)  
    java.lang.Object getData​(java.lang.String name)  
    <T> T getData​(java.lang.String name, java.lang.Class<T> clazz)  
    org.eclipse.swt.widgets.Display getDisplay()  
    boolean getEnabled() getFont() getForeground() getImage()  
    org.eclipse.swt.layout.GridData getLayoutData()  
    protected org.eclipse.swt.widgets.Listener[] getListeners​(int eventType) getLocation() getMargins()  
    org.eclipse.swt.widgets.Menu getMenu()  
    VPanel getParent()  
    org.eclipse.swt.widgets.Shell getShell() getSize()  
    int getState()  
    int getStyle()  
    java.lang.String getText()  
    java.lang.String getToolTipText()  
    abstract VControl.Type getType()  
    int getVisibility()  
    boolean getVisible()  
    org.eclipse.swt.widgets.Composite getWidget()  
    (package private) void handleEvent​(org.eclipse.swt.widgets.Event event)  
    boolean hasState​(int state)  
    boolean hasStyle​(int style)  
    boolean isActivatable()  
    boolean isDisposed()  
    boolean isEnabled()  
    boolean isSameWidgetAs​(VControl control)  
    boolean isSameWidgetAs​(org.eclipse.swt.widgets.Widget widget)  
    boolean isSquare()  
    boolean isVisible()  
    void moveAbove​(VControl control)  
    void moveBelow​(VControl control)  
    void notifyListeners​(int eventType)  
    void notifyListeners​(int eventType, org.eclipse.swt.widgets.Event event)  
    void paintControl​(org.eclipse.swt.widgets.Event e)  
    void redraw()  
    protected boolean redrawOnActivate()  
    protected boolean redrawOnDeactivate()  
    (package private) void removeListener​(int eventType)  
    void removeListener​(int eventType, org.eclipse.swt.widgets.Listener listener)  
    void setActivatable​(boolean activatable)  
    void setActiveCursor​( cursor)  
    void setAlignment​(int x, int y)  
    void setAlpha​( gc)  
    void setAlpha​( gc, int alpha)  
    void setBackground​( color)  
    void setBounds​(int x, int y, int width, int height)  
    void setBounds​( bounds)  
    void setCursor​( cursor)  
    void setData​(java.lang.Enum<?> name, java.lang.Object value)  
    void setData​(java.lang.String name, java.lang.Object value)  
    void setEnabled​(boolean enabled)  
    void setFill​( color)  
    boolean setFocus()  
    protected boolean setFocus​(boolean focus)  
    void setFont​( font)  
    void setForeground​( color)  
    void setImage​(SvgDocument svg)  
    void setImage​( image)  
    void setInactiveCursor​( cursor)  
    void setLayoutData​(org.eclipse.swt.layout.GridData data)  
    void setLocation​(int x, int y)  
    void setLocation​( location)  
    void setMargins​(int marginWidth, int marginHeight)  
    void setMargins​(int left, int right, int top, int bottom)  
    void setMargins​( margins)  
    void setOval​(int rx, int ry)  
    void setOval​(int rx, int ry, fillColor)  
    void setPainter​(IControlPainter painter)  
    void setParent​(VPanel panel)  
    void setPolygon​(int[] points)  
    void setPolygon​(int[] points, fillColor)  
    void setScaleImage​(boolean scale)  
    void setSize​( size)  
    void setSquare​(boolean equal)
    if parameter equal is true, the x and y sizes of this VControl will be forced equal, thus drawing a square button
    protected boolean setState​(int state, boolean set)  
    void setStyle​(int style)  
    boolean setStyle​(int style, boolean set)  
    void setText​(java.lang.String text)  
    void setToolTipText​(java.lang.String text)  
    (package private) void setVisibility​(int visibility)  
    void setVisible​(boolean visible)  
    void setVisible​(boolean visible, int duration)  
    void setVisible​(boolean visible, int duration, java.lang.Runnable callback) toControl​(int x, int y) toControl​( point) toDisplay​(int x, int y) toDisplay​( point)  
    java.lang.String toString()  
    void update()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • VControl

      public VControl​(VPanel panel, int style)
      Javadoc out of date // TODO: update javadoc
      panel -
      style -
  • Method Details

    • containsControl

      protected static final boolean containsControl​(org.eclipse.swt.widgets.Control control, org.eclipse.swt.widgets.Composite composite)
    • handleEvent

      void handleEvent​(org.eclipse.swt.widgets.Event event)
    • activate

      void activate()
    • addListener

      void addListener​(int eventType)
    • addListener

      public void addListener​(int eventType, org.eclipse.swt.widgets.Listener listener)
    • attachListeners

      void attachListeners​(boolean keyListeners)
    • detachListeners

      void detachListeners​(boolean keyListeners)
    • computeSize

      public computeSize​(int wHint, int hHint)
    • computeSize

      public computeSize​(int wHint, int hHint, boolean changed)
    • createMenu

      public org.eclipse.swt.widgets.Menu createMenu()
    • deactivate

      void deactivate()
    • dispose

      public void dispose()
    • getBackground

      public getBackground()
    • getBounds

      public getBounds()
    • getClientArea

      public getClientArea()
    • getClientSize

      public getClientSize()
    • getComposite

      public org.eclipse.swt.widgets.Composite getComposite()
    • getControl

      public org.eclipse.swt.widgets.Control getControl()
    • getData

      public java.lang.Object getData​(java.lang.Enum<?> name)
    • getData

      public <T> T getData​(java.lang.Enum<?> name, java.lang.Class<T> clazz)
    • getData

      public java.lang.Object getData​(java.lang.String name)
    • getData

      public <T> T getData​(java.lang.String name, java.lang.Class<T> clazz)
    • getDisplay

      public org.eclipse.swt.widgets.Display getDisplay()
    • getEnabled

      public boolean getEnabled()
    • getFont

      public getFont()
    • getForeground

      public getForeground()
    • getImage

      public getImage()
    • getLayoutData

      public org.eclipse.swt.layout.GridData getLayoutData()
    • getListeners

      protected org.eclipse.swt.widgets.Listener[] getListeners​(int eventType)
    • getLocation

      public getLocation()
    • getMargins

      public getMargins()
    • getMenu

      public org.eclipse.swt.widgets.Menu getMenu()
    • getParent

      public VPanel getParent()
    • getShell

      public org.eclipse.swt.widgets.Shell getShell()
    • getSize

      public getSize()
    • getState

      public int getState()
    • getStyle

      public int getStyle()
    • getText

      public java.lang.String getText()
      the text string displayed on this VControl
    • getToolTipText

      public java.lang.String getToolTipText()
    • getType

      public abstract VControl.Type getType()
    • getVisibility

      public int getVisibility()
    • getVisible

      public boolean getVisible()
    • getWidget

      public org.eclipse.swt.widgets.Composite getWidget()
    • filterEvent

      protected void filterEvent​(org.eclipse.swt.widgets.Event event)
    • hasState

      public boolean hasState​(int state)
    • hasStyle

      public boolean hasStyle​(int style)
    • isActivatable

      public boolean isActivatable()
    • isDisposed

      public boolean isDisposed()
    • isEnabled

      public boolean isEnabled()
    • isSameWidgetAs

      public boolean isSameWidgetAs​(VControl control)
    • isSameWidgetAs

      public boolean isSameWidgetAs​(org.eclipse.swt.widgets.Widget widget)
    • isSquare

      public boolean isSquare()
      true if this VControl is to be sized as a square
    • isVisible

      public boolean isVisible()
    • moveAbove

      public void moveAbove​(VControl control)
    • moveBelow

      public void moveBelow​(VControl control)
    • notifyListeners

      public void notifyListeners​(int eventType)
    • notifyListeners

      public void notifyListeners​(int eventType, org.eclipse.swt.widgets.Event event)
    • paintControl

      public final void paintControl​(org.eclipse.swt.widgets.Event e)
    • redraw

      public void redraw()
    • redrawOnActivate

      protected boolean redrawOnActivate()
    • redrawOnDeactivate

      protected boolean redrawOnDeactivate()
    • removeListener

      void removeListener​(int eventType)
    • removeListener

      public void removeListener​(int eventType, org.eclipse.swt.widgets.Listener listener)
    • setActivatable

      public void setActivatable​(boolean activatable)
    • setActiveCursor

      public void setActiveCursor​( cursor)
    • setAlignment

      public void setAlignment​(int x, int y)
      x -
      y -
    • setAlpha

      public void setAlpha​( gc)
    • setAlpha

      public void setAlpha​( gc, int alpha)
    • setBackground

      public void setBackground​( color)
    • setBounds

      public void setBounds​(int x, int y, int width, int height)
    • setBounds

      public void setBounds​( bounds)
    • setCursor

      public void setCursor​( cursor)
    • setData

      public void setData​(java.lang.Enum<?> name, java.lang.Object value)
    • setData

      public void setData​(java.lang.String name, java.lang.Object value)
    • setEnabled

      public void setEnabled​(boolean enabled)
    • setFill

      public void setFill​( color)
    • setFocus

      public boolean setFocus()
    • setFocus

      protected boolean setFocus​(boolean focus)
    • setFont

      public void setFont​( font)
    • setForeground

      public void setForeground​( color)
    • setImage

      public void setImage​( image)
    • setImage

      public void setImage​(SvgDocument svg)
    • setInactiveCursor

      public void setInactiveCursor​( cursor)
    • setLayoutData

      public void setLayoutData​(org.eclipse.swt.layout.GridData data)
    • setLocation

      public void setLocation​( location)
    • setLocation

      public void setLocation​(int x, int y)
    • setMargins

      public void setMargins​(int marginWidth, int marginHeight)
      marginWidth -
      marginHeight -
    • setMargins

      public void setMargins​(int left, int right, int top, int bottom)
      left -
      right -
      top -
      bottom -
    • setMargins

      public void setMargins​( margins)
    • setOval

      public void setOval​(int rx, int ry)
    • setOval

      public void setOval​(int rx, int ry, fillColor)
    • setPainter

      public void setPainter​(IControlPainter painter)
    • setParent

      public void setParent​(VPanel panel)
    • setPolygon

      public void setPolygon​(int[] points)
    • setPolygon

      public void setPolygon​(int[] points, fillColor)
    • setScaleImage

      public void setScaleImage​(boolean scale)
    • setSize

      public void setSize​( size)
    • setSquare

      public void setSquare​(boolean equal)
      if parameter equal is true, the x and y sizes of this VControl will be forced equal, thus drawing a square button
      equal -
    • setState

      protected boolean setState​(int state, boolean set)
    • setStyle

      public void setStyle​(int style)
    • setStyle

      public boolean setStyle​(int style, boolean set)
    • setText

      public void setText​(java.lang.String text)
      text -
    • setToolTipText

      public void setToolTipText​(java.lang.String text)
    • setVisibility

      void setVisibility​(int visibility)
    • setVisible

      public void setVisible​(boolean visible)
    • setVisible

      public void setVisible​(boolean visible, int duration)
    • setVisible

      public void setVisible​(boolean visible, int duration, java.lang.Runnable callback)
    • toControl

      public toControl​( point)
    • toControl

      public toControl​(int x, int y)
    • toDisplay

      public toDisplay​( point)
    • toDisplay

      public toDisplay​(int x, int y)
    • toString

      public java.lang.String toString()
      toString in class java.lang.Object
    • update

      public void update()