Changeset 26128 in osm
- Timestamp:
- 2011-06-12T15:00:52+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r26124 r26128 78 78 panelSector.setLocation(450, 0); 79 79 } 80 if ( dlg.mark.light.getRowCount() ==1) {81 dlg.mark.light.addSector(1);82 dlg.mark.light.setSectored(true);80 if (panelSector.getSectorCount() == 0) { 81 panelSector.addSector(1); 82 panelSector.light.setSectored(true); 83 83 } 84 84 panelSector.setVisible(true); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSectors.java
r26124 r26128 7 7 import javax.swing.JTable; 8 8 import javax.swing.JButton; 9 import javax.swing.table.AbstractTableModel; 10 11 import java.awt.event.ActionListener; 9 12 10 13 import oseam.seamarks.Light; … … 16 19 public JButton plusButton; 17 20 public JTable table; 21 public Light light; 22 private JScrollPane tablePane; 23 private ActionListener alMinusButton; 24 private ActionListener alPlusButton; 18 25 19 public PanelSectors(Light li ght) {26 public PanelSectors(Light lit) { 20 27 super("Sector Table"); 28 light = lit; 21 29 panel = new JPanel(); 22 30 this.setSize(700, 100); 23 31 panel.setBounds(0, 0, 700, 512); 24 32 this.getContentPane().add(panel); 33 table = new JTable(light); 34 tablePane = new JScrollPane(table); 35 tablePane.setBounds(40, 0, 660, 34); 36 panel.setLayout(null); 37 panel.add(tablePane); 38 39 alMinusButton = new ActionListener() { 40 public void actionPerformed(java.awt.event.ActionEvent e) { 41 deleteSector(2); 42 } 43 }; 25 44 minusButton = new JButton(new ImageIcon(getClass().getResource("/images/MinusButton.png"))); 26 45 minusButton.setBounds(0, 0, 32, 34); 46 minusButton.addActionListener(alMinusButton); 47 panel.add(minusButton); 48 49 alPlusButton = new ActionListener() { 50 public void actionPerformed(java.awt.event.ActionEvent e) { 51 addSector(2); 52 } 53 }; 27 54 plusButton = new JButton(new ImageIcon(getClass().getResource("/images/PlusButton.png"))); 28 55 plusButton.setBounds(0, 34, 32, 34); 29 table = new JTable(light); 30 JScrollPane tablePane = new JScrollPane(table); 31 tablePane.setBounds(40, 0, 660, 34); 32 panel.setLayout(null); 33 panel.add(minusButton); 56 plusButton.addActionListener(alPlusButton); 34 57 panel.add(plusButton); 35 panel.add(tablePane);36 58 } 59 60 public int getSectorCount() { 61 return light.getRowCount(); 62 } 63 64 public void addSector(int idx) { 65 light.addSector(idx); 66 tablePane.setSize(660, ((light.getRowCount() * 16) + 18)); 67 if (light.getRowCount() > 3) { 68 this.setSize(700, ((light.getRowCount() * 16) + 40)); 69 } else { 70 this.setSize(700, 100); 71 } 72 light.fireTableRowsInserted(idx, idx); 73 } 74 75 public void deleteSector(int idx) { 76 light.deleteSector(idx); 77 tablePane.setSize(660, ((light.getRowCount() * 16) + 18)); 78 if (light.getRowCount() > 3) { 79 this.setSize(700, ((light.getRowCount() * 16) + 40)); 80 } else { 81 this.setSize(700, 100); 82 } 83 light.fireTableRowsDeleted(idx, idx); 84 } 85 37 86 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/Light.java
r26124 r26128 22 22 23 23 public Light(OSeaMAction dia) { 24 super();25 24 dlg = dia; 26 25 lights = new ArrayList<Object[]>(); 27 lights.add(new Object[ 12]);26 lights.add(new Object[]{null, null, null, null, null, null, null, null, null, null, null, null}); 28 27 } 29 28 … … 81 80 public void setSectored(boolean sectored) { 82 81 Sectored = sectored; 83 if (sectored) {84 setLightColour(0, Col.UNKNOWN);85 } else {86 setLightChar(0, Chr.UNKNOWN);87 setLightColour(0, Col.UNKNOWN);88 setLightGroup(0, "");89 setHeight(0, "");90 setRange(0, "");91 setBearing1(0, "");92 setBearing2(0, "");93 setVisibility(0, Vis.UNKNOWN);94 }95 82 } 96 83
Note:
See TracChangeset
for help on using the changeset viewer.