Готовая лабораторная работа 5

This commit is contained in:
Никита Белянин 2023-11-30 22:36:53 +04:00
parent 397c4068b8
commit 98c35a61c0

View File

@ -135,7 +135,7 @@ public class FormTankConfig {
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
wheelDrawing.Draw(g2d,-10, -42); //!!!!
wheelDrawing.Draw(g2d,-10, -42);
super.repaint();
}
}
@ -231,12 +231,12 @@ public class FormTankConfig {
labelAdditionalColor.setTransferHandler(
new TransferHandler(){
@Override
public boolean canImport(TransferSupport support) {
public boolean canImport(TransferHandler.TransferSupport support) {
return support.isDataFlavorSupported(ColorTransferable.colorDataFlavor);
}
@Override
public boolean importData(TransferSupport support) {
public boolean importData(TransferHandler.TransferSupport support) {
if (canImport(support)) {
try {
Color color = (Color) support.getTransferable().getTransferData(ColorTransferable.colorDataFlavor);
@ -262,12 +262,12 @@ public class FormTankConfig {
labelWheel.setTransferHandler(
new TransferHandler(){
@Override
public boolean canImport(TransferSupport support) {
public boolean canImport(TransferHandler.TransferSupport support) {
return support.isDataFlavorSupported(WheelTransferable.wheelDrawingDataFlavor);
}
@Override
public boolean importData(TransferSupport support) {
public boolean importData(TransferHandler.TransferSupport support) {
if (canImport(support)) {
try {
IOrnamentForm wheelDrawing = (IOrnamentForm) support.getTransferable().getTransferData(WheelTransferable.wheelDrawingDataFlavor);
@ -289,12 +289,12 @@ public class FormTankConfig {
canvas.setTransferHandler(
new TransferHandler(){
@Override
public boolean canImport(TransferSupport support) {
public boolean canImport(TransferHandler.TransferSupport support) {
return support.isDataFlavorSupported(DataFlavor.stringFlavor);
}
@Override
public boolean importData(TransferSupport support) {
public boolean importData(TransferHandler.TransferSupport support) {
if (canImport(support)) {
try {
String data = (String) support.getTransferable().getTransferData(DataFlavor.stringFlavor);
@ -337,7 +337,7 @@ public class FormTankConfig {
colorPanels[i].setBounds(10,200+i/2*60,50,50);
colorPanels[i+1].setBounds(70,200+i/2*60,50,50);
}
componentSuspensionOrnament.setBounds(10,470,25,20); //!!!!!!!!!!!!!
componentSuspensionOrnament.setBounds(10,470,25,20);
componentAsteriskOrnament.setBounds(50,470,20,20);
componentWheelCombination.setBounds(90,470,25,20);
labelArmoVehicle.setBounds(10,600 ,80,30);