Changeset 27023 in osm for applications
- Timestamp:
- 2011-11-07T10:00:56+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r26998 r27023 66 66 if (SeaMark.GrpMAP.get(dlg.mark.getObject()) == Grp.SAW) { 67 67 dlg.mark.setTopmark(Top.SPHERE); 68 dlg.mark.set Pattern(Ent.TOPMARK,Pat.NONE);69 dlg.mark.set Colour(Ent.TOPMARK,Col.RED);68 dlg.mark.setTopPattern(Pat.NONE); 69 dlg.mark.setTopColour(Col.RED); 70 70 } else { 71 71 switch (dlg.mark.getCategory()) { … … 75 75 switch (dlg.mark.getRegion()) { 76 76 case A: 77 dlg.mark.set Pattern(Ent.TOPMARK,Pat.NONE);78 dlg.mark.set Colour(Ent.TOPMARK,Col.RED);77 dlg.mark.setTopPattern(Pat.NONE); 78 dlg.mark.setTopColour(Col.RED); 79 79 break; 80 80 case B: 81 dlg.mark.set Pattern(Ent.TOPMARK,Pat.NONE);82 dlg.mark.set Colour(Ent.TOPMARK,Col.GREEN);81 dlg.mark.setTopPattern(Pat.NONE); 82 dlg.mark.setTopColour(Col.GREEN); 83 83 break; 84 84 case C: 85 dlg.mark.set Pattern(Ent.TOPMARK,Pat.HORIZ);86 dlg.mark.set Colour(Ent.TOPMARK,Col.RED);87 dlg.mark.add Colour(Ent.TOPMARK,Col.WHITE);85 dlg.mark.setTopPattern(Pat.HORIZ); 86 dlg.mark.setTopColour(Col.RED); 87 dlg.mark.addTopColour(Col.WHITE); 88 88 break; 89 89 } … … 94 94 switch (dlg.mark.getRegion()) { 95 95 case A: 96 dlg.mark.set Pattern(Ent.TOPMARK,Pat.NONE);97 dlg.mark.set Colour(Ent.TOPMARK,Col.GREEN);96 dlg.mark.setTopPattern(Pat.NONE); 97 dlg.mark.setTopColour(Col.GREEN); 98 98 break; 99 99 case B: 100 dlg.mark.set Pattern(Ent.TOPMARK,Pat.NONE);101 dlg.mark.set Colour(Ent.TOPMARK,Col.RED);100 dlg.mark.setTopPattern(Pat.NONE); 101 dlg.mark.setTopColour(Col.RED); 102 102 break; 103 103 case C: 104 dlg.mark.set Pattern(Ent.TOPMARK,Pat.HORIZ);105 dlg.mark.set Colour(Ent.TOPMARK,Col.GREEN);106 dlg.mark.add Colour(Ent.TOPMARK,Col.WHITE);104 dlg.mark.setTopPattern(Pat.HORIZ); 105 dlg.mark.setTopColour(Col.GREEN); 106 dlg.mark.addTopColour(Col.WHITE); 107 107 break; 108 108 } … … 113 113 } else { 114 114 dlg.mark.setTopmark(Top.NONE); 115 dlg.mark.set Pattern(Ent.TOPMARK,Pat.NONE);116 dlg.mark.set Colour(Ent.TOPMARK,Col.UNKNOWN);115 dlg.mark.setTopPattern(Pat.NONE); 116 dlg.mark.setTopColour(Col.UNKNOWN); 117 117 topmarkButton.setBorderPainted(false); 118 118 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r26998 r27023 42 42 if (dlg.mark != null) { 43 43 if (ent == Ent.LIGHT) { 44 dlg.mark.set Colour(ent, col);44 dlg.mark.setLightAtt(Att.COL, col); 45 45 button.setBorderPainted(true); 46 46 } else { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r26998 r27023 23 23 private ActionListener alCat = new ActionListener() { 24 24 public void actionPerformed(java.awt.event.ActionEvent e) { 25 dlg.mark.set Pattern(Ent.BODY,Pat.HORIZ);25 dlg.mark.setObjPattern(Pat.HORIZ); 26 26 if (northButton.isSelected()) { 27 27 dlg.mark.setCategory(Cat.CAM_NORTH); 28 dlg.mark.set Colour(Ent.BODY,Col.BLACK);29 dlg.mark.add Colour(Ent.BODY,Col.YELLOW);28 dlg.mark.setObjColour(Col.BLACK); 29 dlg.mark.addObjColour(Col.YELLOW); 30 30 northButton.setBorderPainted(true); 31 31 } else { … … 34 34 if (southButton.isSelected()) { 35 35 dlg.mark.setCategory(Cat.CAM_SOUTH); 36 dlg.mark.set Colour(Ent.BODY,Col.YELLOW);37 dlg.mark.add Colour(Ent.BODY,Col.BLACK);36 dlg.mark.setObjColour(Col.YELLOW); 37 dlg.mark.addObjColour(Col.BLACK); 38 38 southButton.setBorderPainted(true); 39 39 } else { … … 42 42 if (eastButton.isSelected()) { 43 43 dlg.mark.setCategory(Cat.CAM_EAST); 44 dlg.mark.set Colour(Ent.BODY,Col.BLACK);45 dlg.mark.add Colour(Ent.BODY,Col.YELLOW);46 dlg.mark.add Colour(Ent.BODY,Col.BLACK);44 dlg.mark.setObjColour(Col.BLACK); 45 dlg.mark.addObjColour(Col.YELLOW); 46 dlg.mark.addObjColour(Col.BLACK); 47 47 eastButton.setBorderPainted(true); 48 48 } else { … … 51 51 if (westButton.isSelected()) { 52 52 dlg.mark.setCategory(Cat.CAM_WEST); 53 dlg.mark.set Colour(Ent.BODY,Col.YELLOW);54 dlg.mark.add Colour(Ent.BODY,Col.BLACK);55 dlg.mark.add Colour(Ent.BODY,Col.YELLOW);53 dlg.mark.setObjColour(Col.YELLOW); 54 dlg.mark.addObjColour(Col.BLACK); 55 dlg.mark.addObjColour(Col.YELLOW); 56 56 westButton.setBorderPainted(true); 57 57 } else { … … 60 60 if (isolButton.isSelected()) { 61 61 dlg.mark.setCategory(Cat.NONE); 62 dlg.mark.set Colour(Ent.BODY,Col.BLACK);63 dlg.mark.add Colour(Ent.BODY,Col.RED);64 dlg.mark.add Colour(Ent.BODY,Col.BLACK);62 dlg.mark.setObjColour(Col.BLACK); 63 dlg.mark.addObjColour(Col.RED); 64 dlg.mark.addObjColour(Col.BLACK); 65 65 isolButton.setBorderPainted(true); 66 66 } else { … … 124 124 if (dlg.mark != null) { 125 125 if (topmarkButton.isSelected()) { 126 dlg.mark.set Pattern(Ent.TOPMARK,Pat.NONE);127 dlg.mark.set Colour(Ent.TOPMARK,Col.BLACK);126 dlg.mark.setTopPattern(Pat.NONE); 127 dlg.mark.setTopColour(Col.BLACK); 128 128 switch (dlg.mark.getCategory()) { 129 129 case CAM_NORTH: … … 146 146 } else { 147 147 dlg.mark.setTopmark(Top.NONE); 148 dlg.mark.set Pattern(Ent.TOPMARK,Pat.NONE);149 dlg.mark.set Colour(Ent.TOPMARK,Col.UNKNOWN);148 dlg.mark.setTopPattern(Pat.NONE); 149 dlg.mark.setTopColour(Col.UNKNOWN); 150 150 topmarkButton.setBorderPainted(false); 151 151 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r27017 r27023 21 21 private ActionListener alGroup = new ActionListener() { 22 22 public void actionPerformed(java.awt.event.ActionEvent e) { 23 dlg.mark.setLight Group(groupBox.getText());23 dlg.mark.setLightAtt(Att.GRP, groupBox.getText()); 24 24 } 25 25 }; … … 28 28 private ActionListener alPeriod = new ActionListener() { 29 29 public void actionPerformed(java.awt.event.ActionEvent e) { 30 dlg.mark.setLight Period(periodBox.getText());30 dlg.mark.setLightAtt(Att.PER, periodBox.getText()); 31 31 } 32 32 }; … … 35 35 private ActionListener alSequence = new ActionListener() { 36 36 public void actionPerformed(java.awt.event.ActionEvent e) { 37 dlg.mark.setLight Seq(sequenceBox.getText());37 dlg.mark.setLightAtt(Att.SEQ, sequenceBox.getText()); 38 38 } 39 39 }; … … 46 46 int idx = visibilities.get(vis); 47 47 if (idx == visibilityBox.getSelectedIndex()) 48 dlg.mark.set Visibility(vis);48 dlg.mark.setLightAtt(Att.VIS, vis); 49 49 } 50 50 } … … 54 54 private ActionListener alHeight = new ActionListener() { 55 55 public void actionPerformed(java.awt.event.ActionEvent e) { 56 dlg.mark.setLight Height(heightBox.getText());56 dlg.mark.setLightAtt(Att.HGT, heightBox.getText()); 57 57 } 58 58 }; … … 61 61 private ActionListener alRange = new ActionListener() { 62 62 public void actionPerformed(java.awt.event.ActionEvent e) { 63 dlg.mark.setLight Range(rangeBox.getText());63 dlg.mark.setLightAtt(Att.RNG, rangeBox.getText()); 64 64 } 65 65 }; … … 68 68 private ActionListener alOrientation = new ActionListener() { 69 69 public void actionPerformed(java.awt.event.ActionEvent e) { 70 dlg.mark.setLight Orientation(orientationBox.getText());70 dlg.mark.setLightAtt(Att.ORT, orientationBox.getText()); 71 71 } 72 72 }; … … 79 79 int idx = categories.get(lit); 80 80 if (idx == categoryBox.getSelectedIndex()) 81 dlg.mark.setLight Category(lit);81 dlg.mark.setLightAtt(Att.LIT, lit); 82 82 } 83 83 } … … 91 91 int idx = exhibitions.get(exh); 92 92 if (idx == exhibitionBox.getSelectedIndex()) 93 dlg.mark.setLight Exhibition(exh);93 dlg.mark.setLightAtt(Att.EXH, exh); 94 94 } 95 95 } … … 105 105 if (panelSector == null) { 106 106 panelSector = new PanelSectors(dlg); 107 panelSector.setAlwaysOnTop(true);108 panelSector.setLocation(450, 0);109 107 } 110 if (panelSector.getSectorCount() == 0) {111 panelSector.addSector(1);112 dlg.mark.setSectored(true);113 }108 // if (panelSector.getSectorCount() == 0) { 109 // panelSector.addSector(1); 110 // dlg.mark.setSectored(true); 111 // } 114 112 panelSector.setVisible(true); 115 113 } else { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r26998 r27023 313 313 panelSpec.setVisible(false); 314 314 panelLights.setVisible(false); 315 if (dlg.mark.isValid()) { 316 moreButton.setEnabled(true); 317 topButton.setEnabled(true); 318 fogButton.setEnabled(true); 319 radButton.setEnabled(true); 320 litButton.setEnabled(true); 321 } 315 322 switch (SeaMark.GrpMAP.get(dlg.mark.getObject())) { 316 323 case LAT: … … 334 341 case SIS: 335 342 lightsButton.setBorderPainted(true); 343 topButton.setEnabled(false); 336 344 panelLights.setVisible(true); 337 345 panelLights.syncPanel(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java
r27005 r27023 102 102 switch (dlg.mark.getCategory()) { 103 103 case LAM_PORT: 104 dlg.mark.set Colour(Ent.BODY,Col.RED);105 dlg.mark.set Pattern(Ent.BODY,Pat.NONE);104 dlg.mark.setObjColour(Col.RED); 105 dlg.mark.setObjPattern(Pat.NONE); 106 106 break; 107 107 case LAM_PPORT: 108 dlg.mark.set Colour(Ent.BODY,Col.RED);109 dlg.mark.add Colour(Ent.BODY,Col.GREEN);110 dlg.mark.add Colour(Ent.BODY,Col.RED);111 dlg.mark.set Pattern(Ent.BODY,Pat.HORIZ);108 dlg.mark.setObjColour(Col.RED); 109 dlg.mark.addObjColour(Col.GREEN); 110 dlg.mark.addObjColour(Col.RED); 111 dlg.mark.setObjPattern(Pat.HORIZ); 112 112 break; 113 113 case LAM_STBD: 114 dlg.mark.set Colour(Ent.BODY,Col.GREEN);115 dlg.mark.set Pattern(Ent.BODY,Pat.NONE);114 dlg.mark.setObjColour(Col.GREEN); 115 dlg.mark.setObjPattern(Pat.NONE); 116 116 break; 117 117 case LAM_PSTBD: 118 dlg.mark.set Colour(Ent.BODY,Col.GREEN);119 dlg.mark.add Colour(Ent.BODY,Col.RED);120 dlg.mark.add Colour(Ent.BODY,Col.GREEN);121 dlg.mark.set Pattern(Ent.BODY,Pat.HORIZ);118 dlg.mark.setObjColour(Col.GREEN); 119 dlg.mark.addObjColour(Col.RED); 120 dlg.mark.addObjColour(Col.GREEN); 121 dlg.mark.setObjPattern(Pat.HORIZ); 122 122 break; 123 123 } … … 130 130 switch (dlg.mark.getCategory()) { 131 131 case LAM_PORT: 132 dlg.mark.set Colour(Ent.BODY,Col.GREEN);133 dlg.mark.set Pattern(Ent.BODY,Pat.NONE);132 dlg.mark.setObjColour(Col.GREEN); 133 dlg.mark.setObjPattern(Pat.NONE); 134 134 break; 135 135 case LAM_PPORT: 136 dlg.mark.set Colour(Ent.BODY,Col.GREEN);137 dlg.mark.add Colour(Ent.BODY,Col.RED);138 dlg.mark.add Colour(Ent.BODY,Col.GREEN);139 dlg.mark.set Pattern(Ent.BODY,Pat.HORIZ);136 dlg.mark.setObjColour(Col.GREEN); 137 dlg.mark.addObjColour(Col.RED); 138 dlg.mark.addObjColour(Col.GREEN); 139 dlg.mark.setObjPattern(Pat.HORIZ); 140 140 break; 141 141 case LAM_STBD: 142 dlg.mark.set Colour(Ent.BODY,Col.RED);143 dlg.mark.set Pattern(Ent.BODY,Pat.NONE);142 dlg.mark.setObjColour(Col.RED); 143 dlg.mark.setObjPattern(Pat.NONE); 144 144 break; 145 145 case LAM_PSTBD: 146 dlg.mark.set Colour(Ent.BODY,Col.RED);147 dlg.mark.add Colour(Ent.BODY,Col.GREEN);148 dlg.mark.add Colour(Ent.BODY,Col.RED);149 dlg.mark.set Pattern(Ent.BODY,Pat.HORIZ);146 dlg.mark.setObjColour(Col.RED); 147 dlg.mark.addObjColour(Col.GREEN); 148 dlg.mark.addObjColour(Col.RED); 149 dlg.mark.setObjPattern(Pat.HORIZ); 150 150 break; 151 151 } … … 156 156 if (regionCButton.isSelected()) { 157 157 dlg.mark.setRegion(Reg.C); 158 dlg.mark.set Pattern(Ent.BODY,Pat.HORIZ);158 dlg.mark.setObjPattern(Pat.HORIZ); 159 159 switch (dlg.mark.getCategory()) { 160 160 case LAM_PORT: 161 dlg.mark.set Colour(Ent.BODY,Col.RED);162 dlg.mark.add Colour(Ent.BODY,Col.WHITE);163 dlg.mark.add Colour(Ent.BODY,Col.RED);164 dlg.mark.add Colour(Ent.BODY,Col.WHITE);161 dlg.mark.setObjColour(Col.RED); 162 dlg.mark.addObjColour(Col.WHITE); 163 dlg.mark.addObjColour(Col.RED); 164 dlg.mark.addObjColour(Col.WHITE); 165 165 break; 166 166 case LAM_PPORT: 167 167 case LAM_PSTBD: 168 dlg.mark.set Colour(Ent.BODY,Col.RED);169 dlg.mark.add Colour(Ent.BODY,Col.GREEN);170 dlg.mark.add Colour(Ent.BODY,Col.RED);171 dlg.mark.add Colour(Ent.BODY,Col.GREEN);168 dlg.mark.setObjColour(Col.RED); 169 dlg.mark.addObjColour(Col.GREEN); 170 dlg.mark.addObjColour(Col.RED); 171 dlg.mark.addObjColour(Col.GREEN); 172 172 break; 173 173 case LAM_STBD: 174 dlg.mark.set Colour(Ent.BODY,Col.GREEN);175 dlg.mark.add Colour(Ent.BODY,Col.WHITE);176 dlg.mark.add Colour(Ent.BODY,Col.GREEN);177 dlg.mark.add Colour(Ent.BODY,Col.WHITE);174 dlg.mark.setObjColour(Col.GREEN); 175 dlg.mark.addObjColour(Col.WHITE); 176 dlg.mark.addObjColour(Col.GREEN); 177 dlg.mark.addObjColour(Col.WHITE); 178 178 break; 179 179 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r26998 r27023 49 49 switch (dlg.mark.getRegion()) { 50 50 case A: 51 dlg.mark.set Pattern(Ent.BODY,Pat.NONE);52 dlg.mark.set Colour(Ent.BODY,Col.RED);51 dlg.mark.setObjPattern(Pat.NONE); 52 dlg.mark.setObjColour(Col.RED); 53 53 break; 54 54 case B: 55 dlg.mark.set Pattern(Ent.BODY,Pat.NONE);56 dlg.mark.set Colour(Ent.BODY,Col.GREEN);55 dlg.mark.setObjPattern(Pat.NONE); 56 dlg.mark.setObjColour(Col.GREEN); 57 57 break; 58 58 case C: 59 dlg.mark.set Pattern(Ent.BODY,Pat.HORIZ);60 dlg.mark.set Colour(Ent.BODY,Col.RED);61 dlg.mark.add Colour(Ent.BODY,Col.WHITE);62 dlg.mark.add Colour(Ent.BODY,Col.RED);63 dlg.mark.add Colour(Ent.BODY,Col.WHITE);59 dlg.mark.setObjPattern(Pat.HORIZ); 60 dlg.mark.setObjColour(Col.RED); 61 dlg.mark.addObjColour(Col.WHITE); 62 dlg.mark.addObjColour(Col.RED); 63 dlg.mark.addObjColour(Col.WHITE); 64 64 break; 65 65 } 66 66 } else { 67 dlg.mark.set Pattern(Ent.BODY,Pat.HORIZ);67 dlg.mark.setObjPattern(Pat.HORIZ); 68 68 switch (dlg.mark.getRegion()) { 69 69 case A: 70 dlg.mark.set Colour(Ent.BODY,Col.RED);71 dlg.mark.add Colour(Ent.BODY,Col.GREEN);72 dlg.mark.add Colour(Ent.BODY,Col.RED);70 dlg.mark.setObjColour(Col.RED); 71 dlg.mark.addObjColour(Col.GREEN); 72 dlg.mark.addObjColour(Col.RED); 73 73 break; 74 74 case B: 75 dlg.mark.set Colour(Ent.BODY,Col.GREEN);76 dlg.mark.add Colour(Ent.BODY,Col.RED);77 dlg.mark.add Colour(Ent.BODY,Col.GREEN);75 dlg.mark.setObjColour(Col.GREEN); 76 dlg.mark.addObjColour(Col.RED); 77 dlg.mark.addObjColour(Col.GREEN); 78 78 break; 79 79 case C: 80 dlg.mark.set Colour(Ent.BODY,Col.RED);81 dlg.mark.add Colour(Ent.BODY,Col.GREEN);82 dlg.mark.add Colour(Ent.BODY,Col.RED);83 dlg.mark.add Colour(Ent.BODY,Col.GREEN);80 dlg.mark.setObjColour(Col.RED); 81 dlg.mark.addObjColour(Col.GREEN); 82 dlg.mark.addObjColour(Col.RED); 83 dlg.mark.addObjColour(Col.GREEN); 84 84 break; 85 85 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java
r26998 r27023 41 41 dlg.panelMain.radButton.setEnabled(true); 42 42 dlg.panelMain.litButton.setEnabled(true); 43 dlg.mark.set Pattern(Ent.BODY,Pat.VERT);44 dlg.mark.set Colour(Ent.BODY,Col.RED);45 dlg.mark.add Colour(Ent.BODY,Col.WHITE);43 dlg.mark.setObjPattern(Pat.VERT); 44 dlg.mark.setObjColour(Col.RED); 45 dlg.mark.addObjColour(Col.WHITE); 46 46 } else { 47 47 dlg.panelMain.moreButton.setVisible(false); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSectors.java
r27017 r27023 9 9 import oseam.dialogs.OSeaMAction; 10 10 import oseam.seamarks.*; 11 import oseam.seamarks.SeaMark.Att; 11 12 import oseam.seamarks.SeaMark.*; 12 13 13 public class PanelSectors extends J Panel{14 public class PanelSectors extends JFrame { 14 15 15 16 private OSeaMAction dlg; 17 private JPanel panel; 16 18 private TableModel model; 17 19 private JTable table; 18 private JFrame frame;19 20 20 // public JPanel panel; 21 // public JButton minusButton; 22 // public JButton plusButton; 23 // private JScrollPane tablePane; 24 // private ActionListener alMinusButton; 25 // private ActionListener alPlusButton; 21 public JButton minusButton; 22 private ActionListener alMinusButton = new ActionListener() { 23 public void actionPerformed(java.awt.event.ActionEvent e) { 24 deleteSector(0); 25 } 26 }; 27 public JButton plusButton; 28 private ActionListener alPlusButton = new ActionListener() { 29 public void actionPerformed(java.awt.event.ActionEvent e) { 30 addSector(0); 31 } 32 }; 26 33 27 34 public PanelSectors(OSeaMAction dia) { 35 super("Sector Table"); 28 36 dlg = dia; 37 this.setSize(700, 100); 38 this.setVisible(true); 39 this.setAlwaysOnTop(true); 40 this.setLocation(450, 0); 41 this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 42 this.setLayout(null); 43 minusButton = new JButton(new ImageIcon(getClass().getResource("/images/MinusButton.png"))); 44 minusButton.setBounds(0, 0, 32, 34); 45 minusButton.addActionListener(alMinusButton); 46 this.add(minusButton); 47 plusButton = new JButton(new ImageIcon(getClass().getResource("/images/PlusButton.png"))); 48 plusButton.setBounds(0, 34, 32, 34); 49 plusButton.addActionListener(alPlusButton); 50 this.add(plusButton); 51 panel = new JPanel(new BorderLayout()); 52 panel.setBounds(40, 0, 660, 512); 29 53 model = new SectorTable(); 30 54 table = new JTable(model); 31 table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 32 frame = new JFrame("Sector Table"); 33 frame.getContentPane().add(new JScrollPane(table)); 34 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 55 table.setBounds(0, 0, 660, 34); 56 panel.add(new JScrollPane(table)); 57 this.getContentPane().add(panel); 35 58 } 36 59 37 60 private class SectorTable extends AbstractTableModel { 38 61 39 private String[] headings = { "Sector", "Colour", "Character", "Group", " Period", "Height", "Range", "Visibility", "Start", "End" };40 62 private String[] headings = { "Sector", "Colour", "Character", "Group", "Sequence", "Period", "Height", "Range", "Visibility", "Start", "End", "Radius" }; 63 41 64 public SectorTable() { 42 }65 } 43 66 44 public String getColumnName(int col) {45 return headings[col];46 }67 public String getColumnName(int col) { 68 return headings[col]; 69 } 47 70 48 public int getColumnCount() {49 return headings.length;50 }71 public int getColumnCount() { 72 return headings.length; 73 } 51 74 52 public int getRowCount() {53 return dlg.mark.getSectorCount() - 1;54 }75 public int getRowCount() { 76 return dlg.mark.getSectorCount(); 77 } 55 78 56 public boolean isCellEditable(int row, int col) {57 return (col > 0);58 }79 public boolean isCellEditable(int row, int col) { 80 return (col > 0); 81 } 59 82 60 public Class getColumnClass(int col) { 61 switch (col) { 62 case 1: 63 return Col.class; 64 case 7: 65 return Vis.class; 66 default: 67 return String.class; 83 public Class getColumnClass(int col) { 84 switch (col) { 85 case 1: 86 return Col.class; 87 case 7: 88 return Vis.class; 89 default: 90 return String.class; 91 } 68 92 } 69 } 70 71 public Object getValueAt(int row, int col) { 72 switch (col) { 73 case 1: 74 return (dlg.mark.getColour(Ent.LIGHT, row)); 75 case 2: 76 return (dlg.mark.getLightChar(row)); 77 case 3: 78 return (dlg.mark.getLightGroup(row)); 79 case 4: 80 return (dlg.mark.getLightPeriod(row)); 81 case 5: 82 return (dlg.mark.getLightHeight(row)); 83 case 6: 84 return (dlg.mark.getLightRange(row)); 85 case 7: 86 return (dlg.mark.getVisibility(row)); 87 case 8: 88 return (dlg.mark.getLightSector1(row)); 89 case 9: 90 return (dlg.mark.getLightSector2(row)); 91 default: 92 return null; 93 94 public Object getValueAt(int row, int col) { 95 return dlg.mark.getLightAtt(col, row); 96 } 97 98 public void setValueAt(Object value, int row, int col) { 99 dlg.mark.setLightAtt(col, row, value); 93 100 } 94 101 } 95 102 96 public void setValueAt(Object value, int row, int col) { 97 switch (col) { 98 case 1: 99 dlg.mark.setColour(Ent.LIGHT, row, (SeaMark.Col)value); 100 case 2: 101 dlg.mark.setLightChar(row, (SeaMark.Chr)value); 102 case 7: 103 dlg.mark.setVisibility(row, (SeaMark.Vis)value); 104 default: 105 dlg.mark.setLightSector2(row, (String)value); 103 public int getSectorCount() { 104 return model.getRowCount(); 105 } 106 107 public void addSector(int idx) { 108 dlg.mark.addLightAtt(Att.COL, Col.UNKNOWN); 109 table.setSize(660, ((table.getRowCount() * 16) + 18)); 110 if (table.getRowCount() > 3) { 111 this.setSize(700, ((table.getRowCount() * 16) + 40)); 112 } else { 113 this.setSize(700, 100); 106 114 } 107 115 } 116 117 public void deleteSector(int idx) { 118 dlg.mark.subLightAtt(Att.COL, 0); 119 table.setSize(660, ((table.getRowCount() * 16) + 18)); 120 if (table.getRowCount() > 3) { 121 this.setSize(700, ((table.getRowCount() * 16) + 40)); 122 } else { 123 this.setSize(700, 100); 124 } 125 } 126 108 127 } 109 /*110 * panel = new JPanel();111 * this.setSize(700, 100);112 * panel.setBounds(0, 0, 700, 512);113 * this.getContentPane().add(panel);114 * table = new JTable();115 * tablePane = new JScrollPane(table);116 * tablePane.setBounds(40, 0, 660, 34);117 * panel.setLayout(null);118 * panel.add(tablePane);119 *120 * alMinusButton = new ActionListener() {121 * public void actionPerformed(java.awt.event.ActionEvent e) { deleteSector(2); } };122 * minusButton = new JButton(new123 * ImageIcon(getClass().getResource("/images/MinusButton.png")));124 * minusButton.setBounds(0, 0, 32, 34);125 * minusButton.addActionListener(alMinusButton); panel.add(minusButton);126 *127 * alPlusButton = new ActionListener() { public void128 * actionPerformed(java.awt.event.ActionEvent e) { addSector(2); } };129 * plusButton = new JButton(new130 * ImageIcon(getClass().getResource("/images/PlusButton.png")));131 * plusButton.setBounds(0, 34, 32, 34);132 * plusButton.addActionListener(alPlusButton); panel.add(plusButton); }133 *134 * public int getSectorCount() { return getRowCount(); }135 *136 * public void addSector(int idx) { lights.add(idx, new Object[]{null, null,137 * null, null, null, null, null, null, null, null, null, null});138 * tablePane.setSize(660, ((getRowCount() * 16) + 18)); if (getRowCount() > 3)139 * { this.setSize(700, ((getRowCount() * 16) + 40)); } else {140 * this.setSize(700, 100); } // light.fireTableRowsInserted(idx, idx); }141 *142 * public void deleteSector(int idx) { lights.remove(idx);143 * tablePane.setSize(660, ((getRowCount() * 16) + 18)); if (getRowCount() > 3)144 * { this.setSize(700, ((getRowCount() * 16) + 40)); } else {145 * this.setSize(700, 100); } // light.fireTableRowsDeleted(idx, idx); }146 *147 * private ArrayList<Object[]> lights;148 *149 */150 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r26998 r27023 51 51 dlg.mark.setObject(objects.get(shp)); 52 52 if (button == cairnButton) { 53 dlg.mark.set Pattern(Ent.BODY,Pat.NONE);54 dlg.mark.set Colour(Ent.BODY,Col.UNKNOWN);53 dlg.mark.setObjPattern(Pat.NONE); 54 dlg.mark.setObjColour(Col.UNKNOWN); 55 55 } 56 if (dlg.mark.get Colour(Ent.BODY,0) == Col.UNKNOWN) {57 dlg.mark.set Pattern(Ent.BODY,Pat.NONE);58 dlg.mark.set Colour(Ent.BODY,Col.YELLOW);56 if (dlg.mark.getObjColour(0) == Col.UNKNOWN) { 57 dlg.mark.setObjPattern(Pat.NONE); 58 dlg.mark.setObjColour(Col.YELLOW); 59 59 } 60 60 button.setBorderPainted(true); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r26998 r27023 49 49 switch (dlg.mark.getRegion()) { 50 50 case A: 51 dlg.mark.set Pattern(Ent.BODY,Pat.NONE);52 dlg.mark.set Colour(Ent.BODY,Col.GREEN);51 dlg.mark.setObjPattern(Pat.NONE); 52 dlg.mark.setObjColour(Col.GREEN); 53 53 break; 54 54 case B: 55 dlg.mark.set Pattern(Ent.BODY,Pat.NONE);56 dlg.mark.set Colour(Ent.BODY,Col.RED);55 dlg.mark.setObjPattern(Pat.NONE); 56 dlg.mark.setObjColour(Col.RED); 57 57 break; 58 58 case C: 59 dlg.mark.set Pattern(Ent.BODY,Pat.HORIZ);60 dlg.mark.set Colour(Ent.BODY,Col.GREEN);61 dlg.mark.add Colour(Ent.BODY,Col.WHITE);62 dlg.mark.add Colour(Ent.BODY,Col.GREEN);63 dlg.mark.add Colour(Ent.BODY,Col.WHITE);59 dlg.mark.setObjPattern(Pat.HORIZ); 60 dlg.mark.setObjColour(Col.GREEN); 61 dlg.mark.addObjColour(Col.WHITE); 62 dlg.mark.addObjColour(Col.GREEN); 63 dlg.mark.addObjColour(Col.WHITE); 64 64 break; 65 65 } 66 66 } else { 67 dlg.mark.set Pattern(Ent.BODY,Pat.HORIZ);67 dlg.mark.setObjPattern(Pat.HORIZ); 68 68 switch (dlg.mark.getRegion()) { 69 69 case A: 70 dlg.mark.set Colour(Ent.BODY,Col.GREEN);71 dlg.mark.add Colour(Ent.BODY,Col.RED);72 dlg.mark.add Colour(Ent.BODY,Col.GREEN);70 dlg.mark.setObjColour(Col.GREEN); 71 dlg.mark.addObjColour(Col.RED); 72 dlg.mark.addObjColour(Col.GREEN); 73 73 break; 74 74 case B: 75 dlg.mark.set Colour(Ent.BODY,Col.RED);76 dlg.mark.add Colour(Ent.BODY,Col.GREEN);77 dlg.mark.add Colour(Ent.BODY,Col.RED);75 dlg.mark.setObjColour(Col.RED); 76 dlg.mark.addObjColour(Col.GREEN); 77 dlg.mark.addObjColour(Col.RED); 78 78 break; 79 79 case C: 80 dlg.mark.set Colour(Ent.BODY,Col.RED);81 dlg.mark.add Colour(Ent.BODY,Col.GREEN);82 dlg.mark.add Colour(Ent.BODY,Col.RED);83 dlg.mark.add Colour(Ent.BODY,Col.GREEN);80 dlg.mark.setObjColour(Col.RED); 81 dlg.mark.addObjColour(Col.GREEN); 82 dlg.mark.addObjColour(Col.RED); 83 dlg.mark.addObjColour(Col.GREEN); 84 84 break; 85 85 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r27017 r27023 323 323 } 324 324 325 public Col getColour(Ent ent, int idx) { 326 if (ent == Ent.BODY) 327 return getObjColour(idx); 328 else 329 return getTopColour(idx); 330 } 331 332 public void setColour(Ent ent, Col col) { 333 if (ent == Ent.BODY) 334 setObjColour(col); 335 else 336 setTopColour(col); 337 } 338 339 public void setColour(Ent ent, int idx, Col col) { 340 if (ent == Ent.BODY) 341 setObjColour(idx, col); 342 else 343 setTopColour(idx, col); 344 } 345 346 public void addColour(Ent ent, int idx, Col col) { 347 if (ent == Ent.BODY) 348 addObjColour(idx, col); 349 else 350 addTopColour(idx, col); 351 } 352 353 public void subColour(Ent ent, int idx) { 354 if (ent == Ent.BODY) 355 subObjColour(idx); 356 else 357 subTopColour(idx); 358 } 359 325 360 private ArrayList<Col> bodyColour = new ArrayList<Col>(); 326 private ArrayList<Col> topColour = new ArrayList<Col>();327 private ArrayList<Col> lightColour = new ArrayList<Col>();328 361 329 public int getSectorCount() { 330 return lightColour.size(); 331 } 332 333 public Col getColour(Ent ent, int i) { 334 switch (ent) { 335 case BODY: 336 case BUOY: 337 case BEACON: 338 case FLOAT: 339 if (i < bodyColour.size()) 340 return bodyColour.get(i); 341 break; 342 case TOPMARK: 343 if (i < topColour.size()) 344 return topColour.get(i); 345 break; 346 case LIGHT: 347 if (i < lightColour.size()) 348 return lightColour.get(i); 349 break; 350 } 351 return Col.UNKNOWN; 352 } 353 354 public void setColour(Ent ent, Col col) { 355 switch (ent) { 356 case BODY: 357 case BUOY: 358 case BEACON: 359 case FLOAT: 360 bodyColour.clear(); 361 bodyColour.add(col); 362 break; 363 case TOPMARK: 364 topColour.clear(); 365 topColour.add(col); 366 break; 367 case LIGHT: 368 lightColour.clear(); 369 lightColour.add(col); 370 break; 371 } 372 } 373 374 public void setColour(Ent ent, int i, Col col) { 375 switch (ent) { 376 case BODY: 377 case BUOY: 378 case BEACON: 379 case FLOAT: 380 if (bodyColour.size() > i) 381 bodyColour.set(i, col); 382 break; 383 case TOPMARK: 384 if (topColour.size() > i) 385 topColour.set(i, col); 386 break; 387 case LIGHT: 388 if (lightColour.size() > i) 389 lightColour.set(i, col); 390 break; 391 } 392 } 393 394 public void addColour(Ent ent, int i, Col col) { 395 switch (ent) { 396 case BODY: 397 case BUOY: 398 case BEACON: 399 case FLOAT: 400 if (bodyColour.size() >= i) 401 bodyColour.add(i, col); 402 break; 403 case TOPMARK: 404 if (topColour.size() >= i) 405 topColour.add(i, col); 406 break; 407 case LIGHT: 408 if (lightColour.size() >= i) 409 lightColour.add(i, col); 410 break; 411 } 412 } 413 414 public void addColour(Ent ent, Col col) { 415 switch (ent) { 416 case BODY: 417 case BUOY: 418 case BEACON: 419 case FLOAT: 420 bodyColour.add(col); 421 break; 422 case TOPMARK: 423 topColour.add(col); 424 break; 425 case LIGHT: 426 lightColour.add(col); 427 break; 428 } 429 } 430 431 public void subColour(Ent ent, int i) { 432 switch (ent) { 433 case BODY: 434 case BUOY: 435 case BEACON: 436 case FLOAT: 437 if (bodyColour.size() > i) 438 bodyColour.remove(i); 439 break; 440 case TOPMARK: 441 if (topColour.size() > i) 442 topColour.remove(i); 443 break; 444 case LIGHT: 445 if (lightColour.size() > i) 446 lightColour.remove(i); 447 break; 448 } 449 } 450 451 private boolean Fired = false; 452 453 public boolean isFired() { 454 return Fired; 455 } 456 457 public void setFired(boolean fired) { 458 Fired = fired; 459 } 460 461 private boolean Sectored = false; 462 463 public boolean isSectored() { 464 return Sectored; 465 } 466 467 public void setSectored(boolean sectored) { 468 Sectored = sectored; 469 } 470 362 public Col getObjColour(int i) { 363 if (i < bodyColour.size()) 364 return bodyColour.get(i); 365 else 366 return Col.UNKNOWN; 367 } 368 369 public void setObjColour(Col col) { 370 bodyColour.clear(); 371 bodyColour.add(col); 372 } 373 374 public void setObjColour(int i, Col col) { 375 if (bodyColour.size() > i) 376 bodyColour.set(i, col); 377 } 378 379 public void addObjColour(int i, Col col) { 380 if (bodyColour.size() >= i) 381 bodyColour.add(i, col); 382 } 383 384 public void addObjColour(Col col) { 385 bodyColour.add(col); 386 } 387 388 public void subObjColour(int i) { 389 if (bodyColour.size() > i) 390 bodyColour.remove(i); 391 } 392 393 private ArrayList<Col> topmarkColour = new ArrayList<Col>(); 394 395 public Col getTopColour(int i) { 396 if (i < topmarkColour.size()) 397 return topmarkColour.get(i); 398 else 399 return Col.UNKNOWN; 400 } 401 402 public void setTopColour(Col col) { 403 topmarkColour.clear(); 404 topmarkColour.add(col); 405 } 406 407 public void setTopColour(int i, Col col) { 408 if (topmarkColour.size() > i) 409 topmarkColour.set(i, col); 410 } 411 412 public void addTopColour(int i, Col col) { 413 if (topmarkColour.size() >= i) 414 topmarkColour.add(i, col); 415 } 416 417 public void addTopColour(Col col) { 418 topmarkColour.add(col); 419 } 420 421 public void subTopColour(int i) { 422 if (topmarkColour.size() > i) 423 topmarkColour.remove(i); 424 } 425 471 426 public enum Chr { 472 427 UNKNOWN, FIXED, FLASH, LFLASH, QUICK, VQUICK, UQUICK, ISOPHASED, OCCULTING, … … 505 460 } 506 461 507 private ArrayList<Chr> lightCharacter = new ArrayList<Chr>();508 509 public Chr getLightChar(int i) {510 if (i < lightCharacter.size())511 return lightCharacter.get(i);512 else513 return Chr.UNKNOWN;514 }515 516 public void setLightChar(Chr chr) {517 lightCharacter.clear();518 lightCharacter.add(chr);519 }520 521 public void setLightChar(int i, Chr chr) {522 if (lightCharacter.size() > i)523 lightCharacter.set(i, chr);524 }525 526 public void addLightChar(int i, Chr chr) {527 if (lightCharacter.size() >= i)528 lightCharacter.add(i, chr);529 }530 531 public void addLightChar(Chr chr) {532 lightCharacter.add(chr);533 }534 535 public void subLightChar(int i) {536 if (lightCharacter.size() > i)537 lightCharacter.remove(i);538 }539 540 private ArrayList<String> lightGroup = new ArrayList<String>();541 542 public String getLightGroup(int i) {543 if (i < lightGroup.size())544 return lightGroup.get(i);545 else546 return "";547 }548 549 public void setLightGroup(String str) {550 lightGroup.clear();551 lightGroup.add(str);552 }553 554 public void setLightGroup(int i, String str) {555 if (lightGroup.size() > i)556 lightGroup.set(i, str);557 }558 559 public void addLightGroup(int i, String str) {560 if (lightGroup.size() >= i)561 lightGroup.add(i, str);562 }563 564 public void addLightGroup(String str) {565 lightGroup.add(str);566 }567 568 public void subLightGroup(int i) {569 if (lightGroup.size() > i)570 lightGroup.remove(i);571 }572 573 private ArrayList<String> lightSequence = new ArrayList<String>();574 575 public String getLightSeq(int i) {576 if (i < lightSequence.size())577 return lightSequence.get(i);578 else579 return "";580 }581 582 public void setLightSeq(String str) {583 lightSequence.clear();584 lightSequence.add(str);585 }586 587 public void setLightSeq(int i, String str) {588 if (lightSequence.size() > i)589 lightSequence.set(i, str);590 }591 592 public void addLightSeq(int i, String str) {593 if (lightSequence.size() >= i)594 lightSequence.add(i, str);595 }596 597 public void addLightSeq(String str) {598 lightSequence.add(str);599 }600 601 public void subLightSeq(int i) {602 if (lightSequence.size() > i)603 lightSequence.remove(i);604 }605 606 private ArrayList<String> lightPeriod = new ArrayList<String>();607 608 public String getLightPeriod(int i) {609 if (i < lightPeriod.size())610 return lightPeriod.get(i);611 else612 return "";613 }614 615 public void setLightPeriod(String str) {616 lightPeriod.clear();617 lightGroup.add(validDecimal(str));618 }619 620 public void setLightPeriod(int i, String str) {621 if (lightPeriod.size() > i)622 lightPeriod.set(i, validDecimal(str));623 }624 625 public void addLightPeriod(int i, String str) {626 if (lightPeriod.size() >= i)627 lightPeriod.add(i, validDecimal(str));628 }629 630 public void addLightPeriod(String str) {631 lightPeriod.add(validDecimal(str));632 }633 634 public void subLightPeriod(int i) {635 if (lightPeriod.size() > i)636 lightPeriod.remove(i);637 }638 639 private ArrayList<String> lightHeight = new ArrayList<String>();640 641 public String getLightHeight(int i) {642 if (i < lightHeight.size())643 return lightHeight.get(i);644 else645 return "";646 }647 648 public void setLightHeight(String str) {649 lightHeight.clear();650 lightHeight.add(validDecimal(str));651 }652 653 public void setLightHeight(int i, String str) {654 if (lightHeight.size() > i)655 lightHeight.set(i, validDecimal(str));656 }657 658 public void addLightHeight(int i, String str) {659 if (lightHeight.size() >= i)660 lightHeight.add(i, validDecimal(str));661 }662 663 public void addLightHeight(String str) {664 lightHeight.add(validDecimal(str));665 }666 667 public void subLightHeight(int i) {668 if (lightHeight.size() > i)669 lightHeight.remove(i);670 }671 672 private ArrayList<String> lightRange = new ArrayList<String>();673 674 public String getLightRange(int i) {675 if (i < lightRange.size())676 return lightRange.get(i);677 else678 return "";679 }680 681 public void setLightRange(String str) {682 lightRange.clear();683 lightRange.add(validDecimal(str));684 }685 686 public void setLightRange(int i, String str) {687 if (lightRange.size() > i)688 lightRange.set(i, validDecimal(str));689 }690 691 public void addLightRange(int i, String str) {692 if (lightRange.size() >= i)693 lightRange.add(i, validDecimal(str));694 }695 696 public void addLightRange(String str) {697 lightRange.add(validDecimal(str));698 }699 700 public void subLightRange(int i) {701 if (lightRange.size() > i)702 lightRange.remove(i);703 }704 705 private ArrayList<String> lightSector1 = new ArrayList<String>();706 707 public String getLightSector1(int i) {708 if (i < lightSector1.size())709 return lightSector1.get(i);710 else711 return "";712 }713 714 public void setLightSector1(String str) {715 lightSector1.clear();716 lightSector1.add(validDecimal(str));717 }718 719 public void setLightSector1(int i, String str) {720 if (lightSector1.size() > i)721 lightSector1.set(i, validDecimal(str));722 }723 724 public void addLightSector1(int i, String str) {725 if (lightSector1.size() >= i)726 lightSector1.add(i, validDecimal(str));727 }728 729 public void addLightSector1(String str) {730 lightSector1.add(validDecimal(str));731 }732 733 public void subLightSector1(int i) {734 if (lightSector1.size() > i)735 lightSector1.remove(i);736 }737 738 private ArrayList<String> lightSector2 = new ArrayList<String>();739 740 public String getLightSector2(int i) {741 if (i < lightSector2.size())742 return lightSector2.get(i);743 else744 return "";745 }746 747 public void setLightSector2(String str) {748 lightSector2.clear();749 lightSector2.add(validDecimal(str));750 }751 752 public void setLightSector2(int i, String str) {753 if (lightSector2.size() > i)754 lightSector2.set(i, validDecimal(str));755 }756 757 public void addLightSector2(int i, String str) {758 if (lightSector2.size() >= i)759 lightSector2.add(i, validDecimal(str));760 }761 762 public void addLightSector2(String str) {763 lightSector2.add(validDecimal(str));764 }765 766 public void subLightSector2(int i) {767 if (lightSector2.size() > i)768 lightSector2.remove(i);769 }770 771 462 public enum Vis { 772 463 UNKNOWN, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS … … 786 477 } 787 478 788 private ArrayList<Vis> lightVisibility = new ArrayList<Vis>();789 790 public Vis getVisibility(int i) {791 return lightVisibility.get(i);792 }793 794 public void setVisibility(int i, Vis vis) {795 lightVisibility.set(i, vis);796 }797 798 private String lightOrientation = "";799 800 public String getLightOrientation() {801 return lightOrientation;802 }803 804 public void setLightOrientation(String str) {805 lightOrientation = validDecimal(str);806 }807 808 479 public enum Lit { 809 480 UNKNOWN, VERT, HORIZ, DIR, UPPER, LOWER, LEAD, REAR, FRONT, … … 816 487 } 817 488 818 private Lit lightCategory = Lit.UNKNOWN;819 820 public Lit getLightCategory() {821 return lightCategory;822 }823 824 public void setLightCategory(Lit lit) {825 lightCategory = lit;826 }827 828 489 public enum Exh { UNKNOWN, H24, DAY, NIGHT, FOG } 829 490 public static final Map<EnumSet<Exh>, String> ExhMAP = new HashMap<EnumSet<Exh>, String>(); … … 836 497 } 837 498 838 p rivate Exh lightExhibition = Exh.UNKNOWN;499 public enum Att { COL, CHR, GRP, SEQ, PER, HGT, RNG, VIS, BEG, END, RAD, EXH, LIT, ORT } 839 500 840 public Exh getLightExhibition() { 841 return lightExhibition; 842 } 843 844 public void setLightExhibition(Exh exh) { 845 lightExhibition = exh; 846 } 501 private ArrayList<Object[]> sectors = new ArrayList<Object[]>(); 847 502 503 public int getSectorCount() { 504 return sectors.size(); 505 } 506 507 public Object getLightAtt(Att att, int i) { 508 return getLightAtt(att.ordinal(), i); 509 } 510 public Object getLightAtt(int att, int i) { 511 if (i < sectors.size()) 512 return sectors.get(i)[att]; 513 else 514 return null; 515 } 516 517 public void setLightAtt(Att att, Object obj) { 518 sectors.clear(); 519 sectors.add(new Object[14]); 520 sectors.get(0)[att.ordinal()] = obj; 521 } 522 523 public void setLightAtt(Att att, int i, Object obj) { 524 setLightAtt(att.ordinal(), i, obj); 525 } 526 527 public void setLightAtt(int att, int i, Object obj) { 528 if (sectors.size() > i) 529 sectors.get(i)[att] = obj; 530 } 531 532 public void addLightAtt(Att att, int i, Object obj) { 533 if (sectors.size() >= i) { 534 sectors.add(i, new Object[14]); 535 sectors.get(i)[att.ordinal()] = obj; 536 } 537 } 538 539 public void addLightAtt(Att att, Object obj) { 540 sectors.add(new Object[14]); 541 sectors.get(sectors.size()-1)[att.ordinal()] = obj; 542 } 543 544 public void subLightAtt(Att att, int i) { 545 if (sectors.size() > i) 546 sectors.remove(i); 547 } 548 549 private boolean Fired = false; 550 551 public boolean isFired() { 552 return Fired; 553 } 554 555 public void setFired(boolean fired) { 556 Fired = fired; 557 } 558 559 private boolean Sectored = false; 560 561 public boolean isSectored() { 562 return Sectored; 563 } 564 565 public void setSectored(boolean sectored) { 566 Sectored = sectored; 567 } 568 848 569 public enum Pat { 849 570 NONE, HORIZ, VERT, DIAG, SQUARE, BORDER … … 859 580 } 860 581 582 public Pat getPattern(Ent ent) { 583 if (ent == Ent.BODY) 584 return getObjPattern(); 585 else 586 return getTopPattern(); 587 } 588 589 public void setPattern(Ent ent, Pat pat) { 590 if (ent == Ent.BODY) 591 setObjPattern(pat); 592 else 593 setTopPattern(pat); 594 } 595 861 596 private Pat bodyPattern = Pat.NONE; 597 598 public Pat getObjPattern() { 599 return bodyPattern; 600 } 601 602 public void setObjPattern(Pat pat) { 603 bodyPattern = pat; 604 } 605 862 606 private Pat topPattern = Pat.NONE; 863 607 864 public Pat getPattern(Ent ent) { 865 switch (ent) { 866 case BODY: 867 case BUOY: 868 case BEACON: 869 case FLOAT: 870 return bodyPattern; 871 case TOPMARK: 872 return topPattern; 873 } 874 return Pat.NONE; 875 } 876 877 public void setPattern(Ent ent, Pat pat) { 878 switch (ent) { 879 case BODY: 880 case BUOY: 881 case BEACON: 882 case FLOAT: 883 bodyPattern = pat; 884 break; 885 case TOPMARK: 886 topPattern = pat; 887 break; 888 } 608 public Pat getTopPattern() { 609 return topPattern; 610 } 611 612 public void setTopPattern(Pat pat) { 613 topPattern = pat; 889 614 } 890 615 … … 1254 979 case FLTSAW: 1255 980 case FLTSPP: 1256 if (get Colour(Ent.BODY,0) != Col.UNKNOWN)981 if (getObjColour(0) != Col.UNKNOWN) 1257 982 return true; 1258 983 break; … … 1374 1099 if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":colour_pattern")) { 1375 1100 str = keys.get("seamark:" + ObjSTR.get(obj) + ":colour_pattern"); 1376 set Pattern(Ent.BODY,Pat.NONE);1101 setObjPattern(Pat.NONE); 1377 1102 for (Pat pat : PatSTR.keySet()) { 1378 1103 if (PatSTR.get(pat).equals(str)) { 1379 set Pattern(Ent.BODY,pat);1104 setObjPattern(pat); 1380 1105 } 1381 1106 } … … 1384 1109 1385 1110 if (getObject() == Obj.LITFLT) { 1386 switch (get Colour(Ent.BODY,0)) {1111 switch (getObjColour(0)) { 1387 1112 case RED: 1388 if ((get Colour(Ent.BODY, 1) == Col.WHITE) && (getColour(Ent.BODY,2) == Col.UNKNOWN)) {1113 if ((getObjColour(1) == Col.WHITE) && (getObjColour(2) == Col.UNKNOWN)) { 1389 1114 setObject(Obj.FLTSAW); 1390 1115 setCategory(Cat.NONE); 1391 } else if (get Colour(Ent.BODY,1) == Col.UNKNOWN) {1116 } else if (getObjColour(1) == Col.UNKNOWN) { 1392 1117 setObject(Obj.FLTLAT); 1393 1118 if (getRegion() == Reg.B) { … … 1396 1121 setCategory(Cat.LAM_PORT); 1397 1122 } 1398 } else if ((get Colour(Ent.BODY, 1) == Col.GREEN) && (getColour(Ent.BODY,2) == Col.RED)) {1123 } else if ((getObjColour(1) == Col.GREEN) && (getObjColour(2) == Col.RED)) { 1399 1124 setObject(Obj.FLTLAT); 1400 1125 if (getRegion() == Reg.B) { … … 1403 1128 setCategory(Cat.LAM_PPORT); 1404 1129 } 1405 } else if ((get Colour(Ent.BODY, 1) == Col.WHITE) && (getColour(Ent.BODY,2) == Col.RED)) {1130 } else if ((getObjColour(1) == Col.WHITE) && (getObjColour(2) == Col.RED)) { 1406 1131 setObject(Obj.FLTLAT); 1407 1132 setCategory(Cat.LAM_PORT); … … 1412 1137 break; 1413 1138 case GREEN: 1414 if (get Colour(Ent.BODY,1) == Col.UNKNOWN) {1139 if (getObjColour(1) == Col.UNKNOWN) { 1415 1140 setObject(Obj.FLTLAT); 1416 1141 if (getRegion() == Reg.B) { … … 1419 1144 setCategory(Cat.LAM_STBD); 1420 1145 } 1421 } else if ((get Colour(Ent.BODY, 1) == Col.RED) && (getColour(Ent.BODY,2) == Col.GREEN)) {1146 } else if ((getObjColour(1) == Col.RED) && (getObjColour(2) == Col.GREEN)) { 1422 1147 setObject(Obj.FLTLAT); 1423 1148 if (getRegion() == Reg.B) { … … 1426 1151 setCategory(Cat.LAM_PSTBD); 1427 1152 } 1428 } else if ((get Colour(Ent.BODY, 1) == Col.WHITE) && (getColour(Ent.BODY,2) == Col.GREEN)) {1153 } else if ((getObjColour(1) == Col.WHITE) && (getObjColour(2) == Col.GREEN)) { 1429 1154 setObject(Obj.FLTLAT); 1430 1155 setCategory(Cat.LAM_STBD); … … 1435 1160 break; 1436 1161 case YELLOW: 1437 if (get Colour(Ent.BODY,1) == Col.BLACK) {1162 if (getObjColour(1) == Col.BLACK) { 1438 1163 setObject(Obj.FLTCAR); 1439 if (get Colour(Ent.BODY,2) == Col.YELLOW) {1164 if (getObjColour(2) == Col.YELLOW) { 1440 1165 setCategory(Cat.CAM_WEST); 1441 1166 } else { … … 1448 1173 break; 1449 1174 case BLACK: 1450 if (get Colour(Ent.BODY,1) == Col.RED) {1175 if (getObjColour(1) == Col.RED) { 1451 1176 setObject(Obj.FLTISD); 1452 1177 setCategory(Cat.NONE); 1453 } else if (get Colour(Ent.BODY,1) == Col.YELLOW) {1454 if (get Colour(Ent.BODY,2) == Col.BLACK) {1178 } else if (getObjColour(1) == Col.YELLOW) { 1179 if (getObjColour(2) == Col.BLACK) { 1455 1180 setCategory(Cat.CAM_EAST); 1456 1181 } else { … … 1480 1205 switch (getCategory()) { 1481 1206 case LAM_PORT: 1482 if (get Colour(Ent.BODY,0) == Col.RED) {1483 if (get Colour(Ent.BODY,1) == Col.WHITE)1207 if (getObjColour(0) == Col.RED) { 1208 if (getObjColour(1) == Col.WHITE) 1484 1209 setRegion(Reg.C); 1485 1210 else 1486 1211 setRegion(Reg.A); 1487 1212 } 1488 if (get Colour(Ent.BODY,0) == Col.GREEN)1213 if (getObjColour(0) == Col.GREEN) 1489 1214 setRegion(Reg.B); 1490 1215 break; 1491 1216 case LAM_PPORT: 1492 if (get Colour(Ent.BODY,0) == Col.RED) {1493 if (get Colour(Ent.BODY,3) == Col.GREEN)1217 if (getObjColour(0) == Col.RED) { 1218 if (getObjColour(3) == Col.GREEN) 1494 1219 setRegion(Reg.C); 1495 1220 else 1496 1221 setRegion(Reg.A); 1497 1222 } 1498 if (get Colour(Ent.BODY,0) == Col.GREEN)1223 if (getObjColour(0) == Col.GREEN) 1499 1224 setRegion(Reg.B); 1500 1225 break; 1501 1226 case LAM_STBD: 1502 if (get Colour(Ent.BODY,0) == Col.GREEN) {1503 if (get Colour(Ent.BODY,1) == Col.WHITE)1227 if (getObjColour(0) == Col.GREEN) { 1228 if (getObjColour(1) == Col.WHITE) 1504 1229 setRegion(Reg.C); 1505 1230 else 1506 1231 setRegion(Reg.A); 1507 1232 } 1508 if (get Colour(Ent.BODY,0) == Col.RED)1233 if (getObjColour(0) == Col.RED) 1509 1234 setRegion(Reg.B); 1510 1235 break; 1511 1236 case LAM_PSTBD: 1512 if (get Colour(Ent.BODY,0) == Col.GREEN)1237 if (getObjColour(0) == Col.GREEN) 1513 1238 setRegion(Reg.A); 1514 if (get Colour(Ent.BODY,0) == Col.RED) {1515 if (get Colour(Ent.BODY,3) == Col.GREEN)1239 if (getObjColour(0) == Col.RED) { 1240 if (getObjColour(3) == Col.GREEN) 1516 1241 setRegion(Reg.C); 1517 1242 else … … 1534 1259 if (keys.containsKey("seamark:topmark:colour")) { 1535 1260 str = keys.get("seamark:topmark:colour"); 1536 set Colour(Ent.TOPMARK,Col.UNKNOWN);1261 setTopColour(Col.UNKNOWN); 1537 1262 for (Col col : ColSTR.keySet()) { 1538 1263 if (ColSTR.get(col).equals(str)) { 1539 set Colour(Ent.TOPMARK,col);1264 setTopColour(col); 1540 1265 } 1541 1266 } … … 1543 1268 if (keys.containsKey("seamark:topmark:colour_pattern")) { 1544 1269 str = keys.get("seamark:topmark:colour_pattern"); 1545 set Pattern(Ent.TOPMARK,Pat.NONE);1270 setTopPattern(Pat.NONE); 1546 1271 for (Pat pat : PatSTR.keySet()) { 1547 1272 if (PatSTR.get(pat).equals(str)) { 1548 set Pattern(Ent.TOPMARK,pat);1273 setTopPattern(pat); 1549 1274 } 1550 1275 } … … 1838 1563 } 1839 1564 colStr = imgStr; 1840 for (Col col : top Colour) {1565 for (Col col : topmarkColour) { 1841 1566 switch (col) { 1842 1567 case WHITE: … … 1948 1673 } 1949 1674 1950 if ((get Colour(Ent.BODY,0) != Col.UNKNOWN) && getShape() != Shp.PERCH) {1951 String str = ColSTR.get(get Colour(Ent.BODY,0));1675 if ((getObjColour(0) != Col.UNKNOWN) && getShape() != Shp.PERCH) { 1676 String str = ColSTR.get(getObjColour(0)); 1952 1677 for (int i = 1; bodyColour.size() > i; i++) { 1953 str += (";" + ColSTR.get(get Colour(Ent.BODY,i)));1678 str += (";" + ColSTR.get(getObjColour(i))); 1954 1679 } 1955 1680 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour", str)); 1956 1681 } 1957 1682 1958 if (get Pattern(Ent.BODY) != Pat.NONE) {1683 if (getObjPattern() != Pat.NONE) { 1959 1684 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatSTR 1960 .get(get Pattern(Ent.BODY))));1685 .get(getObjPattern()))); 1961 1686 } 1962 1687 … … 1977 1702 if (hasTopmark()) { 1978 1703 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:shape", TopSTR.get(getTopmark()))); 1979 if (get Pattern(Ent.TOPMARK) != Pat.NONE)1704 if (getTopPattern() != Pat.NONE) 1980 1705 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour_pattern", PatSTR 1981 .get(get Pattern(Ent.TOPMARK))));1982 if (get Colour(Ent.TOPMARK,0) != Col.UNKNOWN) {1983 String str = ColSTR.get(get Colour(Ent.TOPMARK,0));1984 for (int i = 1; top Colour.size() > i; i++) {1985 str += (";" + ColSTR.get(get Colour(Ent.TOPMARK,i)));1706 .get(getTopPattern()))); 1707 if (getTopColour(0) != Col.UNKNOWN) { 1708 String str = ColSTR.get(getTopColour(0)); 1709 for (int i = 1; topmarkColour.size() > i; i++) { 1710 str += (";" + ColSTR.get(getTopColour(i))); 1986 1711 } 1987 1712 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour", str));
Note:
See TracChangeset
for help on using the changeset viewer.