Changeset 27423 in osm for applications/editors/josm/plugins
- Timestamp:
- 2012-01-08T21:16:43+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src
- Files:
-
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages.properties
r27413 r27423 64 64 SquareDay=Square daymark 65 65 CircleDay=Circular daymark 66 MooringTop=Mooring67 66 68 67 SelectNode=Please select a node -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_de.properties
r27413 r27423 64 64 SquareDay=Quadratisch Tagzeichen 65 65 CircleDay=Kreis Tagzeichen 66 MooringTop=Mooring67 66 68 67 SelectNode=Bitte einen Knoten auswählen -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_en.properties
r27413 r27423 64 64 SquareDay=Square daymark 65 65 CircleDay=Circular daymark 66 MooringTop=Mooring67 66 68 67 SelectNode=Please select a node -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChr.java
r27230 r27423 76 76 } 77 77 }; 78 private ActionListener alCharBox = new ActionListener() { 79 public void actionPerformed(java.awt.event.ActionEvent e) { 78 private FocusListener flCharBox = new FocusListener() { 79 public void focusGained(java.awt.event.FocusEvent e) {} 80 public void focusLost(java.awt.event.FocusEvent e) { 80 81 String str = charBox.getText(); 81 82 dlg.panelMain.mark.setLightAtt(Att.CHR, 0, str); … … 136 137 charBox.setHorizontalAlignment(SwingConstants.CENTER); 137 138 add(charBox); 138 charBox.add ActionListener(alCharBox);139 charBox.addFocusListener(flCharBox); 139 140 } 140 141 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelFog.java
r27230 r27423 39 39 public JLabel groupLabel; 40 40 public JTextField groupBox; 41 private ActionListener alGroup = new ActionListener() {42 public void actionPerformed(java.awt.event.ActionEvent e) {41 private FocusListener flGroup = new FocusAdapter() { 42 public void focusLost(java.awt.event.FocusEvent e) { 43 43 dlg.panelMain.mark.setFogGroup(groupBox.getText()); 44 44 } … … 46 46 public JLabel periodLabel; 47 47 public JTextField periodBox; 48 private ActionListener alPeriod = new ActionListener() {49 public void actionPerformed(java.awt.event.ActionEvent e) {48 private FocusListener flPeriod = new FocusAdapter() { 49 public void focusLost(java.awt.event.FocusEvent e) { 50 50 dlg.panelMain.mark.setFogPeriod(periodBox.getText()); 51 51 } … … 53 53 public JLabel seqLabel; 54 54 public JTextField seqBox; 55 private ActionListener alSeq = new ActionListener() {56 public void actionPerformed(java.awt.event.ActionEvent e) {55 private FocusListener flSeq = new FocusAdapter() { 56 public void focusLost(java.awt.event.FocusEvent e) { 57 57 dlg.panelMain.mark.setFogSequence(seqBox.getText()); 58 58 } … … 60 60 public JLabel rangeLabel; 61 61 public JTextField rangeBox; 62 private ActionListener alRange = new ActionListener() {63 public void actionPerformed(java.awt.event.ActionEvent e) {62 private FocusListener flRange = new FocusAdapter() { 63 public void focusLost(java.awt.event.FocusEvent e) { 64 64 dlg.panelMain.mark.setFogRange(rangeBox.getText()); 65 65 } … … 86 86 groupBox.setHorizontalAlignment(SwingConstants.CENTER); 87 87 add(groupBox); 88 groupBox.add ActionListener(alGroup);88 groupBox.addFocusListener(flGroup); 89 89 90 90 periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER); … … 95 95 periodBox.setHorizontalAlignment(SwingConstants.CENTER); 96 96 add(periodBox); 97 periodBox.add ActionListener(alPeriod);97 periodBox.addFocusListener(flPeriod); 98 98 99 99 seqLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER); … … 104 104 seqBox.setHorizontalAlignment(SwingConstants.CENTER); 105 105 add(seqBox); 106 seqBox.add ActionListener(alSeq);106 seqBox.addFocusListener(flSeq); 107 107 108 108 rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER); … … 113 113 rangeBox.setHorizontalAlignment(SwingConstants.CENTER); 114 114 add(rangeBox); 115 rangeBox.add ActionListener(alRange);115 rangeBox.addFocusListener(flRange); 116 116 117 117 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r27230 r27423 19 19 public JLabel groupLabel; 20 20 public JTextField groupBox; 21 private ActionListener alGroup = new ActionListener() {22 public void actionPerformed(java.awt.event.ActionEvent e) {21 private FocusListener flGroup = new FocusAdapter() { 22 public void focusLost(java.awt.event.FocusEvent e) { 23 23 dlg.panelMain.mark.setLightAtt(Att.GRP, 0, groupBox.getText()); 24 24 } … … 26 26 public JLabel periodLabel; 27 27 public JTextField periodBox; 28 private ActionListener alPeriod = new ActionListener() {29 public void actionPerformed(java.awt.event.ActionEvent e) {28 private FocusListener flPeriod = new FocusAdapter() { 29 public void focusLost(java.awt.event.FocusEvent e) { 30 30 dlg.panelMain.mark.setLightAtt(Att.PER, 0, periodBox.getText()); 31 31 } … … 33 33 public JLabel sequenceLabel; 34 34 public JTextField sequenceBox; 35 private ActionListener alSequence = new ActionListener() {36 public void actionPerformed(java.awt.event.ActionEvent e) {35 private FocusListener flSequence = new FocusAdapter() { 36 public void focusLost(java.awt.event.FocusEvent e) { 37 37 dlg.panelMain.mark.setLightAtt(Att.SEQ, 0, sequenceBox.getText()); 38 38 } … … 52 52 public JLabel heightLabel; 53 53 public JTextField heightBox; 54 private ActionListener alHeight = new ActionListener() {55 public void actionPerformed(java.awt.event.ActionEvent e) {54 private FocusListener flHeight = new FocusAdapter() { 55 public void focusLost(java.awt.event.FocusEvent e) { 56 56 dlg.panelMain.mark.setLightAtt(Att.HGT, 0, heightBox.getText()); 57 57 } … … 59 59 public JLabel rangeLabel; 60 60 public JTextField rangeBox; 61 private ActionListener alRange = new ActionListener() {62 public void actionPerformed(java.awt.event.ActionEvent e) {61 private FocusListener flRange = new FocusAdapter() { 62 public void focusLost(java.awt.event.FocusEvent e) { 63 63 dlg.panelMain.mark.setLightAtt(Att.RNG, 0, rangeBox.getText()); 64 64 } … … 66 66 public JLabel orientationLabel; 67 67 public JTextField orientationBox; 68 private ActionListener alOrientation = new ActionListener() {69 public void actionPerformed(java.awt.event.ActionEvent e) {68 private FocusListener flOrientation = new FocusAdapter() { 69 public void focusLost(java.awt.event.FocusEvent e) { 70 70 dlg.panelMain.mark.setLightAtt(Att.ORT, 0, orientationBox.getText()); 71 71 } … … 73 73 public JLabel multipleLabel; 74 74 public JTextField multipleBox; 75 private ActionListener alMultiple = new ActionListener() {76 public void actionPerformed(java.awt.event.ActionEvent e) {75 private FocusListener flMultiple = new FocusAdapter() { 76 public void focusLost(java.awt.event.FocusEvent e) { 77 77 dlg.panelMain.mark.setLightAtt(Att.MLT, 0, multipleBox.getText()); 78 78 } … … 168 168 groupBox.setHorizontalAlignment(SwingConstants.CENTER); 169 169 add(groupBox); 170 groupBox.add ActionListener(alGroup);170 groupBox.addFocusListener(flGroup); 171 171 172 172 periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER); … … 177 177 periodBox.setHorizontalAlignment(SwingConstants.CENTER); 178 178 add(periodBox); 179 periodBox.add ActionListener(alPeriod);179 periodBox.addFocusListener(flPeriod); 180 180 181 181 heightLabel = new JLabel(Messages.getString("Height"), SwingConstants.CENTER); … … 186 186 heightBox.setHorizontalAlignment(SwingConstants.CENTER); 187 187 add(heightBox); 188 heightBox.add ActionListener(alHeight);188 heightBox.addFocusListener(flHeight); 189 189 190 190 rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER); … … 195 195 rangeBox.setHorizontalAlignment(SwingConstants.CENTER); 196 196 add(rangeBox); 197 rangeBox.add ActionListener(alRange);197 rangeBox.addFocusListener(flRange); 198 198 199 199 sequenceLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER); … … 204 204 sequenceBox.setHorizontalAlignment(SwingConstants.CENTER); 205 205 add(sequenceBox); 206 sequenceBox.add ActionListener(alSequence);206 sequenceBox.addFocusListener(flSequence); 207 207 208 208 categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER); … … 266 266 orientationBox.setVisible(false); 267 267 add(orientationBox); 268 orientationBox.add ActionListener(alOrientation);268 orientationBox.addFocusListener(flOrientation); 269 269 270 270 multipleLabel = new JLabel(Messages.getString("Multiplicity"), SwingConstants.CENTER); … … 277 277 multipleBox.setVisible(false); 278 278 add(multipleBox); 279 multipleBox.add ActionListener(alMultiple);279 multipleBox.addFocusListener(flMultiple); 280 280 } 281 281 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r27413 r27423 26 26 public JLabel nameLabel = null; 27 27 public JTextField nameBox = null; 28 private ActionListener alName = new ActionListener() {29 public void actionPerformed(java.awt.event.ActionEvent e) {28 private FocusListener flName = new FocusListener() { 29 public void focusLost(java.awt.event.FocusEvent e) { 30 30 mark.setName(nameBox.getText()); 31 } 32 public void focusGained(java.awt.event.FocusEvent e) { 31 33 } 32 34 }; … … 233 235 nameBox.setHorizontalAlignment(SwingConstants.CENTER); 234 236 add(nameBox); 235 nameBox.add ActionListener(alName);237 nameBox.addFocusListener(flName); 236 238 237 239 saveButton = new JButton(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java
r27405 r27423 17 17 public JLabel infoLabel; 18 18 public JTextField infoBox; 19 private ActionListener alInfo = new ActionListener() {20 public void actionPerformed(java.awt.event.ActionEvent e) {19 private FocusListener flInfo = new FocusAdapter() { 20 public void focusLost(java.awt.event.FocusEvent e) { 21 21 dlg.panelMain.mark.setInfo(infoBox.getText()); 22 22 } … … 24 24 public JLabel sourceLabel; 25 25 public JTextField sourceBox; 26 private ActionListener alSource = new ActionListener() {27 public void actionPerformed(java.awt.event.ActionEvent e) {26 private FocusListener flSource = new FocusAdapter() { 27 public void focusLost(java.awt.event.FocusEvent e) { 28 28 dlg.panelMain.mark.setSource(sourceBox.getText()); 29 29 } … … 31 31 public JLabel elevLabel; 32 32 public JTextField elevBox; 33 private ActionListener alElev = new ActionListener() {34 public void actionPerformed(java.awt.event.ActionEvent e) {33 private FocusListener flElev = new FocusAdapter() { 34 public void focusLost(java.awt.event.FocusEvent e) { 35 35 dlg.panelMain.mark.setElevation(elevBox.getText()); 36 36 } … … 38 38 public JLabel heightLabel; 39 39 public JTextField heightBox; 40 private ActionListener alHeight = new ActionListener() {41 public void actionPerformed(java.awt.event.ActionEvent e) {40 private FocusListener flHeight = new FocusAdapter() { 41 public void focusLost(java.awt.event.FocusEvent e) { 42 42 dlg.panelMain.mark.setObjectHeight(heightBox.getText()); 43 43 } … … 203 203 elevBox.setHorizontalAlignment(SwingConstants.CENTER); 204 204 add(elevBox); 205 elevBox.add ActionListener(alElev);205 elevBox.addFocusListener(flElev); 206 206 207 207 heightLabel = new JLabel(Messages.getString("Height"), SwingConstants.CENTER); … … 212 212 heightBox.setHorizontalAlignment(SwingConstants.CENTER); 213 213 add(heightBox); 214 heightBox.add ActionListener(alHeight);214 heightBox.addFocusListener(flHeight); 215 215 216 216 sourceLabel = new JLabel(Messages.getString("Source"), SwingConstants.CENTER); … … 221 221 sourceBox.setHorizontalAlignment(SwingConstants.CENTER); 222 222 add(sourceBox); 223 sourceBox.add ActionListener(alSource);223 sourceBox.addFocusListener(flSource); 224 224 225 225 infoLabel = new JLabel(Messages.getString("Information"), SwingConstants.CENTER); … … 230 230 infoBox.setHorizontalAlignment(SwingConstants.CENTER); 231 231 add(infoBox); 232 infoBox.add ActionListener(alInfo);232 infoBox.addFocusListener(flInfo); 233 233 234 234 statusLabel = new JLabel(Messages.getString("Status"), SwingConstants.CENTER); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java
r27230 r27423 35 35 public JLabel groupLabel; 36 36 public JTextField groupBox; 37 private ActionListener alGroup = new ActionListener() {38 public void actionPerformed(java.awt.event.ActionEvent e) {37 private FocusListener flGroup = new FocusAdapter() { 38 public void focusLost(java.awt.event.FocusEvent e) { 39 39 dlg.panelMain.mark.setRaconGroup(groupBox.getText()); 40 40 } … … 42 42 public JLabel periodLabel; 43 43 public JTextField periodBox; 44 private ActionListener alPeriod = new ActionListener() {45 public void actionPerformed(java.awt.event.ActionEvent e) {44 private FocusListener flPeriod = new FocusAdapter() { 45 public void focusLost(java.awt.event.FocusEvent e) { 46 46 dlg.panelMain.mark.setRaconPeriod(periodBox.getText()); 47 47 } … … 49 49 public JLabel seqLabel; 50 50 public JTextField seqBox; 51 private ActionListener alSeq = new ActionListener() {52 public void actionPerformed(java.awt.event.ActionEvent e) {51 private FocusListener flSeq = new FocusAdapter() { 52 public void focusLost(java.awt.event.FocusEvent e) { 53 53 dlg.panelMain.mark.setRaconSequence(seqBox.getText()); 54 54 } … … 56 56 public JLabel rangeLabel; 57 57 public JTextField rangeBox; 58 private ActionListener alRange = new ActionListener() {59 public void actionPerformed(java.awt.event.ActionEvent e) {58 private FocusListener flRange = new FocusAdapter() { 59 public void focusLost(java.awt.event.FocusEvent e) { 60 60 dlg.panelMain.mark.setRaconRange(rangeBox.getText()); 61 61 } … … 63 63 public JLabel sector1Label; 64 64 public JTextField sector1Box; 65 private ActionListener alSector1 = new ActionListener() {66 public void actionPerformed(java.awt.event.ActionEvent e) {65 private FocusListener flSector1 = new FocusAdapter() { 66 public void focusLost(java.awt.event.FocusEvent e) { 67 67 dlg.panelMain.mark.setRaconSector1(sector1Box.getText()); 68 68 } … … 70 70 public JLabel sector2Label; 71 71 public JTextField sector2Box; 72 private ActionListener alSector2 = new ActionListener() {73 public void actionPerformed(java.awt.event.ActionEvent e) {72 private FocusListener flSector2 = new FocusAdapter() { 73 public void focusLost(java.awt.event.FocusEvent e) { 74 74 dlg.panelMain.mark.setRaconSector2(sector2Box.getText()); 75 75 } … … 93 93 groupBox.setHorizontalAlignment(SwingConstants.CENTER); 94 94 add(groupBox); 95 groupBox.add ActionListener(alGroup);95 groupBox.addFocusListener(flGroup); 96 96 97 97 periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER); … … 102 102 periodBox.setHorizontalAlignment(SwingConstants.CENTER); 103 103 add(periodBox); 104 periodBox.add ActionListener(alPeriod);104 periodBox.addFocusListener(flPeriod); 105 105 106 106 seqLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER); … … 111 111 seqBox.setHorizontalAlignment(SwingConstants.CENTER); 112 112 add(seqBox); 113 seqBox.add ActionListener(alSeq);113 seqBox.addFocusListener(flSeq); 114 114 115 115 rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER); … … 119 119 rangeBox.setBounds(new Rectangle(155, 60, 50, 20)); 120 120 rangeBox.setHorizontalAlignment(SwingConstants.CENTER); 121 rangeBox.add ActionListener(alRange);121 rangeBox.addFocusListener(flRange); 122 122 123 123 sectorsLabel = new JLabel(Messages.getString("VisibleSector"), SwingConstants.CENTER); … … 132 132 sector1Box.setHorizontalAlignment(SwingConstants.CENTER); 133 133 add(sector1Box); 134 sector1Box.add ActionListener(alSector1);134 sector1Box.addFocusListener(flSector1); 135 135 136 136 sector2Label = new JLabel(Messages.getString("End"), SwingConstants.CENTER); … … 141 141 sector2Box.setHorizontalAlignment(SwingConstants.CENTER); 142 142 add(sector2Box); 143 sector2Box.add ActionListener(alSector2);143 sector2Box.addFocusListener(flSector2); 144 144 } 145 145 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r27413 r27423 43 43 } 44 44 } 45 if (dlg.node != null) syncPanel(); 45 46 } 46 47 }; … … 66 67 if (button.isSelected()) { 67 68 dlg.panelMain.mark.setShape(shp); 68 dlg.panelMain.mark.setObject(objects.get(shp)); 69 if (button == cairnButton) { 70 dlg.panelMain.mark.setObjPattern(Pat.NOPAT); 71 dlg.panelMain.mark.setObjColour(Col.UNKCOL); 72 } 73 if (dlg.panelMain.mark.getObjColour(0) == Col.UNKCOL) { 74 dlg.panelMain.mark.setObjPattern(Pat.NOPAT); 75 dlg.panelMain.mark.setObjColour(Col.YELLOW); 69 if (SeaMark.EntMAP.get(dlg.panelMain.mark.getObject()) != Ent.MOORING) { 70 dlg.panelMain.mark.setObject(objects.get(shp)); 71 if (dlg.panelMain.mark.getObjColour(0) == Col.UNKCOL) { 72 dlg.panelMain.mark.setObjPattern(Pat.NOPAT); 73 dlg.panelMain.mark.setObjColour(Col.YELLOW); 74 } 75 if (button == cairnButton) { 76 dlg.panelMain.mark.setObjPattern(Pat.NOPAT); 77 dlg.panelMain.mark.setObjColour(Col.UNKCOL); 78 } 79 topmarkButton.setVisible(dlg.panelMain.mark.testValid()); 76 80 } 77 81 button.setBorderPainted(true); … … 79 83 button.setBorderPainted(false); 80 84 } 81 topmarkButton.setVisible(dlg.panelMain.mark.testValid());82 85 dlg.panelMain.panelMore.syncPanel(); 83 86 } … … 105 108 dlg.panelMain.mark.setObject(Obj.UNKOBJ); 106 109 dlg.panelMain.mark.setCategory(Cat.NOCAT); 107 syncPanel();110 dlg.panelMain.mark.setTopmark(Top.NOTOP); 108 111 if (mooringButton.isSelected()) { 109 112 categoryBox.setVisible(false); … … 184 187 add(topmarkButton); 185 188 186 mooringButton.setBounds(new Rectangle(136, 64, 34, 32));187 mooringButton.setToolTipText(Messages.getString("Mooring"));188 mooringButton.setBorder(BorderFactory.createLoweredBevelBorder());189 mooringButton.addActionListener(alMooring);190 add(mooringButton);189 // mooringButton.setBounds(new Rectangle(136, 64, 34, 32)); 190 // mooringButton.setToolTipText(Messages.getString("Mooring")); 191 // mooringButton.setBorder(BorderFactory.createLoweredBevelBorder()); 192 // mooringButton.addActionListener(alMooring); 193 // add(mooringButton); 191 194 } 192 195 … … 196 199 categoryBox.setVisible(false); 197 200 mooringBox.setVisible(true); 201 topmarkButton.setVisible(false); 198 202 for (Cat cat : moorings.keySet()) { 199 203 int item = moorings.get(cat); … … 205 209 mooringBox.setVisible(false); 206 210 categoryBox.setVisible(true); 211 topmarkButton.setBorderPainted(dlg.panelMain.mark.getTopmark() != Top.NOTOP); 212 topmarkButton.setSelected(dlg.panelMain.mark.getTopmark() != Top.NOTOP); 213 topmarkButton.setVisible(dlg.panelMain.mark.testValid()); 207 214 for (Cat cat : categories.keySet()) { 208 215 int item = categories.get(cat); … … 218 225 button.setBorderPainted(false); 219 226 } 220 topmarkButton.setBorderPainted(dlg.panelMain.mark.getTopmark() != Top.NOTOP); 221 topmarkButton.setSelected(dlg.panelMain.mark.getTopmark() != Top.NOTOP); 222 topmarkButton.setVisible(dlg.panelMain.mark.testValid()); 227 dlg.panelMain.mark.testValid(); 223 228 } 224 229 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r27373 r27423 32 32 public JRadioButton squareDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SquareDayButton.png"))); 33 33 public JRadioButton circleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CircleDayButton.png"))); 34 public JRadioButton mooringTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/MooringTopButton.png")));35 34 private EnumMap<Top, JRadioButton> tops = new EnumMap<Top, JRadioButton>(Top.class); 36 35 private ActionListener alTop = new ActionListener() { … … 44 43 button.setBorderPainted(false); 45 44 } 46 mooringTopButton.setBorderPainted(mooringTopButton.isSelected());47 45 } 48 46 }; … … 70 68 add(getTopButton(squareDayButton, 120, 65, 27, 27, "SquareDay", Top.SQUARE)); 71 69 add(getTopButton(circleDayButton, 120, 95, 27, 27, "CircleDay", Top.CIRCLE)); 72 add(getMoorButton(mooringTopButton, 0, 95, 27, 27, "MooringTop"));73 70 } 74 71 … … 77 74 button.setEnabled(state); 78 75 } 79 mooringTopButton.setEnabled(state);80 76 } 81 77 … … 101 97 } 102 98 103 private JRadioButton getMoorButton(JRadioButton button, int x, int y, int w, int h, String tip) {104 button.setBounds(new Rectangle(x, y, w, h));105 button.setBorder(BorderFactory.createLoweredBevelBorder());106 button.setToolTipText(Messages.getString(tip));107 button.addActionListener(alTop);108 topButtons.add(button);109 return button;110 }111 112 99 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r27413 r27423 1136 1136 case LITVES: 1137 1137 case LITHSE: 1138 case MORFAC:1139 1138 case SISTAW: 1140 1139 case SISTAT: 1141 1140 case OFSPLF: 1141 case MORFAC: 1142 case BOYINB: 1142 1143 tmp = true; 1143 1144 break; … … 1827 1828 colStr += ".png"; 1828 1829 if (getClass().getResource(colStr) == null) { 1829 System.out.println("Missing image : " + colStr);1830 System.out.println("Missing image1: " + colStr); 1830 1831 imgStr += ".png"; 1831 1832 if (getClass().getResource(imgStr) == null) { 1832 System.out.println("Missing image : " + imgStr);1833 System.out.println("Missing image2: " + imgStr); 1833 1834 } else { 1834 1835 g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null); … … 1899 1900 imgStr += "Platform"; 1900 1901 break; 1902 case MORFAC: 1903 switch (getCategory()) { 1904 case MOR_DLPN: 1905 imgStr += "Dolphin"; 1906 break; 1907 case MOR_DDPN: 1908 imgStr += "DeviationDolphin"; 1909 break; 1910 case MOR_POST: 1911 imgStr += "Post"; 1912 break; 1913 case MOR_BUOY: 1914 imgStr += "Sphere"; 1915 break; 1916 } 1917 break; 1918 case BOYINB: 1919 imgStr += "Super"; 1920 break; 1901 1921 } 1902 1922 if (!imgStr.equals("/images/")) { 1903 1923 imgStr += ".png"; 1904 1924 if (getClass().getResource(imgStr) == null) { 1905 System.out.println("Missing image : " + imgStr);1925 System.out.println("Missing image3: " + imgStr); 1906 1926 } else { 1907 1927 g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null); … … 2006 2026 colStr += ".png"; 2007 2027 if (getClass().getResource(colStr) == null) { 2008 System.out.println("Missing image : " + colStr);2028 System.out.println("Missing image4: " + colStr); 2009 2029 imgStr += ".png"; 2010 2030 if (getClass().getResource(imgStr) == null) { 2011 System.out.println("Missing image : " + imgStr);2031 System.out.println("Missing image5: " + imgStr); 2012 2032 return; 2013 2033 } else { … … 2016 2036 } else { 2017 2037 g2.drawImage(new ImageIcon(getClass().getResource(colStr)).getImage(), 7, -15, null); 2038 } 2039 } else { 2040 if ((getObject() == Obj.BOYINB) || ((getObject() == Obj.MORFAC) && (getCategory() == Cat.MOR_BUOY))) { 2041 imgStr = "/images/Top_Mooring"; 2042 switch (getShape()) { 2043 case CAN: 2044 case CONI: 2045 case SPHERI: 2046 case BARREL: 2047 imgStr += "_Buoy_Small"; 2048 break; 2049 case PILLAR: 2050 case SPAR: 2051 imgStr += "_Buoy"; 2052 break; 2053 case FLOAT: 2054 case SUPER: 2055 imgStr += "_Float"; 2056 break; 2057 default: 2058 if (getObject() == Obj.MORFAC) { 2059 imgStr += "_Buoy_Small"; 2060 } else { 2061 imgStr += "_Float"; 2062 } 2063 break; 2064 } 2065 imgStr += ".png"; 2066 if (getClass().getResource(imgStr) == null) { 2067 System.out.println("Missing image6: " + imgStr); 2068 return; 2069 } else { 2070 g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null); 2071 } 2018 2072 } 2019 2073 }
Note:
See TracChangeset
for help on using the changeset viewer.