@yamcs/opi 1.3.13 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -66
- package/dist/opi.js +20 -19
- package/dist/opi.js.map +4 -4
- package/dist/opi.standalone.js +19 -18
- package/dist/types/Bevel.d.ts +16 -0
- package/dist/types/DecimalFormat.d.ts +8 -0
- package/dist/types/Display.d.ts +84 -2
- package/dist/types/EventHandler.d.ts +10 -0
- package/dist/types/Font.d.ts +2 -0
- package/dist/types/Graphics.d.ts +69 -6
- package/dist/types/HitRegionSpecification.d.ts +1 -0
- package/dist/types/Widget.d.ts +11 -0
- package/dist/types/XMLNode.d.ts +12 -0
- package/dist/types/actions/Action.d.ts +2 -0
- package/dist/types/actions/ExecuteCommandAction.d.ts +1 -1
- package/dist/types/actions/ExecuteJavaScriptAction.d.ts +1 -1
- package/dist/types/actions/OpenDisplayAction.d.ts +1 -1
- package/dist/types/actions/OpenFileAction.d.ts +1 -1
- package/dist/types/actions/OpenWebpageAction.d.ts +1 -1
- package/dist/types/actions/PlaySoundAction.d.ts +1 -1
- package/dist/types/actions/RunCommandAction.d.ts +1 -1
- package/dist/types/actions/RunProcedureAction.d.ts +1 -1
- package/dist/types/actions/RunStackAction.d.ts +1 -1
- package/dist/types/actions/WritePVAction.d.ts +1 -1
- package/dist/types/actions.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/positioning.d.ts +14 -0
- package/dist/types/properties.d.ts +2 -0
- package/dist/types/pv/LocalPV.d.ts +2 -2
- package/dist/types/pv/PVEngine.d.ts +23 -1
- package/dist/types/pv/formulas/parser.d.ts +3 -3
- package/dist/types/scale.d.ts +22 -0
- package/dist/types/scripting/ArrayWrapper.d.ts +21 -0
- package/dist/types/scripting/Java.d.ts +1 -1
- package/dist/types/scripting/PVUtil.d.ts +1 -1
- package/dist/types/scripting/PVWrapper.d.ts +1 -0
- package/dist/types/scripting/WidgetWrapper.d.ts +2 -0
- package/dist/types/widgets/controls/ActionButton.d.ts +7 -0
- package/dist/types/widgets/controls/BooleanButton.d.ts +4 -0
- package/dist/types/widgets/controls/BooleanSwitch.d.ts +4 -0
- package/dist/types/widgets/controls/CheckBox.d.ts +2 -0
- package/dist/types/widgets/controls/ImageBooleanButton.d.ts +16 -0
- package/dist/types/widgets/controls/Knob.d.ts +64 -0
- package/dist/types/widgets/controls/ScaledSlider.d.ts +81 -0
- package/dist/types/widgets/controls/Spinner.d.ts +49 -0
- package/dist/types/widgets/controls/TextInput.d.ts +17 -2
- package/dist/types/widgets/controls/ThumbWheel.d.ts +42 -0
- package/dist/types/widgets/figures/Ramp.d.ts +1 -1
- package/dist/types/widgets/figures/Scale.d.ts +64 -0
- package/dist/types/widgets/graphics/ImageWidget.d.ts +56 -0
- package/dist/types/widgets/graphics/Label.d.ts +36 -0
- package/dist/types/widgets/graphics/Polygon.d.ts +30 -0
- package/dist/types/widgets/graphics/Polyline.d.ts +36 -0
- package/dist/types/widgets/monitors/Gauge.d.ts +6 -0
- package/dist/types/widgets/monitors/ImageBooleanIndicator.d.ts +18 -0
- package/dist/types/widgets/monitors/IntensityGraph.d.ts +46 -0
- package/dist/types/widgets/monitors/IntensityGraphRegion.d.ts +15 -0
- package/dist/types/widgets/monitors/Meter.d.ts +9 -0
- package/dist/types/widgets/monitors/TextUpdate.d.ts +10 -0
- package/dist/types/widgets/monitors/xygraph/Axis.d.ts +1 -1
- package/dist/types/widgets/others/AbstractContainerWidget.d.ts +8 -0
- package/dist/types/widgets/others/ArrayWidget.d.ts +97 -0
- package/dist/types/widgets/others/Connection.d.ts +58 -0
- package/dist/types/widgets/others/DisplayWidget.d.ts +3 -1
- package/dist/types/widgets/others/GridLayout.d.ts +25 -0
- package/dist/types/widgets/others/GroupingContainer.d.ts +60 -0
- package/dist/types/widgets/others/LinkingContainer.d.ts +25 -3
- package/dist/types/widgets/others/SashContainer.d.ts +29 -0
- package/package.json +6 -2
- package/dist/types/widgets/graphics/ImageHelper.d.ts +0 -3
|
@@ -7,9 +7,11 @@ import { PVWrapper } from "./PVWrapper";
|
|
|
7
7
|
export declare class WidgetWrapper {
|
|
8
8
|
private widget;
|
|
9
9
|
constructor(widget: Widget);
|
|
10
|
+
getWidget(): Widget;
|
|
10
11
|
executeAction(index: number): void;
|
|
11
12
|
getPVByName(name: string): PVWrapper | null;
|
|
12
13
|
getPV(propertyName?: string): PVWrapper | null;
|
|
14
|
+
getChild(name: string): WidgetWrapper | null;
|
|
13
15
|
getHookedActions(): ArrayList;
|
|
14
16
|
getVar(name: string): any;
|
|
15
17
|
setVar(name: string, value: any): void;
|
|
@@ -12,6 +12,13 @@ export declare class ActionButton extends Widget {
|
|
|
12
12
|
private imageLoaded;
|
|
13
13
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
14
14
|
init(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Truncates `text` with a trailing ellipsis so it fits within `maxWidth`,
|
|
17
|
+
* matching Draw2D Label's default text-clipping behavior (the underlying
|
|
18
|
+
* figure ActionButtonFigure wraps in Yamcs Studio). Assumes `ctx.font` is
|
|
19
|
+
* already set to the font `text` should be measured with.
|
|
20
|
+
*/
|
|
21
|
+
private truncateWithEllipsis;
|
|
15
22
|
draw(g: Graphics): void;
|
|
16
23
|
getHookedActions(): Action[];
|
|
17
24
|
get font(): Font;
|
|
@@ -10,6 +10,7 @@ export declare class BooleanButton extends Widget {
|
|
|
10
10
|
private areaRegion?;
|
|
11
11
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
12
12
|
init(): void;
|
|
13
|
+
private openConfirmDialog;
|
|
13
14
|
private toggleOn;
|
|
14
15
|
private toggleOff;
|
|
15
16
|
get booleanValue(): boolean;
|
|
@@ -23,6 +24,9 @@ export declare class BooleanButton extends Widget {
|
|
|
23
24
|
get toggleButton(): boolean;
|
|
24
25
|
get pushActionIndex(): number;
|
|
25
26
|
get releaseActionIndex(): number;
|
|
27
|
+
get showConfirmDialog(): number;
|
|
28
|
+
get password(): string;
|
|
29
|
+
get confirmMessage(): string;
|
|
26
30
|
get squareButton(): boolean;
|
|
27
31
|
get showLed(): boolean;
|
|
28
32
|
get showBooleanLabel(): boolean;
|
|
@@ -8,6 +8,7 @@ export declare class BooleanSwitch extends Widget {
|
|
|
8
8
|
private shaftRegion?;
|
|
9
9
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
10
10
|
init(): void;
|
|
11
|
+
private openConfirmDialog;
|
|
11
12
|
private toggleOn;
|
|
12
13
|
private toggleOff;
|
|
13
14
|
get booleanValue(): boolean;
|
|
@@ -22,6 +23,9 @@ export declare class BooleanSwitch extends Widget {
|
|
|
22
23
|
get toggleButton(): boolean;
|
|
23
24
|
get pushActionIndex(): number;
|
|
24
25
|
get releaseActionIndex(): number;
|
|
26
|
+
get showConfirmDialog(): number;
|
|
27
|
+
get password(): string;
|
|
28
|
+
get confirmMessage(): string;
|
|
25
29
|
get effect3d(): boolean;
|
|
26
30
|
get onColor(): Color;
|
|
27
31
|
get onLabel(): string;
|
|
@@ -13,9 +13,11 @@ export declare class CheckBox extends Widget {
|
|
|
13
13
|
private toggleOn;
|
|
14
14
|
private toggleOff;
|
|
15
15
|
get booleanValue(): boolean;
|
|
16
|
+
drawHolder(g: Graphics): void;
|
|
16
17
|
draw(g: Graphics): void;
|
|
17
18
|
get boxSize(): number;
|
|
18
19
|
get gap(): number;
|
|
20
|
+
get autoSize(): boolean;
|
|
19
21
|
get bit(): number;
|
|
20
22
|
get enabled(): boolean;
|
|
21
23
|
get selectedColor(): Color;
|
|
@@ -12,15 +12,31 @@ export declare class ImageBooleanButton extends Widget {
|
|
|
12
12
|
private areaRegion?;
|
|
13
13
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
14
14
|
init(): void;
|
|
15
|
+
private openConfirmDialog;
|
|
15
16
|
private toggleOn;
|
|
16
17
|
private toggleOff;
|
|
17
18
|
get booleanValue(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Mirrors ImageBoolButtonEditPart#autoSizeWidget(): once the currently-shown
|
|
21
|
+
* (on/off) image has loaded, snap the widget's own width/height to that
|
|
22
|
+
* image's natural size - unless stretch_to_fit is set, in which case the
|
|
23
|
+
* image follows the widget's declared bounds instead, so there's nothing to
|
|
24
|
+
* auto-size to.
|
|
25
|
+
*/
|
|
26
|
+
private applyAutoSize;
|
|
27
|
+
autoScale(widthRatio: number, heightRatio: number): void;
|
|
18
28
|
draw(g: Graphics): void;
|
|
29
|
+
get autoSize(): boolean;
|
|
30
|
+
get stretchToFit(): boolean;
|
|
31
|
+
get transparency(): boolean;
|
|
19
32
|
get bit(): number;
|
|
20
33
|
get dataType(): number;
|
|
21
34
|
get toggleButton(): boolean;
|
|
22
35
|
get pushActionIndex(): number;
|
|
23
36
|
get releaseActionIndex(): number;
|
|
37
|
+
get showConfirmDialog(): number;
|
|
38
|
+
get password(): string;
|
|
39
|
+
get confirmMessage(): string;
|
|
24
40
|
get showBooleanLabel(): boolean;
|
|
25
41
|
get effect3d(): boolean;
|
|
26
42
|
get onImage(): string;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Color } from "../../Color";
|
|
2
|
+
import { Display } from "../../Display";
|
|
3
|
+
import { Font } from "../../Font";
|
|
4
|
+
import { Graphics } from "../../Graphics";
|
|
5
|
+
import { Widget } from "../../Widget";
|
|
6
|
+
import { AbstractContainerWidget } from "../others/AbstractContainerWidget";
|
|
7
|
+
export declare class Knob extends Widget {
|
|
8
|
+
private thumbRegion?;
|
|
9
|
+
private dragValue?;
|
|
10
|
+
private dragAngle?;
|
|
11
|
+
private scaleLayoutCache?;
|
|
12
|
+
private valueLabelFormatCache?;
|
|
13
|
+
constructor(display: Display, parent: AbstractContainerWidget);
|
|
14
|
+
init(): void;
|
|
15
|
+
draw(g: Graphics): void;
|
|
16
|
+
private computeLimits;
|
|
17
|
+
private buildScale;
|
|
18
|
+
private getLayoutScale;
|
|
19
|
+
private drawRamp;
|
|
20
|
+
private drawBulb;
|
|
21
|
+
private drawValueLabel;
|
|
22
|
+
private drawThumb;
|
|
23
|
+
private getValuePosition;
|
|
24
|
+
private getValueInRange;
|
|
25
|
+
private getAbsoluteCenter;
|
|
26
|
+
private pointToAbsoluteAngle;
|
|
27
|
+
private toRelativeAngle;
|
|
28
|
+
private calcValueChange;
|
|
29
|
+
private setCoercedValue;
|
|
30
|
+
private formatLabelValue;
|
|
31
|
+
get majorTickLength(): number;
|
|
32
|
+
get minorTickLength(): number;
|
|
33
|
+
get colorLo(): Color;
|
|
34
|
+
get colorLoLo(): Color;
|
|
35
|
+
get colorHi(): Color;
|
|
36
|
+
get colorHiHi(): Color;
|
|
37
|
+
get effect3d(): boolean;
|
|
38
|
+
get font(): Font;
|
|
39
|
+
get increment(): number;
|
|
40
|
+
get knobColor(): Color;
|
|
41
|
+
get levelLo(): number;
|
|
42
|
+
get levelLoLo(): number;
|
|
43
|
+
get levelHi(): number;
|
|
44
|
+
get levelHiHi(): number;
|
|
45
|
+
get limitsFromPv(): boolean;
|
|
46
|
+
get logScale(): boolean;
|
|
47
|
+
get majorTickStepHint(): number;
|
|
48
|
+
get maximum(): number;
|
|
49
|
+
get minimum(): number;
|
|
50
|
+
get rampGradient(): boolean;
|
|
51
|
+
get scaleFont(): Font;
|
|
52
|
+
get scaleFormat(): string;
|
|
53
|
+
get showHi(): boolean;
|
|
54
|
+
get showHiHi(): boolean;
|
|
55
|
+
get showLo(): boolean;
|
|
56
|
+
get showLoLo(): boolean;
|
|
57
|
+
get showMarkers(): boolean;
|
|
58
|
+
get showMinorTicks(): boolean;
|
|
59
|
+
get showScale(): boolean;
|
|
60
|
+
get showValueLabel(): boolean;
|
|
61
|
+
get thumbColor(): Color;
|
|
62
|
+
get transparentBackground(): boolean;
|
|
63
|
+
get valueLabelFormat(): string;
|
|
64
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Color } from "../../Color";
|
|
2
|
+
import { Display } from "../../Display";
|
|
3
|
+
import { Font } from "../../Font";
|
|
4
|
+
import { Graphics } from "../../Graphics";
|
|
5
|
+
import { Widget } from "../../Widget";
|
|
6
|
+
import { AbstractContainerWidget } from "../others/AbstractContainerWidget";
|
|
7
|
+
export declare class ScaledSlider extends Widget {
|
|
8
|
+
private trackRegion?;
|
|
9
|
+
private thumbRegion?;
|
|
10
|
+
private grabStartValue?;
|
|
11
|
+
private trackScale?;
|
|
12
|
+
private pageTimeout?;
|
|
13
|
+
private pageUp;
|
|
14
|
+
private pagePressedValue;
|
|
15
|
+
private hoveringThumb;
|
|
16
|
+
private draggingThumb;
|
|
17
|
+
constructor(display: Display, parent: AbstractContainerWidget);
|
|
18
|
+
init(): void;
|
|
19
|
+
draw(g: Graphics): void;
|
|
20
|
+
private drawVertical;
|
|
21
|
+
private drawVerticalMarkers;
|
|
22
|
+
private drawVerticalTrack;
|
|
23
|
+
private drawHorizontal;
|
|
24
|
+
private drawHorizontalMarkers;
|
|
25
|
+
private drawHorizontalTrack;
|
|
26
|
+
private drawThumb;
|
|
27
|
+
private drawValueLabel;
|
|
28
|
+
private pageRepeatedly;
|
|
29
|
+
private stopPaging;
|
|
30
|
+
private getAncestorOffset;
|
|
31
|
+
private setCoercedValue;
|
|
32
|
+
private getCoercedValue;
|
|
33
|
+
private formatLabelValue;
|
|
34
|
+
destroy(): void;
|
|
35
|
+
get min(): number;
|
|
36
|
+
get max(): number;
|
|
37
|
+
get lolo(): number | undefined;
|
|
38
|
+
get lo(): number | undefined;
|
|
39
|
+
get hi(): number | undefined;
|
|
40
|
+
get hihi(): number | undefined;
|
|
41
|
+
get markerTickLength(): number;
|
|
42
|
+
get markerTickLineWidth(): number;
|
|
43
|
+
get markerGap(): number;
|
|
44
|
+
get outlineWidth(): number;
|
|
45
|
+
get trackBreadth(): number;
|
|
46
|
+
get thumbLength(): number;
|
|
47
|
+
get thumbBreadth(): number;
|
|
48
|
+
get gapBtwThumbScale(): number;
|
|
49
|
+
get colorHi(): Color;
|
|
50
|
+
get colorHiHi(): Color;
|
|
51
|
+
get colorLo(): Color;
|
|
52
|
+
get colorLoLo(): Color;
|
|
53
|
+
get colorFillbackground(): Color;
|
|
54
|
+
get effect3d(): boolean;
|
|
55
|
+
get fillColor(): Color;
|
|
56
|
+
get font(): Font;
|
|
57
|
+
get horizontal(): boolean;
|
|
58
|
+
get levelHi(): number;
|
|
59
|
+
get levelHiHi(): number;
|
|
60
|
+
get levelLo(): number;
|
|
61
|
+
get levelLoLo(): number;
|
|
62
|
+
get limitsFromPv(): boolean;
|
|
63
|
+
get logScale(): boolean;
|
|
64
|
+
get majorTickStepHint(): number;
|
|
65
|
+
get maximum(): number;
|
|
66
|
+
get minimum(): number;
|
|
67
|
+
get pageIncrement(): number;
|
|
68
|
+
get scaleFont(): Font;
|
|
69
|
+
get scaleFormat(): string;
|
|
70
|
+
get showHi(): boolean;
|
|
71
|
+
get showHiHi(): boolean;
|
|
72
|
+
get showLo(): boolean;
|
|
73
|
+
get showLoLo(): boolean;
|
|
74
|
+
get showMarkers(): boolean;
|
|
75
|
+
get showMinorTicks(): boolean;
|
|
76
|
+
get showScale(): boolean;
|
|
77
|
+
get stepIncrement(): number;
|
|
78
|
+
get thumbColor(): Color;
|
|
79
|
+
get transparentBackground(): boolean;
|
|
80
|
+
get valueLabelFormat(): string;
|
|
81
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Display } from "../../Display";
|
|
2
|
+
import { Font } from "../../Font";
|
|
3
|
+
import { Graphics } from "../../Graphics";
|
|
4
|
+
import { Widget } from "../../Widget";
|
|
5
|
+
import { AbstractContainerWidget } from "../others/AbstractContainerWidget";
|
|
6
|
+
export declare class Spinner extends Widget {
|
|
7
|
+
private upRegion?;
|
|
8
|
+
private upPressed;
|
|
9
|
+
private downRegion?;
|
|
10
|
+
private downPressed;
|
|
11
|
+
private areaRegion?;
|
|
12
|
+
private repeatTimeout?;
|
|
13
|
+
private editing;
|
|
14
|
+
private inputEl?;
|
|
15
|
+
private scratchCanvas?;
|
|
16
|
+
private scratchCtx?;
|
|
17
|
+
constructor(display: Display, parent: AbstractContainerWidget);
|
|
18
|
+
init(): void;
|
|
19
|
+
private stopRepeating;
|
|
20
|
+
private stepRepeatedly;
|
|
21
|
+
private step;
|
|
22
|
+
private currentNumericValue;
|
|
23
|
+
private clamp;
|
|
24
|
+
private startEditing;
|
|
25
|
+
private commitEditing;
|
|
26
|
+
private cancelEditing;
|
|
27
|
+
draw(g: Graphics): void;
|
|
28
|
+
private computeLayout;
|
|
29
|
+
private drawLabel;
|
|
30
|
+
private formatSpinnerValue;
|
|
31
|
+
private drawUpButton;
|
|
32
|
+
private drawDownButton;
|
|
33
|
+
private drawSpinnerButtonBorder;
|
|
34
|
+
destroy(): void;
|
|
35
|
+
get minimum(): number;
|
|
36
|
+
get maximum(): number;
|
|
37
|
+
get stepIncrement(): number;
|
|
38
|
+
get pageIncrement(): number;
|
|
39
|
+
get limitsFromPV(): boolean;
|
|
40
|
+
get format(): number;
|
|
41
|
+
get precision(): number;
|
|
42
|
+
get precisionFromPV(): boolean;
|
|
43
|
+
get buttonsOnLeft(): boolean;
|
|
44
|
+
get horizontalButtonsLayout(): boolean;
|
|
45
|
+
get showText(): boolean;
|
|
46
|
+
get font(): Font;
|
|
47
|
+
get horizAlignment(): number;
|
|
48
|
+
get vertAlignment(): number;
|
|
49
|
+
}
|
|
@@ -11,20 +11,35 @@ export declare class TextInput extends Widget {
|
|
|
11
11
|
private scratchCtx?;
|
|
12
12
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
13
13
|
init(): void;
|
|
14
|
+
private clampToLimits;
|
|
15
|
+
private finishEditing;
|
|
14
16
|
private cancelInput;
|
|
17
|
+
private computeDisplayText;
|
|
18
|
+
drawHolder(g: Graphics): void;
|
|
15
19
|
draw(g: Graphics): void;
|
|
20
|
+
private drawNative;
|
|
16
21
|
hide(): void;
|
|
17
22
|
destroy(): void;
|
|
18
|
-
get
|
|
19
|
-
set value(value: any);
|
|
23
|
+
get autoSize(): boolean;
|
|
20
24
|
get confirmMessage(): string;
|
|
21
25
|
get font(): Font;
|
|
22
26
|
get formatType(): number;
|
|
23
27
|
get horizAlignment(): number;
|
|
28
|
+
get limitsFromPV(): boolean;
|
|
29
|
+
get maximum(): number;
|
|
30
|
+
get minimum(): number;
|
|
24
31
|
get multilineInput(): boolean;
|
|
25
32
|
get passwordInput(): boolean;
|
|
26
33
|
get precision(): number;
|
|
27
34
|
get precisionFromPV(): boolean;
|
|
35
|
+
get readOnly(): boolean;
|
|
36
|
+
get rotationAngle(): number;
|
|
37
|
+
get showHScroll(): boolean;
|
|
38
|
+
get showLohi(): boolean;
|
|
39
|
+
get showNativeBorder(): boolean;
|
|
28
40
|
get showUnits(): boolean;
|
|
41
|
+
get showVScroll(): boolean;
|
|
42
|
+
get style(): number;
|
|
29
43
|
get vertAlignment(): number;
|
|
44
|
+
get wrapWords(): boolean;
|
|
30
45
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Color } from "../../Color";
|
|
2
|
+
import { Display } from "../../Display";
|
|
3
|
+
import { Font } from "../../Font";
|
|
4
|
+
import { Graphics } from "../../Graphics";
|
|
5
|
+
import { Widget } from "../../Widget";
|
|
6
|
+
import { AbstractContainerWidget } from "../others/AbstractContainerWidget";
|
|
7
|
+
export declare class ThumbWheel extends Widget {
|
|
8
|
+
private repeatTimeout?;
|
|
9
|
+
private integerPressed;
|
|
10
|
+
private decimalPressed;
|
|
11
|
+
constructor(display: Display, parent: AbstractContainerWidget);
|
|
12
|
+
private ensurePressedArrays;
|
|
13
|
+
draw(g: Graphics): void;
|
|
14
|
+
private computeLayout;
|
|
15
|
+
private computeDigits;
|
|
16
|
+
private computeWheelLimits;
|
|
17
|
+
private currentNumericValue;
|
|
18
|
+
private drawPlainCell;
|
|
19
|
+
private drawDigitCell;
|
|
20
|
+
private computeLabelBounds;
|
|
21
|
+
private drawCellBorder;
|
|
22
|
+
private drawCellText;
|
|
23
|
+
private drawUpButton;
|
|
24
|
+
private drawDownButton;
|
|
25
|
+
private drawButtonBorder;
|
|
26
|
+
private stopRepeating;
|
|
27
|
+
private clickRepeatedly;
|
|
28
|
+
private click;
|
|
29
|
+
private increment;
|
|
30
|
+
private decrement;
|
|
31
|
+
destroy(): void;
|
|
32
|
+
get minimum(): number;
|
|
33
|
+
get maximum(): number;
|
|
34
|
+
get integerDigits(): number;
|
|
35
|
+
get decimalDigits(): number;
|
|
36
|
+
get internalFrameColor(): Color;
|
|
37
|
+
get focusedFrameColor(): Color;
|
|
38
|
+
get internalFrameSize(): number;
|
|
39
|
+
get limitsFromPV(): boolean;
|
|
40
|
+
get showButtons(): boolean;
|
|
41
|
+
get font(): Font;
|
|
42
|
+
}
|
|
@@ -27,7 +27,7 @@ export declare class Ramp {
|
|
|
27
27
|
private lengthInDegrees;
|
|
28
28
|
private radius;
|
|
29
29
|
constructor(rampWidth: number, startAngle: number, endAngle: number);
|
|
30
|
-
draw(g: Graphics, scaleArea: Bounds, rampArea: Bounds): void;
|
|
30
|
+
draw(g: Graphics, scaleArea: Bounds, rampArea: Bounds, visible?: boolean): void;
|
|
31
31
|
drawRamp(g: Graphics, area: Bounds): void;
|
|
32
32
|
getRadius(): number;
|
|
33
33
|
getValuePosition(v: number, limit?: boolean): number;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Color } from "../../Color";
|
|
2
|
+
import { Font } from "../../Font";
|
|
3
|
+
import { Graphics } from "../../Graphics";
|
|
4
|
+
import { Bounds } from "../../positioning";
|
|
5
|
+
/**
|
|
6
|
+
* Ports org.csstudio.swt.widgets.figureparts.RoundScale (+ RoundScaleTickMarks,
|
|
7
|
+
* RoundScaleTickLabels) from Yamcs Studio. Draws the major/minor tick marks and
|
|
8
|
+
* numeric scale around a round Gauge/Meter dial.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Scale {
|
|
11
|
+
private startAngle;
|
|
12
|
+
private endAngle;
|
|
13
|
+
private direction;
|
|
14
|
+
minimum: number;
|
|
15
|
+
maximum: number;
|
|
16
|
+
logScale: boolean;
|
|
17
|
+
showMinorTicks: boolean;
|
|
18
|
+
visible: boolean;
|
|
19
|
+
majorTickStepHint: number;
|
|
20
|
+
majorTickLength: number;
|
|
21
|
+
minorTickLength: number;
|
|
22
|
+
majorLineWidth: number;
|
|
23
|
+
minorLineWidth: number;
|
|
24
|
+
format: string;
|
|
25
|
+
font: Font;
|
|
26
|
+
foregroundColor: Color;
|
|
27
|
+
private radius;
|
|
28
|
+
constructor(startAngle: number, // degrees
|
|
29
|
+
endAngle: number, // degrees
|
|
30
|
+
direction: "inward" | "outward");
|
|
31
|
+
getRadius(): number;
|
|
32
|
+
/** Formats a value the same way tick labels are formatted. */
|
|
33
|
+
formatText(value: number): string;
|
|
34
|
+
private layoutTicks?;
|
|
35
|
+
private layoutGeometry?;
|
|
36
|
+
/**
|
|
37
|
+
* Computes the radius and tick/label geometry without drawing anything.
|
|
38
|
+
* Callers that need the radius before other siblings are laid out (e.g.
|
|
39
|
+
* Knob, where the ramp/bulb bounds derive from the tick radius but must
|
|
40
|
+
* be *painted* before the ticks so the ticks end up on top) should call
|
|
41
|
+
* this first, then `paint()` once the rest has been drawn. Safe to call
|
|
42
|
+
* more than once; `draw()` is just `layout()` + `paint()` combined for
|
|
43
|
+
* callers that don't care about paint order (Gauge, Meter).
|
|
44
|
+
*/
|
|
45
|
+
layout(g: Graphics, bounds: Bounds): void;
|
|
46
|
+
/** Draws ticks/labels using the geometry computed by the last layout() call. */
|
|
47
|
+
paint(g: Graphics, bounds: Bounds): void;
|
|
48
|
+
draw(g: Graphics, bounds: Bounds): void;
|
|
49
|
+
private computeGeometry;
|
|
50
|
+
private getTickLabelMaxOutLength;
|
|
51
|
+
private getRenderedRange;
|
|
52
|
+
private getAutoFormatPattern;
|
|
53
|
+
private formatValue;
|
|
54
|
+
private getGridStep;
|
|
55
|
+
private computeLinearTicks;
|
|
56
|
+
private computeLogTicks;
|
|
57
|
+
private computeLabelAreas;
|
|
58
|
+
private computeLabelVisibility;
|
|
59
|
+
private isMajorLogTick;
|
|
60
|
+
private drawTickLine;
|
|
61
|
+
private drawLinearTickMarks;
|
|
62
|
+
private drawLogTickMarks;
|
|
63
|
+
private drawTickLabels;
|
|
64
|
+
}
|
|
@@ -10,10 +10,66 @@ export declare class ImageWidget extends Widget {
|
|
|
10
10
|
private imageLoaded;
|
|
11
11
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
12
12
|
init(): void;
|
|
13
|
+
private applyPermutationDelta;
|
|
14
|
+
/**
|
|
15
|
+
* Position always follows the auto-scale ratio (set unconditionally by
|
|
16
|
+
* the base autoScale, mirroring AbstractWidgetModel#doScale()'s
|
|
17
|
+
* unconditional setLocation()). Size only follows the ratio when
|
|
18
|
+
* stretch_to_fit is set; otherwise it's snapped back to the image's
|
|
19
|
+
* natural size, mirroring ImageEditPart#autoSizeWidget() overriding
|
|
20
|
+
* whatever setSize() the auto-scale pipeline computed.
|
|
21
|
+
*/
|
|
22
|
+
autoScale(widthRatio: number, heightRatio: number): void;
|
|
23
|
+
private applyAutoSize;
|
|
24
|
+
/**
|
|
25
|
+
* The source rectangle to sample from the natural image, mirroring
|
|
26
|
+
* PNGSymbolImage#generatePNGData()'s crop handling: an inset that would
|
|
27
|
+
* consume the whole image on its own is dropped back to 0, and the
|
|
28
|
+
* opposite inset is dropped to 0 too if the pair would otherwise leave
|
|
29
|
+
* nothing (or a negative size) left over.
|
|
30
|
+
*/
|
|
31
|
+
private getCropRegion;
|
|
13
32
|
draw(g: Graphics): void;
|
|
33
|
+
/**
|
|
34
|
+
* Draws `source`'s crop region into the widget. Mirrors
|
|
35
|
+
* PNGSymbolImage#paintFigure(): the background fill (when not
|
|
36
|
+
* transparent) covers only the same rectangle the image itself is
|
|
37
|
+
* drawn into - never the full declared width/height if that's larger,
|
|
38
|
+
* e.g. when auto_size is off and the box exceeds the (unstretched)
|
|
39
|
+
* crop.
|
|
40
|
+
*/
|
|
41
|
+
private drawSource;
|
|
42
|
+
private getUnstretchedSourceRect;
|
|
43
|
+
/**
|
|
44
|
+
* When stretching, PNGSymbolImage#generatePNGData() conceptually
|
|
45
|
+
* stretches the whole natural image up to (width+leftCrop+rightCrop) x
|
|
46
|
+
* (height+topCrop+bottomCrop) *before* cropping, so crop_top/bottom/
|
|
47
|
+
* left/right are authored in that stretched image's pixels, not the
|
|
48
|
+
* natural image's. Translate them back into natural-image source
|
|
49
|
+
* coordinates instead of pre-stretching a separate canvas - an
|
|
50
|
+
* equivalent result via a single drawImage call. Skipping this (using
|
|
51
|
+
* the crop amounts directly against the natural image, same as the
|
|
52
|
+
* unstretched case) crops away a larger fraction of the original image
|
|
53
|
+
* than Java does whenever the box is bigger than the natural size.
|
|
54
|
+
*/
|
|
55
|
+
private getStretchedSourceRect;
|
|
14
56
|
private triggerImageLoad;
|
|
15
57
|
private snapshotImage;
|
|
58
|
+
/**
|
|
59
|
+
* Draws `source` (of natural size naturalWidth x naturalHeight) into a
|
|
60
|
+
* new canvas, oriented per this widget's permutation_matrix. Returns a
|
|
61
|
+
* plain 1:1 copy (no extra canvas) when the matrix is the identity -
|
|
62
|
+
* the overwhelming common case - to avoid the extra draw.
|
|
63
|
+
*/
|
|
64
|
+
private renderOriented;
|
|
16
65
|
get transparency(): boolean;
|
|
17
66
|
get imageFile(): string;
|
|
18
67
|
get noAnimation(): boolean;
|
|
68
|
+
get autoSize(): boolean;
|
|
69
|
+
get stretchToFit(): boolean;
|
|
70
|
+
get cropTop(): number;
|
|
71
|
+
get cropBottom(): number;
|
|
72
|
+
get cropLeft(): number;
|
|
73
|
+
get cropRight(): number;
|
|
74
|
+
get permutationMatrix(): number[][];
|
|
19
75
|
}
|
|
@@ -4,14 +4,50 @@ import { Graphics } from "../../Graphics";
|
|
|
4
4
|
import { Widget } from "../../Widget";
|
|
5
5
|
import { AbstractContainerWidget } from "../others/AbstractContainerWidget";
|
|
6
6
|
export declare class Label extends Widget {
|
|
7
|
+
private scrollOffset;
|
|
8
|
+
private maxScroll;
|
|
9
|
+
private dragRange?;
|
|
10
|
+
private grabStartOffset?;
|
|
11
|
+
private actionTimeout?;
|
|
12
|
+
private upPressed;
|
|
13
|
+
private downPressed;
|
|
14
|
+
private thumbRegion?;
|
|
15
|
+
private upRegion?;
|
|
16
|
+
private downRegion?;
|
|
17
|
+
private trackAboveRegion?;
|
|
18
|
+
private trackBelowRegion?;
|
|
7
19
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
20
|
+
init(): void;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
private setScrollOffset;
|
|
23
|
+
private stepScrollRepeatedly;
|
|
24
|
+
private pageScrollRepeatedly;
|
|
25
|
+
private endScrollAction;
|
|
26
|
+
/**
|
|
27
|
+
* Auto Size ignores wrap_words and resizes the widget to fit the text on
|
|
28
|
+
* a single line, like LabelEditPart#getAutoSizeDimension() in Yamcs Studio
|
|
29
|
+
* (which is based on the unscaled TextFigure preferred size, not the
|
|
30
|
+
* wrapped WrappableTextFigure size).
|
|
31
|
+
*/
|
|
32
|
+
drawHolder(g: Graphics): void;
|
|
8
33
|
draw(g: Graphics): void;
|
|
9
34
|
private drawText;
|
|
10
35
|
private drawWrapped;
|
|
36
|
+
/**
|
|
37
|
+
* Vertical scrollbar for overflowing wrap_words content, matching
|
|
38
|
+
* draw2d's stock ScrollBar look (used by WrappableTextFigure's
|
|
39
|
+
* ScrollPane in Yamcs Studio): up/down bevel buttons plus a draggable
|
|
40
|
+
* thumb. Unlike Yamcs Studio, does not support mouse wheel, since neither
|
|
41
|
+
* does WrappableTextFigure/ScrollPane there.
|
|
42
|
+
*/
|
|
43
|
+
private drawScrollbar;
|
|
44
|
+
private drawScrollButton;
|
|
11
45
|
private wrapText;
|
|
12
46
|
private wrapLine;
|
|
47
|
+
get autoSize(): boolean;
|
|
13
48
|
get font(): Font;
|
|
14
49
|
get horizAlignment(): number;
|
|
50
|
+
get showScrollbar(): boolean;
|
|
15
51
|
get vertAlignment(): number;
|
|
16
52
|
get wrapWords(): boolean;
|
|
17
53
|
}
|
|
@@ -5,8 +5,37 @@ import { Point } from "../../positioning";
|
|
|
5
5
|
import { Widget } from "../../Widget";
|
|
6
6
|
import { AbstractContainerWidget } from "../others/AbstractContainerWidget";
|
|
7
7
|
export declare class Polygon extends Widget {
|
|
8
|
+
private zeroDegreePoints;
|
|
9
|
+
private originPoints?;
|
|
8
10
|
constructor(display: Display, parent: AbstractContainerWidget);
|
|
9
11
|
init(): void;
|
|
12
|
+
private updateZeroDegreePoints;
|
|
13
|
+
/**
|
|
14
|
+
* Mirrors AbstractPolyModel#doScale() in the Java reference, which is a
|
|
15
|
+
* two-step process, not a single uniform scale of each point:
|
|
16
|
+
*
|
|
17
|
+
* 1. The shape's bounding-box anchor (its own top-left corner) moves by
|
|
18
|
+
* the FULL, unclamped widthRatio/heightRatio - same as any other
|
|
19
|
+
* widget's x/y always does, regardless of its own ScaleOptions - so
|
|
20
|
+
* the shape's position keeps up with the rest of the layout even when
|
|
21
|
+
* the display auto-scales non-uniformly.
|
|
22
|
+
* 2. Only the points' offsets *relative to that already-repositioned
|
|
23
|
+
* anchor* are then scaled by the ratio clamped against ScaleOptions
|
|
24
|
+
* (e.g. keep_wh_ratio, which defaults to true for polygons) - so it's
|
|
25
|
+
* just the shape's own internal proportions that stay locked, not its
|
|
26
|
+
* position. Collapsing both steps into one clamped scale of the
|
|
27
|
+
* absolute points (as an earlier version of this method did) makes a
|
|
28
|
+
* keep_wh_ratio polygon barely move at all under non-uniform scaling,
|
|
29
|
+
* clustering near its design position instead of tracking the layout.
|
|
30
|
+
*
|
|
31
|
+
* originPoints must be latched *before* the base autoScale call below:
|
|
32
|
+
* that call writes x/y, which synchronously fires the x/y listeners
|
|
33
|
+
* above and translates PROP_POINTS as a side effect. Capturing origin
|
|
34
|
+
* points afterwards would latch that already-shifted value forever
|
|
35
|
+
* (since this only runs once), corrupting every subsequent rescale
|
|
36
|
+
* including the revert back to the original size.
|
|
37
|
+
*/
|
|
38
|
+
autoScale(widthRatio: number, heightRatio: number): void;
|
|
10
39
|
draw(g: Graphics): void;
|
|
11
40
|
private drawFill;
|
|
12
41
|
get alpha(): number;
|
|
@@ -16,4 +45,5 @@ export declare class Polygon extends Widget {
|
|
|
16
45
|
get lineColor(): Color;
|
|
17
46
|
get lineStyle(): number;
|
|
18
47
|
get points(): Point[];
|
|
48
|
+
get rotationAngle(): number;
|
|
19
49
|
}
|