@@ -53,22 +53,22 @@ public static ClipBoard getInstance()
5353 return ClipBoardInstanceFactory .instance ;
5454 }
5555
56- private static JLabel selection = new JLabel ("SELECTION : OFF " );
57- private static CLIPBOARD_ACTION clipboardAction = CLIPBOARD_ACTION .DEFUALT ;
58- public static JLabel cutLabel ;
59- public static JLabel copyLabel ;
60- public static JLabel pasteLabel ;
56+ private static JLabel selection = new JLabel ("SELECTION : OFF " );
57+ private static CLIPBOARD_ACTION clipboardAction = CLIPBOARD_ACTION .DEFUALT ;
58+ public static JLabel cutLabel ;
59+ public static JLabel copyLabel ;
60+ public static JLabel pasteLabel ;
6161
62- private static boolean isControlKeyActive = false ;
62+ private static boolean isControlKeyActive = false ;
6363
64- private static String clipBoardType ;
65- private static List <Rung > copiedTempRung = new ArrayList <Rung >();
66- private static List <Rung > copiedRung = new ArrayList <Rung >();
67- private static List <ColumnScreen > tempData = new ArrayList <ColumnScreen >();
68- private static List <ColumnScreen > copiedCell = new ArrayList <ColumnScreen >();
64+ private static String clipBoardType ;
65+ private static List <Rung > copiedTempRung = new ArrayList <Rung >();
66+ private static List <Rung > copiedRung = new ArrayList <Rung >();
67+ private static List <ColumnScreen > tempData = new ArrayList <ColumnScreen >();
68+ private static List <ColumnScreen > copiedCell = new ArrayList <ColumnScreen >();
6969
70- private static int currentRowNumber ;
71- private static int currentColumnNumber ;
70+ private static int currentRowNumber ;
71+ private static int currentColumnNumber ;
7272
7373 public static String getClipBoardType ()
7474 {
@@ -116,21 +116,24 @@ public static void addCopiedRung()
116116 {
117117 for (Rung rung : copiedTempRung )
118118 {
119- int rowNumber = rung .getRowNumber ();
120- RowScreen rowScreen = SCREEN .getRow (rowNumber );
121- if (clipboardAction == CLIPBOARD_ACTION .COPY )
119+ if (copiedRung .contains (rung ) == false )
122120 {
123- rowScreen .setBackground (java .awt .Color .GREEN );
121+ int rowNumber = rung .getRowNumber ();
122+ RowScreen rowScreen = SCREEN .getRow (rowNumber );
123+ if (clipboardAction == CLIPBOARD_ACTION .COPY )
124+ {
125+ rowScreen .setBackground (java .awt .Color .GREEN );
126+ }
127+ else if (clipboardAction == CLIPBOARD_ACTION .CUT )
128+ {
129+ rowScreen .setBackground (java .awt .Color .RED );
130+ }
131+ else
132+ {
133+ rowScreen .setBackground (java .awt .Color .RED );
134+ }
135+ copiedRung .add (rung );
124136 }
125- else if (clipboardAction == CLIPBOARD_ACTION .CUT )
126- {
127- rowScreen .setBackground (java .awt .Color .RED );
128- }
129- else
130- {
131- rowScreen .setBackground (java .awt .Color .RED );
132- }
133- copiedRung .add (rung );
134137 }
135138 }
136139
0 commit comments