Changeset 27000 in osm for applications/editors
- Timestamp:
- 2011-11-03T19:38:31+01:00 (13 years ago)
- 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/panels/PanelLit.java
r26989 r27000 85 85 if (sectorButton.isSelected()) { 86 86 if (panelSector == null) { 87 panelSector = new PanelSectors(dlg .mark.light);87 panelSector = new PanelSectors(dlg); 88 88 panelSector.setAlwaysOnTop(true); 89 89 panelSector.setLocation(450, 0); … … 91 91 if (panelSector.getSectorCount() == 0) { 92 92 panelSector.addSector(1); 93 panelSector.light.setSectored(true);93 dlg.mark.setSectored(true); 94 94 } 95 95 panelSector.setVisible(true); 96 96 } else { 97 dlg.mark. light.setSectored(false);97 dlg.mark.setSectored(false); 98 98 panelSector.setVisible(false); 99 99 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSectors.java
r26999 r27000 2 2 3 3 import java.awt.event.*; 4 import java.util.ArrayList; 5 4 6 import javax.swing.*; 5 7 8 import oseam.dialogs.OSeaMAction; 6 9 import oseam.seamarks.*; 7 10 8 11 public class PanelSectors extends JFrame { 9 12 13 private OSeaMAction dlg; 10 14 public JPanel panel; 11 15 public JButton minusButton; 12 16 public JButton plusButton; 13 17 public JTable table; 14 public Light light;15 18 private JScrollPane tablePane; 16 19 private ActionListener alMinusButton; 17 20 private ActionListener alPlusButton; 18 21 19 public PanelSectors( Light lit) {22 public PanelSectors(OSeaMAction dia) { 20 23 super("Sector Table"); 21 light = lit; 24 dlg = dia; 25 lights = new ArrayList<Object[]>(); 26 lights.add(new Object[]{null, null, null, null, null, null, null, null, null, null, null, null}); 22 27 panel = new JPanel(); 23 28 this.setSize(700, 100); 24 29 panel.setBounds(0, 0, 700, 512); 25 30 this.getContentPane().add(panel); 26 table = new JTable( light);31 table = new JTable(); 27 32 tablePane = new JScrollPane(table); 28 33 tablePane.setBounds(40, 0, 660, 34); … … 52 57 53 58 public int getSectorCount() { 54 return light.getRowCount();59 return getRowCount(); 55 60 } 56 61 57 62 public void addSector(int idx) { 58 light .addSector(idx);59 tablePane.setSize(660, (( light.getRowCount() * 16) + 18));60 if ( light.getRowCount() > 3) {61 this.setSize(700, (( light.getRowCount() * 16) + 40));63 lights.add(idx, new Object[]{null, null, null, null, null, null, null, null, null, null, null, null}); 64 tablePane.setSize(660, ((getRowCount() * 16) + 18)); 65 if (getRowCount() > 3) { 66 this.setSize(700, ((getRowCount() * 16) + 40)); 62 67 } else { 63 68 this.setSize(700, 100); 64 69 } 65 light.fireTableRowsInserted(idx, idx);70 // light.fireTableRowsInserted(idx, idx); 66 71 } 67 72 68 73 public void deleteSector(int idx) { 69 light .deleteSector(idx);70 tablePane.setSize(660, (( light.getRowCount() * 16) + 18));71 if ( light.getRowCount() > 3) {72 this.setSize(700, (( light.getRowCount() * 16) + 40));74 lights.remove(idx); 75 tablePane.setSize(660, ((getRowCount() * 16) + 18)); 76 if (getRowCount() > 3) { 77 this.setSize(700, ((getRowCount() * 16) + 40)); 73 78 } else { 74 79 this.setSize(700, 100); 75 80 } 76 light.fireTableRowsDeleted(idx, idx);81 // light.fireTableRowsDeleted(idx, idx); 77 82 } 78 83 84 private String[] columns = { "Sector", "Start", "End", "Colour", 85 "Character", "Group", "Period", "Height", "Range", "Visibility" }; 86 private ArrayList<Object[]> lights; 87 88 private String getColumnName(int col) { 89 return columns[col].toString(); 90 } 91 92 private int getColumnCount() { 93 return columns.length; 94 } 95 96 private int getRowCount() { 97 return lights.size()-1; 98 } 99 100 private Object getValueAt(int row, int col) { 101 if (col == 0) { 102 return row+1; 103 } else { 104 return ((Object[])lights.get(row+1))[col+1]; 105 } 106 } 107 108 private boolean isCellEditable(int row, int col) { 109 return (col > 0); 110 } 111 112 private void setValueAt(Object value, int row, int col) { 113 ((Object[])lights.get(row+1))[col+1] = value; 114 } 115 79 116 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/Light.java
r26999 r27000 61 61 } 62 62 63 private boolean Fired = false;64 65 public boolean isFired() {66 return Fired;67 }68 69 public void setFired(boolean fired) {70 Fired = fired;71 }72 73 private boolean Sectored = false;74 75 public boolean isSectored() {76 return Sectored;77 }78 79 public void setSectored(boolean sectored) {80 Sectored = sectored;81 }82 83 63 public String getBearing1(int idx) { 84 64 return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 1); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26999 r27000 18 18 dlg = dia; 19 19 } 20 21 public Light light = new Light(dlg);22 20 23 21 public String validDecimal(String str) { … … 428 426 } 429 427 428 private boolean Fired = false; 429 430 public boolean isFired() { 431 return Fired; 432 } 433 434 public void setFired(boolean fired) { 435 Fired = fired; 436 } 437 438 private boolean Sectored = false; 439 440 public boolean isSectored() { 441 return Sectored; 442 } 443 444 public void setSectored(boolean sectored) { 445 Sectored = sectored; 446 } 447 430 448 public enum Chr { 431 449 UNKNOWN, FIXED, FLASH, LONGFLASH, QUICK, VERYQUICK, ULTRAQUICK, ISOPHASED, OCCULTING, MORSE, ALTERNATING, INTERRUPTEDQUICK, INTERRUPTEDVERYQUICK, INTERRUPTEDULTRAQUICK
Note:
See TracChangeset
for help on using the changeset viewer.