Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Nebula ProgressCircle

< Back to Nebula Main Page

Introduction

ProgressCircle.png


This widget is a graphical presentation of a ratio. It can be considered as another vision of the progress bar. Please notice that there is no interaction with the user.

Usage

The usage is very simple :

  • You create a ProgressCircle widget
  • You set the minimum, maximum and selection values with the methods setMinimum, setMaximum, setSelection
  • You (eventually) set the graphical parameters of the widget: circle size, thickness, the color, the color of the highlighted part with the appropriate setter.
  • If you want to display the text, just use setShowText(true). In this case, please fill the pattern with the setTextPattern method. 2 Constants are provided: PERCENTAGE_PATTERN and INTEGER_PATTERN.


When you set another value for this widget, an image is displayed to show the transition between the previous value and the new value.


final ProgressCircle circle = new ProgressCircle(shell, SWT.NONE);
circle.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
circle.setTextPattern(ProgressCircle.INTEGER_PATTERN);
circle.setMinimum(-100);
circle.setMaximum(100);
circle.setSelection(52);
circle.setThickness(10);
circle.setCircleSize(100);
circle.setShowText(true);


You can use it also to display a countdown (like an egg cooker).


final ProgressCircle circle = new ProgressCircle(shell, SWT.NONE);
circle.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
circle.setTextPattern(ProgressCircle.INTEGER_PATTERN);
circle.setThickness(10);
circle.setCircleSize(100);
circle.setShowText(true);

final LocalTime time = LocalTime.of(0, 2, 40);
circle.startCountDown(time);

Example

An example called ProgressCircleSnippet is located in the plugin org.eclipse.nebula.widgets.progresscircle.snippets.

This example is also available here : ProgressCircleSnippet.java

Back to the top