Changeset 26124 in osm for applications/editors/josm/plugins/smed/plugs
- Timestamp:
- 2011-06-11T23:03:02+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChr.java
r26110 r26124 20 20 import oseam.Messages; 21 21 import oseam.dialogs.OSeaMAction; 22 import oseam.seamarks.SeaMark.Chr;23 22 import oseam.seamarks.SeaMark; 23 import oseam.seamarks.Light; 24 import oseam.seamarks.Light.Chr; 24 25 25 26 public class PanelChr extends JPanel { … … 76 77 } 77 78 } 78 if ( SeaMark.ChrMAP.containsKey(combo)) {79 charBox.setText( SeaMark.ChrMAP.get(combo));79 if (Light.ChrMAP.containsKey(combo)) { 80 charBox.setText(Light.ChrMAP.get(combo)); 80 81 } else { 81 82 for (Chr chr : buttons.keySet()) { 82 83 JToggleButton button = buttons.get(chr); 83 84 if (button == source) { 84 charBox.setText( SeaMark.ChrMAP.get(EnumSet.of(chr)));85 charBox.setText(Light.ChrMAP.get(EnumSet.of(chr))); 85 86 button.setSelected(true); 86 87 button.setBorderPainted(true); … … 97 98 String str = charBox.getText(); 98 99 EnumSet<Chr> set = EnumSet.noneOf(Chr.class); 99 for (EnumSet<Chr> map : SeaMark.ChrMAP.keySet()) {100 if (str.equals( SeaMark.ChrMAP.get(map))) {100 for (EnumSet<Chr> map : Light.ChrMAP.keySet()) { 101 if (str.equals(Light.ChrMAP.get(map))) { 101 102 set = map; 102 103 break; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r26114 r26124 9 9 import javax.swing.JTextField; 10 10 import javax.swing.JComboBox; 11 import javax.swing.JTable;12 11 import javax.swing.SwingConstants; 13 import javax.swing.JFrame;14 12 15 13 import java.awt.Color; … … 82 80 if (dlg.mark.light.getRowCount() == 1) { 83 81 dlg.mark.light.addSector(1); 84 dlg.mark.setSectored(true); 82 dlg.mark.light.setSectored(true); 85 83 } 86 84 panelSector.setVisible(true); 87 85 } else { 88 dlg.mark.setSectored(false); 86 dlg.mark.light.setSectored(false); 89 87 panelSector.setVisible(false); 90 88 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSectors.java
r26114 r26124 1 1 package oseam.panels; 2 3 import java.util.ArrayList;4 2 5 3 import javax.swing.ImageIcon; … … 9 7 import javax.swing.JTable; 10 8 import javax.swing.JButton; 11 import javax.swing.table.AbstractTableModel;12 9 13 10 import oseam.seamarks.Light; 14 import oseam.seamarks.SeaMark;15 11 16 12 public class PanelSectors extends JFrame { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/Light.java
r26114 r26124 2 2 3 3 import java.util.ArrayList; 4 import java.util.EnumSet; 5 import java.util.HashMap; 6 import java.util.Map; 7 import java.util.regex.Matcher; 8 import java.util.regex.Pattern; 4 9 5 10 import javax.swing.table.AbstractTableModel; 6 11 12 import oseam.dialogs.OSeaMAction; 13 import oseam.seamarks.SeaMark.Col; 14 7 15 public class Light extends AbstractTableModel { 16 17 OSeaMAction dlg; 8 18 9 19 private String[] columns = { "Sector", "Start", "End", "Colour", … … 11 21 private ArrayList<Object[]> lights; 12 22 13 public Light() { 23 public Light(OSeaMAction dia) { 14 24 super(); 25 dlg = dia; 15 26 lights = new ArrayList<Object[]>(); 16 27 lights.add(new Object[12]); … … 42 53 43 54 public void setValueAt(Object value, int row, int col) { 44 // lights.set(row, value)[col] = value; 45 fireTableCellUpdated(row, col); 55 ((Object[])lights.get(row+1))[col+1] = value; 46 56 } 47 57 public void addSector(int idx) { 48 lights.add(idx, new Object[ 12]);58 lights.add(idx, new Object[]{null, null, null, null, null, null, null, null, null, null, null, null}); 49 59 } 50 60 … … 53 63 } 54 64 65 private boolean Fired = false; 66 67 public boolean isFired() { 68 return Fired; 69 } 70 71 public void setFired(boolean fired) { 72 Fired = fired; 73 } 74 75 private boolean Sectored = false; 76 77 public boolean isSectored() { 78 return Sectored; 79 } 80 81 public void setSectored(boolean sectored) { 82 Sectored = sectored; 83 if (sectored) { 84 setLightColour(0, Col.UNKNOWN); 85 } else { 86 setLightChar(0, Chr.UNKNOWN); 87 setLightColour(0, Col.UNKNOWN); 88 setLightGroup(0, ""); 89 setHeight(0, ""); 90 setRange(0, ""); 91 setBearing1(0, ""); 92 setBearing2(0, ""); 93 setVisibility(0, Vis.UNKNOWN); 94 } 95 } 96 97 public String getBearing1(int idx) { 98 return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 1); 99 } 100 101 public void setBearing1(int idx, String bearing) { 102 dlg.panelMain.panelLit.panelSector.table.setValueAt(bearing, idx, 1); 103 } 104 105 public String getBearing2(int idx) { 106 return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 2); 107 } 108 109 public void setBearing2(int idx, String bearing) { 110 dlg.panelMain.panelLit.panelSector.table.setValueAt(bearing, idx, 2); 111 } 112 113 public Col getLightColour(int idx) { 114 return (Col)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 3); 115 } 116 117 public void setLightColour(int idx, Col col) { 118 dlg.panelMain.panelLit.panelSector.table.setValueAt(col, idx, 3); 119 } 120 121 public enum Chr { 122 UNKNOWN, FIXED, FLASH, LONGFLASH, QUICK, VERYQUICK, ULTRAQUICK, 123 ISOPHASED, OCCULTING, MORSE, ALTERNATING, INTERRUPTEDQUICK, INTERRUPTEDVERYQUICK, INTERRUPTEDULTRAQUICK 124 } 125 126 public static final Map<EnumSet<Chr>, String> ChrMAP = new HashMap<EnumSet<Chr>, String>(); 127 static { 128 ChrMAP.put(EnumSet.of(Chr.UNKNOWN), ""); 129 ChrMAP.put(EnumSet.of(Chr.FIXED), "F"); 130 ChrMAP.put(EnumSet.of(Chr.FLASH), "Fl"); 131 ChrMAP.put(EnumSet.of(Chr.LONGFLASH), "LFl"); 132 ChrMAP.put(EnumSet.of(Chr.QUICK), "Q"); 133 ChrMAP.put(EnumSet.of(Chr.VERYQUICK), "VQ"); 134 ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK), "UQ"); 135 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDQUICK), "IQ"); 136 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDVERYQUICK), "IVQ"); 137 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDULTRAQUICK), "IUQ"); 138 ChrMAP.put(EnumSet.of(Chr.ISOPHASED), "Iso"); 139 ChrMAP.put(EnumSet.of(Chr.OCCULTING), "Oc"); 140 ChrMAP.put(EnumSet.of(Chr.MORSE), "Mo"); 141 ChrMAP.put(EnumSet.of(Chr.ALTERNATING), "Al"); 142 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED), "Al.F"); 143 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl"); 144 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED, Chr.FLASH), "F.Al.Fl"); 145 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LONGFLASH), "Al.LFl"); 146 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.ISOPHASED), "Al.Iso"); 147 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc"); 148 ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.FLASH), "FFl"); 149 ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LONGFLASH), "FLFl"); 150 ChrMAP.put(EnumSet.of(Chr.OCCULTING, Chr.FLASH), "OcFl"); 151 ChrMAP.put(EnumSet.of(Chr.FLASH, Chr.LONGFLASH), "FlLFl"); 152 ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LONGFLASH), "Q+LFl"); 153 ChrMAP.put(EnumSet.of(Chr.VERYQUICK, Chr.LONGFLASH), "VQ+LFl"); 154 ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK, Chr.LONGFLASH), "UQ+LFl"); 155 } 156 157 public Chr getLightChar(int idx) { 158 return (Chr)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 4); 159 } 160 161 public void setLightChar(int idx, Chr chr) { 162 dlg.panelMain.panelLit.panelSector.table.setValueAt(chr, idx, 4); 163 } 164 165 public String getLightGroup(int idx) { 166 return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 5); 167 } 168 169 public void setLightGroup(int idx, String grp) { 170 dlg.panelMain.panelLit.panelSector.table.setValueAt(grp, idx, 5); 171 } 172 173 protected void setLightGroup(int idx, Map<String, String> keys) { 174 String s = ""; 175 if (keys.containsKey("seamark:light:group")) { 176 s = keys.get("seamark:light:group"); 177 setLightGroup(0, s); 178 } 179 } 180 181 public String getLightPeriod(int idx) { 182 return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 6); 183 } 184 185 public void setLightPeriod(int idx, String prd) { 186 String regex = "^[\\d\\s.]+$"; 187 188 if (!prd.isEmpty()) { 189 190 Pattern pat = Pattern.compile(regex); 191 Matcher matcher = pat.matcher(prd); 192 193 if (matcher.find()) { 194 // setErrMsg(null); 195 } else { 196 // setErrMsg("Must be a number"); 197 prd = ""; 198 // dlg.tfM01RepeatTime.requestFocus(); 199 } 200 } 201 dlg.panelMain.panelLit.panelSector.table.setValueAt(prd, idx, 6); 202 } 203 204 public String getHeight(int idx) { 205 return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 7); 206 } 207 208 public void setHeight(int idx, String hgt) { 209 dlg.panelMain.panelLit.panelSector.table.setValueAt(hgt, idx, 7); 210 } 211 212 public String getRange(int idx) { 213 return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 8); 214 } 215 216 public void setRange(int idx, String rng) { 217 dlg.panelMain.panelLit.panelSector.table.setValueAt(rng, idx, 8); 218 } 219 220 public enum Vis { UNKNOWN, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS } 221 public static final Map<EnumSet<Vis>, String> VisMAP = new HashMap<EnumSet<Vis>, String>(); 222 static { 223 VisMAP.put(EnumSet.of(Vis.UNKNOWN), ""); 224 VisMAP.put(EnumSet.of(Vis.HIGH), "high"); 225 VisMAP.put(EnumSet.of(Vis.LOW), "low"); 226 VisMAP.put(EnumSet.of(Vis.FAINT), "faint"); 227 VisMAP.put(EnumSet.of(Vis.INTEN), "intensified"); 228 VisMAP.put(EnumSet.of(Vis.UNINTEN), "unintensified"); 229 VisMAP.put(EnumSet.of(Vis.REST), "restricted"); 230 VisMAP.put(EnumSet.of(Vis.OBS), "obscured"); 231 VisMAP.put(EnumSet.of(Vis.PARTOBS), "part_obscured"); 232 } 233 234 public Vis getVisibility(int idx) { 235 return (Vis)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 9); 236 } 237 238 public void setVisibility(int idx, Vis vis) { 239 dlg.panelMain.panelLit.panelSector.table.setValueAt(vis, idx, 9); 240 } 241 242 public enum Lit { UNKNOWN, VERT, VERT2, VERT3, VERT4, HORIZ, HORIZ2, HORIZ3, HORIZ4, 243 UPPER, LOWER, REAR, FRONT, AERO, AIROBS, FOGDET, FLOOD, STRIP, SUBS, SPOT, MOIRE, EMERG, BEAR } 244 public static final Map<EnumSet<Lit>, String> LitMAP = new HashMap<EnumSet<Lit>, String>(); 245 static { 246 LitMAP.put(EnumSet.of(Lit.UNKNOWN), ""); 247 } 248 249 public Lit getLightCategory(int idx) { 250 return (Lit)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 10); 251 } 252 253 public void setLightCategory(int idx, Lit cat) { 254 dlg.panelMain.panelLit.panelSector.table.setValueAt(cat, idx, 10); 255 } 256 257 public enum Exh { UNKNOWN, H24, DAY, NIGHT, FOG } 258 public static final Map<EnumSet<Exh>, String> ExhMAP = new HashMap<EnumSet<Exh>, String>(); 259 static { 260 ExhMAP.put(EnumSet.of(Exh.UNKNOWN), ""); 261 ExhMAP.put(EnumSet.of(Exh.H24), "24h"); 262 ExhMAP.put(EnumSet.of(Exh.DAY), "day"); 263 ExhMAP.put(EnumSet.of(Exh.NIGHT), "night"); 264 ExhMAP.put(EnumSet.of(Exh.FOG), "fog"); 265 } 266 267 public Exh getExhibition(int idx) { 268 return (Exh)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 11); 269 } 270 271 public void setExhibition(int idx, Exh exh) { 272 dlg.panelMain.panelLit.panelSector.table.setValueAt(exh, idx, 11); 273 } 274 275 public String getOrientation(int idx) { 276 return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 12); 277 } 278 279 public void setOrientation(int idx, String ori) { 280 dlg.panelMain.panelLit.panelSector.table.setValueAt(ori, idx, 12); 281 } 282 55 283 } 56 284 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26114 r26124 16 16 import oseam.Messages; 17 17 import oseam.dialogs.OSeaMAction; 18 import oseam.seamarks.Light; 18 19 19 20 public class SeaMark { … … 234 235 case DAYMARK: 235 236 return dayColour; 236 case LIGHT: 237 return light Colour[sectorIndex];237 // case LIGHT: 238 // return light.getLightColour(); 238 239 } 239 240 return Col.UNKNOWN; … … 254 255 dayColour = col; 255 256 break; 256 case LIGHT: 257 lightColour[sectorIndex] = col;258 break; 257 // case LIGHT: 258 // light.setLightColour(col); 259 // break; 259 260 } 260 261 } … … 411 412 } 412 413 413 private boolean Fired = false; 414 415 public boolean isFired() { 416 return Fired; 417 } 418 419 public void setFired(boolean fired) { 420 Fired = fired; 421 } 422 423 private boolean Sectored = false; 424 425 public boolean isSectored() { 426 return Sectored; 427 } 428 429 public void setSectored(boolean sectored) { 430 Sectored = sectored; 431 if (sectored) { 432 lightColour[0] = Col.UNKNOWN; 433 } else { 434 setsectorIndex(0); 435 setLightChar(""); 436 setLightColour(Col.UNKNOWN); 437 setLightGroup(""); 438 setHeight(""); 439 setRange(""); 440 setBearing1(""); 441 setBearing2(""); 442 setVisibility(Vis.UNKNOWN); 443 } 444 } 445 446 private int sectorIndex = 0; 447 448 public int getsectorIndex() { 449 return sectorIndex; 450 } 451 452 public void setsectorIndex(int sector) { 453 sectorIndex = sector; 454 } 414 public Light light = new Light(dlg); 455 415 456 public enum Chr {457 UNKNOWN, FIXED, FLASH, LONGFLASH, QUICK, VERYQUICK, ULTRAQUICK,458 ISOPHASED, OCCULTING, MORSE, ALTERNATING, INTERRUPTEDQUICK, INTERRUPTEDVERYQUICK, INTERRUPTEDULTRAQUICK459 }460 461 public static final Map<EnumSet<Chr>, String> ChrMAP = new HashMap<EnumSet<Chr>, String>();462 static {463 ChrMAP.put(EnumSet.of(Chr.UNKNOWN), "");464 ChrMAP.put(EnumSet.of(Chr.FIXED), "F");465 ChrMAP.put(EnumSet.of(Chr.FLASH), "Fl");466 ChrMAP.put(EnumSet.of(Chr.LONGFLASH), "LFl");467 ChrMAP.put(EnumSet.of(Chr.QUICK), "Q");468 ChrMAP.put(EnumSet.of(Chr.VERYQUICK), "VQ");469 ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK), "UQ");470 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDQUICK), "IQ");471 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDVERYQUICK), "IVQ");472 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDULTRAQUICK), "IUQ");473 ChrMAP.put(EnumSet.of(Chr.ISOPHASED), "Iso");474 ChrMAP.put(EnumSet.of(Chr.OCCULTING), "Oc");475 ChrMAP.put(EnumSet.of(Chr.MORSE), "Mo");476 ChrMAP.put(EnumSet.of(Chr.ALTERNATING), "Al");477 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED), "Al.F");478 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl");479 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED, Chr.FLASH), "F.Al.Fl");480 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LONGFLASH), "Al.LFl");481 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.ISOPHASED), "Al.Iso");482 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc");483 ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.FLASH), "FFl");484 ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LONGFLASH), "FLFl");485 ChrMAP.put(EnumSet.of(Chr.OCCULTING, Chr.FLASH), "OcFl");486 ChrMAP.put(EnumSet.of(Chr.FLASH, Chr.LONGFLASH), "FlLFl");487 ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LONGFLASH), "Q+LFl");488 ChrMAP.put(EnumSet.of(Chr.VERYQUICK, Chr.LONGFLASH), "VQ+LFl");489 ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK, Chr.LONGFLASH), "UQ+LFl");490 }491 492 public Light light = new Light();493 494 private String[] LightChar = new String[10];495 496 public String getLightChar() {497 if (LightChar[sectorIndex] == null)498 return (LightChar[0]);499 return LightChar[sectorIndex];500 }501 502 public void setLightChar(String lightChar) {503 if (sectorIndex == 0) {504 LightChar = new String[10];505 LightChar[0] = lightChar;506 } else if (LightChar[0].isEmpty())507 LightChar[sectorIndex] = lightChar;508 }509 510 private Col[] lightColour = new Col[10];511 512 public Col getLightColour() {513 if (lightColour[sectorIndex] == null)514 return (lightColour[0]);515 return lightColour[sectorIndex];516 }517 518 public void setLightColour(Col col) {519 lightColour[sectorIndex] = col;520 }521 522 private String[] LightGroup = new String[10];523 524 public String getLightGroup() {525 if (LightGroup[sectorIndex] == null)526 return (LightGroup[0]);527 return LightGroup[sectorIndex];528 }529 530 public void setLightGroup(String lightGroup) {531 if (sectorIndex == 0)532 LightGroup = new String[10];533 LightGroup[sectorIndex] = lightGroup;534 }535 536 protected void setLightGroup(Map<String, String> keys) {537 String s = "";538 if (keys.containsKey("seamark:light:group")) {539 s = keys.get("seamark:light:group");540 setLightGroup(s);541 }542 }543 544 private String[] Height = new String[10];545 546 public String getHeight() {547 if (Height[sectorIndex] == null)548 return (Height[0]);549 return Height[sectorIndex];550 }551 552 public void setHeight(String height) {553 if (sectorIndex == 0)554 Height = new String[10];555 Height[sectorIndex] = height;556 }557 558 private String[] Range = new String[10];559 560 public String getRange() {561 if (Range[sectorIndex] == null)562 return (Range[0]);563 return Range[sectorIndex];564 }565 566 public void setRange(String range) {567 if (sectorIndex == 0)568 Range = new String[10];569 Range[sectorIndex] = range;570 }571 572 private String[] Bearing1 = new String[10];573 574 public String getBearing1() {575 if (Bearing1[sectorIndex] == null)576 return (Bearing1[0]);577 return Bearing1[sectorIndex];578 }579 580 public void setBearing1(String bearing) {581 if (sectorIndex == 0)582 Bearing1 = new String[10];583 Bearing1[sectorIndex] = bearing;584 }585 586 private String[] Bearing2 = new String[10];587 588 public String getBearing2() {589 if (Bearing2[sectorIndex] == null)590 return (Bearing2[0]);591 return Bearing2[sectorIndex];592 }593 594 public void setBearing2(String bearing) {595 if (sectorIndex == 0)596 Bearing2 = new String[10];597 Bearing2[sectorIndex] = bearing;598 }599 600 public enum Vis { UNKNOWN, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS }601 public static final Map<EnumSet<Vis>, String> VisMAP = new HashMap<EnumSet<Vis>, String>();602 static {603 VisMAP.put(EnumSet.of(Vis.UNKNOWN), "");604 VisMAP.put(EnumSet.of(Vis.HIGH), "high");605 VisMAP.put(EnumSet.of(Vis.LOW), "low");606 VisMAP.put(EnumSet.of(Vis.FAINT), "faint");607 VisMAP.put(EnumSet.of(Vis.INTEN), "intensified");608 VisMAP.put(EnumSet.of(Vis.UNINTEN), "unintensified");609 VisMAP.put(EnumSet.of(Vis.REST), "restricted");610 VisMAP.put(EnumSet.of(Vis.OBS), "obscured");611 VisMAP.put(EnumSet.of(Vis.PARTOBS), "part_obscured");612 }613 614 private Vis[] Visibility = new Vis[10];615 616 public Vis getVisibility() {617 if (Visibility[sectorIndex] == null)618 return (Visibility[0]);619 return Visibility[sectorIndex];620 }621 622 public void setVisibility(Vis visibility) {623 if (sectorIndex == 0)624 Visibility = new Vis[10];625 Visibility[sectorIndex] = visibility;626 }627 628 private String[] LightPeriod = new String[10];629 630 public String getLightPeriod() {631 if (LightPeriod[sectorIndex] == null)632 return (LightPeriod[0]);633 return LightPeriod[sectorIndex];634 }635 636 public void setLightPeriod(String lightPeriod) {637 String regex = "^[\\d\\s.]+$";638 639 if (!lightPeriod.isEmpty()) {640 641 Pattern pat = Pattern.compile(regex);642 Matcher matcher = pat.matcher(lightPeriod);643 644 if (matcher.find()) {645 // setErrMsg(null);646 } else {647 // setErrMsg("Must be a number");648 lightPeriod = "";649 // dlg.tfM01RepeatTime.requestFocus();650 }651 }652 if (sectorIndex == 0)653 LightPeriod = new String[10];654 LightPeriod[sectorIndex] = lightPeriod;655 }656 657 416 private boolean paintlock = false; 658 417 … … 918 677 str = keys.get("seamark:topmark:shape"); 919 678 } 920 679 /* 921 680 for (Map.Entry<String, String> entry : keys.entrySet()) { 922 681 String key = entry.getKey(); 923 682 String value = entry.getValue().trim(); 924 683 if (key.contains("seamark:light:")) { 925 setFired(true); 684 light.setFired(true); 926 685 int index = 0; 927 686 key = key.substring(14); … … 967 726 } 968 727 } 969 728 */ 970 729 if (keys.containsKey("seamark:fog_signal") || keys.containsKey("seamark:fog_signal:category") 971 730 || keys.containsKey("seamark:fog_signal:group") || keys.containsKey("seamark:fog_signal:period")) { … … 1182 941 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:daymark:colour", str)); 1183 942 } 1184 943 /* 1185 944 Col colour; 1186 945 if (isFired()) { … … 1236 995 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i + ":sector_end", Bearing2[i])); 1237 996 } 1238 } 997 }*/ 1239 998 if (hasRadar()) { 1240 999 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_reflector", "yes"));
Note:
See TracChangeset
for help on using the changeset viewer.