CanScan
Loading...
Searching...
No Matches
Package fr.softsf.canscan.model

Classes

enum  Mode
 Application operation modes. More...
 

Functions

record CommonFields (File logoFile, int size, double imageRatio, Color qrColor, Color bgColor, boolean roundedModules, int margin)
 Common form fields used to configure QR code generation.
 
record EncodedData (String data, String defaultFileName)
 Encapsulates the encoded QR data and the suggested default file name for saving.
 
record MecardJFields (JTextField nameField, JTextField orgField, JTextField phoneField, JTextField emailField, JTextField adrField, JTextField urlField)
 Encapsulates all MECARD input fields for QR code generation.
 
record MeetJFields (JTextField meetTitleField, JTextField meetUIdField, JTextField meetNameField, DatePicker meetBeginDatePicker, TimePicker meetBeginTimePicker, DatePicker meetEndDatePicker, TimePicker meetEndTimePicker, JTextField meetLatField, JTextField meetLongField)
 Encapsulates all MEET fields for QR code generation.
 
record ModuleContext (CommonFields config, int matrixWidth, int matrixHeight, int whiteBoxX, int whiteBoxY, int whiteBoxSize)
 Context for QR module rendering, including configuration, matrix dimensions, and logo area.
 
record NativeImageUiComponents (JTextField nameField, JButton browseButton, JSlider ratioSlider, JButton qrColorButton, JRadioButton freeRadio, JRadioButton meetRadio, JTextArea freeField, TimePicker meetBeginTimePicker)
 Encapsulates core Swing GUI components used for UI testing and previews simulating Native Image configuration.
 
record WholeFields (IntSupplier availableHeightForQrCode, Mode currentMode, String free, String name, String org, String tel, String email, String adr, String url, String meetTitle, String meetUId, String meetName, String meetBeginDateTime, String meetEndDateTime, String meetLat, String meetLong, String logoPath, int size, int margin, double ratio, Color qrColor, Color bgColor, boolean isRoundedModules)
 Immutable data structure (record) for QR code generation input.
 

Function Documentation

◆ CommonFields()

record fr.softsf.canscan.model.CommonFields ( File logoFile,
int size,
double imageRatio,
Color qrColor,
Color bgColor,
boolean roundedModules,
int margin )

Common form fields used to configure QR code generation.

◆ EncodedData()

record fr.softsf.canscan.model.EncodedData ( String data,
String defaultFileName )

Encapsulates the encoded QR data and the suggested default file name for saving.

Parameters
datathe text input provided by the user
defaultFileNamethe suggested default file name (defined by the MODE)

◆ MecardJFields()

record fr.softsf.canscan.model.MecardJFields ( JTextField nameField,
JTextField orgField,
JTextField phoneField,
JTextField emailField,
JTextField adrField,
JTextField urlField )

Encapsulates all MECARD input fields for QR code generation.

NOTE: This record intentionally stores direct references to mutable UI JTextField. Copying these components is impractical, and they are expected to be treated as shared UI state.

Parameters
nameFieldtext field for the contact name
orgFieldtext field for the organization
phoneFieldtext field for the phone number
emailFieldtext field for the email
adrFieldtext field for the postal address
urlFieldtext field for the website URL

◆ MeetJFields()

record fr.softsf.canscan.model.MeetJFields ( JTextField meetTitleField,
JTextField meetUIdField,
JTextField meetNameField,
DatePicker meetBeginDatePicker,
TimePicker meetBeginTimePicker,
DatePicker meetEndDatePicker,
TimePicker meetEndTimePicker,
JTextField meetLatField,
JTextField meetLongField )

Encapsulates all MEET fields for QR code generation.

NOTE: This record intentionally stores direct references to mutable UI components (JTextField, DatePicker, etc.). Copying these components is impractical, and they are expected to be treated as shared UI state.

Parameters
meetTitleFieldtext field for the event summary/title
meetUIdFieldtext field for the unique event identifier
meetNameFieldtext field for the organizer's name
meetBeginDatePickerdate picker for the event start date
meetBeginTimePickertime picker for the event start time
meetEndDatePickerdate picker for the event end date
meetEndTimePickertime picker for the event end time
meetLatFieldtext field for latitude (GEO/LOCATION)
meetLongFieldtext field for longitude (GEO/LOCATION)

◆ ModuleContext()

record fr.softsf.canscan.model.ModuleContext ( CommonFields config,
int matrixWidth,
int matrixHeight,
int whiteBoxX,
int whiteBoxY,
int whiteBoxSize )

Context for QR module rendering, including configuration, matrix dimensions, and logo area.

Parameters
configQR code configuration
matrixWidthmatrix width
matrixHeightmatrix height
whiteBoxXlogo area X coordinate
whiteBoxYlogo area Y coordinate
whiteBoxSizelogo area size
+ Here is the call graph for this function:

◆ NativeImageUiComponents()

record fr.softsf.canscan.model.NativeImageUiComponents ( JTextField nameField,
JButton browseButton,
JSlider ratioSlider,
JButton qrColorButton,
JRadioButton freeRadio,
JRadioButton meetRadio,
JTextArea freeField,
TimePicker meetBeginTimePicker )

Encapsulates core Swing GUI components used for UI testing and previews simulating Native Image configuration.

The record holds direct references to mutable Swing components (e.g., JButton, JTextField); this is intentional as copying them is impractical.

Provides a method to assign unique names for reliable identification by test frameworks.

Assigns unique names to all non-null components for automated tests.

This ensures that each component can be reliably identified by UI testing frameworks or native image simulators.

◆ WholeFields()

record fr.softsf.canscan.model.WholeFields ( IntSupplier availableHeightForQrCode,
Mode currentMode,
String free,
String name,
String org,
String tel,
String email,
String adr,
String url,
String meetTitle,
String meetUId,
String meetName,
String meetBeginDateTime,
String meetEndDateTime,
String meetLat,
String meetLong,
String logoPath,
int size,
int margin,
double ratio,
Color qrColor,
Color bgColor,
boolean isRoundedModules )

Immutable data structure (record) for QR code generation input.

This record encapsulates all user-provided data (text content, coordinates) and visual configuration (colors, dimensions, logo) required to create and render a QR code.

It supports different encoding modes (defined by Mode):

  • Mode#MECARD: Structured business/contact cards.
  • Mode#MEET: Event or meeting invitations (calendar data).
  • Mode#FREE: Simple free-form text or URL.
Parameters
availableHeightForQrCodeAn IntSupplier that provides the available vertical height in pixels for QR code rendering upon invocation (lazy evaluation).
currentModeThe active encoding mode for the QR code content.

MECARD Mode Parameters

Parameters
nameFull name of the contact.
orgOrganization or company name.
telTelephone number.
emailEmail address.
adrPostal address.
urlWebsite or profile URL.

MEETING Mode Parameters

Parameters
meetTitleTitle of the meeting or event.
meetUIdUnique event identifier (UID).
meetNameOrganizer or event name.
meetBeginDateTimeEvent start date and time in UTC format (e.g., 19970715T040000Z).
meetEndDateTimeEvent end date and time in UTC format (e.g., 19970715T040000Z).
meetLatGeographic latitude of the meeting location.
meetLongGeographic longitude of the meeting location.

FREE Mode Parameter

Parameters
freeFree-form text content (unstructured text or simple URL).

General and Visual Configuration

Parameters
logoPathOptional file path for the image to embed in the center of the QR code.
sizeTarget image size of the QR code in pixels (including the quiet zone).
marginQuiet zone size in modules.
ratioLogo visibility ratio (maximum logo radius / QR code size), between 0.0 and 1.0.
qrColorColor of the QR code modules.
bgColorBackground color of the QR code and the quiet zone.
isRoundedModulestrue if modules should be rendered with rounded corners.