[vcs-log] minor: performDelegateUpdate -> delegateGraphChanged, convert -> convertToDelegate

This commit is contained in:
Julia Beliaeva
2015-02-02 16:45:58 +03:00
parent 026819b5df
commit 9a07208560
6 changed files with 15 additions and 14 deletions
@@ -44,7 +44,7 @@ public class CollapsedLinearGraphController extends CascadeLinearGraphController
@NotNull
@Override
protected LinearGraphAnswer performDelegateUpdate(@NotNull LinearGraphAnswer delegateAnswer) {
protected LinearGraphAnswer delegateGraphChanged(@NotNull LinearGraphAnswer delegateAnswer) {
if (delegateAnswer.getGraphChanges() != null) {
LinearGraph delegateGraph = getDelegateLinearGraphController().getCompiledGraph();
myCollapsedGraph = CollapsedGraph.updateInstance(myCollapsedGraph, delegateGraph);
@@ -108,7 +108,7 @@ public class CollapsedLinearGraphController extends CascadeLinearGraphController
@Nullable
@Override
protected GraphElement convert(@NotNull GraphElement graphElement) {
protected GraphElement convertToDelegate(@NotNull GraphElement graphElement) {
if (graphElement instanceof GraphEdge) {
Integer upIndex = ((GraphEdge)graphElement).getUpNodeIndex();
Integer downIndex = ((GraphEdge)graphElement).getDownNodeIndex();
@@ -27,7 +27,7 @@ public class BaseLinearGraphController extends CascadeLinearGraphController {
@NotNull
@Override
protected LinearGraphAnswer performDelegateUpdate(@NotNull LinearGraphAnswer delegateAnswer) {
protected LinearGraphAnswer delegateGraphChanged(@NotNull LinearGraphAnswer delegateAnswer) {
throw new IllegalStateException();
}
@@ -48,7 +48,7 @@ public class BekBaseLinearGraphController extends CascadeLinearGraphController {
@NotNull
@Override
protected LinearGraphAnswer performDelegateUpdate(@NotNull LinearGraphAnswer delegateAnswer) {
protected LinearGraphAnswer delegateGraphChanged(@NotNull LinearGraphAnswer delegateAnswer) {
throw new IllegalStateException();
}
@@ -65,7 +65,7 @@ public class BekBaseLinearGraphController extends CascadeLinearGraphController {
@Nullable
@Override
protected GraphElement convert(@NotNull GraphElement graphElement) {
protected GraphElement convertToDelegate(@NotNull GraphElement graphElement) {
if (graphElement instanceof GraphEdge) {
Integer upIndex = ((GraphEdge)graphElement).getUpNodeIndex();
Integer downIndex = ((GraphEdge)graphElement).getDownNodeIndex();
@@ -39,8 +39,9 @@ public abstract class CascadeLinearGraphController implements LinearGraphControl
public LinearGraphAnswer performLinearGraphAction(@NotNull LinearGraphAction action) {
LinearGraphAnswer answer = performAction(action);
if (answer == null && myDelegateLinearGraphController != null) {
answer = myDelegateLinearGraphController.performLinearGraphAction(new VisibleGraphImpl.LinearGraphActionImpl(convert(action.getAffectedElement()), action.getType()));
answer = performDelegateUpdate(answer);
answer = myDelegateLinearGraphController.performLinearGraphAction(new VisibleGraphImpl.LinearGraphActionImpl(
convertToDelegate(action.getAffectedElement()), action.getType()));
answer = delegateGraphChanged(answer);
}
if (answer != null)
return answer;
@@ -48,15 +49,15 @@ public abstract class CascadeLinearGraphController implements LinearGraphControl
}
@Nullable
private PrintElementWithGraphElement convert(@Nullable PrintElementWithGraphElement element) {
private PrintElementWithGraphElement convertToDelegate(@Nullable PrintElementWithGraphElement element) {
if (element == null) return null;
GraphElement convertedGraphElement = convert(element.getGraphElement());
GraphElement convertedGraphElement = convertToDelegate(element.getGraphElement());
if (convertedGraphElement == null) return null;
return PrintElementWithGraphElement.converted(element, convertedGraphElement);
}
@Nullable
protected GraphElement convert(@NotNull GraphElement graphElement) {
protected GraphElement convertToDelegate(@NotNull GraphElement graphElement) {
return graphElement;
}
@@ -72,7 +73,7 @@ public abstract class CascadeLinearGraphController implements LinearGraphControl
}
@NotNull
protected abstract LinearGraphAnswer performDelegateUpdate(@NotNull LinearGraphAnswer delegateAnswer);
protected abstract LinearGraphAnswer delegateGraphChanged(@NotNull LinearGraphAnswer delegateAnswer);
// null mean that this action must be performed by delegateGraphController
@Nullable
@@ -52,14 +52,14 @@ public class FilterLinearGraphController extends CascadeLinearGraphController {
@Nullable
@Override
protected GraphElement convert(@NotNull GraphElement graphElement) {
protected GraphElement convertToDelegate(@NotNull GraphElement graphElement) {
// filter prohibits any actions on delegate graph for now
return null;
}
@NotNull
@Override
protected LinearGraphAnswer performDelegateUpdate(@NotNull LinearGraphAnswer delegateAnswer) {
protected LinearGraphAnswer delegateGraphChanged(@NotNull LinearGraphAnswer delegateAnswer) {
if (delegateAnswer == LinearGraphUtils.DEFAULT_GRAPH_ANSWER) return delegateAnswer;
throw new UnsupportedOperationException(); // todo fix later
}
@@ -55,7 +55,7 @@ public class LinearBekController extends CascadeLinearGraphController {
@NotNull
@Override
protected LinearGraphAnswer performDelegateUpdate(@NotNull LinearGraphAnswer delegateAnswer) {
protected LinearGraphAnswer delegateGraphChanged(@NotNull LinearGraphAnswer delegateAnswer) {
return delegateAnswer;
}