use of y.view.HitInfo in project binnavi by google.
the class CEdgeExitState 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.hasHitEdges()) {
return CHitEdgesTransformer.changeEdge(m_factory, event, hitInfo, m_edge);
} else {
return CHitEdgesTransformer.exitEdge(m_factory, event, hitInfo, this);
}
}
use of y.view.HitInfo in project binnavi by google.
the class CEdgeHoverState method mouseMoved.
@Override
public IMouseStateChange mouseMoved(final MouseEvent event, final AbstractZyGraph<?, ?> g) {
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.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);
}
}
use of y.view.HitInfo 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);
}
}
use of y.view.HitInfo in project binnavi by google.
the class CEdgeLabelHoverState method mouseMoved.
@Override
public IMouseStateChange mouseMoved(final MouseEvent event, final AbstractZyGraph<?, ?> g) {
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 {
// We are in the node hover state but now there are no more hit nodes.
// That means we just left the node and we have to undo all GUI changes
// we made when entering the node.
m_factory.createEdgeLabelExitState(m_label, event);
return new CStateChange(m_factory.createDefaultState(), true);
}
}
use of y.view.HitInfo in project binnavi by google.
the class CNodeClickedLeftState 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.hasHitNodes()) {
return CHitNodesTransformer.changeNode(m_factory, event, hitInfo, m_node);
} else {
m_factory.createNodeExitState(m_node, event);
return CHitNodesTransformer.exitNode(m_factory, event, hitInfo, this);
}
}
Aggregations