Changeset 26977 in osm for applications/editors
- Timestamp:
- 2011-10-28T13:51:21+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r26970 r26977 202 202 panelSaw.setVisible(false); 203 203 } 204 if (dlg.mark.isValid()) { 205 topmarkButton.setVisible(true); 206 dlg.panelMain.moreButton.setVisible(true); 207 } else { 208 topmarkButton.setVisible(false); 209 dlg.panelMain.moreButton.setVisible(false); 210 } 211 panelPort.syncButtons(); 212 panelStbd.syncButtons(); 213 panelSaw.syncButtons(); 204 214 205 215 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r26972 r26977 188 188 189 189 public void syncButtons() { 190 northButton.setBorderPainted(northButton.isSelected()); 191 southButton.setBorderPainted(southButton.isSelected()); 192 eastButton.setBorderPainted(eastButton.isSelected()); 193 westButton.setBorderPainted(westButton.isSelected()); 194 isolButton.setBorderPainted(isolButton.isSelected()); 190 northButton.setBorderPainted(dlg.mark.getCategory() == Cat.CAM_NORTH); 191 southButton.setBorderPainted(dlg.mark.getCategory() == Cat.CAM_SOUTH); 192 eastButton.setBorderPainted(dlg.mark.getCategory() == Cat.CAM_EAST); 193 westButton.setBorderPainted(dlg.mark.getCategory() == Cat.CAM_WEST); 194 isolButton.setBorderPainted(dlg.mark.getCategory() == Cat.UNKNOWN); 195 for (Shp shp : shapes.keySet()) { 196 JRadioButton button = shapes.get(shp); 197 if (dlg.mark.getShape() == shp) { 198 button.setBorderPainted(true); 199 } else 200 button.setBorderPainted(false); 201 } 202 if (dlg.mark.isValid()) { 203 topmarkButton.setVisible(true); 204 dlg.panelMain.moreButton.setVisible(true); 205 } else { 206 topmarkButton.setVisible(false); 207 dlg.panelMain.moreButton.setVisible(false); 208 } 195 209 } 196 210 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r26970 r26977 258 258 panelMore.setVisible(true); 259 259 moreButton.setText("^ ^ ^"); 260 if (topButton.isSelected())260 miscButtons.clearSelection(); 261 261 panelTop.setVisible(false); 262 if (radButton.isSelected())262 topButton.setBorderPainted(false); 263 263 panelRadar.setVisible(false); 264 if (fogButton.isSelected())264 radButton.setBorderPainted(false); 265 265 panelFog.setVisible(false); 266 if (litButton.isSelected())266 fogButton.setBorderPainted(false); 267 267 panelLit.setVisible(false); 268 litButton.setBorderPainted(false); 268 269 } 269 270 } … … 298 299 alType.actionPerformed(null); 299 300 alMisc.actionPerformed(null); 301 dlg.panelMain.panelChan.syncButtons(); 302 dlg.panelMain.panelHaz.syncButtons(); 303 dlg.panelMain.panelMore.syncButtons(); 300 304 } 301 305 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java
r26970 r26977 300 300 301 301 } 302 303 public void syncButtons() { 304 panelPat.syncButtons(); 305 } 302 306 303 307 private void addStsItem(String str, Sts sts) { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPat.java
r26970 r26977 72 72 } 73 73 74 public void syncButtons() { 75 for (Pat pat : patterns.keySet()) { 76 JRadioButton button = patterns.get(pat); 77 if (dlg.mark.getPattern(ent) == pat) { 78 button.setBorderPainted(true); 79 } else 80 button.setBorderPainted(false); 81 } 82 panelCol.syncStack(); 83 } 84 74 85 private JRadioButton getPatButton(JRadioButton button, int x, int y, int w, int h, String tip, Pat pat) { 75 86 button.setBounds(new Rectangle(x, y, w, h)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r26972 r26977 4 4 import java.awt.event.*; 5 5 import javax.swing.*; 6 6 7 import java.util.*; 7 8 … … 112 113 } 113 114 115 public void syncButtons() { 116 for (Shp shp : shapes.keySet()) { 117 JRadioButton button = shapes.get(shp); 118 if (dlg.mark.getShape() == shp) { 119 button.setBorderPainted(true); 120 } else 121 button.setBorderPainted(false); 122 } 123 } 124 114 125 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 115 126 button.setBounds(new Rectangle(x, y, w, h)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java
r26972 r26977 4 4 import java.awt.event.*; 5 5 import javax.swing.*; 6 6 7 import java.util.*; 7 8 … … 65 66 } 66 67 68 public void syncButtons() { 69 for (Shp shp : shapes.keySet()) { 70 JRadioButton button = shapes.get(shp); 71 if (dlg.mark.getShape() == shp) { 72 button.setBorderPainted(true); 73 } else 74 button.setBorderPainted(false); 75 } 76 } 77 67 78 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 68 79 button.setBounds(new Rectangle(x, y, w, h)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r26972 r26977 4 4 import java.awt.event.*; 5 5 import javax.swing.*; 6 6 7 import java.util.*; 7 8 … … 112 113 } 113 114 115 public void syncButtons() { 116 for (Shp shp : shapes.keySet()) { 117 JRadioButton button = shapes.get(shp); 118 if (dlg.mark.getShape() == shp) { 119 button.setBorderPainted(true); 120 } else 121 button.setBorderPainted(false); 122 } 123 } 124 114 125 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 115 126 button.setBounds(new Rectangle(x, y, w, h)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26972 r26977 74 74 ObjSTR.put(Obj.FLTLAT, "light_float"); 75 75 ObjSTR.put(Obj.FLTSAW, "light_float"); 76 ObjSTR.put(Obj.FLTISD, "light_float"); 76 77 ObjSTR.put(Obj.FLTSPP, "light_float"); 77 78 ObjSTR.put(Obj.LITMAJ, "light_major"); … … 114 115 EntMAP.put(Obj.LITMIN, Ent.LIGHT); 115 116 EntMAP.put(Obj.LITFLT, Ent.FLOAT); 117 EntMAP.put(Obj.FLTCAR, Ent.FLOAT); 118 EntMAP.put(Obj.FLTLAT, Ent.FLOAT); 119 EntMAP.put(Obj.FLTSAW, Ent.FLOAT); 120 EntMAP.put(Obj.FLTISD, Ent.FLOAT); 121 EntMAP.put(Obj.FLTSPP, Ent.FLOAT); 116 122 EntMAP.put(Obj.LITVES, Ent.LIGHT); 117 123 EntMAP.put(Obj.LNDMRK, Ent.LIGHT); … … 141 147 GrpMAP.put(Obj.LITMIN, Grp.LIT); 142 148 GrpMAP.put(Obj.LITFLT, Grp.FLT); 149 GrpMAP.put(Obj.FLTCAR, Grp.CAR); 150 GrpMAP.put(Obj.FLTLAT, Grp.LAT); 151 GrpMAP.put(Obj.FLTSAW, Grp.SAW); 152 GrpMAP.put(Obj.FLTISD, Grp.ISD); 153 GrpMAP.put(Obj.FLTSPP, Grp.SPP); 143 154 GrpMAP.put(Obj.LITVES, Grp.LIT); 144 155 GrpMAP.put(Obj.LNDMRK, Grp.LIT); … … 879 890 } 880 891 892 if (getObject() == Obj.LITFLT) { 893 switch (getColour(Ent.BODY, 0)) { 894 case RED: 895 if ((getColour(Ent.BODY, 1) == Col.WHITE) && (getColour(Ent.BODY, 2) == Col.UNKNOWN)) { 896 setObject(Obj.FLTSAW); 897 setCategory(Cat.UNKNOWN); 898 } else if (getColour(Ent.BODY, 1) == Col.UNKNOWN) { 899 setObject(Obj.FLTLAT); 900 if (getRegion() == Reg.B) { 901 setCategory(Cat.LAM_STBD); 902 } else { 903 setCategory(Cat.LAM_PORT); 904 } 905 } else if ((getColour(Ent.BODY, 1) == Col.GREEN) && (getColour(Ent.BODY, 2) == Col.RED)) { 906 setObject(Obj.FLTLAT); 907 if (getRegion() == Reg.B) { 908 setCategory(Cat.LAM_PSTBD); 909 } else { 910 setCategory(Cat.LAM_PPORT); 911 } 912 } else if ((getColour(Ent.BODY, 1) == Col.WHITE) && (getColour(Ent.BODY, 2) == Col.RED)) { 913 setObject(Obj.FLTLAT); 914 setCategory(Cat.LAM_PORT); 915 } else { 916 setObject(Obj.FLTSPP); 917 setCategory(Cat.UNKNOWN); 918 } 919 break; 920 case GREEN: 921 if (getColour(Ent.BODY, 1) == Col.UNKNOWN) { 922 setObject(Obj.FLTLAT); 923 if (getRegion() == Reg.B) { 924 setCategory(Cat.LAM_PORT); 925 } else { 926 setCategory(Cat.LAM_STBD); 927 } 928 } else if ((getColour(Ent.BODY, 1) == Col.RED) && (getColour(Ent.BODY, 2) == Col.GREEN)) { 929 setObject(Obj.FLTLAT); 930 if (getRegion() == Reg.B) { 931 setCategory(Cat.LAM_PPORT); 932 } else { 933 setCategory(Cat.LAM_PSTBD); 934 } 935 } else if ((getColour(Ent.BODY, 1) == Col.WHITE) && (getColour(Ent.BODY, 2) == Col.GREEN)) { 936 setObject(Obj.FLTLAT); 937 setCategory(Cat.LAM_STBD); 938 } else { 939 setObject(Obj.FLTSPP); 940 setCategory(Cat.UNKNOWN); 941 } 942 break; 943 case YELLOW: 944 if (getColour(Ent.BODY, 1) == Col.BLACK) { 945 setObject(Obj.FLTCAR); 946 if (getColour(Ent.BODY, 2) == Col.YELLOW) { 947 setCategory(Cat.CAM_WEST); 948 } else { 949 setCategory(Cat.CAM_SOUTH); 950 } 951 } else { 952 setObject(Obj.FLTSPP); 953 setCategory(Cat.UNKNOWN); 954 } 955 break; 956 case BLACK: 957 if (getColour(Ent.BODY, 1) == Col.RED) { 958 setObject(Obj.FLTISD); 959 setCategory(Cat.UNKNOWN); 960 } else if (getColour(Ent.BODY, 1) == Col.YELLOW) { 961 if (getColour(Ent.BODY, 2) == Col.BLACK) { 962 setCategory(Cat.CAM_EAST); 963 } else { 964 setCategory(Cat.CAM_NORTH); 965 } 966 } else { 967 setObject(Obj.FLTSPP); 968 setCategory(Cat.UNKNOWN); 969 } 970 break; 971 default: 972 setObject(Obj.FLTSPP); 973 setCategory(Cat.UNKNOWN); 974 } 975 } 976 881 977 for (Obj obj : ObjSTR.keySet()) { 882 978 if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":system")) { … … 1065 1161 1066 1162 dlg.panelMain.syncButtons(); 1067 dlg.panelMain.panelChan.syncButtons();1068 dlg.panelMain.panelHaz.syncButtons();1069 dlg.panelMain.panelMore.panelPat.panelCol.syncStack();1070 1163 1071 1164 paintlock = false;
Note:
See TracChangeset
for help on using the changeset viewer.