|
@@ -8,6 +8,7 @@ import java.awt.Graphics;
|
|
import java.awt.Graphics2D;
|
|
import java.awt.Graphics2D;
|
|
|
|
|
|
import javax.swing.*;
|
|
import javax.swing.*;
|
|
|
|
+import javax.swing.border.Border;
|
|
|
|
|
|
import Model.LayeredGraphNode;
|
|
import Model.LayeredGraphNode;
|
|
|
|
|
|
@@ -66,11 +67,6 @@ public class NodeView extends JPanel {
|
|
@Override
|
|
@Override
|
|
public void paintComponent( Graphics g )
|
|
public void paintComponent( Graphics g )
|
|
{
|
|
{
|
|
- /*else
|
|
|
|
- {
|
|
|
|
- g.setColor( Color.WHITE );
|
|
|
|
- g.fillRect( 0, 0, getWidth()-1, getHeight()-1 );
|
|
|
|
- }*/
|
|
|
|
Graphics2D g2 = (Graphics2D)g;
|
|
Graphics2D g2 = (Graphics2D)g;
|
|
g2.setColor( model.getColor() );
|
|
g2.setColor( model.getColor() );
|
|
g2.setStroke(new BasicStroke(5));
|
|
g2.setStroke(new BasicStroke(5));
|
|
@@ -81,7 +77,7 @@ public class NodeView extends JPanel {
|
|
g.setColor( Color.GRAY );
|
|
g.setColor( Color.GRAY );
|
|
g.fillRect( 0, 0, (int)model.getWidth()-1, (int)model.getHeight()-1 );
|
|
g.fillRect( 0, 0, (int)model.getWidth()-1, (int)model.getHeight()-1 );
|
|
}
|
|
}
|
|
- g2.setColor( model.getColor() );
|
|
|
|
- g2.drawRect( 0, 0, (int)model.getWidth()-1, (int)model.getHeight()-1 );
|
|
|
|
|
|
+ Border linebor = BorderFactory.createLineBorder(model.getColor(), 5);
|
|
|
|
+ linebor.paintBorder( this, g2, 0, 0, (int)model.getWidth()-1, (int)model.getHeight()-1 );
|
|
}
|
|
}
|
|
}
|
|
}
|