|
@@ -9,6 +9,7 @@ import java.awt.Graphics2D;
|
|
|
import java.awt.Image;
|
|
|
import java.awt.Paint;
|
|
|
import java.awt.Rectangle;
|
|
|
+import java.awt.RenderingHints;
|
|
|
import java.awt.event.ActionEvent;
|
|
|
import java.awt.event.ActionListener;
|
|
|
import java.awt.event.MouseEvent;
|
|
@@ -88,6 +89,12 @@ class MyCanvas extends JPanel implements MouseListener, MouseMotionListener {
|
|
|
public void paintComponent(Graphics g) {
|
|
|
super.paintComponent(g);
|
|
|
g2 = (Graphics2D) g;
|
|
|
+ g2.setStroke(new BasicStroke(GlobalVariables.SCALE/15));
|
|
|
+ RenderingHints rh = new RenderingHints(
|
|
|
+ RenderingHints.KEY_ANTIALIASING,
|
|
|
+ RenderingHints.VALUE_ANTIALIAS_ON);
|
|
|
+ g2.setRenderingHints(rh);
|
|
|
+
|
|
|
|
|
|
//Selection
|
|
|
if(selectRect != null){
|
|
@@ -95,12 +102,9 @@ class MyCanvas extends JPanel implements MouseListener, MouseMotionListener {
|
|
|
g2.fillRect((int)selectRect.getX(), (int)selectRect.getY(), (int)selectRect.getWidth(), (int)selectRect.getHeight());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- //drawEdge
|
|
|
- g2.setStroke(new BasicStroke(GlobalVariables.SCALE/10));
|
|
|
+ //drawEdges
|
|
|
g.setColor(Color.BLACK);
|
|
|
- if(drawEdge)g.drawLine(tempCps.getPos().x+GlobalVariables.SCALE_DIVIDED2, tempCps.getPos().y+GlobalVariables.SCALE_DIVIDED2, x, y);
|
|
|
+ if(drawEdge)g2.drawLine(tempCps.getPos().x+GlobalVariables.SCALE_DIVIDED2, tempCps.getPos().y+GlobalVariables.SCALE_DIVIDED2, x, y);
|
|
|
|
|
|
for (CpsObject cps : model.getObjectsOnCanvas()) {
|
|
|
for (CpsObject con : cps.getConnectedTo()) {
|