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