Repository navigation
Resources
Description of all files in src/main/resources/: what is there, why it is needed, and how to add something new. These resources are packaged into the plugin jar and are available at runtime through ClassLoader.getResourceAsStream(...) (flat paths from the jar root).
src/main/resources/
├── sql/setup/ → plugin DB migrations
│ └── create.sql
├── strings/ → localization
│ ├── strings.properties (EN)
│ └── strings_ru.properties (RU)
├── svg/ → indicator SVG graphics
│ ├── compass.svg
│ └── speedometer/
│ ├── background.svg
│ ├── delimiter.svg
│ ├── arrow.svg, arrow_tail.svg
│ └── numeric_40.svg, numeric_80.svg, numeric_160.svg, numeric_320.svg
└── templates/ → default Mixel templates for source types
├── video.vttp, gpx.vttp
├── thumbnail-video.vttp, thumbnail-gpx.vttp
└── README.md
The plugin owns its own SQLite DB (see getDbVersion() = 1 in VelitaskPlagin). When the plugin is first installed into a project, the SDK executes create.sql; on later version bumps, it executes upgrade-N.sql (from the current version to the new one).
Current schema (v1):
-
slope_groups— aggregates of slope segments (ascent/descent/flat), calculated inonSourceImportedthrough SlopeDetector. SlopeText, SlopeChart, and SlopeSpeed depend on them. -
slope_atom_groups— mappingatom_id → group_id(atoms from coresensors_slope_data↔ groups fromslope_groups).
SQL uses placeholders ${table:slope_groups} — at runtime, the plugin-prefixed table name is substituted to avoid collisions with other plugins.
How to add a migration: when changing the schema, bump getDbVersion() (for example 1 → 2), create sql/setup/upgrade-2.sql with SQL ALTER TABLE / CREATE TABLE. The SDK will run the upgrade automatically on projects with the old version.
Two files, in standard Java .properties format:
-
strings.properties— English localization (default). -
strings_ru.properties— Russian localization.
Keys are built by the schema Plugin.Indicator.<name>.<property> — for example Plugin.Indicator.compass.title, Plugin.Indicator.distanceText.tags. This matches the KEY constant inside each indicator.
The plugin loads both locales (see defineAdditionLocales() — it returns ["ru"] in addition to the UI locale). This guarantees that Russian strings are available even when the UI is launched with the English locale.
Encoding — direct UTF-8. Cyrillic is written as regular text, without \uXXXX escapes (see DOCS_GUIDE.md and the project's general rule).
Consistency check: during build, the Gradle task checkLocalization (see build.gradle) compares keys used in code through localized(...) with both files. Any missing key is a release blocker (see RELEASING.md, Step 1).
Indicator raster graphics are made through SVG for scalability. SVG is loaded through SvgProperty with .bind(selector, attr, ColorProperty) — at runtime, the current user colors are substituted into the attributes of SVG elements.
Files:
-
svg/compass.svg— compass. Used by CompassIndicator with binds.body / .ring / .tick / .needle-n / .needle-sto user colors. -
svg/speedometer/— five SVG files for the speedometer, used by SpeedometerIndicator:-
background.svg— round background (bind.ring). -
delimiter.svg— scale ticks (bind.tick). -
numeric_40.svg,numeric_80.svg,numeric_160.svg,numeric_320.svg— four variants of scale numbers (bind.number); the indicator selects one of the four bymSpeedScale. -
arrow.svg— needle (bind.arrow-bodyfor fill and stroke). -
arrow_tail.svg— tail-sector line (bind.tailfor stroke).
-
CSS class naming convention: selectors .body, .ring, .tick, .needle-*, .arrow-*, .number are stable; indicator binds depend on them. When editing SVG, do not rename classes — otherwise .bind(...) will stop finding elements.
How to add a new SVG:
- Put the file in
svg/(or a subfolder if there are several resources). - Declare
SvgPropertyin the indicator with this path:new SvgProperty("name", "svg/file.svg"). - Add
.bind(...)for each configurable color — the selector in the SVG must be styled through<style>or be thefill/strokeattribute of an element.
.vttp files are JSON snapshots of a Mixel composition for typical source types. They are used as the last fallback when the project has no template of its own and there is also nothing in the user's templates folder. Without them, opening a new source would produce an empty Mixel and a "configure the layout" notification.
Files:
| File | When it is used |
|---|---|
video.vttp |
Default Mixel for a VIDEO source (mp4, mov) |
gpx.vttp |
Default Mixel for a GPX source |
thumbnail-video.vttp |
Thumbnail render for VIDEO in the project browser |
thumbnail-gpx.vttp |
Thumbnail render for GPX in the project browser |
File names = SourceType.name().toLowerCase() from the SDK (video, gpx, image, telemiger). To add a default for a new type, put <type>.vttp.
Update workflow:
- Launch Velitask and open a representative source.
- Configure Mixel: indicators, sizes, positions.
-
File → Export Template→ save.vttp. - Copy the exported file into this folder under the required name.
- Rebuild the distribution:
cd ../../../../distrib && ./gradlew rebuildStage -Pname=plugin-official && ./gradlew assembleRelease.
.vttp format — full JSON snapshot of Mixel, product of mixel.toJSON(true). Layers reference indicators by UID <plugin-uid>.<indicator-name> (for example com.velitask.plagin.official.geoMap). When loading through mixel.fromJSON(json, true):
- Indicators not registered in the current
PlaginsManagerare silently skipped — this lets the template work even if some plugins are not loaded. - Properties of type
SensorProperty/SourcePropertyreceiveapplyDefaultSource(...)automatically — sensor/source IDs are not hardcoded into the template.
Current templates are MVP placeholders with a minimal layout. Most likely they will be rewritten into full ones when leaving beta.
- Java ClassLoader.getResourceAsStream — the main way to access these resources at runtime.
- Reference implementation for resource handling — SpeedometerIndicator (SVG + binds).