Changeset 26553 in osm for applications
- Timestamp:
- 2011-08-21T17:36:36+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r26552 r26553 67 67 if (prefPortButton.isSelected()) { 68 68 dlg.mark.setCategory(Cat.LAT_PREF_PORT); 69 if (panelPort.shapes.containsKey(shp) && (shp != Shp.PERCH)) {69 if (panelPort.shapes.containsKey(shp)) { 70 70 panelPort.shapes.get(shp).doClick(); 71 71 } else { … … 82 82 prefPortButton.setBorderPainted(true); 83 83 panelPort.setVisible(true); 84 panelPort.perchButton.setVisible(false);85 panelPort.stakeButton.setVisible(false);86 if (dlg.mark.getShape() == Shp.PERCH || dlg.mark.getShape() == Shp.STAKE) {87 dlg.mark.setShape(Shp.UNKNOWN);88 panelPort.clearSelections();89 }90 84 } else { 91 85 prefPortButton.setBorderPainted(false); … … 118 112 if (prefStbdButton.isSelected()) { 119 113 dlg.mark.setCategory(Cat.LAT_PREF_STBD); 120 if (panelStbd.shapes.containsKey(shp) && (shp != Shp.PERCH)) {114 if (panelStbd.shapes.containsKey(shp)) { 121 115 panelStbd.shapes.get(shp).doClick(); 122 116 } else { … … 133 127 prefStbdButton.setBorderPainted(true); 134 128 panelStbd.setVisible(true); 135 panelStbd.perchButton.setVisible(false);136 panelStbd.stakeButton.setVisible(false);137 if (dlg.mark.getShape() == Shp.PERCH || dlg.mark.getShape() == Shp.STAKE) {138 dlg.mark.setShape(Shp.UNKNOWN);139 panelStbd.clearSelections();140 }141 129 } else { 142 130 prefStbdButton.setBorderPainted(false); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26552 r26553 165 165 166 166 public enum Shp { 167 UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER, B EACON, TOWER, STAKE, PERCH167 UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER, BUOYANT, CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON 168 168 } 169 169 … … 178 178 ShpMAP.put(Shp.FLOAT, "float"); 179 179 ShpMAP.put(Shp.SUPER, "super-buoy"); 180 ShpMAP.put(Shp.BEACON, "beacon"); 180 ShpMAP.put(Shp.BUOYANT, "buoyant"); 181 ShpMAP.put(Shp.CAIRN, "cairn"); 182 ShpMAP.put(Shp.PILE, "pile"); 183 ShpMAP.put(Shp.LATTICE, "lattice"); 181 184 ShpMAP.put(Shp.TOWER, "tower"); 182 185 ShpMAP.put(Shp.STAKE, "stake"); … … 331 334 public static final EnumMap<Pat, String> PatMAP = new EnumMap<Pat, String>(Pat.class); 332 335 static { 333 PatMAP.put(Pat.HORIZ, "horizontal _stripes");334 PatMAP.put(Pat.VERT, "vertical _stripes");335 PatMAP.put(Pat.DIAG, "diagonal _stripes");336 PatMAP.put(Pat.HORIZ, "horizontal stripes"); 337 PatMAP.put(Pat.VERT, "vertical stripes"); 338 PatMAP.put(Pat.DIAG, "diagonal stripes"); 336 339 PatMAP.put(Pat.SQUARE, "squared"); 337 PatMAP.put(Pat.BORDER, "border _stripe");340 PatMAP.put(Pat.BORDER, "border stripe"); 338 341 } 339 342 … … 592 595 } 593 596 if (getShape() == Shp.UNKNOWN) { 597 if (EntMAP.get(getObject()) == Ent.BUOY) 598 setShape(Shp.BUOY); 594 599 if (EntMAP.get(getObject()) == Ent.BEACON) 595 600 setShape(Shp.BEACON); … … 634 639 setRegion(Reg.C); 635 640 } else if (GrpMAP.get(object) == Grp.LAT) { 636 if (getCategory() != Cat.UNKNOWN) { 637 switch (getCategory()) { 638 case LAT_PORT: 639 case LAT_PREF_PORT: 640 if (getColour(Ent.BODY, 0) == Col.RED) { 641 switch (getCategory()) { 642 case LAT_PORT: 643 if (getColour(Ent.BODY, 0) == Col.RED) { 644 if (getColour(Ent.BODY, 1) == Col.WHITE) 645 setRegion(Reg.C); 646 else 641 647 setRegion(Reg.A); 642 if (getColour(Ent.BODY, 1) == Col.WHITE) 643 setRegion(Reg.C); 644 } 645 if (getColour(Ent.BODY, 0) == Col.GREEN) 648 } 649 if (getColour(Ent.BODY, 0) == Col.GREEN) 650 setRegion(Reg.B); 651 break; 652 case LAT_PREF_PORT: 653 if (getColour(Ent.BODY, 0) == Col.RED) { 654 if (getColour(Ent.BODY, 3) == Col.GREEN) 655 setRegion(Reg.C); 656 else 657 setRegion(Reg.A); 658 } 659 if (getColour(Ent.BODY, 0) == Col.GREEN) 660 setRegion(Reg.B); 661 break; 662 case LAT_STBD: 663 if (getColour(Ent.BODY, 0) == Col.GREEN) { 664 if (getColour(Ent.BODY, 1) == Col.WHITE) 665 setRegion(Reg.C); 666 else 667 setRegion(Reg.A); 668 } 669 if (getColour(Ent.BODY, 0) == Col.RED) 670 setRegion(Reg.B); 671 break; 672 case LAT_PREF_STBD: 673 if (getColour(Ent.BODY, 0) == Col.GREEN) 674 setRegion(Reg.A); 675 if (getColour(Ent.BODY, 0) == Col.RED) { 676 if (getColour(Ent.BODY, 3) == Col.GREEN) 677 setRegion(Reg.C); 678 else 646 679 setRegion(Reg.B); 647 break; 648 case LAT_STBD: 649 case LAT_PREF_STBD: 650 if (getColour(Ent.BODY, 0) == Col.GREEN) { 651 setRegion(Reg.A); 652 if (getColour(Ent.BODY, 1) == Col.WHITE) 653 setRegion(Reg.C); 654 } 655 if (getColour(Ent.BODY, 0) == Col.RED) 656 setRegion(Reg.B); 657 break; 658 } 680 } 681 break; 659 682 } 660 683 } … … 702 725 if (getColour(Ent.FLOAT, 1) == Col.WHITE) 703 726 if (getColour(Ent.FLOAT, 2) == Col.RED) { 727 setRegion(Reg.C); 704 728 dlg.panelMain.panelChan.portButton.doClick(); 729 } else { 730 dlg.panelMain.panelChan.safeWaterButton.doClick(); 731 } 732 else if (getColour(Ent.FLOAT, 1) == Col.GREEN) { 733 if (getColour(Ent.FLOAT, 3) == Col.GREEN) { 705 734 setRegion(Reg.C); 706 } else 707 dlg.panelMain.panelChan.safeWaterButton.doClick(); 708 else if (getColour(Ent.FLOAT, 1) == Col.GREEN) 735 } 736 if (getRegion().equals("B")) { 737 dlg.panelMain.panelChan.prefStbdButton.doClick(); 738 } else { 739 dlg.panelMain.panelChan.prefPortButton.doClick(); 740 } 741 } else { 709 742 if (getRegion().equals("B")) 710 dlg.panelMain.panelChan. prefStbdButton.doClick();743 dlg.panelMain.panelChan.stbdButton.doClick(); 711 744 else 712 dlg.panelMain.panelChan.prefPortButton.doClick(); 713 if (getRegion().equals("B")) 714 dlg.panelMain.panelChan.stbdButton.doClick(); 715 else 716 dlg.panelMain.panelChan.portButton.doClick(); 745 dlg.panelMain.panelChan.portButton.doClick(); 746 } 717 747 break; 718 748 case GREEN: 719 749 dlg.panelMain.chanButton.doClick(); 720 if (getColour(Ent.FLOAT, 1) == Col.RED) 721 if (getRegion().equals("B")) 750 if (getColour(Ent.FLOAT, 1) == Col.RED) { 751 if (getRegion().equals("B")) { 722 752 dlg.panelMain.panelChan.prefPortButton.doClick(); 723 else753 } else { 724 754 dlg.panelMain.panelChan.prefStbdButton.doClick(); 725 if (getRegion().equals("B"))726 dlg.panelMain.panelChan.portButton.doClick();727 else755 } 756 } else if (getColour(Ent.FLOAT, 1) == Col.WHITE) { 757 setRegion(Reg.C); 728 758 dlg.panelMain.panelChan.stbdButton.doClick(); 759 } else { 760 if (getRegion().equals("B")) { 761 dlg.panelMain.panelChan.portButton.doClick(); 762 } else { 763 dlg.panelMain.panelChan.stbdButton.doClick(); 764 } 765 } 729 766 break; 730 767 case BLACK: … … 759 796 imgStr += "Tower"; 760 797 break; 798 case BUOY: 761 799 case PILLAR: 762 800 imgStr += "Pillar"; … … 778 816 break; 779 817 case BEACON: 818 case CAIRN: 819 case PILE: 820 case LATTICE: 821 case BUOYANT: 780 822 imgStr += "Beacon"; 781 823 break; … … 784 826 break; 785 827 case STAKE: 828 case POLE: 829 case POST: 786 830 imgStr += "Stake"; 787 831 break; 788 default:789 if (EntMAP.get(getObject()) == Ent.BEACON)790 imgStr += "Beacon";791 if (EntMAP.get(getObject()) == Ent.BUOY)792 imgStr += "Pillar";793 832 } 794 833 if (!imgStr.equals("/images/")) { … … 865 904 if (str != null) 866 905 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":category", str)); 867 if ( getShape() != Shp.BEACON)906 if ((getShape() != Shp.BUOY) && (getShape() != Shp.BEACON)) 868 907 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":shape", ShpMAP.get(getShape()))); 869 908 } … … 878 917 879 918 if (getPattern(Ent.BODY) != Pat.NONE) { 880 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatMAP.get(getPattern(Ent.BODY)))); 881 } 882 883 if (((GrpMAP.get(object) == Grp.LAT) && getShape() != Shp.PERCH) || getShape() == Shp.FLOAT) { 919 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatMAP 920 .get(getPattern(Ent.BODY)))); 921 } 922 923 if ((GrpMAP.get(object) == Grp.LAT) && (getShape() != Shp.PERCH) || (getObject() == Obj.FLTLAT)) { 884 924 switch (region) { 885 925 case A:
Note:
See TracChangeset
for help on using the changeset viewer.