Changeset 27189 in osm
- Timestamp:
- 2011-12-08T00:27:39+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
r26998 r27189 37 37 node = nextNode; 38 38 mark = new SeaMark(dlg); 39 mark.setBounds(new Rectangle(235, 0, 165, 160)); 40 panelMain.add(mark, 0); 39 41 mark.parseMark(node); 40 42 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r27112 r27189 108 108 lightButton.setVisible(dlg.mark.testValid()); 109 109 alLit.actionPerformed(null); 110 dlg.mark.paintSign();111 110 } 112 111 }; … … 169 168 } 170 169 dlg.panelMain.panelTop.syncPanel(); 171 dlg.mark.paintSign();172 170 } 173 171 }; … … 214 212 } 215 213 dlg.panelMain.panelLit.syncPanel(); 216 dlg.mark.paintSign();217 214 } 218 215 }; … … 245 242 topmarkButton.setVisible(false); 246 243 this.add(topmarkButton); 247 lightButton.setBounds(new Rectangle(1 65, 0, 34, 32));244 lightButton.setBounds(new Rectangle(130, 32, 34, 32)); 248 245 lightButton.setToolTipText(Messages.getString("Light")); 249 246 lightButton.setBorder(BorderFactory.createLoweredBevelBorder()); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChr.java
r27060 r27189 65 65 } 66 66 dlg.mark.setLightAtt(Att.CHR, 0, charBox.getText()); 67 dlg.mark.paintSign();68 67 } 69 68 }; … … 89 88 } 90 89 } 91 dlg.mark.paintSign();92 90 } 93 91 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r27054 r27189 58 58 syncPanel(); 59 59 } 60 dlg.mark.paintSign();61 60 } else { 62 61 button.setBorderPainted(false); … … 80 79 } 81 80 } 82 dlg.mark.paintSign();83 81 } 84 82 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelFog.java
r27060 r27189 35 35 button.setBorderPainted(false); 36 36 } 37 dlg.mark.paintSign();38 37 } 39 38 }; … … 43 42 public void actionPerformed(java.awt.event.ActionEvent e) { 44 43 dlg.mark.setFogGroup(groupBox.getText()); 45 dlg.mark.paintSign();46 44 } 47 45 }; … … 51 49 public void actionPerformed(java.awt.event.ActionEvent e) { 52 50 dlg.mark.setFogPeriod(periodBox.getText()); 53 dlg.mark.paintSign();54 51 } 55 52 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r27112 r27189 71 71 alLit.actionPerformed(null); 72 72 dlg.panelMain.panelMore.syncPanel(); 73 dlg.mark.paintSign();74 73 } 75 74 }; … … 102 101 topmarkButton.setVisible(dlg.mark.testValid()); 103 102 lightButton.setVisible(dlg.mark.testValid()); 104 dlg.mark.paintSign();105 103 } 106 104 }; … … 136 134 } 137 135 dlg.panelMain.panelTop.syncPanel(); 138 dlg.mark.paintSign();139 136 } 140 137 }; … … 172 169 } 173 170 dlg.panelMain.panelLit.syncPanel(); 174 dlg.mark.paintSign();175 171 } 176 172 }; … … 200 196 topmarkButton.setVisible(false); 201 197 this.add(topmarkButton); 202 lightButton.setBounds(new Rectangle(1 65, 0, 34, 32));198 lightButton.setBounds(new Rectangle(130, 32, 34, 32)); 203 199 lightButton.setToolTipText(Messages.getString("Light")); 204 200 lightButton.setBorder(BorderFactory.createLoweredBevelBorder()); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r27131 r27189 27 27 dlg.mark.setCategory(cat); 28 28 dlg.mark.testValid(); 29 dlg.mark.paintSign();30 29 } 31 30 } … … 41 40 dlg.mark.setCategory(cat); 42 41 dlg.mark.testValid(); 43 dlg.mark.paintSign();44 42 } 45 43 } … … 55 53 dlg.mark.setCategory(cat); 56 54 dlg.mark.testValid(); 57 dlg.mark.paintSign();58 55 } 59 56 } … … 111 108 } 112 109 dlg.mark.testValid(); 113 dlg.mark.paintSign();114 110 } 115 111 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r27124 r27189 22 22 public void actionPerformed(java.awt.event.ActionEvent e) { 23 23 dlg.mark.setLightAtt(Att.GRP, 0, groupBox.getText()); 24 dlg.mark.paintSign();25 24 } 26 25 }; … … 30 29 public void actionPerformed(java.awt.event.ActionEvent e) { 31 30 dlg.mark.setLightAtt(Att.PER, 0, periodBox.getText()); 32 dlg.mark.paintSign();33 31 } 34 32 }; … … 38 36 public void actionPerformed(java.awt.event.ActionEvent e) { 39 37 dlg.mark.setLightAtt(Att.SEQ, 0, sequenceBox.getText()); 40 dlg.mark.paintSign();41 38 } 42 39 }; … … 58 55 public void actionPerformed(java.awt.event.ActionEvent e) { 59 56 dlg.mark.setLightAtt(Att.HGT, 0, heightBox.getText()); 60 dlg.mark.paintSign();61 57 } 62 58 }; … … 66 62 public void actionPerformed(java.awt.event.ActionEvent e) { 67 63 dlg.mark.setLightAtt(Att.RNG, 0, rangeBox.getText()); 68 dlg.mark.paintSign();69 64 } 70 65 }; … … 81 76 public void actionPerformed(java.awt.event.ActionEvent e) { 82 77 dlg.mark.setLightAtt(Att.MLT, 0, multipleBox.getText()); 83 dlg.mark.paintSign();84 78 } 85 79 }; … … 118 112 multipleBox.setVisible(false); 119 113 } 120 dlg.mark.paintSign();121 114 } 122 115 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r27112 r27189 23 23 public PanelRadar panelRadar = null; 24 24 public PanelLit panelLit = null; 25 public JLabel shapeIcon = null;26 public JLabel lightIcon = null;27 public JLabel topIcon = null;28 public JLabel radarIcon = null;29 public JLabel radarLabel = null;30 public JLabel fogIcon = null;31 public JLabel fogLabel = null;32 public JLabel colLabel = null;33 public JLabel litLabel = null;34 25 public JLabel nameLabel = null; 35 26 public JTextField nameBox = null; … … 172 163 dlg = dia; 173 164 panelChan = new PanelChan(dlg); 174 panelChan.setBounds(new Rectangle(65, 0, 200, 160));165 panelChan.setBounds(new Rectangle(65, 0, 185, 160)); 175 166 panelChan.setVisible(false); 176 167 panelHaz = new PanelHaz(dlg); 177 panelHaz.setBounds(new Rectangle(65, 0, 200, 160));168 panelHaz.setBounds(new Rectangle(65, 0, 185, 160)); 178 169 panelHaz.setVisible(false); 179 170 panelSpec = new PanelSpec(dlg); 180 panelSpec.setBounds(new Rectangle(65, 0, 200, 160));171 panelSpec.setBounds(new Rectangle(65, 0, 185, 160)); 181 172 panelSpec.setVisible(false); 182 173 panelLights = new PanelLights(dlg); 183 panelLights.setBounds(new Rectangle(65, 0, 200, 160));174 panelLights.setBounds(new Rectangle(65, 0, 185, 160)); 184 175 panelLights.setVisible(false); 185 176 panelMore = new PanelMore(dlg); … … 198 189 panelLit.setBounds(new Rectangle(40, 165, 360, 160)); 199 190 panelLit.setVisible(false); 200 201 shapeIcon = new JLabel();202 shapeIcon.setBounds(new Rectangle(235, 0, 150, 185));203 this.add(shapeIcon, null);204 lightIcon = new JLabel();205 lightIcon.setBounds(new Rectangle(235, 0, 150, 185));206 this.add(lightIcon, null);207 topIcon = new JLabel();208 topIcon.setBounds(new Rectangle(235, 0, 150, 185));209 this.add(topIcon, null);210 radarIcon = new JLabel();211 radarIcon.setBounds(new Rectangle(235, 0, 150, 185));212 this.add(radarIcon, null);213 fogIcon = new JLabel();214 fogIcon.setBounds(new Rectangle(235, 0, 150, 185));215 this.add(fogIcon, null);216 radarLabel = new JLabel("", SwingConstants.CENTER);217 litLabel = new JLabel("", SwingConstants.CENTER);218 litLabel.setBounds(new Rectangle(210, 35, 100, 20));219 this.add(litLabel, null);220 radarLabel.setBounds(new Rectangle(210, 55, 100, 20));221 this.add(radarLabel, null);222 fogLabel = new JLabel("", SwingConstants.CENTER);223 fogLabel.setBounds(new Rectangle(210, 75, 100, 20));224 this.add(fogLabel, null);225 colLabel = new JLabel("", SwingConstants.CENTER);226 colLabel.setBounds(new Rectangle(235, 100, 150, 20));227 this.add(colLabel, null);228 191 229 192 this.add(getButton(chanButton, 0, 0, 62, 40, "Chan"), null); … … 281 244 282 245 moreButton = new JButton(); 283 moreButton.setBounds(new Rectangle( 350, 145, 40, 15));246 moreButton.setBounds(new Rectangle(190, 145, 40, 15)); 284 247 moreButton.setMargin(new Insets(0, 0, 0, 0)); 285 248 moreButton.setText("v v v"); … … 321 284 panelRadar.setVisible(false); 322 285 panelLit.setVisible(false); 323 radarLabel.setText("");324 fogLabel.setText("");325 colLabel.setText("");326 litLabel.setText("");327 shapeIcon.setIcon(null);328 lightIcon.setIcon(null);329 topIcon.setIcon(null);330 radarIcon.setIcon(null);331 fogIcon.setIcon(null);332 286 nameBox.setEnabled(false); 333 287 if (dlg.mark != null) { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java
r27118 r27189 40 40 private ActionListener alHeight = new ActionListener() { 41 41 public void actionPerformed(java.awt.event.ActionEvent e) { 42 dlg.mark.setHeight(heightBox.getText()); 42 dlg.mark.setObjectHeight(heightBox.getText()); 43 43 } 44 44 }; … … 307 307 regionCButton.setBorderPainted(dlg.mark.getRegion() == Reg.C); 308 308 elevBox.setText(dlg.mark.getElevation()); 309 heightBox.setText(dlg.mark.getHeight()); 309 heightBox.setText(dlg.mark.getObjectHeight()); 310 310 sourceBox.setText(dlg.mark.getSource()); 311 311 infoBox.setText(dlg.mark.getInfo()); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r27112 r27189 84 84 dlg.panelMain.panelChan.lightButton.setVisible(false); 85 85 } 86 dlg.mark.paintSign();87 86 } 88 87 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java
r27060 r27189 31 31 } 32 32 syncPanel(); 33 dlg.mark.paintSign();34 33 } 35 34 }; … … 39 38 public void actionPerformed(java.awt.event.ActionEvent e) { 40 39 dlg.mark.setRaconGroup(groupBox.getText()); 41 dlg.mark.paintSign();42 40 } 43 41 }; … … 47 45 public void actionPerformed(java.awt.event.ActionEvent e) { 48 46 dlg.mark.setRaconPeriod(periodBox.getText()); 49 dlg.mark.paintSign();50 47 } 51 48 }; … … 55 52 public void actionPerformed(java.awt.event.ActionEvent e) { 56 53 dlg.mark.setRaconSequence(seqBox.getText()); 57 dlg.mark.paintSign();58 54 } 59 55 }; … … 63 59 public void actionPerformed(java.awt.event.ActionEvent e) { 64 60 dlg.mark.setRaconRange(rangeBox.getText()); 65 dlg.mark.paintSign();66 61 } 67 62 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java
r27054 r27189 42 42 } 43 43 dlg.panelMain.panelMore.syncPanel(); 44 dlg.mark.paintSign();45 44 } 46 45 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r27118 r27189 63 63 topmarkButton.setVisible(dlg.mark.testValid()); 64 64 dlg.panelMain.panelMore.syncPanel(); 65 dlg.mark.paintSign();66 65 } 67 66 }; … … 81 80 } 82 81 dlg.panelMain.panelTop.syncPanel(); 83 dlg.mark.paintSign();84 82 } 85 83 }; … … 90 88 this.setLayout(null); 91 89 this.add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYSPP), null); 92 this.add(getShapeButton(sparButton, 3 5, 0, 34, 32, "Spar", Shp.SPAR, Obj.BOYSPP), null);93 this.add(getShapeButton(canButton, 70, 0, 34, 32, "Can", Shp.CAN, Obj.BOYSPP), null);94 this.add(getShapeButton(coneButton, 10 5, 0, 34, 32, "Cone", Shp.CONE, Obj.BOYSPP), null);90 this.add(getShapeButton(sparButton, 34, 0, 34, 32, "Spar", Shp.SPAR, Obj.BOYSPP), null); 91 this.add(getShapeButton(canButton, 68, 0, 34, 32, "Can", Shp.CAN, Obj.BOYSPP), null); 92 this.add(getShapeButton(coneButton, 102, 0, 34, 32, "Cone", Shp.CONE, Obj.BOYSPP), null); 95 93 this.add(getShapeButton(sphereButton, 0, 32, 34, 32, "Sphere", Shp.SPHERE, Obj.BOYSPP), null); 96 this.add(getShapeButton(barrelButton, 3 5, 32, 34, 32, "Barrel", Shp.BARREL, Obj.BOYSPP), null);97 this.add(getShapeButton(superButton, 70, 32, 34, 32, "Super", Shp.SUPER, Obj.BOYSPP), null);98 this.add(getShapeButton(floatButton, 10 5, 32, 34, 32, "Float", Shp.FLOAT, Obj.LITFLT), null);94 this.add(getShapeButton(barrelButton, 34, 32, 34, 32, "Barrel", Shp.BARREL, Obj.BOYSPP), null); 95 this.add(getShapeButton(superButton, 68, 32, 34, 32, "Super", Shp.SUPER, Obj.BOYSPP), null); 96 this.add(getShapeButton(floatButton, 102, 32, 34, 32, "Float", Shp.FLOAT, Obj.LITFLT), null); 99 97 this.add(getShapeButton(beaconButton, 0, 64, 34, 32, "Beacon", Shp.BEACON, Obj.BCNSPP), null); 100 this.add(getShapeButton(towerButton, 3 5, 64, 34, 32, "TowerB", Shp.TOWER, Obj.BCNSPP), null);101 this.add(getShapeButton(stakeButton, 70, 64, 34, 32, "Stake", Shp.STAKE, Obj.BCNSPP), null);102 this.add(getShapeButton(cairnButton, 10 5, 64, 34, 32, "CairnB", Shp.CAIRN, Obj.BCNSPP), null);98 this.add(getShapeButton(towerButton, 34, 64, 34, 32, "TowerB", Shp.TOWER, Obj.BCNSPP), null); 99 this.add(getShapeButton(stakeButton, 68, 64, 34, 32, "Stake", Shp.STAKE, Obj.BCNSPP), null); 100 this.add(getShapeButton(cairnButton, 102, 64, 34, 32, "CairnB", Shp.CAIRN, Obj.BCNSPP), null); 103 101 104 102 categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER); 105 categoryLabel.setBounds(new Rectangle(5, 100, 1 70, 20));103 categoryLabel.setBounds(new Rectangle(5, 100, 160, 20)); 106 104 this.add(categoryLabel, null); 107 105 categoryBox = new JComboBox(); 108 categoryBox.setBounds(new Rectangle(5, 120, 1 70, 20));106 categoryBox.setBounds(new Rectangle(5, 120, 160, 20)); 109 107 this.add(categoryBox, null); 110 108 categoryBox.addActionListener(alCategoryBox); … … 128 126 addCatItem(Messages.getString("Anchorage"), Cat.SPM_ANCH); 129 127 130 topmarkButton.setBounds(new Rectangle(1 40, 0, 34, 32));128 topmarkButton.setBounds(new Rectangle(136, 0, 34, 32)); 131 129 topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder()); 132 130 topmarkButton.addActionListener(alTop); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r27112 r27189 84 84 dlg.panelMain.panelChan.lightButton.setVisible(false); 85 85 } 86 dlg.mark.paintSign();87 86 } 88 87 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r26998 r27189 45 45 } 46 46 mooringTopButton.setBorderPainted(mooringTopButton.isSelected()); 47 dlg.mark.paintSign();48 47 } 49 48 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r27155 r27189 1 1 package oseam.seamarks; 2 2 3 import javax.swing.*; 4 3 5 import java.awt.*; 4 import javax.swing.*; 6 import java.awt.geom.Arc2D; 7 5 8 import java.util.*; 6 9 … … 12 15 import oseam.dialogs.OSeaMAction; 13 16 14 public class SeaMark { 17 public class SeaMark extends JPanel { 15 18 16 19 public OSeaMAction dlg = null; … … 51 54 public void setName(String str) { 52 55 name = str.trim(); 56 repaint(); 53 57 } 54 58 … … 97 101 public void setObject(Obj obj) { 98 102 object = obj; 103 repaint(); 99 104 } 100 105 … … 266 271 public void setCategory(Cat cat) { 267 272 category = cat; 273 repaint(); 268 274 } 269 275 … … 299 305 public void setShape(Shp shp) { 300 306 shape = shp; 307 repaint(); 301 308 } 302 309 … … 387 394 bodyColour.clear(); 388 395 bodyColour.add(col); 396 repaint(); 389 397 } 390 398 … … 392 400 if (bodyColour.size() > i) 393 401 bodyColour.set(i, col); 402 repaint(); 394 403 } 395 404 … … 420 429 topmarkColour.clear(); 421 430 topmarkColour.add(col); 431 repaint(); 422 432 } 423 433 … … 425 435 if (topmarkColour.size() > i) 426 436 topmarkColour.set(i, col); 437 repaint(); 427 438 } 428 439 … … 583 594 sectors.get(i)[att] = obj; 584 595 } 596 repaint(); 585 597 } 586 598 … … 689 701 public void setTopmark(Top top) { 690 702 topShape = top; 703 repaint(); 691 704 } 692 705 … … 710 723 public void setRadar(Rtb type) { 711 724 RaType = type; 725 repaint(); 712 726 } 713 727 … … 720 734 public void setRaconGroup(String grp) { 721 735 raconGroup = grp; 736 repaint(); 722 737 } 723 738 … … 730 745 public void setRaconSequence(String seq) { 731 746 raconSequence = seq; 747 repaint(); 732 748 } 733 749 … … 740 756 public void setRaconPeriod(String per) { 741 757 raconPeriod = validDecimal(per); 758 repaint(); 742 759 } 743 760 … … 750 767 public void setRaconRange(String rng) { 751 768 raconRange = validDecimal(rng); 769 repaint(); 752 770 } 753 771 … … 760 778 public void setRaconSector1(String sec) { 761 779 raconSector1 = validDecimal(sec); 780 repaint(); 762 781 } 763 782 … … 770 789 public void setRaconSector2(String sec) { 771 790 raconSector2 = validDecimal(sec); 791 repaint(); 772 792 } 773 793 … … 796 816 public void setFogSound(Fog sound) { 797 817 fogSound = sound; 818 repaint(); 798 819 } 799 820 … … 806 827 public void setFogGroup(String grp) { 807 828 fogGroup = grp; 829 repaint(); 808 830 } 809 831 … … 816 838 public void setFogSequence(String seq) { 817 839 fogSequence = seq; 840 repaint(); 818 841 } 819 842 … … 826 849 public void setFogRange(String rng) { 827 850 fogRange = validDecimal(rng); 851 repaint(); 828 852 } 829 853 … … 836 860 public void setFogPeriod(String per) { 837 861 fogPeriod = validDecimal(per); 862 repaint(); 838 863 } 839 864 … … 964 989 public String height = ""; 965 990 966 public String getHeight() { 991 public String getObjectHeight() { 967 992 return height; 968 993 } 969 994 970 public void setHeight(String str) { 995 public void setObjectHeight(String str) { 971 996 height = validDecimal(str); 972 997 } … … 1087 1112 dlg.panelMain.panelMore.syncPanel(); 1088 1113 dlg.panelMain.panelMore.setVisible(false); 1089 paintSign();1090 1114 } 1091 1115 … … 1112 1136 } 1113 1137 1114 private boolean paintlock = false;1115 1116 1138 public void parseMark(Node node) { 1117 paintlock = true;1118 1139 dlg.manager.showVisualMessage(""); 1119 1140 String str = Main.pref.get("smedplugin.IALA"); … … 1224 1245 1225 1246 if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":height")) { 1226 setHeight(keys.get("seamark:" + ObjSTR.get(obj) + ":height")); 1247 setObjectHeight(keys.get("seamark:" + ObjSTR.get(obj) + ":height")); 1227 1248 } 1228 1249 if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":elevation")) { … … 1532 1553 } 1533 1554 if (keys.containsKey("seamark:height")) { 1534 setHeight(keys.get("seamark:height")); 1555 setObjectHeight(keys.get("seamark:height")); 1535 1556 } 1536 1557 if (keys.containsKey("seamark:elevation")) { … … 1592 1613 dlg.panelMain.syncPanel(); 1593 1614 1594 paintlock = false; 1595 paintSign(); 1596 } 1597 1598 public void paintSign() { 1599 1600 if (paintlock) 1601 return; 1602 1603 dlg.panelMain.shapeIcon.setIcon(null); 1604 dlg.panelMain.litLabel.setText(""); 1605 dlg.panelMain.colLabel.setText(""); 1606 dlg.panelMain.radarLabel.setText(""); 1607 dlg.panelMain.fogLabel.setText(""); 1608 dlg.panelMain.topIcon.setIcon(null); 1609 dlg.panelMain.fogIcon.setIcon(null); 1610 dlg.panelMain.radarIcon.setIcon(null); 1611 dlg.panelMain.lightIcon.setIcon(null); 1612 1613 String colStr; 1615 } 1616 1617 public void paintComponent(Graphics g) { 1618 super.paintComponent(g); 1619 1620 Graphics2D g2 = (Graphics2D) g; 1621 1622 String colStr; 1614 1623 String lblStr; 1615 1624 String imgStr = "/images/"; … … 1732 1741 System.out.println("Missing image: " + imgStr); 1733 1742 } else { 1734 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass() 1735 .getResource(imgStr))); 1736 dlg.panelMain.colLabel.setText(lblStr); 1743 g.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null); 1744 g.drawString(lblStr, 75, 110); 1737 1745 } 1738 1746 } else { 1739 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(colStr))); 1740 } 1741 } else { 1742 dlg.panelMain.shapeIcon.setIcon(null); 1747 g.drawImage(new ImageIcon(getClass().getResource(colStr)).getImage(), 7, -15, null); 1748 } 1743 1749 } 1744 1750 } else if (getObject() != Obj.UNKNOWN) { … … 1805 1811 System.out.println("Missing image: " + imgStr); 1806 1812 } else { 1807 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(imgStr))); 1808 } 1809 } else { 1810 dlg.panelMain.shapeIcon.setIcon(null); 1813 g.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null); 1814 } 1811 1815 } 1812 1816 } … … 1914 1918 return; 1915 1919 } else { 1916 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(imgStr)));1920 g.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null); 1917 1921 } 1918 1922 } else { 1919 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(colStr))); 1920 } 1921 } else { 1922 dlg.panelMain.topIcon.setIcon(null); 1923 g.drawImage(new ImageIcon(getClass().getResource(colStr)).getImage(), 7, -15, null); 1924 } 1925 } 1926 1927 for (int i = 1; i < sectors.size(); i++) { 1928 g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 1929 g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i))); 1930 g2.setStroke(new BasicStroke(6.0f)); 1931 if (!((String)getLightAtt(Att.BEG, i)).isEmpty() && !((String)getLightAtt(Att.END, i)).isEmpty()) { 1932 Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.BEG, i)); 1933 Double da = 270 - Double.parseDouble((String)getLightAtt(Att.END, i)) - a0; 1934 da -= da > 0 ? 360 : 0; 1935 g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN)); 1936 } 1937 } 1938 g2.setPaint(Color.BLACK); 1939 if (getLightAtt(Att.COL, 0) != Col.UNKNOWN) { 1940 if (sectors.size() == 1) { 1941 switch ((Col) getLightAtt(Att.COL, 0)) { 1942 case RED: 1943 g.drawImage(new ImageIcon(getClass().getResource("/images/Light_Red_120.png")).getImage(), 7, -15, null); 1944 break; 1945 case GREEN: 1946 g.drawImage(new ImageIcon(getClass().getResource("/images/Light_Green_120.png")).getImage(), 7, -15, null); 1947 break; 1948 case WHITE: 1949 case YELLOW: 1950 g.drawImage(new ImageIcon(getClass().getResource("/images/Light_White_120.png")).getImage(), 7, -15, null); 1951 break; 1952 default: 1953 g.drawImage(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png")).getImage(), 7, -15, null); 1954 } 1955 } 1956 String c = (String) dlg.mark.getLightAtt(Att.CHR, 0); 1957 String tmp = ""; 1958 if (c.contains("+")) { 1959 int i1 = c.indexOf("+"); 1960 tmp = c.substring(i1, c.length()); 1961 c = c.substring(0, i1); 1962 if (!((String) getLightAtt(Att.GRP, 0)).isEmpty()) { 1963 c += "(" + (String) getLightAtt(Att.GRP, 0) + ")"; 1964 } 1965 if (tmp != null) 1966 c += tmp; 1967 } else if (!((String) getLightAtt(Att.GRP, 0)).isEmpty()) 1968 c += "(" + (String) getLightAtt(Att.GRP, 0) + ")"; 1969 switch ((Col) getLightAtt(Att.COL, 0)) { 1970 case RED: 1971 c += ".R"; 1972 break; 1973 case GREEN: 1974 c += ".G"; 1975 break; 1976 case AMBER: 1977 c += ".Am"; 1978 break; 1979 case ORANGE: 1980 c += ".Or"; 1981 break; 1982 case BLUE: 1983 c += ".Bu"; 1984 break; 1985 case VIOLET: 1986 c += ".Vi"; 1987 break; 1988 } 1989 tmp = (String) getLightAtt(Att.MLT, 0); 1990 if (!tmp.isEmpty()) 1991 c = tmp + c; 1992 if (dlg.mark.getLightAtt(Att.LIT, 0) != Lit.UNKNOWN) { 1993 switch ((Lit)dlg.mark.getLightAtt(Att.LIT, 0)) { 1994 case VERT: 1995 c += "(Vert)"; 1996 break; 1997 case HORIZ: 1998 c += "(Horiz)"; 1999 break; 2000 } 2001 } 2002 tmp = (String) getLightAtt(Att.PER, 0); 2003 if (!tmp.isEmpty()) 2004 c += " " + tmp + "s"; 2005 g.drawString(c, 100, 70); 1923 2006 } 1924 2007 1925 2008 if (getFogSound() != Fog.NONE) { 1926 dlg.panelMain.fogIcon.setIcon(new ImageIcon(getClass().getResource("/images/Fog_Signal.png")));2009 g.drawImage(new ImageIcon(getClass().getResource("/images/Fog_Signal.png")).getImage(), 7, -15, null); 1927 2010 String str = ""; 1928 2011 if (getFogSound() != Fog.UNKNOWN) … … 1956 2039 if (!getFogPeriod().isEmpty()) 1957 2040 str += getFogPeriod() + "s"; 1958 dlg.panelMain.fogLabel.setText(str);2041 g.drawString(str, 0, 70); 1959 2042 } 1960 2043 1961 2044 if (RaType != Rtb.NONE) { 1962 2045 if (getRadar() == Rtb.REFLECTOR) { 1963 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png")));2046 g.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png")).getImage(), 7, -15, null); 1964 2047 } else { 1965 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Station.png")));2048 g.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Station.png")).getImage(), 7, -15, null); 1966 2049 String str = ""; 1967 2050 if (getRadar() == Rtb.RAMARK) … … 1975 2058 if (!getRaconPeriod().isEmpty()) 1976 2059 str += getRaconPeriod() + "s"; 1977 dlg.panelMain.radarLabel.setText(str); 1978 } 1979 } 1980 1981 if (getLightAtt(Att.COL, 0) != Col.UNKNOWN) { 1982 if (sectors.size() == 1) { 1983 switch ((Col) getLightAtt(Att.COL, 0)) { 1984 case RED: 1985 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Red_120.png"))); 1986 break; 1987 case GREEN: 1988 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Green_120.png"))); 1989 break; 1990 case WHITE: 1991 case YELLOW: 1992 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_120.png"))); 1993 break; 1994 default: 1995 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png"))); 1996 } 1997 } 1998 String c = (String) dlg.mark.getLightAtt(Att.CHR, 0); 1999 String tmp = ""; 2000 if (c.contains("+")) { 2001 int i1 = c.indexOf("+"); 2002 tmp = c.substring(i1, c.length()); 2003 c = c.substring(0, i1); 2004 if (!((String) getLightAtt(Att.GRP, 0)).isEmpty()) { 2005 c += "(" + (String) getLightAtt(Att.GRP, 0) + ")"; 2006 } 2007 if (tmp != null) 2008 c += tmp; 2009 } else if (!((String) getLightAtt(Att.GRP, 0)).isEmpty()) 2010 c += "(" + (String) getLightAtt(Att.GRP, 0) + ")"; 2011 switch ((Col) getLightAtt(Att.COL, 0)) { 2012 case RED: 2013 c += ".R"; 2014 break; 2015 case GREEN: 2016 c += ".G"; 2017 break; 2018 case AMBER: 2019 c += ".Am"; 2020 break; 2021 case ORANGE: 2022 c += ".Or"; 2023 break; 2024 case BLUE: 2025 c += ".Bu"; 2026 break; 2027 case VIOLET: 2028 c += ".Vi"; 2029 break; 2030 } 2031 tmp = (String) getLightAtt(Att.MLT, 0); 2032 if (!tmp.isEmpty()) 2033 c = tmp + c; 2034 if (dlg.mark.getLightAtt(Att.LIT, 0) != Lit.UNKNOWN) { 2035 switch ((Lit)dlg.mark.getLightAtt(Att.LIT, 0)) { 2036 case VERT: 2037 c += "(Vert)"; 2038 break; 2039 case HORIZ: 2040 c += "(Horiz)"; 2041 break; 2042 } 2043 } 2044 tmp = (String) getLightAtt(Att.PER, 0); 2045 if (!tmp.isEmpty()) 2046 c += " " + tmp + "s"; 2047 dlg.panelMain.litLabel.setText(c); 2048 } 2049 2050 paintlock = false; 2060 g.drawString(str, 0, 50); 2061 } 2062 } 2063 2051 2064 } 2052 2065 … … 2103 2116 } 2104 2117 } 2105 if (!getHeight().isEmpty()) { 2106 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":height", getHeight())); 2118 if (!getObjectHeight().isEmpty()) { 2119 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":height", getObjectHeight())); 2107 2120 } 2108 2121 if (!getElevation().isEmpty()) {
Note:
See TracChangeset
for help on using the changeset viewer.