Лабораторная работа 7
This commit is contained in:
parent
f9893aec35
commit
672b49e1ec
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user