Repository navigation
Resources
A description of all files in src/main/resources/: what is there, what it is for, and how to add new ones. The resources are packed into the plugin jar and are available at run time through ClassLoader.getResourceAsStream(...) by flat paths from the jar root.
src/main/resources/
├── sql/setup/ → plugin DB schema
│ └── create.sql
├── localization/ → localization
│ ├── strings.properties (EN)
│ └── strings_ru.properties (RU)
├── svg/ → SVG graphics of the indicators
│ ├── 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/ → system Mixel templates by source type
│ ├── README.md
│ └── video.vttp, image.vttp, audio.vttp, gpx.vttp
└── templates.ai/ → materials for the AI assistant (en/ and ru/)
├── en/ gpx.vttp, video.vttp, instruction.md, prompt.md
└── ru/ gpx.vttp, video.vttp, instruction.md, prompt.md
The plugin owns its own database inside the project (see getDbVersion() in VelitaskPlagin; the version is currently 1). The file create.sql is a full snapshot of the schema of the current version. Rules of application:
- A new plugin database (the project has no saved version) executes only
create.sql; the version is recorded as equal togetDbVersion(), and theupgrade-N.sqlfiles are not executed. - An existing database is brought up to date by the chain
upgrade-(old+1)…upgrade-getDbVersion(): the fileupgrade-N.sqlmoves the database from versionN-1toN, each step is executed in its own transaction, and the saved version is updated only after a successful step. Currently the plugin has noupgrade-N.sqlfiles. - If the database could not be brought to the required version (a step failed or the file is missing), the plugin is disconnected from the project, the project opens without it, and an entry goes to the application log; the attempt is repeated the next time the project is opened.
- The
getMinSupportedDbVersion()method is not overridden in the plugin (1by default): theupgrade-N.sqlfiles below this value can be deleted once the old versions are no longer supported.
Current schema (v1):
-
slope_groups— aggregates of slope sections (uphill, downhill, flat); they are calculated inonSourceImportedthrough SlopeDetector. SlopeTextIndicator, SlopeChartIndicator and SlopeSpeedIndicator depend on them. -
slope_atom_groups— the linkatom_id→group_id(atoms from the core'ssensors_slope_dataand groups fromslope_groups).
The SQL uses substitutions such as ${table:slope_groups}: the runtime replaces them with the table name carrying the plugin prefix to avoid collisions with other plugins.
How to change the schema. Everything in one commit: bring create.sql to the new snapshot, add sql/setup/upgrade-N.sql (ALTER TABLE / CREATE TABLE, etc., moving from N-1 to N) and raise getDbVersion() to N (for example, 1 → 2). A released upgrade-N.sql is not edited — every new change gets a new number. In the comments of SQL files use only -- lines and do not put ; inside comments: the file is split by ; when parsed.
Two files in the standard Java .properties format:
-
strings.properties— English strings (the default). -
strings_ru.properties— Russian strings.
The application finds them under the localization/ path; a separate manifest attribute is not needed. The keys follow the scheme Plugin.Indicator.<name>.<property>, for example Plugin.Indicator.compass.title, Plugin.Indicator.distanceText.tags; they match the KEY constant inside each indicator.
The method defineAdditionLocales() returns ["ru"] in addition to the interface locale, so the Russian strings are available even with an English interface.
The encoding is UTF-8. Cyrillic is written as plain text, without \uXXXX.
The graphics of the indicators are made with SVG for scaling. The file is loaded through SvgProperty, and .bind(selector, attr, ColorProperty) substitutes the user's current colors into the attributes of SVG elements.
Files:
-
svg/compass.svg— the compass for CompassIndicator; the bindings.body,.ring,.tick,.needle-n,.needle-sto the user's colors. -
svg/speedometer/— the speedometer SVG for SpeedometerIndicator:-
background.svg— the round background (.ring); -
delimiter.svg— the scale ticks (.tick); -
numeric_40.svg,numeric_80.svg,numeric_160.svg,numeric_320.svg— four variants of the scale digits (.number), the indicator selects one by the speed scale; -
arrow.svg— the needle (.arrow-body, fill and stroke); -
arrow_tail.svg— the line of the tail sector (.tail, stroke).
-
CSS class names .body, .ring, .tick, .needle-*, .arrow-*, .number are stable: the bindings in the indicators depend on them. When editing an SVG do not rename the classes, otherwise .bind(...) will stop finding the elements.
How to add an SVG:
- Put the file in
svg/(or in a subfolder if there are several files). - Declare an
SvgPropertywith this path in the indicator:new SvgProperty("name", "svg/file.svg"). - Add
.bind(...)for every configurable color; the element must set the color through<style>or thefill/strokeattributes.
.vttp is a JSON snapshot of a Mixel composition. It is the last fallback: a template is applied if no template was found for the source either in the project folder or in the user folder. Without them a new source opens with an empty Mixel and a notification that the layout needs to be set up or a template put in place. The distribution build picks these files up from the plugin resources and places them in the templates folder next to the installed application.
Files:
| File | When it is used |
|---|---|
video.vttp |
Default layout for a VIDEO source |
image.vttp |
Default layout for an IMAGE source |
audio.vttp |
Default layout for an AUDIO source |
gpx.vttp |
Default layout for a GPX source |
README.md |
Description of the folder (in English) |
The application looks for a source template by three names, in order: the file name without the extension, the extension, the source type (SourceType in lower case, for example video, gpx, image, audio). For each name the project, user and system folders are searched. To add a layout for a new type, put <type>.vttp.
Source thumbnails are no longer set by template files: there are no thumbnail-*.vttp files in the resources. The thumbnails are built by the plugin's preview generators, which build a template programmatically from a single indicator layer: VideoPreviewGenerator, ImagePreviewGenerator, AudioPreviewGenerator, GeoPreviewGenerator.
How to update a template:
- Run Velitask and open a representative source.
- Set up the Mixel: indicators, sizes, positions.
- Choose File → Export → Template... and save the
.vttp. - Copy the file to this folder under the required name.
The .vttp format is a full JSON snapshot of the Mixel (the result of toJSON(true)). Layers refer to indicators by the UID <plugin-uid>.<indicator-name>, for example com.velitask.plagin.official.geoMap. On loading (fromJSON(json, true)):
- indicators not registered in the plugin manager (
PlaginsManager) are silently skipped, so a template works even if some plugins are not loaded; -
SensorProperty/SourcePropertyproperties receive a default source automatically, and sensor and source identifiers are not baked into the template.
If a template cannot be read, the application writes a warning to the log, clears the Mixel and tries the next option.
The current templates are blanks with a minimal layout; they are meant to be replaced with full ones.
The folder contains sets for users who build a .vttp with the help of an AI assistant. In each language (en/, ru/) there are examples video.vttp and gpx.vttp, the instruction instruction.md (how to hand the materials to the assistant and check the result), a ready-made prompt prompt.md and the reference indicators.json — the full layer names, titles and the full set of properties with default values for all indicators; the reference is generated automatically from a snapshot of the running plugin at every release and is not edited by hand. These files are not system templates: the application does not apply them, and no references to them were found in the application or plugin code; they are meant to be read by a person and copied into a conversation with an AI. The user description of the format is in User-JSON.
- ClassLoader.getResourceAsStream — the main way to access resources at run time.
- The reference work with resources is SpeedometerIndicator (SVG and color bindings).