Skip to content

Instantly share code, notes, and snippets.

View romualdrichard's full-sized avatar

Romuald Richard romualdrichard

View GitHub Profile
@romualdrichard
romualdrichard / CreateOrUpdateCalculatedNotes.ajs
Created April 23, 2026 08:11
#jarchi Create/update note from label
/**
* CreateOrUpdateCalculatedNotes.ajs
* ---------------------------------------------------------------------------
* Creates a note for each selected object in the current view,
* or updates all notes that have the calculatedLabel property.
*
* Rules:
* - The "calculatedLabel" property on the note stores the ID of the
* visual object it refers to (enables reliable updates).
* - Note text = labelValue of the object if non-empty, otherwise name.
@romualdrichard
romualdrichard / IfRenderer.java
Last active June 2, 2026 07:23
IfRenderer.java for archi
/**
* This program and the accompanying materials
* are made available under the terms of the License
* which accompanies this distribution in the file LICENSE.txt
*/
package com.archimatetool.editor.ui.textrender;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
@romualdrichard
romualdrichard / Excel XML 2003 Export Import.ajs
Last active April 28, 2026 10:08
#jArchi Export and Import model or views to Excel 2003 XML
/*
* Archi ↔ Excel XML (XML Spreadsheet 2003)
* Single script: choose Export or Import at startup
* Export: full model or selected views → .xml
* Import: .xml → model (UID optional, duplicate detection with custom dialog)
*/
console.show();
console.clear();
// ---------- Global SWT declarations ----------
@romualdrichard
romualdrichard / DecreaseFontSize.ajs
Created April 9, 2026 12:06
#jarchi decrease fonts size of the selection
// This script decrease the font size of the selected element
// Requires jArchi - https://www.archimatetool.com
// Change -1 to 1 to have IncreaseFontSize script
// Assign a key to this script
try{
console.log("font decreasing");
$(selection).each(function(selectedElement) {
selectedElement.fontSize += -1;
} );
@romualdrichard
romualdrichard / CreateViewFromSelection.ajs
Last active April 3, 2026 09:03
#jarchi create view from selection
/**
* CreateViewFromSelection.ajs
*
* Creates a new ArchiMate view from the current selection,
* OR updates an existing generated view if one is selected.
*
* Identity: The view carries a user property "generated-by-script" = "CreateViewFromSelection"
* and a JSON property "generation-criteria" storing the full criteria.
*
* Update mode (view with that property selected):
@romualdrichard
romualdrichard / gist:6a33ed04757bfc2a54bb46299ab1b37e
Created March 31, 2026 08:10
#jarchi Merge Two Selected Archi Objects
/**
* Merge Two Selected Archi Objects
*
* Works with either:
* - Two elements of the same type
* - Two relationships of the same type, source and target
*
* An SWT dialog lets the user choose, for each field (name, documentation,
* each property), which value to keep — or to merge both documentation texts.
*
@romualdrichard
romualdrichard / align-and-spread.ajs
Last active March 31, 2026 08:08
#jarchi Align and Spread with dialogbox
// Author: Jean-Charles Perron, based on the work of Rob Kamp
// Requires: jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
// Purpose: SWT dialog to align (left, top, bottom, right) and spread (horizontal, vertical) selected elements
// Date: 2024-01
// Version: 2.2
// Changes:
// 1.0 - Initial version (Rob Kamp / Jean-Charles Perron): spread vertical/horizontal via prompt
// 2.0 - SWT dialog with align left/top/bottom/right + spread H/V, closeable with ESC
// 2.1 - Dual behaviour: children mode vs normal mode
// 2.2 - Children mode reworked:
@romualdrichard
romualdrichard / Generate-Single-Page-HTML-Export-Interactive.ajs
Created January 23, 2026 09:45
#jarchi Export Single page html interactive
// Generate Single-page HTML Export - Enhanced with Interactive Views
//
// Based on: https://github.com/archi-contribs/jarchi-single-page-html-export
// Enhanced by: Claude (2026) - Added interactive SVG overlays
// STABLE VERSION - Based on v1.9 + v2.0 uncheck fix
//
// Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
// Add this script to the repertory of jarchi-single-page-html-export
// === CONFIGURATION ===
@romualdrichard
romualdrichard / Create View From Properties.ajs
Last active February 5, 2026 13:34
#jarchi Create View from Properties
/*
* jArchi Script – Filtered Views Manager
* ─────────────────────────────────────────
* Tab 1 – "Filter Views" : create or update a single view by property filters
* Tab 2 – "Manage Views" : scan model, list every view that carries saved
* criteria, and batch-update them. Each row has its
* own "Synchronize" checkbox (default ON).
*
* Filter logic
* same property, several values → OR
@romualdrichard
romualdrichard / ModifyPropertyValue.ajs
Created January 30, 2026 08:46
#jarchi modifiy property value
/*
* JArchi Script - Modify User Property Value
*
* This script allows you to search and replace a property value
* on all model objects that have this property.
*
* Uses SWT dialog boxes for user interaction.
*/
// Import necessary SWT classes