TPTP 4.1.0 Platform Project
Public API Specification

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

java.lang.Object
  extended byorg.eclipse.hyades.ui.widgets.zoomslider.ZoomControlBarsCollection

public class ZoomControlBarsCollection
extends java.lang.Object

A collection of ZoomControlBars for a particular ZoomSlider

Since:
4.0.0

Constructor Summary
ZoomControlBarsCollection(ZoomSlider slider)
          Create a new ZoomControlBarsCollection for this slider
 
Method Summary
 void add(ZoomControlBar bar)
          Add this ZoomControlBar to the collection of control bars for this slider.
 void dispose()
          Dispose of all system resources used by this collection and the bars within it
 ZoomControlBar getZoomControlBarContaining(int x, int y)
          Get the ZoomControlBar from this collection at the given coordinates
 java.util.Vector getZoomControlBars()
          Get a vector of all the controls bars within this collection
 boolean hasBars()
          Returns true if the collection contains at least one bar.
 boolean isPrimed()
          Primed is true if the collection has a bar that the user is interacting with, and if the bar is currently being changed
 boolean isSelected()
          Returns true if the current collection is selected.
 boolean mouseDown(org.eclipse.swt.events.MouseEvent event)
          A method to handle a mouse down MouseEvent on the bars within this collection
 boolean mouseMove(org.eclipse.swt.events.MouseEvent event)
          A method to handle a mouse move MouseEvent on the bars within this collection This is only valid if the collection has been primed (a bar was clicked on)
 boolean mouseUp(org.eclipse.swt.events.MouseEvent event)
          A method to handle a mouse up MouseEvent on the bars within this collection
 void paint(org.eclipse.swt.graphics.Image buffer, org.eclipse.swt.graphics.GC gBuffer, org.eclipse.swt.graphics.GC g, boolean indicatorsChanged)
          Paint all the ZoomControlBars in this collection
 void remove(ZoomControlBar bar)
          Remove a ZoomControlBar from the collection of bars.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZoomControlBarsCollection

public ZoomControlBarsCollection(ZoomSlider slider)
Create a new ZoomControlBarsCollection for this slider

Parameters:
slider - the slider that the zoom controls will be associated with
Method Detail

add

public void add(ZoomControlBar bar)
Add this ZoomControlBar to the collection of control bars for this slider. Zoom Control bars are not duplicated in the list.

Parameters:
bar - the ZoomControlBar to add to the collection.

remove

public void remove(ZoomControlBar bar)
Remove a ZoomControlBar from the collection of bars.

Parameters:
bar - the ZoomControlBar to remove from the list

hasBars

public boolean hasBars()
Returns true if the collection contains at least one bar.

Returns:
true if the number of bars is at least 1, false if it is 0

isSelected

public boolean isSelected()
Returns true if the current collection is selected. A collection is selected if the user has started interacting with any one of the control bars in the collection

Returns:
whether this collection is selected

isPrimed

public boolean isPrimed()
Primed is true if the collection has a bar that the user is interacting with, and if the bar is currently being changed

Returns:
the primed status

paint

public void paint(org.eclipse.swt.graphics.Image buffer,
                  org.eclipse.swt.graphics.GC gBuffer,
                  org.eclipse.swt.graphics.GC g,
                  boolean indicatorsChanged)
Paint all the ZoomControlBars in this collection

Parameters:
buffer - the zoom control image to paint on the control
gBuffer - a buffer GC
g - GC
indicatorsChanged - true if the indicators for this slider have changed, false otherwise

mouseDown

public boolean mouseDown(org.eclipse.swt.events.MouseEvent event)
A method to handle a mouse down MouseEvent on the bars within this collection

Parameters:
event - the mouse event
Returns:
boolean if a bar within this collection was clicked on

mouseUp

public boolean mouseUp(org.eclipse.swt.events.MouseEvent event)
A method to handle a mouse up MouseEvent on the bars within this collection

Parameters:
event - the mouse event
Returns:
boolean if a bar within this collection occured under the mouse up

mouseMove

public boolean mouseMove(org.eclipse.swt.events.MouseEvent event)
A method to handle a mouse move MouseEvent on the bars within this collection This is only valid if the collection has been primed (a bar was clicked on)

Parameters:
event - the mouse move event
Returns:
the boolean state of the move

getZoomControlBarContaining

public ZoomControlBar getZoomControlBarContaining(int x,
                                                  int y)
Get the ZoomControlBar from this collection at the given coordinates

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the control bar at the coordinate specified or null if none is found

getZoomControlBars

public java.util.Vector getZoomControlBars()
Get a vector of all the controls bars within this collection

Returns:
a Vector of ZoomControlBars

dispose

public void dispose()
Dispose of all system resources used by this collection and the bars within it


TPTP 4.1.0 Platform Project
Public API Specification