コード例 #1
0
  @Override
  public void renderStatic(GC gc, ViewPort vp) {
    final Graph<? extends ConnectionData> graph = grm.getGraph();
    for (final Connection<? extends ConnectionData> e : graph.getConnections()) {
      final int x1 = vp.toCoordX(e.from.x);
      final int y1 = vp.toCoordY(e.from.y);

      final int x2 = vp.toCoordX(e.to.x);
      final int y2 = vp.toCoordY(e.to.y);
      gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_BLACK));
      gc.drawLine(x1, y1, x2, y2);
    }
  }