-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added group to fSelectionChange event
- Loading branch information
1 parent
9a15216
commit 58850bb
Showing
90 changed files
with
516 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
...src/domain/create-rounded-rect-from-element/create-rounded-rect-from-element.execution.ts
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
projects/f-flow/src/domain/create-rounded-rect-from-element/index.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
.../calculate-connection-line-by-behavior/calculate-connection-line-by-behavior.execution.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { CalculateConnectionLineByBehaviorRequest } from './calculate-connection-line-by-behavior.request'; | ||
import { Injectable } from '@angular/core'; | ||
import { EFConnectionBehavior } from '../../../f-connection'; | ||
import { FExecutionRegister, IExecution } from '@foblex/mediator'; | ||
import { ILine } from '@foblex/2d'; | ||
import { floatingBehavior } from './floating-behavior'; | ||
import { fixedCenterBehavior } from './fixed-center-behavior'; | ||
import { fixedOutboundBehavior } from './fixed-outbound-behavior'; | ||
|
||
@Injectable() | ||
@FExecutionRegister(CalculateConnectionLineByBehaviorRequest) | ||
export class CalculateConnectionLineByBehaviorExecution implements IExecution<CalculateConnectionLineByBehaviorRequest, ILine> { | ||
|
||
private _handlers = { | ||
|
||
[ EFConnectionBehavior.FLOATING.toString() ]: floatingBehavior, | ||
|
||
[ EFConnectionBehavior.FIXED_CENTER.toString() ]: fixedCenterBehavior, | ||
|
||
[ EFConnectionBehavior.FIXED.toString() ]: fixedOutboundBehavior, | ||
} | ||
|
||
public handle(payload: CalculateConnectionLineByBehaviorRequest): ILine { | ||
return this._handlers[ payload.behavior ](payload); | ||
} | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
...on/calculate-connection-line-by-behavior/calculate-connection-line-by-behavior.request.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { EFConnectionBehavior } from '../../../f-connection'; | ||
import { EFConnectableSide } from '../../../f-connectors'; | ||
import { IRoundedRect } from '@foblex/2d'; | ||
|
||
export class CalculateConnectionLineByBehaviorRequest { | ||
|
||
constructor( | ||
public outputRect: IRoundedRect, | ||
public inputRect: IRoundedRect, | ||
public behavior: EFConnectionBehavior | string, | ||
public outputSide: EFConnectableSide, | ||
public inputSide: EFConnectableSide, | ||
) { | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...ow/src/domain/f-connection/calculate-connection-line-by-behavior/fixed-center-behavior.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ILine, Line } from '@foblex/2d'; | ||
import { CalculateConnectionLineByBehaviorRequest } from './calculate-connection-line-by-behavior.request'; | ||
|
||
export function fixedCenterBehavior(payload: CalculateConnectionLineByBehaviorRequest): ILine { | ||
return new Line( | ||
payload.outputRect.gravityCenter, | ||
payload.inputRect.gravityCenter | ||
); | ||
} |
41 changes: 41 additions & 0 deletions
41
.../src/domain/f-connection/calculate-connection-line-by-behavior/fixed-outbound-behavior.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { ILine, IPoint, IRect, Line, Point } from '@foblex/2d'; | ||
import { CalculateConnectionLineByBehaviorRequest } from './calculate-connection-line-by-behavior.request'; | ||
import { EFConnectableSide } from '../../../f-connectors'; | ||
|
||
export function fixedOutboundBehavior(payload: CalculateConnectionLineByBehaviorRequest): ILine { | ||
return new Line( | ||
positions[ payload.outputSide === EFConnectableSide.AUTO ? EFConnectableSide.BOTTOM : payload.outputSide ](payload.outputRect), | ||
positions[ payload.inputSide === EFConnectableSide.AUTO ? EFConnectableSide.TOP : payload.inputSide ](payload.inputRect) | ||
); | ||
} | ||
|
||
const positions = { | ||
[ EFConnectableSide.TOP ]: (rect: IRect): IPoint => { | ||
const result = new Point(); | ||
result.y = rect.y; | ||
result.x = rect.x + rect.width / 2; | ||
return result; | ||
}, | ||
[ EFConnectableSide.BOTTOM ]: (rect: IRect): IPoint => { | ||
const result = new Point(); | ||
result.y = rect.y + rect.height; | ||
result.x = rect.x + rect.width / 2; | ||
return result; | ||
}, | ||
[ EFConnectableSide.LEFT ]: (rect: IRect): IPoint => { | ||
const result = new Point(); | ||
result.x = rect.x; | ||
result.y = rect.y + rect.height / 2; | ||
return result; | ||
}, | ||
[ EFConnectableSide.RIGHT ]: (rect: IRect): IPoint => { | ||
const result = new Point(); | ||
result.x = rect.x + rect.width; | ||
result.y = rect.y + rect.height / 2; | ||
return result; | ||
}, | ||
}; | ||
|
||
|
||
|
||
|
29 changes: 29 additions & 0 deletions
29
...f-flow/src/domain/f-connection/calculate-connection-line-by-behavior/floating-behavior.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { GetIntersections, ILine, IPoint, Line } from '@foblex/2d'; | ||
import { CalculateConnectionLineByBehaviorRequest } from './calculate-connection-line-by-behavior.request'; | ||
|
||
export function floatingBehavior(payload: CalculateConnectionLineByBehaviorRequest): ILine { | ||
return _getIntersectionsLine( | ||
_fromRoundedRectIntersections(payload), | ||
_toRoundedRectIntersections(payload), | ||
payload | ||
); | ||
} | ||
|
||
function _fromRoundedRectIntersections(payload: CalculateConnectionLineByBehaviorRequest) { | ||
return GetIntersections.getRoundedRectIntersections( | ||
payload.outputRect.gravityCenter, payload.inputRect.gravityCenter, payload.outputRect | ||
)[ 0 ]; | ||
} | ||
|
||
function _toRoundedRectIntersections(payload: CalculateConnectionLineByBehaviorRequest) { | ||
return GetIntersections.getRoundedRectIntersections( | ||
payload.inputRect.gravityCenter, payload.outputRect.gravityCenter, payload.inputRect | ||
)[ 0 ]; | ||
} | ||
|
||
function _getIntersectionsLine(from: IPoint, to: IPoint, payload: CalculateConnectionLineByBehaviorRequest): ILine { | ||
return new Line( | ||
from ? from : payload.outputRect.gravityCenter, | ||
to ? to : payload.inputRect.gravityCenter | ||
); | ||
} |
9 changes: 9 additions & 0 deletions
9
projects/f-flow/src/domain/f-connection/calculate-connection-line-by-behavior/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export * from './calculate-connection-line-by-behavior.execution'; | ||
|
||
export * from './calculate-connection-line-by-behavior.request'; | ||
|
||
export * from './fixed-center-behavior'; | ||
|
||
export * from './fixed-outbound-behavior'; | ||
|
||
export * from './floating-behavior'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...s/get-flow-state-connections.execution.ts → ...s/get-flow-state-connections.execution.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...t-flow-state/i-f-flow-state-connection.ts → ...t-flow-state/i-f-flow-state-connection.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...et-flow-state/i-f-flow-state-connector.ts → ...et-flow-state/i-f-flow-state-connector.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.