feat: F4.8a the documentation items in model and file, measured against Java's
New oracle DocuRun on Java's JDocuElement. Italic is kept (the model knew only bold), an item keeps its file's size and font size (Swift's 32 x 24 and 8-72 changed Java's files), an item without a colour is Java's light grey. Java's new items, colour lists, font sizes and styles, the drag's smallest sizes and Java's stacking; document commands for the editor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -57,8 +57,8 @@
|
||||
// interface, as Java's own setters (setStandardGateway, setDNSServer) do:
|
||||
// Java reads them from the first interface only (getStandardGateway,
|
||||
// getDNSServer), and the model keeps no others;
|
||||
// - a documentation item always has a text and a font, bold or plain: where
|
||||
// Java has none, the empty text and Dialog 12 the model gives it;
|
||||
// - a documentation item always has a text, a font and a colour: where
|
||||
// Java has none, the empty text, Dialog 12 and the light grey Java shows;
|
||||
// - a switch's SSID the file lacked (Java rolls one) is the one the model
|
||||
// derives from the node's id;
|
||||
// - files in the model's order (directories first, then by name) and of the
|
||||
@@ -105,6 +105,7 @@ import {
|
||||
type ManualRoute,
|
||||
type RemoteLinkConfiguration,
|
||||
type SwitchConfiguration,
|
||||
documentationFontStyle,
|
||||
type DocumentationItem,
|
||||
type HostLabelPolicy,
|
||||
type HostWirelessConfiguration,
|
||||
@@ -554,6 +555,6 @@ function exportDocumentationItem(item: DocumentationItem): FlsDocumentationItem
|
||||
width: Math.round(item.frame.width),
|
||||
height: Math.round(item.frame.height),
|
||||
color: [channel(item.color.red), channel(item.color.green), channel(item.color.blue), channel(item.color.alpha)],
|
||||
font: { name: item.fontName, style: item.isBold ? 1 : 0, size: item.fontSize },
|
||||
font: { name: item.fontName, style: documentationFontStyle(item), size: item.fontSize },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -65,8 +65,7 @@ import {
|
||||
VirtualFileSystem,
|
||||
VirtualFileSystemError,
|
||||
topologyNode,
|
||||
DOCUMENTATION_BLACK,
|
||||
DOCUMENTATION_PALE_YELLOW,
|
||||
DOCUMENTATION_LIGHT_GRAY,
|
||||
type DeviceConfiguration,
|
||||
type DhcpClientConfiguration,
|
||||
type DhcpServerConfiguration,
|
||||
@@ -770,7 +769,8 @@ function importDocumentationItem(
|
||||
const seed = `java-doc|${order}|${item.type}|${item.x}|${item.y}|${item.width}|${item.height}|${text}`;
|
||||
let color;
|
||||
if (item.color === null) {
|
||||
color = kind === 'text' ? DOCUMENTATION_BLACK : DOCUMENTATION_PALE_YELLOW;
|
||||
// Java shows it light grey, either kind (JDocuElement.setColor(null)).
|
||||
color = DOCUMENTATION_LIGHT_GRAY;
|
||||
warnings.push(`documentation item ${order + 1} without a color, given the default`);
|
||||
} else {
|
||||
const [red, green, blue, alpha] = item.color;
|
||||
@@ -785,6 +785,7 @@ function importDocumentationItem(
|
||||
fontName: item.font?.name ?? 'Dialog',
|
||||
fontSize: item.font?.size ?? 12,
|
||||
isBold: ((item.font?.style ?? 0) & 1) === 1,
|
||||
isItalic: ((item.font?.style ?? 0) & 2) === 2,
|
||||
order,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user