|
@ -5,7 +5,7 @@ import javax.swing.border.*; |
|
|
import java.awt.*; |
|
|
import java.awt.*; |
|
|
import java.awt.event.*; |
|
|
import java.awt.event.*; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
//refractoring test |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class AIGridGUI extends JPanel { |
|
|
public class AIGridGUI extends JPanel { |
|
@ -28,8 +28,8 @@ public class AIGridGUI extends JPanel { |
|
|
Border loweredBevel = BorderFactory.createLoweredBevelBorder(); |
|
|
Border loweredBevel = BorderFactory.createLoweredBevelBorder(); |
|
|
//Border raisedbevel = BorderFactory.createRaisedBevelBorder(); |
|
|
//Border raisedbevel = BorderFactory.createRaisedBevelBorder(); |
|
|
Border defaultBorder; |
|
|
Border defaultBorder; |
|
|
//empty = BorderFactory.createEmptyBorder(4, 4, 4, 4); |
|
|
|
|
|
Border compound = BorderFactory.createCompoundBorder(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ship shipToPlace; |
|
|
Ship shipToPlace; |
|
|
boolean vertical = false; |
|
|
boolean vertical = false; |
|
|
boolean clear; |
|
|
boolean clear; |
|
@ -504,6 +504,14 @@ public class AIGridGUI extends JPanel { |
|
|
clear = false; |
|
|
clear = false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < shipToPlace.getLength(); i++) { |
|
|
|
|
|
int testing = cell.getGridLocation() + i; |
|
|
|
|
|
if((i > 0 && (testing % columns) == 0) || buttons.get(testing).getCellContents() != null) { |
|
|
|
|
|
clear = false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(clear) { |
|
|
if(clear) { |
|
|