public class A {
private void drawEdge(Graphics g, float edgeWidth,
int x1, int x2, int y1, int y2) {
final Graphics2D g2d = (Graphics2D) g;
g2d.setStroke(new BasicStroke(edgeWidth));
g.drawLine(x1, y1, x2, y2);
}
}
public class A {
private void drawEdge(Edge edge, Graphics g) {
final Graphics2D g2d = (Graphics2D) g;
g2d.setStroke(new BasicStroke(edge.getEdgeWidth()));
g.drawLine(edge.getX1(), edge.getY1(), edge.getX2(), edge.getY2());
}
}
public class Edge {
private final float edgeWidth;
private final int x1;
...
public Edge(float edgeWidth, int x1, int x2, int y1, int y2) {
this.edgeWidth = edgeWidth;
this.x1 = x1;
...
}
public float getEdgeWidth() {
return edgeWidth;
}
public int getX1() {
return x1;
}
...
}