Changeset 30738 in osm for applications/editors/josm/plugins/smed/src/panels/PanelSectors.java
- Timestamp:
- 2014-10-19T01:27:04+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/src/panels/PanelSectors.java
r30737 r30738 123 123 124 124 public int getRowCount() { 125 if ( dlg.panelMain == null)125 if (SmedAction.panelMain == null) 126 126 return 1; 127 127 else 128 return dlg.panelMain.mark.getSectorCount();128 return SmedAction.panelMain.mark.getSectorCount(); 129 129 } 130 130 … … 152 152 return row; 153 153 case 1: 154 if (((String) dlg.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) {155 if ( dlg.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL) {154 if (((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) { 155 if (SmedAction.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL) { 156 156 return Col.UNKCOL; 157 157 } else { 158 return dlg.panelMain.mark.getLightAtt(Att.ALT, row);158 return SmedAction.panelMain.mark.getLightAtt(Att.ALT, row); 159 159 } 160 160 } else { 161 return dlg.panelMain.mark.getLightAtt(Att.COL, row);161 return SmedAction.panelMain.mark.getLightAtt(Att.COL, row); 162 162 } 163 163 case 6: 164 return ( dlg.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR);164 return (SmedAction.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR); 165 165 case 7: 166 166 case 8: 167 if ( dlg.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR)168 return dlg.panelMain.mark.getLightAtt(Att.ORT, row);167 if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR) 168 return SmedAction.panelMain.mark.getLightAtt(Att.ORT, row); 169 169 else 170 return dlg.panelMain.mark.getLightAtt(col - 1, row);170 return SmedAction.panelMain.mark.getLightAtt(col - 1, row); 171 171 case 12: 172 return visibilities.get( dlg.panelMain.mark.getLightAtt(Att.VIS, row));172 return visibilities.get(SmedAction.panelMain.mark.getLightAtt(Att.VIS, row)); 173 173 case 13: 174 return exhibitions.get( dlg.panelMain.mark.getLightAtt(Att.EXH, row));174 return exhibitions.get(SmedAction.panelMain.mark.getLightAtt(Att.EXH, row)); 175 175 default: 176 return dlg.panelMain.mark.getLightAtt(col - 1, row);176 return SmedAction.panelMain.mark.getLightAtt(col - 1, row); 177 177 } 178 178 } … … 184 184 ImageIcon img = colours.get(colour); 185 185 if (img == value) 186 if (((String) dlg.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) {187 if (((colour == Col.UNKCOL) && ( dlg.panelMain.mark.getLightAtt(Att.ALT, row) == Col.UNKCOL))188 || ( dlg.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL)) {189 dlg.panelMain.mark.setLightAtt(Att.COL, row, colour);186 if (((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) { 187 if (((colour == Col.UNKCOL) && (SmedAction.panelMain.mark.getLightAtt(Att.ALT, row) == Col.UNKCOL)) 188 || (SmedAction.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL)) { 189 SmedAction.panelMain.mark.setLightAtt(Att.COL, row, colour); 190 190 } else { 191 dlg.panelMain.mark.setLightAtt(Att.ALT, row, colour);191 SmedAction.panelMain.mark.setLightAtt(Att.ALT, row, colour); 192 192 } 193 193 } else { 194 dlg.panelMain.mark.setLightAtt(Att.COL, row, colour);194 SmedAction.panelMain.mark.setLightAtt(Att.COL, row, colour); 195 195 } 196 196 } … … 200 200 case 10: 201 201 case 11: 202 dlg.panelMain.mark.setLightAtt(col - 1, row, value);202 SmedAction.panelMain.mark.setLightAtt(col - 1, row, value); 203 203 break; 204 204 case 6: 205 205 if ((Boolean) value == true) { 206 dlg.panelMain.mark.setLightAtt(Att.LIT, row, Lit.DIR);207 dlg.panelMain.mark.setLightAtt(Att.BEG, row, "");208 dlg.panelMain.mark.setLightAtt(Att.END, row, "");206 SmedAction.panelMain.mark.setLightAtt(Att.LIT, row, Lit.DIR); 207 SmedAction.panelMain.mark.setLightAtt(Att.BEG, row, ""); 208 SmedAction.panelMain.mark.setLightAtt(Att.END, row, ""); 209 209 } else { 210 dlg.panelMain.mark.setLightAtt(Att.LIT, row, Lit.UNKLIT);211 dlg.panelMain.mark.setLightAtt(Att.ORT, row, "");210 SmedAction.panelMain.mark.setLightAtt(Att.LIT, row, Lit.UNKLIT); 211 SmedAction.panelMain.mark.setLightAtt(Att.ORT, row, ""); 212 212 } 213 213 break; 214 214 case 7: 215 215 case 8: 216 if ( dlg.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR) {217 dlg.panelMain.mark.setLightAtt(Att.ORT, row, value);216 if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR) { 217 SmedAction.panelMain.mark.setLightAtt(Att.ORT, row, value); 218 218 } else { 219 dlg.panelMain.mark.setLightAtt(col - 1, row, value);219 SmedAction.panelMain.mark.setLightAtt(col - 1, row, value); 220 220 } 221 221 break; … … 224 224 String str = visibilities.get(vis); 225 225 if (str.equals(value)) 226 dlg.panelMain.mark.setLightAtt(Att.VIS, row, vis);226 SmedAction.panelMain.mark.setLightAtt(Att.VIS, row, vis); 227 227 } 228 228 break; … … 231 231 String str = exhibitions.get(exh); 232 232 if (str.equals(value)) 233 dlg.panelMain.mark.setLightAtt(Att.EXH, row, exh);233 SmedAction.panelMain.mark.setLightAtt(Att.EXH, row, exh); 234 234 } 235 235 break; 236 236 default: 237 dlg.panelMain.mark.setLightAtt(col - 1, row, value);237 SmedAction.panelMain.mark.setLightAtt(col - 1, row, value); 238 238 } 239 239 } … … 261 261 } 262 262 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) { 263 if (!((String) dlg.panelMain.mark.getLightAtt(Att.CHR, rowIndex)).contains("Al")) {264 col2Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.COL, rowIndex)));263 if (!((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, rowIndex)).contains("Al")) { 264 col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, rowIndex))); 265 265 } else { 266 col2Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.ALT, rowIndex)));267 } 268 col1Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.COL, rowIndex)));266 col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, rowIndex))); 267 } 268 col1Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, rowIndex))); 269 269 return this; 270 270 } … … 276 276 277 277 public void addSector(int idx) { 278 dlg.panelMain.mark.addLight(idx);278 SmedAction.panelMain.mark.addLight(idx); 279 279 table.setSize(860, ((table.getRowCount() * 16) + 28)); 280 280 if (table.getRowCount() > 3) { … … 287 287 public void deleteSector(int idx) { 288 288 if (idx > 0) { 289 dlg.panelMain.mark.delLight(idx);289 SmedAction.panelMain.mark.delLight(idx); 290 290 table.setSize(860, ((table.getRowCount() * 16) + 28)); 291 291 if (table.getRowCount() > 3) {
Note:
See TracChangeset
for help on using the changeset viewer.
