Changeset 26988 in osm for applications/editors


Ignore:
Timestamp:
2011-10-29T15:36:25+02:00 (13 years ago)
Author:
malcolmh
Message:

save

Location:
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java

    r26978 r26988  
    6868                                }
    6969                        }
    70                         syncButtons();
     70                        syncPanel();
    7171                }
    7272        };
     
    7777                                if (topmarkButton.isSelected()) {
    7878                                        if (SeaMark.GrpMAP.get(dlg.mark.getObject()) == Grp.SAW) {
    79                                                 dlg.panelMain.panelTop.sphereTopButton.doClick();
    80                                                 dlg.panelMain.panelTop.panelPat.noneButton.doClick();
    81                                                 dlg.panelMain.panelTop.panelPat.panelCol.redButton.doClick();
     79                                                dlg.mark.setTopmark(Top.SPHERE);
     80                                                dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE);
     81                                                dlg.mark.setColour(Ent.TOPMARK, Col.RED);
    8282                                        } else {
    8383                                                switch (dlg.mark.getCategory()) {
    8484                                                case LAM_PORT:
    8585                                                case LAM_PPORT:
    86                                                         dlg.panelMain.panelTop.canTopButton.doClick();
     86                                                        dlg.mark.setTopmark(Top.CAN);
    8787                                                        switch (dlg.mark.getRegion()) {
    8888                                                        case A:
    89                                                                 dlg.panelMain.panelTop.panelPat.noneButton.doClick();
    90                                                                 dlg.panelMain.panelTop.panelPat.panelCol.redButton.doClick();
     89                                                                dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE);
     90                                                                dlg.mark.setColour(Ent.TOPMARK, Col.RED);
    9191                                                                break;
    9292                                                        case B:
    93                                                                 dlg.panelMain.panelTop.panelPat.noneButton.doClick();
    94                                                                 dlg.panelMain.panelTop.panelPat.panelCol.greenButton.doClick();
     93                                                                dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE);
     94                                                                dlg.mark.setColour(Ent.TOPMARK, Col.GREEN);
    9595                                                                break;
    9696                                                        case C:
    97                                                                 dlg.panelMain.panelTop.panelPat.horizButton.doClick();
    98                                                                 dlg.panelMain.panelTop.panelPat.panelCol.redButton.doClick();
    99                                                                 dlg.panelMain.panelTop.panelPat.panelCol.addButton.doClick();
    100                                                                 dlg.panelMain.panelTop.panelPat.panelCol.whiteButton.doClick();
     97                                                                dlg.mark.setPattern(Ent.TOPMARK, Pat.HORIZ);
     98                                                                dlg.mark.setColour(Ent.TOPMARK, Col.RED);
     99                                                                dlg.mark.addColour(Ent.TOPMARK, Col.WHITE);
    101100                                                                break;
    102101                                                        }
     
    107106                                                        switch (dlg.mark.getRegion()) {
    108107                                                        case A:
    109                                                                 dlg.panelMain.panelTop.panelPat.noneButton.doClick();
    110                                                                 dlg.panelMain.panelTop.panelPat.panelCol.greenButton.doClick();
     108                                                                dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE);
     109                                                                dlg.mark.setColour(Ent.TOPMARK, Col.GREEN);
    111110                                                                break;
    112111                                                        case B:
    113                                                                 dlg.panelMain.panelTop.panelPat.noneButton.doClick();
    114                                                                 dlg.panelMain.panelTop.panelPat.panelCol.redButton.doClick();
     112                                                                dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE);
     113                                                                dlg.mark.setColour(Ent.TOPMARK, Col.RED);
    115114                                                                break;
    116115                                                        case C:
    117                                                                 dlg.panelMain.panelTop.panelPat.horizButton.doClick();
    118                                                                 dlg.panelMain.panelTop.panelPat.panelCol.greenButton.doClick();
    119                                                                 dlg.panelMain.panelTop.panelPat.panelCol.addButton.doClick();
    120                                                                 dlg.panelMain.panelTop.panelPat.panelCol.whiteButton.doClick();
     116                                                                dlg.mark.setPattern(Ent.TOPMARK, Pat.HORIZ);
     117                                                                dlg.mark.setColour(Ent.TOPMARK, Col.GREEN);
     118                                                                dlg.mark.addColour(Ent.TOPMARK, Col.WHITE);
    121119                                                                break;
    122120                                                        }
     
    126124                                        topmarkButton.setBorderPainted(true);
    127125                                } else {
     126                                        dlg.mark.setTopmark(Top.NONE);
     127                                        dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE);
     128                                        dlg.mark.setColour(Ent.TOPMARK, Col.UNKNOWN);
    128129                                        topmarkButton.setBorderPainted(false);
    129130                                }
     131                                dlg.panelMain.panelTop.syncPanel();
    130132                                dlg.mark.paintSign();
    131133                        }
     
    161163        }
    162164       
    163         public void syncButtons() {
     165        public void syncPanel() {
    164166                if (portButton.isSelected()) {
    165167                        portButton.setBorderPainted(true);
     
    210212                        dlg.panelMain.moreButton.setVisible(false);
    211213                }
    212                 panelPort.syncButtons();
    213                 panelStbd.syncButtons();
    214                 panelSaw.syncButtons();
     214                topmarkButton.setBorderPainted(topmarkButton.isSelected());
     215                topmarkButton.setVisible(dlg.mark.isValid());
     216                panelPort.syncPanel();
     217                panelStbd.syncPanel();
     218                panelSaw.syncPanel();
    215219
    216220        }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java

    r26978 r26988  
    137137                        if (dlg.mark != null) {
    138138                                if (topmarkButton.isSelected()) {
    139                                         dlg.panelMain.panelTop.panelPat.noneButton.doClick();
    140                                         dlg.panelMain.panelTop.panelPat.panelCol.blackButton.doClick();
     139                                        dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE);
     140                                        dlg.mark.setColour(Ent.TOPMARK, Col.BLACK);
    141141                                        switch (dlg.mark.getCategory()) {
    142142                                        case CAM_NORTH:
    143                                                 dlg.panelMain.panelTop.northTopButton.doClick();
     143                                                dlg.mark.setTopmark(Top.NORTH);
    144144                                                break;
    145145                                        case CAM_SOUTH:
    146                                                 dlg.panelMain.panelTop.southTopButton.doClick();
     146                                                dlg.mark.setTopmark(Top.SOUTH);
    147147                                                break;
    148148                                        case CAM_EAST:
    149                                                 dlg.panelMain.panelTop.eastTopButton.doClick();
     149                                                dlg.mark.setTopmark(Top.EAST);
    150150                                                break;
    151151                                        case CAM_WEST:
    152                                                 dlg.panelMain.panelTop.westTopButton.doClick();
     152                                                dlg.mark.setTopmark(Top.WEST);
    153153                                                break;
    154154                                        default:
    155                                                 dlg.panelMain.panelTop.spheres2TopButton.doClick();
     155                                                dlg.mark.setTopmark(Top.SPHERES2);
    156156                                                break;
    157157                                        }
    158158                                        topmarkButton.setBorderPainted(true);
    159159                                } else {
     160                                        dlg.mark.setTopmark(Top.NONE);
     161                                        dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE);
     162                                        dlg.mark.setColour(Ent.TOPMARK, Col.UNKNOWN);
    160163                                        topmarkButton.setBorderPainted(false);
    161164                                }
     165                                dlg.panelMain.panelTop.syncPanel();
     166                                dlg.mark.paintSign();
    162167                        }
    163168                }
     
    188193        }
    189194
    190         public void syncButtons() {
     195        public void syncPanel() {
    191196                northButton.setBorderPainted(dlg.mark.getCategory() == Cat.CAM_NORTH);
    192197                southButton.setBorderPainted(dlg.mark.getCategory() == Cat.CAM_SOUTH);
     
    201206                                button.setBorderPainted(false);
    202207                }
    203                 if (dlg.mark.isValid()) {
    204                         topmarkButton.setVisible(true);
    205                         dlg.panelMain.moreButton.setVisible(true);
    206                 } else {
    207                         topmarkButton.setVisible(false);
    208                         dlg.panelMain.moreButton.setVisible(false);
    209                 }
     208                topmarkButton.setBorderPainted(topmarkButton.isSelected());
     209                topmarkButton.setVisible(dlg.mark.isValid());
    210210        }
    211211
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java

    r26977 r26988  
    1919        public JLabel radarIcon = null;
    2020        public JLabel fogIcon = null;
     21        public JLabel colLabel = null;
    2122        public JLabel nameLabel = null;
    2223        public JTextField nameBox = null;
     
    9495                fogIcon.setBounds(new Rectangle(235, 0, 150, 185));
    9596                this.add(fogIcon, null);
     97                colLabel = new JLabel("", SwingConstants.CENTER);
     98                colLabel.setBounds(new Rectangle(235, 100, 150, 20));
     99                this.add(colLabel, null);
    96100
    97101                this.add(getButton(chanButton, 0, 0, 62, 40, "Chan"), null);
     
    274278        }
    275279
    276         public void syncButtons() {
     280        public void syncPanel() {
    277281                if (dlg.mark == null) {
    278282                        topButton.setEnabled(false);
     
    299303                alType.actionPerformed(null);
    300304                alMisc.actionPerformed(null);
    301                 dlg.panelMain.panelChan.syncButtons();
    302                 dlg.panelMain.panelHaz.syncButtons();
    303                 dlg.panelMain.panelMore.syncButtons();
     305                dlg.panelMain.panelChan.syncPanel();
     306                dlg.panelMain.panelHaz.syncPanel();
     307                dlg.panelMain.panelSpec.syncPanel();
     308                dlg.panelMain.panelMore.setVisible(false);
     309                dlg.panelMain.panelMore.syncPanel();
     310                dlg.panelMain.panelTop.syncPanel();
     311                moreButton.setVisible(dlg.mark.isValid());
    304312        }
    305313
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java

    r26977 r26988  
    301301                }
    302302       
    303         public void syncButtons() {
    304                 panelPat.syncButtons();
     303        public void syncPanel() {
     304                panelPat.syncPanel();
     305                regionAButton.setBorderPainted(dlg.mark.getRegion() == Reg.A);
     306                regionBButton.setBorderPainted(dlg.mark.getRegion() == Reg.B);
     307                regionCButton.setBorderPainted(dlg.mark.getRegion() == Reg.C);
     308                elevBox.setText(dlg.mark.getElevation());
     309                heightBox.setText(dlg.mark.getHeight());
     310                sourceBox.setText(dlg.mark.getSource());
     311                infoBox.setText(dlg.mark.getInfo());
     312                statusBox.setSelectedIndex(0);
     313                for (Sts sts : statuses.keySet()) {
     314                        int item = statuses.get(sts);
     315                        if (dlg.mark.getStatus() == sts)
     316                                statusBox.setSelectedIndex(item);
     317                }
     318                constrBox.setSelectedIndex(0);
     319                for (Cns cns : constructions.keySet()) {
     320                        int item = constructions.get(cns);
     321                        if (dlg.mark.getConstr() == cns)
     322                                constrBox.setSelectedIndex(item);
     323                }
     324                visBox.setSelectedIndex(0);
     325                for (Vis vis : visibilities.keySet()) {
     326                        int item = visibilities.get(vis);
     327                        if (dlg.mark.getVis() == vis)
     328                                visBox.setSelectedIndex(item);
     329                }
     330                reflBox.setSelectedIndex(0);
     331                for (Vis vis : reflectivities.keySet()) {
     332                        int item = reflectivities.get(vis);
     333                        if (dlg.mark.getRvis() == vis)
     334                                reflBox.setSelectedIndex(item);
     335                }
    305336        }
    306337
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPat.java

    r26977 r26988  
    7272        }
    7373
    74         public void syncButtons() {
     74        public void syncPanel() {
    7575                for (Pat pat : patterns.keySet()) {
    7676                        JRadioButton button = patterns.get(pat);
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java

    r26978 r26988  
    114114        }
    115115
    116         public void syncButtons() {
     116        public void syncPanel() {
    117117                for (Shp shp : shapes.keySet()) {
    118118                        JRadioButton button = shapes.get(shp);
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java

    r26978 r26988  
    6767        }
    6868
    69         public void syncButtons() {
     69        public void syncPanel() {
    7070                for (Shp shp : shapes.keySet()) {
    7171                        JRadioButton button = shapes.get(shp);
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java

    r26970 r26988  
    2525                                        dlg.mark.setCategory(cat);
    2626                        }
    27                         checkValidity();
    2827                }
    2928        };
     
    5150                                        dlg.mark.setShape(shp);
    5251                                        dlg.mark.setObject(objects.get(shp));
    53                                         if ((button == cairnButton) && !(dlg.panelMain.panelMore.panelPat.panelCol.delButton.isSelected()))
    54                                                 dlg.panelMain.panelMore.panelPat.panelCol.delButton.doClick();
     52                                        if ((button == cairnButton) && !(dlg.panelMain.panelMore.panelPat.panelCol.delButton.isSelected())) {
     53                                                dlg.mark.setPattern(Ent.BODY, Pat.NONE);
     54                                                dlg.mark.setColour(Ent.BODY, Col.UNKNOWN);
     55                                        }
    5556                                        button.setBorderPainted(true);
    5657                                } else
    5758                                        button.setBorderPainted(false);
    5859                        }
    59                         checkValidity();
    60                 }
     60                        if ((dlg.mark.getObject() != Obj.UNKNOWN) && (dlg.mark.getShape() != Shp.UNKNOWN)) {
     61                                dlg.panelMain.topButton.setEnabled(true);
     62                                dlg.panelMain.fogButton.setEnabled(true);
     63                                dlg.panelMain.radButton.setEnabled(true);
     64                                dlg.panelMain.litButton.setEnabled(true);
     65                                dlg.panelMain.moreButton.setVisible(true);
     66                        } else {
     67                                dlg.panelMain.topButton.setEnabled(false);
     68                                dlg.panelMain.fogButton.setEnabled(false);
     69                                dlg.panelMain.radButton.setEnabled(false);
     70                                dlg.panelMain.litButton.setEnabled(false);
     71                                dlg.panelMain.moreButton.setVisible(false);
     72                        }
     73                        dlg.panelMain.panelMore.syncPanel();
     74                        dlg.mark.paintSign()
     75;               }
    6176        };
    6277
     
    104119        }
    105120
    106         private void checkValidity() {
    107                 if (dlg.mark != null) {
    108                         if ((dlg.mark.getObject() != Obj.UNKNOWN) && (dlg.mark.getShape() != Shp.UNKNOWN)) {
    109                                 dlg.panelMain.topButton.setEnabled(true);
    110                                 dlg.panelMain.fogButton.setEnabled(true);
    111                                 dlg.panelMain.radButton.setEnabled(true);
    112                                 dlg.panelMain.litButton.setEnabled(true);
    113                                 dlg.panelMain.moreButton.setVisible(true);
    114                         } else {
    115                                 dlg.panelMain.topButton.setEnabled(false);
    116                                 dlg.panelMain.fogButton.setEnabled(false);
    117                                 dlg.panelMain.radButton.setEnabled(false);
    118                                 dlg.panelMain.litButton.setEnabled(false);
    119                                 dlg.panelMain.moreButton.setVisible(false);
    120                         }
     121        public void syncPanel() {
     122                for (Shp shp : shapes.keySet()) {
     123                        JRadioButton button = shapes.get(shp);
     124                        if (dlg.mark.getShape() == shp) {
     125                                button.setBorderPainted(true);
     126                        } else
     127                                button.setBorderPainted(false);
     128                }
     129                categoryBox.setSelectedIndex(0);
     130                for (Cat cat : categories.keySet()) {
     131                        int item = categories.get(cat);
     132                        if (dlg.mark.getCategory() == cat)
     133                                categoryBox.setSelectedIndex(item);
    121134                }
    122135        }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java

    r26978 r26988  
    114114        }
    115115
    116         public void syncButtons() {
     116        public void syncPanel() {
    117117                for (Shp shp : shapes.keySet()) {
    118118                        JRadioButton button = shapes.get(shp);
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java

    r26978 r26988  
    44import java.awt.event.*;
    55import javax.swing.*;
     6
    67import java.util.*;
    78
     
    5455                this.setLayout(null);
    5556                panelPat = new PanelPat(dlg, Ent.TOPMARK);
    56                 panelPat.setBounds(new Rectangle(0, 0, 110, 160));
     57                panelPat.setBounds(new Rectangle(160, 0, 110, 160));
    5758                this.add(panelPat, null);
    58                 this.add(getTopButton(noTopButton, 110, 5, 27, 27, "NoTop", Top.NONE), null);
    59                 this.add(getTopButton(canTopButton, 140, 5, 27, 27, "CanTop", Top.CAN), null);
    60                 this.add(getTopButton(coneTopButton, 170, 5, 27, 27, "ConeTop", Top.CONE), null);
    61                 this.add(getTopButton(sphereTopButton, 200, 5, 27, 27, "SphereTop", Top.SPHERE), null);
    62                 this.add(getTopButton(XTopButton, 230, 5, 27, 27, "XTop", Top.X_SHAPE), null);
    63                 this.add(getTopButton(northTopButton, 110, 35, 27, 27, "NorthTop", Top.NORTH), null);
    64                 this.add(getTopButton(southTopButton, 140, 35, 27, 27, "SouthTop", Top.SOUTH), null);
    65                 this.add(getTopButton(eastTopButton, 170, 35, 27, 27, "EastTop", Top.EAST), null);
    66                 this.add(getTopButton(westTopButton, 200, 35, 27, 27, "WestTop", Top.WEST), null);
    67                 this.add(getTopButton(spheres2TopButton, 230, 35, 27, 27, "Spheres2Top", Top.SPHERES2), null);
    68                 this.add(getTopButton(boardDayButton, 110, 65, 27, 27, "BoardDay", Top.BOARD), null);
    69                 this.add(getTopButton(diamondDayButton, 140, 65, 27, 27, "DiamondDay", Top.DIAMOND), null);
    70                 this.add(getTopButton(triangleDayButton, 170, 65, 27, 27, "TriangleDay", Top.TRIANGLE), null);
    71                 this.add(getTopButton(triangleInvDayButton, 200, 65, 27, 27, "TriangleInvDay", Top.TRIANGLE_INV), null);
    72                 this.add(getTopButton(squareDayButton, 230, 65, 27, 27, "SquareDay", Top.SQUARE), null);
    73                 this.add(getTopButton(circleDayButton, 230, 95, 27, 27, "CircleDay", Top.CIRCLE), null);
    74                 this.add(getMoorButton(mooringTopButton, 110, 95, 27, 27, "MooringTop"), null);
     59                this.add(getTopButton(noTopButton, 0, 5, 27, 27, "NoTop", Top.NONE), null);
     60                this.add(getTopButton(canTopButton, 30, 5, 27, 27, "CanTop", Top.CAN), null);
     61                this.add(getTopButton(coneTopButton, 60, 5, 27, 27, "ConeTop", Top.CONE), null);
     62                this.add(getTopButton(sphereTopButton, 90, 5, 27, 27, "SphereTop", Top.SPHERE), null);
     63                this.add(getTopButton(XTopButton, 120, 5, 27, 27, "XTop", Top.X_SHAPE), null);
     64                this.add(getTopButton(northTopButton, 0, 35, 27, 27, "NorthTop", Top.NORTH), null);
     65                this.add(getTopButton(southTopButton, 30, 35, 27, 27, "SouthTop", Top.SOUTH), null);
     66                this.add(getTopButton(eastTopButton, 60, 35, 27, 27, "EastTop", Top.EAST), null);
     67                this.add(getTopButton(westTopButton, 90, 35, 27, 27, "WestTop", Top.WEST), null);
     68                this.add(getTopButton(spheres2TopButton, 120, 35, 27, 27, "Spheres2Top", Top.SPHERES2), null);
     69                this.add(getTopButton(boardDayButton, 0, 65, 27, 27, "BoardDay", Top.BOARD), null);
     70                this.add(getTopButton(diamondDayButton, 30, 65, 27, 27, "DiamondDay", Top.DIAMOND), null);
     71                this.add(getTopButton(triangleDayButton, 60, 65, 27, 27, "TriangleDay", Top.TRIANGLE), null);
     72                this.add(getTopButton(triangleInvDayButton, 90, 65, 27, 27, "TriangleInvDay", Top.TRIANGLE_INV), null);
     73                this.add(getTopButton(squareDayButton, 120, 65, 27, 27, "SquareDay", Top.SQUARE), null);
     74                this.add(getTopButton(circleDayButton, 120, 95, 27, 27, "CircleDay", Top.CIRCLE), null);
     75                this.add(getMoorButton(mooringTopButton, 0, 95, 27, 27, "MooringTop"), null);
    7576        }
    7677
     
    8081                }
    8182                mooringTopButton.setEnabled(state);
     83        }
     84       
     85        public void syncPanel() {
     86                for (Top top : tops.keySet()) {
     87                        JRadioButton button = tops.get(top);
     88                        if (dlg.mark.getTopmark() == top) {
     89                                button.setBorderPainted(true);
     90                        } else
     91                                button.setBorderPainted(false);
     92                }
     93                panelPat.syncPanel();
    8294        }
    8395
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r26978 r26988  
    562562
    563563        public enum Fog {
    564                 UNKNOWN, HORN, SIREN, DIA, BELL, WHIS, GONG, EXPLOS
    565         }
    566 
    567         private Fog FogSound = Fog.UNKNOWN;
     564                NONE, UNKNOWN, HORN, SIREN, DIA, BELL, WHIS, GONG, EXPLOS
     565        }
     566
     567        public static final EnumMap<Fog, String> FogSTR = new EnumMap<Fog, String>(Fog.class);
     568        static {
     569                FogSTR.put(Fog.UNKNOWN, "yes");
     570                FogSTR.put(Fog.HORN, "horn");
     571                FogSTR.put(Fog.SIREN, "siren");
     572                FogSTR.put(Fog.DIA, "diaphone");
     573                FogSTR.put(Fog.BELL, "bell");
     574                FogSTR.put(Fog.WHIS, "whistle");
     575                FogSTR.put(Fog.GONG, "gong");
     576                FogSTR.put(Fog.EXPLOS, "explosion");
     577        }
     578
     579        private Fog FogSound = Fog.NONE;
    568580
    569581        public Fog getFogSound() {
     
    581593        }
    582594
    583         public void setFogGroup(String group) {
    584                 FogGroup = group;
     595        public void setFogGroup(String grp) {
     596                FogGroup = grp;
     597        }
     598
     599        private String FogSequence = "";
     600
     601        public String getFogSequence() {
     602                return FogSequence;
     603        }
     604
     605        public void setFogSequence(String seq) {
     606                FogSequence = seq;
     607        }
     608
     609        private String FogRange = "";
     610
     611        public String getFogRange() {
     612                return FogRange;
     613        }
     614
     615        public void setFogRange(String rng) {
     616                FogRange = validDecimal(rng);
    585617        }
    586618
     
    591623        }
    592624
    593         public void setFogPeriod(String period) {
    594                 FogPeriod = period;
     625        public void setFogPeriod(String per) {
     626                FogPeriod = validDecimal(per);
    595627        }
    596628
     
    11521184                }
    11531185
    1154                 dlg.panelMain.syncButtons();
     1186                dlg.panelMain.syncPanel();
    11551187
    11561188                paintlock = false;
     
    11681200                dlg.panelMain.radarIcon.setIcon(null);
    11691201                dlg.panelMain.fogIcon.setIcon(null);
     1202                dlg.panelMain.colLabel.setText("");
    11701203
    11711204                String colStr;
     1205                String lblStr;
    11721206                String imgStr = "/images/";
    11731207                if (getShape() != Shp.UNKNOWN) {
     
    12171251                        }
    12181252                        colStr = imgStr;
     1253                        lblStr = "";
    12191254                        for (Col col : bodyColour) {
    12201255                                switch (col) {
    12211256                                case WHITE:
    12221257                                        colStr += "_White";
     1258                                        lblStr += "W";
    12231259                                        break;
    12241260                                case RED:
    12251261                                        colStr += "_Red";
     1262                                        lblStr += "R";
    12261263                                        break;
    12271264                                case ORANGE:
    12281265                                        colStr += "_Orange";
     1266                                        lblStr += "Or";
    12291267                                        break;
    12301268                                case AMBER:
    12311269                                        colStr += "_Amber";
     1270                                        lblStr += "Am";
    12321271                                        break;
    12331272                                case YELLOW:
    12341273                                        colStr += "_Yellow";
     1274                                        lblStr += "Y";
    12351275                                        break;
    12361276                                case GREEN:
    12371277                                        colStr += "_Green";
     1278                                        lblStr += "G";
    12381279                                        break;
    12391280                                case BLUE:
    12401281                                        colStr += "_Blue";
     1282                                        lblStr += "Bu";
    12411283                                        break;
    12421284                                case VIOLET:
    12431285                                        colStr += "_Violet";
     1286                                        lblStr += "Vi";
    12441287                                        break;
    12451288                                case BLACK:
    12461289                                        colStr += "_Black";
     1290                                        lblStr += "B";
     1291                                        break;
     1292                                case GREY:
     1293                                        colStr += "_Grey";
     1294                                        lblStr += "Gr";
     1295                                        break;
     1296                                case BROWN:
     1297                                        colStr += "_Brown";
     1298                                        lblStr += "Br";
     1299                                        break;
     1300                                case MAGENTA:
     1301                                        colStr += "_Magenta";
     1302                                        lblStr += "Mg";
     1303                                        break;
     1304                                case PINK:
     1305                                        colStr += "_Pink";
     1306                                        lblStr += "Pk";
    12471307                                        break;
    12481308                                }
     
    12621322                                        if (getClass().getResource(imgStr) == null) {
    12631323                                                System.out.println("Missing image: " + imgStr);
    1264                                                 return;
    12651324                                        } else {
    12661325                                                dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(imgStr)));
     1326                                                dlg.panelMain.colLabel.setText(lblStr);
    12671327                                        }
    12681328                                } else {
     
    13001360                                if (getClass().getResource(imgStr) == null) {
    13011361                                        System.out.println("Missing image: " + imgStr);
    1302                                         return;
    13031362                                } else {
    13041363                                        dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(imgStr)));
Note: See TracChangeset for help on using the changeset viewer.