LogoLogo
v7.0.0
v7.0.0
  • TotalCross Overview
  • TotalCross Javadoc
  • TotalCross Changelog
  • Roadmap
  • Documentation
    • Getting Started
      • First embedded project with TotalCross
    • Components
      • Accordion
      • Aligned Labels
      • Button
      • Check
      • ComboBox
      • Dynamic Scroll
      • Edit
      • Floating Button
      • Gpiod
      • Grid
      • GridContainer
      • Image
      • ImageControl
      • ImageList
      • Label
      • Material Icons
      • Material Window
      • MessageBox
      • Multi Edit
      • Progress Bar
      • Progress Box
      • Radio
      • Radio Group
      • Scroll Container
      • Side Menu
      • Slider
      • Sliding Window
      • Spin List
      • Spinner
      • Switch
      • Tabbed Container
      • Velocimeter
    • APIs
      • API Overview
      • API Rest
      • Asynchronous Task
      • Camera
      • Control
        • Main Window
        • Window
        • Container
      • GPS
      • HTTPS and SSL
      • JSON
      • Maps
        • Maps - Deprecated
        • Static Map
      • Material Design Standards
      • Ninepath
      • Notifications
      • PrinterManager
      • Push Notification Firebase
      • Scanner
      • SOAP
      • Socket
      • SocketServer
      • SQLite Encryption
      • QR Code Generator
      • totalcross.sys
      • Youtube API
    • Creating an Issue
    • Contributing
      • Branch workflow
      • Writing documentation
    • Guides
      • App Architecture
        • Suggested Architecture
        • Why do Design Patterns help with the application's organization?
          • MVC Architecture Pattern
          • Template Pattern
          • Data Persistence: DAO Pattern.
        • Separation of concepts: What is the best way to create UI interfaces?
        • Positioning
          • Manual Positioning
        • Relative Positioning
        • Best practices to improve project maintenance
      • Device Simulator
      • Package your app from scratch
        • TotalCross SDK
        • Environment Variables in IDE
          • Eclipse
          • IntelliJ
        • Deploy your app with a dependecy TC
        • Deploy iOS
          • Using Development certificate to test your apps
      • Understanding TotalCross for Linux ARM
      • Running C++ applications with TotalCross
      • Web Services
    • Miscelaneous
      • Java JDK 8
      • Maven
      • Installing Visual Studio Code
    • FAQ
      • IMEI in Android 10
Powered by GitBook
On this page
  • Overview
  • Attributes
  • Methods
  • References

Was this helpful?

  1. Documentation
  2. Components

Velocimeter

PreviousTabbed ContainerNextAPIs

Last updated 6 years ago

Was this helpful?

Overview

The Velocimeter represents a velocimeter gauge. The background and pointer can be customized. The text, max and min values can be drawn or not. The pointer's color can be changed

VelocimeterSample.java
  // Adds a timer
tt = addTimer(50);

  // Creates a simple Velocimeter
vel = new Velocimeter();
vel.value = -20;
vel.max = 40;
vel.pointerColor = Color.GREEN;
add(vel, CENTER, CENTER, PARENTSIZE + 50, PARENTSIZE + 50);

// Generates an event from the timer
@Override
public void onEvent(Event e)
{
	if (e.type == TimerEvent.TRIGGERED && tt.triggered)
	{
		vel.value++;
		if (vel.value > vel.max + 20)
		{
			vel.value = vel.min - 20;
		}
		repaint();
	}
}

Attributes

Type

Name

Description

boolean

drawMax

Set to false to don't draw the max value's text

boolean

drawMin

Set to false to don't draw the min value's text

boolean

drawValue

Set to false to don't draw the value's text.

int

max

The maximum value; defaults to 100.

int

maxAngle

The maximum angle value; defaults to 270 degrees for the default gauge

int

min

The minimum value; defaults to 0

int

pointerColor

The pointer's color

int

value

The current value

int

valueColor

The value's color.

Methods

Type

Name

Description

Constructor

Velocimeter( )

Constructs a velocimeter using the default gauge and pointer images

Constructor

Velocimeter(String gaugeImagePath, String pointerImagePath)

Constructs a velocimeter using the given images

References

To view the full code, .

See the for more information.

click here
JavaDocs