Skip to content

Commit

Permalink
klighd.lsp: mrtree: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
soerendomroes committed Nov 11, 2022
1 parent 851fa81 commit 3f80be6
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,14 @@ class MrTreeActionHandler extends AbstractActionHandler {
MrTreeInteractiveLanguageServerExtension lsExtension

new() {
this.supportedMessages = newHashMap(
MrTreeSetPositionConstraintAction.KIND -> MrTreeSetPositionConstraintAction,
MrTreeDeletePositionConstraintAction.KIND -> MrTreeDeletePositionConstraintAction,
SetAspectRatioAction.KIND -> SetAspectRatioAction)
this.supportedMessages = newHashMap(MrTreeSetPositionConstraintAction.KIND -> MrTreeSetPositionConstraintAction)
}

override handle(Action action, String clientId, KGraphDiagramServer server) {
if (action instanceof MrTreeSetPositionConstraintAction) {
synchronized((server as KGraphDiagramServer).modelLock) {
lsExtension.setPositionConstraint(action.constraint, clientId)
}
} else if (action instanceof MrTreeDeletePositionConstraintAction) {
synchronized((server as KGraphDiagramServer).modelLock) {
lsExtension.deletePositionConstraint(action.constraint, clientId)
}
} else if (action instanceof SetAspectRatioAction) {
synchronized((server as KGraphDiagramServer).modelLock) {
lsExtension.setAspectRatio(action.constraint, clientId)
}
} else {
throw new IllegalArgumentException("Action " + action.kind + " not supported by handler " + this.class.simpleName)
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,6 @@ class MrTreeInteractiveLanguageServerExtension implements ILanguageServerExtensi
setConstraint(MrTreeOptions.POSITION_CONSTRAINT, uri, pc.id,
pc.position, pc.positionConstraint)
}

def deletePositionConstraint(MrTreeDeletePositionConstraint constraint, String clientId) {
// Not implemented
}

/**
* Sets the aspect ratio.
*/
def setAspectRatio(SetAspectRatio constraint, String clientId) {
// Not implemented
}

/**
* Sets a layer or position constraint with a chosen {@code value} on the node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,43 +39,3 @@ public class MrTreeSetPositionConstraintAction implements Action {
initializer.accept(this)
}
}

/**
* Deletes the constraint on the node that is identified by the given id.
*
* @author sdo
*/
@Accessors
@EqualsHashCode
@ToString(skipNulls = true)
public class MrTreeDeletePositionConstraintAction implements Action {
public static val KIND = 'treeDeletePositionConstraint'
String kind = KIND

MrTreeDeletePositionConstraint constraint

new() {}
new(Consumer<MrTreeDeletePositionConstraintAction> initializer) {
initializer.accept(this)
}
}

/**
* Deletes the constraint on the node that is identified by the given id.
*
* @author sdo
*/
@Accessors
@EqualsHashCode
@ToString(skipNulls = true)
public class SetAspectRatioAction implements Action {
public static val KIND = 'setAspectRatio'
String kind = KIND

SetAspectRatio constraint

new() {}
new(Consumer<SetAspectRatioAction> initializer) {
initializer.accept(this)
}
}

0 comments on commit 3f80be6

Please sign in to comment.