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).
    • Field Detail

      • carbon

        public static final boolean carbon
        true if the platform is Carbon, false otherwise
      • gtk

        public static final boolean gtk
        true if the platform is GTK, false otherwise
      • win32

        public static final boolean win32
        true if the platform is Win32, false otherwise
      • Points_OK

        private static final int[] Points_OK
      • Points_Cancel

        private static final int[] Points_Cancel
      • Points_Left

        private static final int[] Points_Left
      • Points_Right

        private static final int[] Points_Right
      • Points_Up

        private static final int[] Points_Up
      • Points_Down

        private static final int[] Points_Down
      • Points_Add

        private static final int[] Points_Add
      • Points_Subtract

        private static final int[] Points_Subtract
      • composite

        org.eclipse.swt.widgets.Composite composite
      • style

        private int style
      • menu

        org.eclipse.swt.widgets.Menu menu
      • image

        org.eclipse.swt.graphics.Image image
      • text

        java.lang.String text
      • tooltipText

        java.lang.String tooltipText
      • points

        int[] points
      • fill

        org.eclipse.swt.graphics.Color fill
      • foreground

        org.eclipse.swt.graphics.Color foreground
      • background

        org.eclipse.swt.graphics.Color background
      • font

        org.eclipse.swt.graphics.Font font
      • activeCursor

        private org.eclipse.swt.graphics.Cursor activeCursor
      • inactiveCursor

        private org.eclipse.swt.graphics.Cursor inactiveCursor
      • layoutData

        org.eclipse.swt.layout.GridData layoutData
      • state

        private int state
      • bounds

        org.eclipse.swt.graphics.Rectangle bounds
      • marginTop

        int marginTop
      • marginBottom

        int marginBottom
      • marginLeft

        int marginLeft
      • marginRight

        int marginRight
      • xAlign

        int xAlign
      • yAlign

        int yAlign
      • disposed

        boolean disposed
      • square

        boolean square
      • visibility

        int visibility
      • scaleImage

        boolean scaleImage
      • customToolTip

        boolean customToolTip
      • dataMap

        java.util.Map<java.lang.String,​java.lang.Object> dataMap
      • listeners

        java.util.Map<java.lang.Integer,​java.util.List<org.eclipse.swt.widgets.Listener>> listeners
      • eventTypes

        private java.util.Set<java.lang.Integer> eventTypes
      • listener

        private org.eclipse.swt.widgets.Listener listener
      • activatable

        private boolean activatable
    • Constructor Detail

      • VControl

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

      • 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 org.eclipse.swt.graphics.Point computeSize​(int wHint,
                                                          int hHint)
      • computeSize

        public org.eclipse.swt.graphics.Point computeSize​(int wHint,
                                                          int hHint,
                                                          boolean changed)
      • createMenu

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

        void deactivate()
      • dispose

        public void dispose()
      • getBackground

        public org.eclipse.swt.graphics.Color getBackground()
      • getBounds

        public org.eclipse.swt.graphics.Rectangle getBounds()
      • getClientArea

        public org.eclipse.swt.graphics.Rectangle getClientArea()
      • getClientSize

        public org.eclipse.swt.graphics.Point 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 org.eclipse.swt.graphics.Font getFont()
      • getForeground

        public org.eclipse.swt.graphics.Color getForeground()
      • getImage

        public org.eclipse.swt.graphics.Image getImage()
      • getLayoutData

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

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

        public org.eclipse.swt.graphics.Point getLocation()
      • getMargins

        public org.eclipse.swt.graphics.Rectangle getMargins()
      • getMenu

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

        public VPanel getParent()
      • getShell

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

        public org.eclipse.swt.graphics.Point getSize()
      • getState

        public int getState()
      • getStyle

        public int getStyle()
      • getText

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

        public java.lang.String getToolTipText()
      • 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)
      • include

        private boolean include​(boolean key,
                                int type)
      • 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()
        Returns:
        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​(org.eclipse.swt.graphics.Cursor cursor)
      • setAlignment

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

        public void setAlpha​(org.eclipse.swt.graphics.GC gc)
      • setAlpha

        public void setAlpha​(org.eclipse.swt.graphics.GC gc,
                             int alpha)
      • setBackground

        public void setBackground​(org.eclipse.swt.graphics.Color color)
      • setBounds

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

        public void setBounds​(org.eclipse.swt.graphics.Rectangle bounds)
      • setCursor

        public void setCursor​(org.eclipse.swt.graphics.Cursor 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​(org.eclipse.swt.graphics.Color color)
      • setFocus

        public boolean setFocus()
      • setFocus

        protected boolean setFocus​(boolean focus)
      • setFont

        public void setFont​(org.eclipse.swt.graphics.Font font)
      • setForeground

        public void setForeground​(org.eclipse.swt.graphics.Color color)
      • setImage

        public void setImage​(org.eclipse.swt.graphics.Image image)
      • setInactiveCursor

        public void setInactiveCursor​(org.eclipse.swt.graphics.Cursor cursor)
      • setLayoutData

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

        public void setLocation​(org.eclipse.swt.graphics.Point location)
      • setLocation

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

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

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

        public void setMargins​(org.eclipse.swt.graphics.Rectangle margins)
      • setOval

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

        public void setOval​(int rx,
                            int ry,
                            org.eclipse.swt.graphics.Color fillColor)
      • setParent

        public void setParent​(VPanel panel)
      • setPolygon

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

        public void setPolygon​(int[] points,
                               org.eclipse.swt.graphics.Color fillColor)
      • setScaleImage

        public void setScaleImage​(boolean scale)
      • setSize

        public void setSize​(org.eclipse.swt.graphics.Point 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
        Parameters:
        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)
        Parameters:
        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 org.eclipse.swt.graphics.Point toControl​(org.eclipse.swt.graphics.Point point)
      • toControl

        public org.eclipse.swt.graphics.Point toControl​(int x,
                                                        int y)
      • toDisplay

        public org.eclipse.swt.graphics.Point toDisplay​(org.eclipse.swt.graphics.Point point)
      • toDisplay

        public org.eclipse.swt.graphics.Point toDisplay​(int x,
                                                        int y)
      • toString

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

        public void update()