Ignore:
Timestamp:
2011-12-10T14:41:01+01:00 (13 years ago)
Author:
malcolmh
Message:

save

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

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java

    r27200 r27201  
    4040                                                node = null;
    4141                                                panelMain.mark.clearSign();
    42                                                 panelMain.syncPanel();
    4342                                                manager.showVisualMessage(Messages.getString("OneNode"));
    4443                                        }
     
    4847                                node = null;
    4948                                panelMain.mark.clearSign();
    50                                 panelMain.syncPanel();
    5149                                manager.showVisualMessage(Messages.getString("SelectNode"));
    5250                        }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java

    r27200 r27201  
    134134                        sectorButton.setBorderPainted(sectorButton.isSelected());
    135135                        if (sectorButton.isSelected()) {
    136                                 if (panelSector == null) {
    137                                         panelSector = new PanelSectors(dlg);
    138                                 }
    139136                                panelSector.setVisible(true);
    140137                        } else {
    141                                 if (panelSector != null) {
    142                                         panelSector.setVisible(false);
    143                                         panelSector = null;
    144                                 }
     138                                panelSector.setVisible(false);
    145139                                while (dlg.panelMain.mark.getSectorCount() > 1)
    146140                                        dlg.panelMain.mark.delLight(1);
     
    158152                this.add(panelChr, null);
    159153                this.add(panelCol, null);
     154                panelSector = new PanelSectors(dlg);
     155                panelSector.setVisible(false);
    160156
    161157                typeButtons = new ButtonGroup();
     
    285281
    286282        public void syncPanel() {
    287                 if (panelSector != null) {
    288                         panelSector.setVisible(false);
    289                         panelSector = null;
    290                 }
    291                 singleButton.setBorderPainted(false);
    292                 sectorButton.setBorderPainted(false);
    293283                orientationLabel.setVisible(false);
    294284                orientationBox.setVisible(false);
     
    319309                                exhibitionBox.setSelectedIndex(item);
    320310                }
     311                if (dlg.panelMain.mark.isSectored()) {
     312                        singleButton.setBorderPainted(false);
     313                        sectorButton.setBorderPainted(true);
     314                        panelSector.setVisible(true);
     315                } else {
     316                        singleButton.setBorderPainted(true);
     317                        sectorButton.setBorderPainted(false);
     318                        panelSector.setVisible(false);
     319                        while (dlg.panelMain.mark.getSectorCount() > 1)
     320                                dlg.panelMain.mark.delLight(dlg.panelMain.mark.getSectorCount() - 1);
     321                }
    321322                panelCol.syncPanel();
    322323                panelChr.syncPanel();
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSectors.java

    r27200 r27201  
    6868                this.getContentPane().add(panel);
    6969
    70                 table.setSize(860, ((table.getRowCount() * 16) + 18));
     70                table.setSize(860, ((table.getRowCount() * 16) + 20));
    7171                if (table.getRowCount() > 3) {
    72                         this.setSize(900, ((table.getRowCount() * 16) + 40));
     72                        this.setSize(900, ((table.getRowCount() * 16) + 42));
    7373                }
    7474               
     
    126126
    127127                public int getRowCount() {
    128                         return dlg.panelMain.mark.getSectorCount();
     128                        if (dlg.panelMain == null)
     129                                return 1;
     130                        else
     131                                return dlg.panelMain.mark.getSectorCount();
    129132                }
    130133
     
    258261        public void deleteSector(int idx) {
    259262                dlg.panelMain.mark.delLight(idx);
    260                 table.setSize(860, ((table.getRowCount() * 16) + 18));
     263                table.setSize(860, ((table.getRowCount() * 16) + 20));
    261264                if (table.getRowCount() > 3) {
    262                         this.setSize(900, ((table.getRowCount() * 16) + 40));
     265                        this.setSize(900, ((table.getRowCount() * 16) + 42));
    263266                } else {
    264267                        this.setSize(900, 100);
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r27200 r27201  
    2121        public SeaMark(OSeaMAction dia) {
    2222                dlg = dia;
     23                clrLight();
    2324        }
    2425
     
    101102        public void setObject(Obj obj) {
    102103                object = obj;
     104                if (obj == Obj.UNKNOWN) {
     105                        setCategory(Cat.NONE);
     106                        setShape(Shp.UNKNOWN);
     107                        setColour(Ent.BODY, Col.UNKNOWN);
     108                        setPattern(Ent.BODY, Pat.NONE);
     109                        setTopmark(Top.NONE);
     110                        setColour(Ent.TOPMARK, Col.UNKNOWN);
     111                        setPattern(Ent.TOPMARK, Pat.NONE);
     112                        setFogSound(Fog.NONE);
     113                        setRadar(Rtb.NONE);
     114                        setStatus(Sts.UNKNOWN);
     115                        setConstr(Cns.UNKNOWN);
     116                        setConsp(Con.UNKNOWN);
     117                        setRefl(Con.UNKNOWN);
     118                        setRef("");
     119                        setObjectHeight("");
     120                        setElevation("");
     121                        setInfo("");
     122                        setSource("");
     123                        setFixme("");
     124                }
    103125                repaint();
    104126        }
     
    559581        }
    560582
     583        public boolean isSectored() {
     584                return (sectors.size() > 1);
     585        }
     586
    561587        public Object getLightAtt(Att att, int i) {
    562588                return getLightAtt(att.ordinal(), i);
     
    619645
    620646        public void clrLight() {
    621                 delLight(0);
     647                sectors.clear();
    622648                addLight();
    623649        }
     
    723749        public void setRadar(Rtb type) {
    724750                RaType = type;
     751                if (type == Rtb.NONE) {
     752                        setRaconGroup("");
     753                        setRaconSequence("");
     754                        setRaconPeriod("");
     755                        setRaconRange("");
     756                        setRaconSector1("");
     757                        setRaconSector2("");
     758                }
    725759                repaint();
    726760        }
     
    816850        public void setFogSound(Fog sound) {
    817851                fogSound = sound;
     852                if (sound == Fog.NONE) {
     853                        setFogGroup("");
     854                        setFogSequence("");
     855                        setFogPeriod("");
     856                        setFogRange("");
     857                }
    818858                repaint();
    819859        }
     
    10941134        public void clearSign() {
    10951135                setObject(Obj.UNKNOWN);
    1096                 setCategory(Cat.NONE);
    1097                 setShape(Shp.UNKNOWN);
    1098                 setColour(Ent.BODY, Col.UNKNOWN);
    1099                 setPattern(Ent.BODY, Pat.NONE);
    1100                 setTopmark(Top.NONE);
    1101                 setColour(Ent.TOPMARK, Col.UNKNOWN);
    1102                 setPattern(Ent.TOPMARK, Pat.NONE);
    1103                 setFogSound(Fog.NONE);
    1104                 setRadar(Rtb.NONE);
     1136                setName("");
    11051137                clrLight();
    1106                 dlg.panelMain.moreButton.setVisible(false);
    1107                 dlg.panelMain.saveButton.setEnabled(false);
    1108                 dlg.panelMain.topButton.setEnabled(false);
    1109                 dlg.panelMain.fogButton.setEnabled(false);
    1110                 dlg.panelMain.radButton.setEnabled(false);
    1111                 dlg.panelMain.litButton.setEnabled(false);
    1112                 dlg.panelMain.panelMore.syncPanel();
    1113                 dlg.panelMain.panelMore.setVisible(false);
     1138                dlg.panelMain.syncPanel();
    11141139                repaint();
    11151140        }
Note: See TracChangeset for help on using the changeset viewer.