Changeset 26977 in osm for applications


Ignore:
Timestamp:
2011-10-28T13:51:21+02:00 (13 years ago)
Author:
malcolmh
Message:

save

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

Legend:

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

    r26970 r26977  
    202202                        panelSaw.setVisible(false);
    203203                }
     204                if (dlg.mark.isValid()) {
     205                        topmarkButton.setVisible(true);
     206                        dlg.panelMain.moreButton.setVisible(true);
     207                } else {
     208                        topmarkButton.setVisible(false);
     209                        dlg.panelMain.moreButton.setVisible(false);
     210                }
     211                panelPort.syncButtons();
     212                panelStbd.syncButtons();
     213                panelSaw.syncButtons();
    204214
    205215        }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java

    r26972 r26977  
    188188
    189189        public void syncButtons() {
    190                 northButton.setBorderPainted(northButton.isSelected());
    191                 southButton.setBorderPainted(southButton.isSelected());
    192                 eastButton.setBorderPainted(eastButton.isSelected());
    193                 westButton.setBorderPainted(westButton.isSelected());
    194                 isolButton.setBorderPainted(isolButton.isSelected());
     190                northButton.setBorderPainted(dlg.mark.getCategory() == Cat.CAM_NORTH);
     191                southButton.setBorderPainted(dlg.mark.getCategory() == Cat.CAM_SOUTH);
     192                eastButton.setBorderPainted(dlg.mark.getCategory() == Cat.CAM_EAST);
     193                westButton.setBorderPainted(dlg.mark.getCategory() == Cat.CAM_WEST);
     194                isolButton.setBorderPainted(dlg.mark.getCategory() == Cat.UNKNOWN);
     195                for (Shp shp : shapes.keySet()) {
     196                        JRadioButton button = shapes.get(shp);
     197                        if (dlg.mark.getShape() == shp) {
     198                                button.setBorderPainted(true);
     199                        } else
     200                                button.setBorderPainted(false);
     201                }
     202                if (dlg.mark.isValid()) {
     203                        topmarkButton.setVisible(true);
     204                        dlg.panelMain.moreButton.setVisible(true);
     205                } else {
     206                        topmarkButton.setVisible(false);
     207                        dlg.panelMain.moreButton.setVisible(false);
     208                }
    195209        }
    196210
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java

    r26970 r26977  
    258258                                        panelMore.setVisible(true);
    259259                                        moreButton.setText("^ ^ ^");
    260                                         if (topButton.isSelected())
     260                                        miscButtons.clearSelection();
    261261                                                panelTop.setVisible(false);
    262                                         if (radButton.isSelected())
     262                                                topButton.setBorderPainted(false);
    263263                                                panelRadar.setVisible(false);
    264                                         if (fogButton.isSelected())
     264                                                radButton.setBorderPainted(false);
    265265                                                panelFog.setVisible(false);
    266                                         if (litButton.isSelected())
     266                                                fogButton.setBorderPainted(false);
    267267                                                panelLit.setVisible(false);
     268                                                litButton.setBorderPainted(false);
    268269                                }
    269270                        }
     
    298299                alType.actionPerformed(null);
    299300                alMisc.actionPerformed(null);
     301                dlg.panelMain.panelChan.syncButtons();
     302                dlg.panelMain.panelHaz.syncButtons();
     303                dlg.panelMain.panelMore.syncButtons();
    300304        }
    301305
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java

    r26970 r26977  
    300300
    301301                }
     302       
     303        public void syncButtons() {
     304                panelPat.syncButtons();
     305        }
    302306
    303307        private void addStsItem(String str, Sts sts) {
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPat.java

    r26970 r26977  
    7272        }
    7373
     74        public void syncButtons() {
     75                for (Pat pat : patterns.keySet()) {
     76                        JRadioButton button = patterns.get(pat);
     77                        if (dlg.mark.getPattern(ent) == pat) {
     78                                button.setBorderPainted(true);
     79                        } else
     80                                button.setBorderPainted(false);
     81                }
     82                panelCol.syncStack();
     83        }
     84       
    7485        private JRadioButton getPatButton(JRadioButton button, int x, int y, int w, int h, String tip, Pat pat) {
    7586                button.setBounds(new Rectangle(x, y, w, h));
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java

    r26972 r26977  
    44import java.awt.event.*;
    55import javax.swing.*;
     6
    67import java.util.*;
    78
     
    112113        }
    113114
     115        public void syncButtons() {
     116                for (Shp shp : shapes.keySet()) {
     117                        JRadioButton button = shapes.get(shp);
     118                        if (dlg.mark.getShape() == shp) {
     119                                button.setBorderPainted(true);
     120                        } else
     121                                button.setBorderPainted(false);
     122                }
     123        }
     124       
    114125        private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
    115126                button.setBounds(new Rectangle(x, y, w, h));
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java

    r26972 r26977  
    44import java.awt.event.*;
    55import javax.swing.*;
     6
    67import java.util.*;
    78
     
    6566        }
    6667
     68        public void syncButtons() {
     69                for (Shp shp : shapes.keySet()) {
     70                        JRadioButton button = shapes.get(shp);
     71                        if (dlg.mark.getShape() == shp) {
     72                                button.setBorderPainted(true);
     73                        } else
     74                                button.setBorderPainted(false);
     75                }
     76        }
     77       
    6778        private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
    6879                button.setBounds(new Rectangle(x, y, w, h));
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java

    r26972 r26977  
    44import java.awt.event.*;
    55import javax.swing.*;
     6
    67import java.util.*;
    78
     
    112113        }
    113114
     115        public void syncButtons() {
     116                for (Shp shp : shapes.keySet()) {
     117                        JRadioButton button = shapes.get(shp);
     118                        if (dlg.mark.getShape() == shp) {
     119                                button.setBorderPainted(true);
     120                        } else
     121                                button.setBorderPainted(false);
     122                }
     123        }
     124       
    114125        private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
    115126                button.setBounds(new Rectangle(x, y, w, h));
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r26972 r26977  
    7474                ObjSTR.put(Obj.FLTLAT, "light_float");
    7575                ObjSTR.put(Obj.FLTSAW, "light_float");
     76                ObjSTR.put(Obj.FLTISD, "light_float");
    7677                ObjSTR.put(Obj.FLTSPP, "light_float");
    7778                ObjSTR.put(Obj.LITMAJ, "light_major");
     
    114115                EntMAP.put(Obj.LITMIN, Ent.LIGHT);
    115116                EntMAP.put(Obj.LITFLT, Ent.FLOAT);
     117                EntMAP.put(Obj.FLTCAR, Ent.FLOAT);
     118                EntMAP.put(Obj.FLTLAT, Ent.FLOAT);
     119                EntMAP.put(Obj.FLTSAW, Ent.FLOAT);
     120                EntMAP.put(Obj.FLTISD, Ent.FLOAT);
     121                EntMAP.put(Obj.FLTSPP, Ent.FLOAT);
    116122                EntMAP.put(Obj.LITVES, Ent.LIGHT);
    117123                EntMAP.put(Obj.LNDMRK, Ent.LIGHT);
     
    141147                GrpMAP.put(Obj.LITMIN, Grp.LIT);
    142148                GrpMAP.put(Obj.LITFLT, Grp.FLT);
     149                GrpMAP.put(Obj.FLTCAR, Grp.CAR);
     150                GrpMAP.put(Obj.FLTLAT, Grp.LAT);
     151                GrpMAP.put(Obj.FLTSAW, Grp.SAW);
     152                GrpMAP.put(Obj.FLTISD, Grp.ISD);
     153                GrpMAP.put(Obj.FLTSPP, Grp.SPP);
    143154                GrpMAP.put(Obj.LITVES, Grp.LIT);
    144155                GrpMAP.put(Obj.LNDMRK, Grp.LIT);
     
    879890                }
    880891
     892                if (getObject() == Obj.LITFLT) {
     893                        switch (getColour(Ent.BODY, 0)) {
     894                        case RED:
     895                                if ((getColour(Ent.BODY, 1) == Col.WHITE) && (getColour(Ent.BODY, 2) == Col.UNKNOWN)) {
     896                                        setObject(Obj.FLTSAW);
     897                                        setCategory(Cat.UNKNOWN);
     898                                } else if (getColour(Ent.BODY, 1) == Col.UNKNOWN) {
     899                                        setObject(Obj.FLTLAT);
     900                                        if (getRegion() == Reg.B) {
     901                                                setCategory(Cat.LAM_STBD);
     902                                        } else {
     903                                                setCategory(Cat.LAM_PORT);
     904                                        }
     905                                } else if ((getColour(Ent.BODY, 1) == Col.GREEN) && (getColour(Ent.BODY, 2) == Col.RED)) {
     906                                        setObject(Obj.FLTLAT);
     907                                        if (getRegion() == Reg.B) {
     908                                                setCategory(Cat.LAM_PSTBD);
     909                                        } else {
     910                                                setCategory(Cat.LAM_PPORT);
     911                                        }
     912                                } else if ((getColour(Ent.BODY, 1) == Col.WHITE) && (getColour(Ent.BODY, 2) == Col.RED)) {
     913                                        setObject(Obj.FLTLAT);
     914                                        setCategory(Cat.LAM_PORT);
     915                                } else {
     916                                        setObject(Obj.FLTSPP);
     917                                        setCategory(Cat.UNKNOWN);
     918                                }
     919                                break;
     920                        case GREEN:
     921                        if (getColour(Ent.BODY, 1) == Col.UNKNOWN) {
     922                                setObject(Obj.FLTLAT);
     923                                if (getRegion() == Reg.B) {
     924                                        setCategory(Cat.LAM_PORT);
     925                                } else {
     926                                        setCategory(Cat.LAM_STBD);
     927                                }
     928                        } else if ((getColour(Ent.BODY, 1) == Col.RED) && (getColour(Ent.BODY, 2) == Col.GREEN)) {
     929                                setObject(Obj.FLTLAT);
     930                                if (getRegion() == Reg.B) {
     931                                        setCategory(Cat.LAM_PPORT);
     932                                } else {
     933                                        setCategory(Cat.LAM_PSTBD);
     934                                }
     935                        } else if ((getColour(Ent.BODY, 1) == Col.WHITE) && (getColour(Ent.BODY, 2) == Col.GREEN)) {
     936                                setObject(Obj.FLTLAT);
     937                                setCategory(Cat.LAM_STBD);
     938                        } else {
     939                                setObject(Obj.FLTSPP);
     940                                setCategory(Cat.UNKNOWN);
     941                        }
     942                                break;
     943                        case YELLOW:
     944                                if (getColour(Ent.BODY, 1) == Col.BLACK) {
     945                                        setObject(Obj.FLTCAR);
     946                                        if (getColour(Ent.BODY, 2) == Col.YELLOW) {
     947                                                setCategory(Cat.CAM_WEST);
     948                                        } else {
     949                                                setCategory(Cat.CAM_SOUTH);
     950                                        }
     951                                } else {
     952                                        setObject(Obj.FLTSPP);
     953                                        setCategory(Cat.UNKNOWN);
     954                                }
     955                                break;
     956                        case BLACK:
     957                                if (getColour(Ent.BODY, 1) == Col.RED) {
     958                                        setObject(Obj.FLTISD);
     959                                        setCategory(Cat.UNKNOWN);
     960                                } else if (getColour(Ent.BODY, 1) == Col.YELLOW) {
     961                                        if (getColour(Ent.BODY, 2) == Col.BLACK) {
     962                                                setCategory(Cat.CAM_EAST);
     963                                        } else {
     964                                                setCategory(Cat.CAM_NORTH);
     965                                        }
     966                                } else {
     967                                        setObject(Obj.FLTSPP);
     968                                        setCategory(Cat.UNKNOWN);
     969                                }
     970                                break;
     971                                default:
     972                                        setObject(Obj.FLTSPP);
     973                                        setCategory(Cat.UNKNOWN);
     974                        }
     975                }
     976               
    881977                for (Obj obj : ObjSTR.keySet()) {
    882978                        if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":system")) {
     
    10651161               
    10661162                dlg.panelMain.syncButtons();
    1067                 dlg.panelMain.panelChan.syncButtons();
    1068                 dlg.panelMain.panelHaz.syncButtons();
    1069                 dlg.panelMain.panelMore.panelPat.panelCol.syncStack();
    10701163
    10711164                paintlock = false;
Note: See TracChangeset for help on using the changeset viewer.