use of com.google.security.zynamics.zylib.gui.zygraph.editmode.CStateChange in project binnavi by google.
the class CBendHoverState method mouseMoved.
@Override
public IMouseStateChange mouseMoved(final MouseEvent event, final AbstractZyGraph<?, ?> graph) {
final double x = m_graph.getEditMode().translateX(event.getX());
final double y = m_graph.getEditMode().translateY(event.getY());
final HitInfo hitInfo = m_graph.getGraph().getHitInfo(x, y);
if (hitInfo.hasHitNodes()) {
m_factory.createBendExitState(m_bend, event);
return CHitNodesTransformer.enterNode(m_factory, event, hitInfo);
} else if (hitInfo.hasHitNodeLabels()) {
throw new IllegalStateException();
} else if (hitInfo.hasHitEdges()) {
m_factory.createBendExitState(m_bend, event);
return CHitEdgesTransformer.enterEdge(m_factory, event, hitInfo);
} else if (hitInfo.hasHitEdgeLabels()) {
m_factory.createBendExitState(m_bend, event);
return CHitEdgeLabelsTransformer.enterEdgeLabel(m_factory, event, hitInfo);
} else if (hitInfo.hasHitBends()) {
return CHitBendsTransformer.changeBend(m_factory, event, hitInfo, m_bend);
} else if (hitInfo.hasHitPorts()) {
return new CStateChange(this, true);
} else {
return new CStateChange(m_factory.createDefaultState(), true);
}
}
use of com.google.security.zynamics.zylib.gui.zygraph.editmode.CStateChange in project binnavi by google.
the class CEdgeLabelEnterState method mouseMoved.
@Override
public IMouseStateChange mouseMoved(final MouseEvent event, final AbstractZyGraph<?, ?> graph) {
final double x = m_graph.getEditMode().translateX(event.getX());
final double y = m_graph.getEditMode().translateY(event.getY());
final HitInfo hitInfo = m_graph.getGraph().getHitInfo(x, y);
if (hitInfo.hasHitNodes()) {
m_factory.createEdgeLabelExitState(m_label, event);
return CHitNodesTransformer.enterNode(m_factory, event, hitInfo);
} else if (hitInfo.hasHitNodeLabels()) {
throw new IllegalStateException();
} else if (hitInfo.hasHitEdges()) {
m_factory.createEdgeLabelExitState(m_label, event);
return CHitEdgesTransformer.enterEdge(m_factory, event, hitInfo);
} else if (hitInfo.hasHitEdgeLabels()) {
return CHitEdgeLabelsTransformer.changeEdgeLabel(m_factory, event, hitInfo, m_label);
} else if (hitInfo.hasHitBends()) {
m_factory.createEdgeLabelExitState(m_label, event);
return CHitBendsTransformer.enterBend(m_factory, event, hitInfo);
} else if (hitInfo.hasHitPorts()) {
return new CStateChange(this, true);
} else {
return new CStateChange(m_factory.createEdgeLabelExitState(m_label, event), true);
}
}
use of com.google.security.zynamics.zylib.gui.zygraph.editmode.CStateChange in project binnavi by google.
the class CEdgeLabelHoverState method mousePressed.
@Override
public IMouseStateChange mousePressed(final MouseEvent event, final AbstractZyGraph<?, ?> graph) {
final double x = m_graph.getEditMode().translateX(event.getX());
final double y = m_graph.getEditMode().translateY(event.getY());
final HitInfo hitInfo = m_graph.getGraph().getHitInfo(x, y);
if (hitInfo.hasHitNodes()) {
throw new IllegalStateException();
} else if (hitInfo.hasHitNodeLabels()) {
throw new IllegalStateException();
} else if (hitInfo.hasHitEdges()) {
throw new IllegalStateException();
} else if (hitInfo.hasHitEdgeLabels()) {
final EdgeLabel label = hitInfo.getHitEdgeLabel();
if (label == m_label) {
// }
return new CStateChange(this, true);
} else {
throw new IllegalStateException();
}
} else if (hitInfo.hasHitBends()) {
throw new IllegalStateException();
} else if (hitInfo.hasHitPorts()) {
return new CStateChange(this, true);
} else {
m_factory.createEdgeLabelExitState(m_label, event);
return new CStateChange(this, true);
}
}
use of com.google.security.zynamics.zylib.gui.zygraph.editmode.CStateChange in project binnavi by google.
the class CHitBackgroundTransformer method exitBackground.
public static IMouseStateChange exitBackground(final CStateFactory<?, ?> m_factory, final MouseEvent event, final AbstractZyGraph<?, ?> graph, final IMouseState state) {
final double x = graph.getEditMode().translateX(event.getX());
final double y = graph.getEditMode().translateY(event.getY());
final HitInfo hitInfo = graph.getGraph().getHitInfo(x, y);
if (hitInfo.hasHitNodes()) {
return CHitNodesTransformer.enterNode(m_factory, event, hitInfo);
} else if (hitInfo.hasHitNodeLabels()) {
throw new IllegalStateException();
} else if (hitInfo.hasHitEdges()) {
return CHitEdgesTransformer.enterEdge(m_factory, event, hitInfo);
} else if (hitInfo.hasHitEdgeLabels()) {
return CHitEdgeLabelsTransformer.enterEdgeLabel(m_factory, event, hitInfo);
} else if (hitInfo.hasHitBends()) {
return CHitBendsTransformer.enterBend(m_factory, event, hitInfo);
} else if (hitInfo.hasHitPorts()) {
return new CStateChange(state, true);
} else {
return new CStateChange(m_factory.createDefaultState(), true);
}
}
use of com.google.security.zynamics.zylib.gui.zygraph.editmode.CStateChange in project binnavi by google.
the class CEdgeLabelExitState method mouseMoved.
@Override
public IMouseStateChange mouseMoved(final MouseEvent event, final AbstractZyGraph<?, ?> graph) {
final double x = m_graph.getEditMode().translateX(event.getX());
final double y = m_graph.getEditMode().translateY(event.getY());
final HitInfo hitInfo = m_graph.getGraph().getHitInfo(x, y);
if (hitInfo.hasHitNodes()) {
return CHitNodesTransformer.enterNode(m_factory, event, hitInfo);
} else if (hitInfo.hasHitNodeLabels()) {
throw new IllegalStateException();
} else if (hitInfo.hasHitEdges()) {
return CHitEdgesTransformer.enterEdge(m_factory, event, hitInfo);
} else if (hitInfo.hasHitEdgeLabels()) {
return CHitEdgeLabelsTransformer.enterEdgeLabel(m_factory, event, hitInfo);
} else if (hitInfo.hasHitBends()) {
return CHitBendsTransformer.enterBend(m_factory, event, hitInfo);
} else if (hitInfo.hasHitPorts()) {
return new CStateChange(this, true);
} else {
return new CStateChange(m_factory.createDefaultState(), true);
}
}
Aggregations