Changeset 24848 in osm
- Timestamp:
- 2010-12-23T16:01:02+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r24839 r24848 57 57 public void actionPerformed(java.awt.event.ActionEvent e) { 58 58 if (northButton.isSelected()) { 59 if (!(dlg.mark instanceof MarkCard)) 60 dlg.mark = new MarkCard(dlg); 59 if (!(dlg.mark instanceof MarkCard)) { 60 dlg.mark = new MarkCard(dlg); 61 alShape.actionPerformed(null); 62 } 61 63 dlg.mark.setCategory(Cat.CARD_NORTH); 62 64 dlg.mark.setColour(Col.BLACK_YELLOW); … … 68 70 } 69 71 if (southButton.isSelected()) { 70 if (!(dlg.mark instanceof MarkCard)) 71 dlg.mark = new MarkCard(dlg); 72 if (!(dlg.mark instanceof MarkCard)) { 73 dlg.mark = new MarkCard(dlg); 74 alShape.actionPerformed(null); 75 } 72 76 dlg.mark.setCategory(Cat.CARD_SOUTH); 73 77 dlg.mark.setColour(Col.YELLOW_BLACK); … … 79 83 } 80 84 if (eastButton.isSelected()) { 81 if (!(dlg.mark instanceof MarkCard)) 82 dlg.mark = new MarkCard(dlg); 85 if (!(dlg.mark instanceof MarkCard)) { 86 dlg.mark = new MarkCard(dlg); 87 alShape.actionPerformed(null); 88 } 83 89 dlg.mark.setCategory(Cat.CARD_EAST); 84 90 dlg.mark.setColour(Col.BLACK_YELLOW_BLACK); … … 90 96 } 91 97 if (westButton.isSelected()) { 92 if (!(dlg.mark instanceof MarkCard)) 93 dlg.mark = new MarkCard(dlg); 98 if (!(dlg.mark instanceof MarkCard)) { 99 dlg.mark = new MarkCard(dlg); 100 alShape.actionPerformed(null); 101 } 94 102 dlg.mark.setCategory(Cat.CARD_WEST); 95 103 dlg.mark.setColour(Col.YELLOW_BLACK_YELLOW); … … 101 109 } 102 110 if (isolButton.isSelected()) { 103 if (!(dlg.mark instanceof MarkIsol)) 111 if (!(dlg.mark instanceof MarkIsol)) { 104 112 dlg.mark = new MarkIsol(dlg); 113 alShape.actionPerformed(null); 114 } 105 115 dlg.mark.setColour(Col.BLACK_RED_BLACK); 106 116 dlg.panelMain.panelTop.spheres2TopButton.doClick(); … … 163 173 towerButton.setBorderPainted(false); 164 174 } 175 if (dlg.mark != null) 176 dlg.mark.paintSign(); 165 177 } 166 178 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r24839 r24848 19 19 import oseam.Messages; 20 20 import oseam.dialogs.OSeaMAction; 21 import oseam.seamarks.SeaMark.Cat; 21 22 22 23 import java.awt.Cursor; … … 49 50 ActionListener alCat = new ActionListener() { 50 51 public void actionPerformed(java.awt.event.ActionEvent e) { 51 houseButton.setBorderPainted(houseButton.isSelected()); 52 majorButton.setBorderPainted(majorButton.isSelected()); 53 minorButton.setBorderPainted(minorButton.isSelected()); 54 vesselButton.setBorderPainted(vesselButton.isSelected()); 55 floatButton.setBorderPainted(floatButton.isSelected()); 52 if (houseButton.isSelected()) { 53 dlg.mark.setCategory(Cat.LIGHT_HOUSE); 54 houseButton.setBorderPainted(true); 55 } else { 56 houseButton.setBorderPainted(false); 57 } 58 if (majorButton.isSelected()) { 59 dlg.mark.setCategory(Cat.LIGHT_MAJOR); 60 majorButton.setBorderPainted(true); 61 } else { 62 majorButton.setBorderPainted(false); 63 } 64 if (minorButton.isSelected()) { 65 dlg.mark.setCategory(Cat.LIGHT_MINOR); 66 minorButton.setBorderPainted(true); 67 } else { 68 minorButton.setBorderPainted(false); 69 } 70 if (vesselButton.isSelected()) { 71 dlg.mark.setCategory(Cat.LIGHT_VESSEL); 72 vesselButton.setBorderPainted(true); 73 } else { 74 vesselButton.setBorderPainted(false); 75 } 76 if (floatButton.isSelected()) { 77 dlg.mark.setCategory(Cat.LIGHT_FLOAT); 78 floatButton.setBorderPainted(true); 79 } else { 80 floatButton.setBorderPainted(false); 81 } 56 82 if (dlg.mark != null) 57 83 dlg.mark.paintSign(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r24839 r24848 7 7 8 8 import java.awt.Color; 9 import java.awt.Dimension;10 9 import java.awt.Rectangle; 11 import java.awt.Font;12 10 13 11 import javax.swing.ButtonGroup; 14 12 import javax.swing.ImageIcon; 15 import javax.swing.JLabel;16 import javax.swing.JTextField;17 import javax.swing.JComboBox;18 import javax.swing.JCheckBox;19 13 import javax.swing.JRadioButton; 20 14 21 15 import oseam.Messages; 22 16 import oseam.dialogs.OSeaMAction; 23 24 import java.awt.Cursor; 17 import oseam.seamarks.SeaMark.Shp; 18 import oseam.seamarks.SeaMark.Col; 19 25 20 import java.awt.event.ActionListener; 26 21 … … 71 66 ActionListener alShape = new ActionListener() { 72 67 public void actionPerformed(java.awt.event.ActionEvent e) { 73 pillarButton.setBorderPainted(pillarButton.isSelected()); 74 sparButton.setBorderPainted(sparButton.isSelected()); 75 canButton.setBorderPainted(canButton.isSelected()); 76 coneButton.setBorderPainted(coneButton.isSelected()); 77 sphereButton.setBorderPainted(sphereButton.isSelected()); 78 barrelButton.setBorderPainted(barrelButton.isSelected()); 79 superButton.setBorderPainted(superButton.isSelected()); 80 floatButton.setBorderPainted(floatButton.isSelected()); 81 beaconButton.setBorderPainted(beaconButton.isSelected()); 82 towerButton.setBorderPainted(towerButton.isSelected()); 68 if (pillarButton.isSelected()) { 69 dlg.mark.setShape(Shp.PILLAR); 70 pillarButton.setBorderPainted(true); 71 } else { 72 pillarButton.setBorderPainted(false); 73 } 74 if (sparButton.isSelected()) { 75 dlg.mark.setShape(Shp.SPAR); 76 sparButton.setBorderPainted(true); 77 } else { 78 sparButton.setBorderPainted(false); 79 } 80 if (canButton.isSelected()) { 81 dlg.mark.setShape(Shp.CAN); 82 canButton.setBorderPainted(true); 83 } else { 84 canButton.setBorderPainted(false); 85 } 86 if (coneButton.isSelected()) { 87 dlg.mark.setShape(Shp.CONE); 88 coneButton.setBorderPainted(true); 89 } else { 90 coneButton.setBorderPainted(false); 91 } 92 if (sphereButton.isSelected()) { 93 dlg.mark.setShape(Shp.SPHERE); 94 sphereButton.setBorderPainted(true); 95 } else { 96 sphereButton.setBorderPainted(false); 97 } 98 if (barrelButton.isSelected()) { 99 dlg.mark.setShape(Shp.BARREL); 100 barrelButton.setBorderPainted(true); 101 } else { 102 barrelButton.setBorderPainted(false); 103 } 104 if (superButton.isSelected()) { 105 dlg.mark.setShape(Shp.SUPER); 106 superButton.setBorderPainted(true); 107 } else { 108 superButton.setBorderPainted(false); 109 } 110 if (floatButton.isSelected()) { 111 dlg.mark.setShape(Shp.FLOAT); 112 floatButton.setBorderPainted(true); 113 } else { 114 floatButton.setBorderPainted(false); 115 } 116 if (beaconButton.isSelected()) { 117 dlg.mark.setShape(Shp.BEACON); 118 beaconButton.setBorderPainted(true); 119 } else { 120 beaconButton.setBorderPainted(false); 121 } 122 if (towerButton.isSelected()) { 123 dlg.mark.setShape(Shp.TOWER); 124 towerButton.setBorderPainted(true); 125 } else { 126 towerButton.setBorderPainted(false); 127 } 83 128 if (dlg.mark != null) 84 129 dlg.mark.paintSign(); … … 95 140 beaconButton.addActionListener(alShape); 96 141 towerButton.addActionListener(alShape); 97 98 142 } 99 143 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java
r24839 r24848 73 73 74 74 public void paintSign() { 75 /* 76 * if (dlg.paintlock) return; 77 * 78 * super.paintSign(); 79 */ 80 if ((getCategory() != Cat.UNKNOWN) && (getShape() != Shp.UNKNOWN)) { 75 String image = "/images/Cardinal"; 81 76 82 String image = "/images/Cardinal"; 77 switch (getShape()) { 78 case PILLAR: 79 image += "_Pillar_Single"; 80 break; 81 case SPAR: 82 image += "_Spar_Single"; 83 break; 84 case BEACON: 85 image += "_Beacon_Single"; 86 break; 87 case TOWER: 88 image += "_Tower_Single"; 89 break; 90 case FLOAT: 91 image += "_Float_Single"; 92 break; 93 default: 94 } 83 95 84 switch (getShape()) { 85 case PILLAR: 86 image += "_Pillar_Single"; 87 break; 88 case SPAR: 89 image += "_Spar_Single"; 90 break; 91 case BEACON: 92 image += "_Beacon_Single"; 93 break; 94 case TOWER: 95 image += "_Tower_Single"; 96 break; 97 case FLOAT: 98 image += "_Float_Single"; 99 break; 100 default: 101 } 102 103 if (!image.equals("/images/Cardinal")) { 104 image += ".png"; 105 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image))); 106 } else 107 dlg.panelMain.shapeIcon.setIcon(null); 108 } 96 if (!image.equals("/images/Cardinal")) { 97 image += ".png"; 98 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image))); 99 } else 100 dlg.panelMain.shapeIcon.setIcon(null); 101 super.paintSign(); 109 102 } 110 103 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java
r24839 r24848 169 169 170 170 public void paintSign() { 171 /*172 * if (dlg.paintlock) return; super.paintSign();173 */174 171 boolean region = getRegion(); 175 172 Shp style = getShape(); … … 470 467 } else 471 468 dlg.panelMain.shapeIcon.setIcon(null); 469 super.paintSign(); 472 470 } 473 471 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java
r24839 r24848 55 55 56 56 public void paintSign() { 57 /*58 * if (dlg.paintlock) return; super.paintSign();59 */60 if (getCategory() != Cat.UNKNOWN) {57 switch (getCategory()) { 58 case LIGHT_HOUSE: 59 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_House.png"))); 60 break; 61 61 62 switch (getCategory()) { 63 case LIGHT_HOUSE: 64 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_House.png"))); 65 break; 62 case LIGHT_MAJOR: 63 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Major.png"))); 64 break; 66 65 67 case LIGHT_MAJOR:68 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Major.png")));69 66 case LIGHT_MINOR: 67 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Minor.png"))); 68 break; 70 69 71 case LIGHT_MINOR:72 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Minor.png")));73 70 case LIGHT_VESSEL: 71 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Float_Major.png"))); 72 break; 74 73 75 case LIGHT_VESSEL: 76 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Major_Float.png"))); 77 break; 78 79 default: 80 } 74 case LIGHT_FLOAT: 75 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Float_Minor.png"))); 76 break; 81 77 } 78 super.paintSign(); 82 79 } 83 80 … … 100 97 super.saveSign("light_vessel"); 101 98 break; 99 case LIGHT_FLOAT: 100 super.saveSign("light_float"); 101 break; 102 102 default: 103 103 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java
r24839 r24848 81 81 */ 82 82 public void paintSign() { 83 /* 84 * if (dlg.paintlock) return; super.paintSign(); 85 */ 83 86 84 String image = "/images/Safe_Water"; 87 85 … … 133 131 dlg.panelMain.topIcon.setIcon(null); 134 132 } 133 super.paintSign(); 135 134 } 136 135 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java
r24839 r24848 95 95 96 96 public void paintSign() { 97 /* 98 * if (dlg.paintlock) return; super.paintSign(); 99 */ 100 if ((getCategory() != Cat.UNKNOWN) && (getShape() != Shp.UNKNOWN)) { 101 102 String image = "/images/Special_Purpose"; 103 104 switch (getShape()) { 105 case PILLAR: 106 image += "_Pillar"; 107 break; 108 case CAN: 109 image += "_Can"; 110 break; 111 case CONE: 112 image += "_Cone"; 113 break; 114 case SPAR: 115 image += "_Spar"; 116 break; 117 case SPHERE: 118 image += "_Sphere"; 119 break; 120 case BARREL: 121 image += "_Barrel"; 122 break; 123 case FLOAT: 124 image += "_Float"; 125 break; 126 case BEACON: 127 image += "_Beacon"; 128 break; 129 case TOWER: 130 image += "_Tower"; 131 break; 132 default: 133 } 134 135 if (!image.equals("/images/Special_Purpose")) { 136 image += ".png"; 137 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image))); 138 /* 139 * if (hasTopMark()) { image = ""; switch (getShape()) { case PILLAR: 140 * case SPAR: switch (getTopMarkIndex()) { case TOP_YELLOW_X: image = 141 * "/images/Top_X_Yellow_Buoy.png"; break; case TOP_RED_X: image = 142 * "/images/Top_X_Red_Buoy.png"; break; case TOP_YELLOW_CAN: image = 143 * "/images/Top_Can_Yellow_Buoy.png"; break; case TOP_YELLOW_CONE: image 144 * = "/images/Top_Cone_Yellow_Buoy.png"; break; } break; case CAN: case 145 * CONE: case SPHERE: case BARREL: switch (getTopMarkIndex()) { case 146 * TOP_YELLOW_X: image = "/images/Top_X_Yellow_Buoy_Small.png"; break; 147 * case TOP_RED_X: image = "/images/Top_X_Red_Buoy_Small.png"; break; 148 * case TOP_YELLOW_CAN: image = "/images/Top_Can_Yellow_Buoy_Small.png"; 149 * break; case TOP_YELLOW_CONE: image = 150 * "/images/Top_Cone_Yellow_Buoy_Small.png"; break; } break; case 151 * BEACON: case TOWER: switch (getTopMarkIndex()) { case TOP_YELLOW_X: 152 * image = "/images/Top_X_Yellow_Beacon.png"; break; case TOP_RED_X: 153 * image = "/images/Top_X_Red_Beacon.png"; break; case TOP_YELLOW_CAN: 154 * image = "/images/Top_Can_Yellow_Beacon.png"; break; case 155 * TOP_YELLOW_CONE: image = "/images/Top_Cone_Yellow_Beacon.png"; break; 156 * } break; case FLOAT: switch (getTopMarkIndex()) { case TOP_YELLOW_X: 157 * image = "/images/Top_X_Yellow_Float.png"; break; case TOP_RED_X: 158 * image = "/images/Top_X_Red_Float.png"; break; case TOP_YELLOW_CAN: 159 * image = "/images/Top_Can_Yellow_Float.png"; break; case 160 * TOP_YELLOW_CONE: image = "/images/Top_Cone_Yellow_Float.png"; break; 161 * } break; } if (!image.isEmpty()) dlg.lM06Icon.setIcon(new 162 * ImageIcon(getClass().getResource(image))); } 163 */} else 164 dlg.panelMain.shapeIcon.setIcon(null); 97 98 String image = "/images/Special_Purpose"; 99 100 switch (getShape()) { 101 case PILLAR: 102 image += "_Pillar"; 103 break; 104 case CAN: 105 image += "_Can"; 106 break; 107 case CONE: 108 image += "_Cone"; 109 break; 110 case SPAR: 111 image += "_Spar"; 112 break; 113 case SPHERE: 114 image += "_Sphere"; 115 break; 116 case BARREL: 117 image += "_Barrel"; 118 break; 119 case FLOAT: 120 image += "_Float"; 121 break; 122 case BEACON: 123 image += "_Beacon"; 124 break; 125 case TOWER: 126 image += "_Tower"; 127 break; 165 128 } 129 130 if (!image.equals("/images/Special_Purpose")) { 131 image += ".png"; 132 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image))); 133 /* 134 * if (hasTopMark()) { image = ""; switch (getShape()) { case PILLAR: case 135 * SPAR: switch (getTopMarkIndex()) { case TOP_YELLOW_X: image = 136 * "/images/Top_X_Yellow_Buoy.png"; break; case TOP_RED_X: image = 137 * "/images/Top_X_Red_Buoy.png"; break; case TOP_YELLOW_CAN: image = 138 * "/images/Top_Can_Yellow_Buoy.png"; break; case TOP_YELLOW_CONE: image = 139 * "/images/Top_Cone_Yellow_Buoy.png"; break; } break; case CAN: case 140 * CONE: case SPHERE: case BARREL: switch (getTopMarkIndex()) { case 141 * TOP_YELLOW_X: image = "/images/Top_X_Yellow_Buoy_Small.png"; break; 142 * case TOP_RED_X: image = "/images/Top_X_Red_Buoy_Small.png"; break; case 143 * TOP_YELLOW_CAN: image = "/images/Top_Can_Yellow_Buoy_Small.png"; break; 144 * case TOP_YELLOW_CONE: image = "/images/Top_Cone_Yellow_Buoy_Small.png"; 145 * break; } break; case BEACON: case TOWER: switch (getTopMarkIndex()) { 146 * case TOP_YELLOW_X: image = "/images/Top_X_Yellow_Beacon.png"; break; 147 * case TOP_RED_X: image = "/images/Top_X_Red_Beacon.png"; break; case 148 * TOP_YELLOW_CAN: image = "/images/Top_Can_Yellow_Beacon.png"; break; 149 * case TOP_YELLOW_CONE: image = "/images/Top_Cone_Yellow_Beacon.png"; 150 * break; } break; case FLOAT: switch (getTopMarkIndex()) { case 151 * TOP_YELLOW_X: image = "/images/Top_X_Yellow_Float.png"; break; case 152 * TOP_RED_X: image = "/images/Top_X_Red_Float.png"; break; case 153 * TOP_YELLOW_CAN: image = "/images/Top_Can_Yellow_Float.png"; break; case 154 * TOP_YELLOW_CONE: image = "/images/Top_Cone_Yellow_Float.png"; break; } 155 * break; } if (!image.isEmpty()) dlg.lM06Icon.setIcon(new 156 * ImageIcon(getClass().getResource(image))); } 157 */ 158 } else 159 dlg.panelMain.shapeIcon.setIcon(null); 160 super.paintSign(); 166 161 } 167 162
Note:
See TracChangeset
for help on using the changeset viewer.