use of y.view.HitInfo in project binnavi by google.
the class CBendClickedLeftState method mouseMoved.
@Override
public IMouseStateChange mouseMoved(final MouseEvent event, final AbstractZyGraph<?, ?> g) {
final double x = g.getEditMode().translateX(event.getX());
final double y = g.getEditMode().translateY(event.getY());
final HitInfo hitInfo = g.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);
final Edge e = hitInfo.getHitEdge();
return new CStateChange(m_factory.createEdgeEnterState(e, event), true);
} else if (hitInfo.hasHitEdgeLabels()) {
m_factory.createBendExitState(m_bend, event);
final EdgeLabel l = hitInfo.getHitEdgeLabel();
return new CStateChange(m_factory.createEdgeLabelEnterState(l, event), true);
} else if (hitInfo.hasHitBends()) {
return CHitBendsTransformer.changeBend(m_factory, event, hitInfo, m_bend);
} else if (hitInfo.hasHitPorts()) {
return new CStateChange(this, true);
} else {
m_factory.createBendExitState(m_bend, event);
return new CStateChange(this, true);
}
}
use of y.view.HitInfo in project binnavi by google.
the class CBendEnterState 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()) {
final Edge e = hitInfo.getHitEdge();
m_factory.createBendExitState(m_bend, event);
return new CStateChange(m_factory.createEdgeEnterState(e, event), true);
} else if (hitInfo.hasHitEdgeLabels()) {
final EdgeLabel l = hitInfo.getHitEdgeLabel();
m_factory.createBendExitState(m_bend, event);
return new CStateChange(m_factory.createEdgeLabelEnterState(l, event), true);
} 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.createBendExitState(m_bend, event), true);
}
}
use of y.view.HitInfo in project binnavi by google.
the class CBendExitState 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);
}
}
use of y.view.HitInfo 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 y.view.HitInfo in project binnavi by google.
the class CEdgeClickedLeftState method mouseMoved.
@Override
public IMouseStateChange mouseMoved(final MouseEvent event, final AbstractZyGraph<?, ?> graph) {
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.hasHitEdges()) {
return CHitEdgesTransformer.changeEdge(m_factory, event, hitInfo, m_edge);
} else {
m_factory.createEdgeExitState(m_edge, event);
return CHitEdgesTransformer.exitEdge(m_factory, event, hitInfo, this);
}
}
Aggregations