Skip to content

Resources

roosit edited this page Nov 15, 2026 · 5 revisions

Plugin Resources

Up | Русский

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.

Structure

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

sql/setup/ — plugin DB

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 to getDbVersion(), and the upgrade-N.sql files are not executed.
  • An existing database is brought up to date by the chain upgrade-(old+1) … upgrade-getDbVersion(): the file upgrade-N.sql moves the database from version N-1 to N, each step is executed in its own transaction, and the saved version is updated only after a successful step. Currently the plugin has no upgrade-N.sql files.
  • 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 (1 by default): the upgrade-N.sql files below this value can be deleted once the old versions are no longer supported.

Current schema (v1):

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.

localization/ — localization

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.

svg/ — indicator graphics

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-s to 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:

  1. Put the file in svg/ (or in a subfolder if there are several files).
  2. Declare an SvgProperty with this path in the indicator: new SvgProperty("name", "svg/file.svg").
  3. Add .bind(...) for every configurable color; the element must set the color through <style> or the fill / stroke attributes.

templates/ — system Mixel templates

.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:

  1. Run Velitask and open a representative source.
  2. Set up the Mixel: indicators, sizes, positions.
  3. Choose File → Export → Template... and save the .vttp.
  4. 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 / SourceProperty properties 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.

templates.ai/ — materials for the AI assistant

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.

Useful links

Clone this wiki locally