TPTP 4.1.0 Platform Project
Public API Specification

org.eclipse.hyades.ui.widgets.zoomslider
Class ZoomControlBar

java.lang.Object
  extended byorg.eclipse.hyades.ui.widgets.zoomslider.ZoomControlBar
Direct Known Subclasses:
ZoomImageBar

public class ZoomControlBar
extends java.lang.Object

A zoom control bar is a user adjustable entity placed on a slider that enables the user to dynamically alter a generic control by adjusting the position of the entity on the slider

Since:
4.0.0

Field Summary
protected  org.eclipse.swt.graphics.Rectangle area
           
protected  org.eclipse.swt.graphics.Color color
          This control bars color
protected  boolean enabled
          The enabled state of this control bar
protected  org.eclipse.swt.graphics.Image image
          The image to display on the control bar
protected  int size
          The size of this control bar
protected  ZoomSlider slider
          The slider this bar appears on
protected  java.lang.String tooltip
          The tooltip to show on hovering over the control bar
protected  double value
          This control bars current value
 
Constructor Summary
ZoomControlBar(ZoomSlider slider)
          Construct a new ZoomControlBar with the default color and initial value and size
ZoomControlBar(ZoomSlider slider, org.eclipse.swt.graphics.Color color)
          Construct a new ZoomControlBar with default initial value and size
ZoomControlBar(ZoomSlider slider, org.eclipse.swt.graphics.Color color, int size)
          Construct a new ZoomControlBar with default initial value
ZoomControlBar(ZoomSlider slider, double value)
          Construct a new ZoomControlBar with default initial color and size
ZoomControlBar(ZoomSlider slider, double value, org.eclipse.swt.graphics.Color color)
          Construct a new ZoomControlBar with default size
ZoomControlBar(ZoomSlider slider, double value, org.eclipse.swt.graphics.Color color, int size)
          Construct a new ZoomControlBar
ZoomControlBar(ZoomSlider slider, double value, int size)
          Construct a new ZoomControlBar with default color
ZoomControlBar(ZoomSlider slider, int size)
          Contruct a new ZoomControlBar with default color and value
 
Method Summary
 void addZoomControlBarListener(ZoomControlBarListener listener)
          Add a ZoomControlBarListener to this control bar's list of event listeners
 void dispose()
          Dispose of system resources
protected  void draw3DBox(org.eclipse.swt.graphics.GC g, int x, int y, int w, int h, org.eclipse.swt.graphics.Color boxcolor)
           
 org.eclipse.swt.graphics.Color getColor()
          Get the control bar's color
protected  org.eclipse.swt.graphics.Rectangle getDrawingArea(double d)
           
 int getSize()
          Get the rectangle height size of the control bar
 java.lang.String getToolTipText()
          Get this control's tooltip text
 double getValue()
          Get the current control bar's value
 ZoomSlider getZoomSlider()
          Get the parent zoomslider
 void hide(org.eclipse.swt.graphics.Image backBuffer, org.eclipse.swt.graphics.GC g)
          Hide the control
 boolean inside(int x, int y)
          Returns whether an arbitrary coordinate is within this control bar control
 boolean isEnabled()
          Check whether this control is enabled
 void paint(org.eclipse.swt.graphics.GC g)
          Paint this zoom control bar on the provided GC
 void removeZoomControlBarListener(ZoomControlBarListener listener)
          Remove a ZoomControlBarListener from this control bar's list of listeners
 void setColor(org.eclipse.swt.graphics.Color color)
          Set the control bar's color
 void setEnabled(boolean en)
          Set the enabled state of this control bar
 void setSize(int size)
          Set the rectangle height size of the control bar
 void setToolTipText(java.lang.String text)
          Set this control's tooltip text
 void setValue(double val)
          Set this control bar's control value
 void setZoomSlider(ZoomSlider slider)
          Set the parent zoomslider for this control bar
 void sprayZoomControlBarEvent(boolean finished)
          Send a ZoomControlBarEvent to all listeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

slider

protected ZoomSlider slider
The slider this bar appears on


value

protected double value
This control bars current value


area

protected org.eclipse.swt.graphics.Rectangle area

color

protected org.eclipse.swt.graphics.Color color
This control bars color


size

protected int size
The size of this control bar


enabled

protected boolean enabled
The enabled state of this control bar


image

protected org.eclipse.swt.graphics.Image image
The image to display on the control bar


tooltip

protected java.lang.String tooltip
The tooltip to show on hovering over the control bar

Constructor Detail

ZoomControlBar

public ZoomControlBar(ZoomSlider slider)
Construct a new ZoomControlBar with the default color and initial value and size

Parameters:
slider - the ZoomSlider to create a ZoomControlBar on

ZoomControlBar

public ZoomControlBar(ZoomSlider slider,
                      double value)
Construct a new ZoomControlBar with default initial color and size

Parameters:
slider - the parent ZoomSlider
value - the initial control value

ZoomControlBar

public ZoomControlBar(ZoomSlider slider,
                      org.eclipse.swt.graphics.Color color)
Construct a new ZoomControlBar with default initial value and size

Parameters:
slider - the parent ZoomSlider
color - the initial color of the control bar

ZoomControlBar

public ZoomControlBar(ZoomSlider slider,
                      double value,
                      org.eclipse.swt.graphics.Color color)
Construct a new ZoomControlBar with default size

Parameters:
slider - the parent ZoomSlider
value - the initial value
color - the initial color of the control bar

ZoomControlBar

public ZoomControlBar(ZoomSlider slider,
                      int size)
Contruct a new ZoomControlBar with default color and value

Parameters:
slider - the parent ZoomSlider
size - the control bar size

ZoomControlBar

public ZoomControlBar(ZoomSlider slider,
                      double value,
                      int size)
Construct a new ZoomControlBar with default color

Parameters:
slider - the parent ZoomSlider
value - the initial value
size - the initial control bar size

ZoomControlBar

public ZoomControlBar(ZoomSlider slider,
                      org.eclipse.swt.graphics.Color color,
                      int size)
Construct a new ZoomControlBar with default initial value

Parameters:
slider - the parent ZoomSlider
color - the initial control bar color
size - the initial control bar size

ZoomControlBar

public ZoomControlBar(ZoomSlider slider,
                      double value,
                      org.eclipse.swt.graphics.Color color,
                      int size)
Construct a new ZoomControlBar

Parameters:
slider - the parent ZoomSlider
color - the initial control bar color
size - the initial control bar size
value - the intial control bar value
Method Detail

setZoomSlider

public void setZoomSlider(ZoomSlider slider)
Set the parent zoomslider for this control bar

Parameters:
slider - the parent slider

getZoomSlider

public ZoomSlider getZoomSlider()
Get the parent zoomslider

Returns:
the parent zoomslider

setToolTipText

public void setToolTipText(java.lang.String text)
Set this control's tooltip text

Parameters:
text - the tooltip text to set

getToolTipText

public java.lang.String getToolTipText()
Get this control's tooltip text

Returns:
the current tooltip text, and null if none has been set

setValue

public void setValue(double val)
Set this control bar's control value

Parameters:
val - the value to set this control bar control to

getValue

public double getValue()
Get the current control bar's value

Returns:
the current value

setColor

public void setColor(org.eclipse.swt.graphics.Color color)
Set the control bar's color

Parameters:
color - the color to set

getColor

public org.eclipse.swt.graphics.Color getColor()
Get the control bar's color

Returns:
the current control bar color

setEnabled

public void setEnabled(boolean en)
Set the enabled state of this control bar

Parameters:
en - a boolean depicting the enabled state of this control

isEnabled

public boolean isEnabled()
Check whether this control is enabled

Returns:
a boolean representing the enabled state of the control bar

setSize

public void setSize(int size)
Set the rectangle height size of the control bar

Parameters:
size - the size of the bar in pixels

getSize

public int getSize()
Get the rectangle height size of the control bar

Returns:
the height in pixels

hide

public void hide(org.eclipse.swt.graphics.Image backBuffer,
                 org.eclipse.swt.graphics.GC g)
Hide the control

Parameters:
backBuffer - a reverse image to paint
g - the parent GC

paint

public void paint(org.eclipse.swt.graphics.GC g)
Paint this zoom control bar on the provided GC

Parameters:
g - the GC to paint this control bar on

getDrawingArea

protected org.eclipse.swt.graphics.Rectangle getDrawingArea(double d)

inside

public boolean inside(int x,
                      int y)
Returns whether an arbitrary coordinate is within this control bar control

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
true if (x,y) is contained within this control, false otherwise

sprayZoomControlBarEvent

public void sprayZoomControlBarEvent(boolean finished)
Send a ZoomControlBarEvent to all listeners

Parameters:
finished - true if the event shows completion of a change

addZoomControlBarListener

public void addZoomControlBarListener(ZoomControlBarListener listener)
Add a ZoomControlBarListener to this control bar's list of event listeners

Parameters:
listener - an implementation of ZoomControlBarListener

removeZoomControlBarListener

public void removeZoomControlBarListener(ZoomControlBarListener listener)
Remove a ZoomControlBarListener from this control bar's list of listeners

Parameters:
listener - an implementation of ZoomControlBarListener

draw3DBox

protected void draw3DBox(org.eclipse.swt.graphics.GC g,
                         int x,
                         int y,
                         int w,
                         int h,
                         org.eclipse.swt.graphics.Color boxcolor)

dispose

public void dispose()
Dispose of system resources


TPTP 4.1.0 Platform Project
Public API Specification