Ignore:
Timestamp:
2011-12-08T00:27:39+01:00 (13 years ago)
Author:
malcolmh
Message:

save

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  
    3737                                                        node = nextNode;
    3838                                                        mark = new SeaMark(dlg);
     39                                                        mark.setBounds(new Rectangle(235, 0, 165, 160));
     40                                                        panelMain.add(mark, 0);
    3941                                                        mark.parseMark(node);
    4042                                                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java

    r27112 r27189  
    108108                        lightButton.setVisible(dlg.mark.testValid());
    109109                        alLit.actionPerformed(null);
    110                         dlg.mark.paintSign();
    111110                }
    112111        };
     
    169168                        }
    170169                        dlg.panelMain.panelTop.syncPanel();
    171                         dlg.mark.paintSign();
    172170                }
    173171        };
     
    214212                        }
    215213                        dlg.panelMain.panelLit.syncPanel();
    216                         dlg.mark.paintSign();
    217214                }
    218215        };
     
    245242                topmarkButton.setVisible(false);
    246243                this.add(topmarkButton);
    247                 lightButton.setBounds(new Rectangle(165, 0, 34, 32));
     244                lightButton.setBounds(new Rectangle(130, 32, 34, 32));
    248245                lightButton.setToolTipText(Messages.getString("Light"));
    249246                lightButton.setBorder(BorderFactory.createLoweredBevelBorder());
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChr.java

    r27060 r27189  
    6565                        }
    6666                        dlg.mark.setLightAtt(Att.CHR, 0, charBox.getText());
    67                         dlg.mark.paintSign();
    6867                }
    6968        };
     
    8988                                }
    9089                        }
    91                         dlg.mark.paintSign();
    9290                }
    9391        };
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java

    r27054 r27189  
    5858                                                        syncPanel();
    5959                                                }
    60                                                 dlg.mark.paintSign();
    6160                                } else {
    6261                                        button.setBorderPainted(false);
     
    8079                                }
    8180                        }
    82                         dlg.mark.paintSign();
    8381                }
    8482        };
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelFog.java

    r27060 r27189  
    3535                                        button.setBorderPainted(false);
    3636                        }
    37                         dlg.mark.paintSign();
    3837                }
    3938        };
     
    4342                public void actionPerformed(java.awt.event.ActionEvent e) {
    4443                        dlg.mark.setFogGroup(groupBox.getText());
    45                         dlg.mark.paintSign();
    4644                }
    4745        };
     
    5149                public void actionPerformed(java.awt.event.ActionEvent e) {
    5250                        dlg.mark.setFogPeriod(periodBox.getText());
    53                         dlg.mark.paintSign();
    5451                }
    5552        };
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java

    r27112 r27189  
    7171                        alLit.actionPerformed(null);
    7272                        dlg.panelMain.panelMore.syncPanel();
    73                         dlg.mark.paintSign();
    7473                }
    7574        };
     
    102101                        topmarkButton.setVisible(dlg.mark.testValid());
    103102                        lightButton.setVisible(dlg.mark.testValid());
    104                         dlg.mark.paintSign();
    105103                }
    106104        };
     
    136134                        }
    137135                        dlg.panelMain.panelTop.syncPanel();
    138                         dlg.mark.paintSign();
    139136                }
    140137        };
     
    172169                        }
    173170                        dlg.panelMain.panelLit.syncPanel();
    174                         dlg.mark.paintSign();
    175171                }
    176172        };
     
    200196                topmarkButton.setVisible(false);
    201197                this.add(topmarkButton);
    202                 lightButton.setBounds(new Rectangle(165, 0, 34, 32));
     198                lightButton.setBounds(new Rectangle(130, 32, 34, 32));
    203199                lightButton.setToolTipText(Messages.getString("Light"));
    204200                lightButton.setBorder(BorderFactory.createLoweredBevelBorder());
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java

    r27131 r27189  
    2727                                        dlg.mark.setCategory(cat);
    2828                                        dlg.mark.testValid();
    29                                         dlg.mark.paintSign();
    3029                                }
    3130                        }
     
    4140                                        dlg.mark.setCategory(cat);
    4241                                        dlg.mark.testValid();
    43                                         dlg.mark.paintSign();
    4442                                }
    4543                        }
     
    5553                                        dlg.mark.setCategory(cat);
    5654                                        dlg.mark.testValid();
    57                                         dlg.mark.paintSign();
    5855                                }
    5956                        }
     
    111108                        }
    112109                        dlg.mark.testValid();
    113                         dlg.mark.paintSign();
    114110                }
    115111        };
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java

    r27124 r27189  
    2222                public void actionPerformed(java.awt.event.ActionEvent e) {
    2323                        dlg.mark.setLightAtt(Att.GRP, 0, groupBox.getText());
    24                         dlg.mark.paintSign();
    2524                }
    2625        };
     
    3029                public void actionPerformed(java.awt.event.ActionEvent e) {
    3130                        dlg.mark.setLightAtt(Att.PER, 0, periodBox.getText());
    32                         dlg.mark.paintSign();
    3331                }
    3432        };
     
    3836                public void actionPerformed(java.awt.event.ActionEvent e) {
    3937                        dlg.mark.setLightAtt(Att.SEQ, 0, sequenceBox.getText());
    40                         dlg.mark.paintSign();
    4138                }
    4239        };
     
    5855                public void actionPerformed(java.awt.event.ActionEvent e) {
    5956                        dlg.mark.setLightAtt(Att.HGT, 0, heightBox.getText());
    60                         dlg.mark.paintSign();
    6157                }
    6258        };
     
    6662                public void actionPerformed(java.awt.event.ActionEvent e) {
    6763                        dlg.mark.setLightAtt(Att.RNG, 0, rangeBox.getText());
    68                         dlg.mark.paintSign();
    6964                }
    7065        };
     
    8176                public void actionPerformed(java.awt.event.ActionEvent e) {
    8277                        dlg.mark.setLightAtt(Att.MLT, 0, multipleBox.getText());
    83                         dlg.mark.paintSign();
    8478                }
    8579        };
     
    118112                                multipleBox.setVisible(false);
    119113                        }
    120                         dlg.mark.paintSign();
    121114                }
    122115        };
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java

    r27112 r27189  
    2323        public PanelRadar panelRadar = null;
    2424        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;
    3425        public JLabel nameLabel = null;
    3526        public JTextField nameBox = null;
     
    172163                dlg = dia;
    173164                panelChan = new PanelChan(dlg);
    174                 panelChan.setBounds(new Rectangle(65, 0, 200, 160));
     165                panelChan.setBounds(new Rectangle(65, 0, 185, 160));
    175166                panelChan.setVisible(false);
    176167                panelHaz = new PanelHaz(dlg);
    177                 panelHaz.setBounds(new Rectangle(65, 0, 200, 160));
     168                panelHaz.setBounds(new Rectangle(65, 0, 185, 160));
    178169                panelHaz.setVisible(false);
    179170                panelSpec = new PanelSpec(dlg);
    180                 panelSpec.setBounds(new Rectangle(65, 0, 200, 160));
     171                panelSpec.setBounds(new Rectangle(65, 0, 185, 160));
    181172                panelSpec.setVisible(false);
    182173                panelLights = new PanelLights(dlg);
    183                 panelLights.setBounds(new Rectangle(65, 0, 200, 160));
     174                panelLights.setBounds(new Rectangle(65, 0, 185, 160));
    184175                panelLights.setVisible(false);
    185176                panelMore = new PanelMore(dlg);
     
    198189                panelLit.setBounds(new Rectangle(40, 165, 360, 160));
    199190                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);
    228191
    229192                this.add(getButton(chanButton, 0, 0, 62, 40, "Chan"), null);
     
    281244
    282245                moreButton = new JButton();
    283                 moreButton.setBounds(new Rectangle(350, 145, 40, 15));
     246                moreButton.setBounds(new Rectangle(190, 145, 40, 15));
    284247                moreButton.setMargin(new Insets(0, 0, 0, 0));
    285248                moreButton.setText("v v v");
     
    321284                panelRadar.setVisible(false);
    322285                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);
    332286                nameBox.setEnabled(false);
    333287                if (dlg.mark != null) {
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java

    r27118 r27189  
    4040        private ActionListener alHeight = new ActionListener() {
    4141                public void actionPerformed(java.awt.event.ActionEvent e) {
    42                         dlg.mark.setHeight(heightBox.getText());
     42                        dlg.mark.setObjectHeight(heightBox.getText());
    4343                }
    4444        };
     
    307307                regionCButton.setBorderPainted(dlg.mark.getRegion() == Reg.C);
    308308                elevBox.setText(dlg.mark.getElevation());
    309                 heightBox.setText(dlg.mark.getHeight());
     309                heightBox.setText(dlg.mark.getObjectHeight());
    310310                sourceBox.setText(dlg.mark.getSource());
    311311                infoBox.setText(dlg.mark.getInfo());
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java

    r27112 r27189  
    8484                                dlg.panelMain.panelChan.lightButton.setVisible(false);
    8585                        }
    86                         dlg.mark.paintSign();
    8786                }
    8887        };
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java

    r27060 r27189  
    3131                        }
    3232                        syncPanel();
    33                         dlg.mark.paintSign();
    3433                }
    3534        };
     
    3938                public void actionPerformed(java.awt.event.ActionEvent e) {
    4039                        dlg.mark.setRaconGroup(groupBox.getText());
    41                         dlg.mark.paintSign();
    4240                }
    4341        };
     
    4745                public void actionPerformed(java.awt.event.ActionEvent e) {
    4846                        dlg.mark.setRaconPeriod(periodBox.getText());
    49                         dlg.mark.paintSign();
    5047                }
    5148        };
     
    5552                public void actionPerformed(java.awt.event.ActionEvent e) {
    5653                        dlg.mark.setRaconSequence(seqBox.getText());
    57                         dlg.mark.paintSign();
    5854                }
    5955        };
     
    6359                public void actionPerformed(java.awt.event.ActionEvent e) {
    6460                        dlg.mark.setRaconRange(rangeBox.getText());
    65                         dlg.mark.paintSign();
    6661                }
    6762        };
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java

    r27054 r27189  
    4242                        }
    4343                        dlg.panelMain.panelMore.syncPanel();
    44                         dlg.mark.paintSign();
    4544                }
    4645        };
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java

    r27118 r27189  
    6363                        topmarkButton.setVisible(dlg.mark.testValid());
    6464                        dlg.panelMain.panelMore.syncPanel();
    65                         dlg.mark.paintSign();
    6665                }
    6766        };
     
    8180                        }
    8281                        dlg.panelMain.panelTop.syncPanel();
    83                         dlg.mark.paintSign();
    8482                }
    8583        };
     
    9088                this.setLayout(null);
    9189                this.add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYSPP), null);
    92                 this.add(getShapeButton(sparButton, 35, 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, 105, 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);
    9593                this.add(getShapeButton(sphereButton, 0, 32, 34, 32, "Sphere", Shp.SPHERE, Obj.BOYSPP), null);
    96                 this.add(getShapeButton(barrelButton, 35, 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, 105, 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);
    9997                this.add(getShapeButton(beaconButton, 0, 64, 34, 32, "Beacon", Shp.BEACON, Obj.BCNSPP), null);
    100                 this.add(getShapeButton(towerButton, 35, 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, 105, 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);
    103101
    104102                categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER);
    105                 categoryLabel.setBounds(new Rectangle(5, 100, 170, 20));
     103                categoryLabel.setBounds(new Rectangle(5, 100, 160, 20));
    106104                this.add(categoryLabel, null);
    107105                categoryBox = new JComboBox();
    108                 categoryBox.setBounds(new Rectangle(5, 120, 170, 20));
     106                categoryBox.setBounds(new Rectangle(5, 120, 160, 20));
    109107                this.add(categoryBox, null);
    110108                categoryBox.addActionListener(alCategoryBox);
     
    128126                addCatItem(Messages.getString("Anchorage"), Cat.SPM_ANCH);
    129127
    130                 topmarkButton.setBounds(new Rectangle(140, 0, 34, 32));
     128                topmarkButton.setBounds(new Rectangle(136, 0, 34, 32));
    131129                topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder());
    132130                topmarkButton.addActionListener(alTop);
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java

    r27112 r27189  
    8484                                dlg.panelMain.panelChan.lightButton.setVisible(false);
    8585                        }
    86                         dlg.mark.paintSign();
    8786                }
    8887        };
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java

    r26998 r27189  
    4545                        }
    4646                        mooringTopButton.setBorderPainted(mooringTopButton.isSelected());
    47                         dlg.mark.paintSign();
    4847                }
    4948        };
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r27155 r27189  
    11package oseam.seamarks;
    22
     3import javax.swing.*;
     4
    35import java.awt.*;
    4 import javax.swing.*;
     6import java.awt.geom.Arc2D;
     7
    58import java.util.*;
    69
     
    1215import oseam.dialogs.OSeaMAction;
    1316
    14 public class SeaMark {
     17public class SeaMark extends JPanel {
    1518
    1619        public OSeaMAction dlg = null;
     
    5154        public void setName(String str) {
    5255                name = str.trim();
     56                repaint();
    5357        }
    5458
     
    97101        public void setObject(Obj obj) {
    98102                object = obj;
     103                repaint();
    99104        }
    100105
     
    266271        public void setCategory(Cat cat) {
    267272                category = cat;
     273                repaint();
    268274        }
    269275
     
    299305        public void setShape(Shp shp) {
    300306                shape = shp;
     307                repaint();
    301308        }
    302309
     
    387394                bodyColour.clear();
    388395                bodyColour.add(col);
     396                repaint();
    389397        }
    390398
     
    392400                if (bodyColour.size() > i)
    393401                        bodyColour.set(i, col);
     402                repaint();
    394403        }
    395404
     
    420429                topmarkColour.clear();
    421430                topmarkColour.add(col);
     431                repaint();
    422432        }
    423433
     
    425435                if (topmarkColour.size() > i)
    426436                        topmarkColour.set(i, col);
     437                repaint();
    427438        }
    428439
     
    583594                                sectors.get(i)[att] = obj;
    584595                        }
     596                repaint();
    585597        }
    586598
     
    689701        public void setTopmark(Top top) {
    690702                topShape = top;
     703                repaint();
    691704        }
    692705
     
    710723        public void setRadar(Rtb type) {
    711724                RaType = type;
     725                repaint();
    712726        }
    713727
     
    720734        public void setRaconGroup(String grp) {
    721735                raconGroup = grp;
     736                repaint();
    722737        }
    723738
     
    730745        public void setRaconSequence(String seq) {
    731746                raconSequence = seq;
     747                repaint();
    732748        }
    733749
     
    740756        public void setRaconPeriod(String per) {
    741757                raconPeriod = validDecimal(per);
     758                repaint();
    742759        }
    743760
     
    750767        public void setRaconRange(String rng) {
    751768                raconRange = validDecimal(rng);
     769                repaint();
    752770        }
    753771
     
    760778        public void setRaconSector1(String sec) {
    761779                raconSector1 = validDecimal(sec);
     780                repaint();
    762781        }
    763782
     
    770789        public void setRaconSector2(String sec) {
    771790                raconSector2 = validDecimal(sec);
     791                repaint();
    772792        }
    773793
     
    796816        public void setFogSound(Fog sound) {
    797817                fogSound = sound;
     818                repaint();
    798819        }
    799820
     
    806827        public void setFogGroup(String grp) {
    807828                fogGroup = grp;
     829                repaint();
    808830        }
    809831
     
    816838        public void setFogSequence(String seq) {
    817839                fogSequence = seq;
     840                repaint();
    818841        }
    819842
     
    826849        public void setFogRange(String rng) {
    827850                fogRange = validDecimal(rng);
     851                repaint();
    828852        }
    829853
     
    836860        public void setFogPeriod(String per) {
    837861                fogPeriod = validDecimal(per);
     862                repaint();
    838863        }
    839864
     
    964989        public String height = "";
    965990
    966         public String getHeight() {
     991        public String getObjectHeight() {
    967992                return height;
    968993        }
    969994
    970         public void setHeight(String str) {
     995        public void setObjectHeight(String str) {
    971996                height = validDecimal(str);
    972997        }
     
    10871112                dlg.panelMain.panelMore.syncPanel();
    10881113                dlg.panelMain.panelMore.setVisible(false);
    1089                 paintSign();
    10901114        }
    10911115
     
    11121136        }
    11131137
    1114         private boolean paintlock = false;
    1115 
    11161138        public void parseMark(Node node) {
    1117                 paintlock = true;
    11181139                dlg.manager.showVisualMessage("");
    11191140                String str = Main.pref.get("smedplugin.IALA");
     
    12241245
    12251246                        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"));
    12271248                        }
    12281249                        if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":elevation")) {
     
    15321553                }
    15331554                if (keys.containsKey("seamark:height")) {
    1534                         setHeight(keys.get("seamark:height"));
     1555                        setObjectHeight(keys.get("seamark:height"));
    15351556                }
    15361557                if (keys.containsKey("seamark:elevation")) {
     
    15921613                dlg.panelMain.syncPanel();
    15931614
    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;
    16141623                String lblStr;
    16151624                String imgStr = "/images/";
     
    17321741                                                System.out.println("Missing image: " + imgStr);
    17331742                                        } 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);
    17371745                                        }
    17381746                                } 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                                }
    17431749                        }
    17441750                } else if (getObject() != Obj.UNKNOWN) {
     
    18051811                                        System.out.println("Missing image: " + imgStr);
    18061812                                } 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                                }
    18111815                        }
    18121816                }
     
    19141918                                        return;
    19151919                                } else {
    1916                                         dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(imgStr)));
     1920                                        g.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
    19171921                                }
    19181922                        } 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);
    19232006                }
    19242007
    19252008                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);
    19272010                        String str = "";
    19282011                        if (getFogSound() != Fog.UNKNOWN)
     
    19562039                        if (!getFogPeriod().isEmpty())
    19572040                                str += getFogPeriod() + "s";
    1958                         dlg.panelMain.fogLabel.setText(str);
     2041                        g.drawString(str, 0, 70);
    19592042                }
    19602043
    19612044                if (RaType != Rtb.NONE) {
    19622045                        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);
    19642047                        } 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);
    19662049                                String str = "";
    19672050                                if (getRadar() == Rtb.RAMARK)
     
    19752058                                if (!getRaconPeriod().isEmpty())
    19762059                                        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
    20512064        }
    20522065
     
    21032116                                        }
    21042117                                }
    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()));
    21072120                                }
    21082121                                if (!getElevation().isEmpty()) {
Note: See TracChangeset for help on using the changeset viewer.