Changeset 26114 in osm for applications/editors/josm/plugins
- Timestamp:
- 2011-06-10T11:21:54+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src
- Files:
-
- 5 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r26110 r26114 61 61 public PanelLit(OSeaMAction dia) { 62 62 dlg = dia; 63 panelSector = new PanelSectors();64 panelSector.setAlwaysOnTop(true);65 panelSector.setLocation(450, 0);66 63 panelChr = new PanelChr(dlg); 67 64 panelChr.setBounds(new Rectangle(0, 0, 88, 160)); … … 78 75 sectorButton.setBorderPainted(sectorButton.isSelected()); 79 76 if (sectorButton.isSelected()) { 77 if (panelSector == null) { 78 panelSector = new PanelSectors(dlg.mark.light); 79 panelSector.setAlwaysOnTop(true); 80 panelSector.setLocation(450, 0); 81 } 82 if (dlg.mark.light.getRowCount() == 1) { 83 dlg.mark.light.addSector(1); 84 dlg.mark.setSectored(true); 85 } 80 86 panelSector.setVisible(true); 81 87 } else { 88 dlg.mark.setSectored(false); 82 89 panelSector.setVisible(false); 83 90 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSectors.java
r26110 r26114 1 1 package oseam.panels; 2 3 import java.util.ArrayList; 2 4 3 5 import javax.swing.ImageIcon; … … 9 11 import javax.swing.table.AbstractTableModel; 10 12 13 import oseam.seamarks.Light; 14 import oseam.seamarks.SeaMark; 15 11 16 public class PanelSectors extends JFrame { 12 17 … … 16 21 public JTable table; 17 22 18 class TableModel extends AbstractTableModel { 19 20 private String[] columns = { "Sector", "Start", "End", "Colour", 21 "Character", "Group", "Period", "Height", "Range", "Visibility" }; 22 private Object[][] data = { { new Integer(1), "", "", "", "", "", "", "", "", "" } }; 23 24 public String getColumnName(int col) { 25 return columns[col].toString(); 26 } 27 28 public int getColumnCount() { 29 return columns.length; 30 } 31 32 public int getRowCount() { 33 return data.length; 34 } 35 36 public Object getValueAt(int row, int col) { 37 return data[row][col]; 38 } 39 40 public boolean isCellEditable(int row, int col) { 41 return (col > 0); 42 } 43 44 public void setValueAt(Object value, int row, int col) { 45 data[row][col] = value; 46 fireTableCellUpdated(row, col); 47 } 48 } 49 50 public PanelSectors() { 23 public PanelSectors(Light light) { 51 24 super("Sector Table"); 52 25 panel = new JPanel(); … … 58 31 plusButton = new JButton(new ImageIcon(getClass().getResource("/images/PlusButton.png"))); 59 32 plusButton.setBounds(0, 34, 32, 34); 60 table = new JTable( new TableModel());33 table = new JTable(light); 61 34 JScrollPane tablePane = new JScrollPane(table); 62 35 tablePane.setBounds(40, 0, 660, 34); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26096 r26114 440 440 setBearing1(""); 441 441 setBearing2(""); 442 set Radius("");442 setVisibility(Vis.UNKNOWN); 443 443 } 444 444 } … … 453 453 sectorIndex = sector; 454 454 } 455 455 456 456 public enum Chr { 457 457 UNKNOWN, FIXED, FLASH, LONGFLASH, QUICK, VERYQUICK, ULTRAQUICK, … … 490 490 } 491 491 492 public Light light = new Light(); 493 492 494 private String[] LightChar = new String[10]; 493 495 … … 596 598 } 597 599 598 private String[] Radius = new String[10]; 599 600 public String getRadius() { 601 if (Radius[sectorIndex] == null) 602 return (Radius[0]); 603 return Radius[sectorIndex]; 604 } 605 606 public void setRadius(String radius) { 600 public enum Vis { UNKNOWN, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS } 601 public static final Map<EnumSet<Vis>, String> VisMAP = new HashMap<EnumSet<Vis>, String>(); 602 static { 603 VisMAP.put(EnumSet.of(Vis.UNKNOWN), ""); 604 VisMAP.put(EnumSet.of(Vis.HIGH), "high"); 605 VisMAP.put(EnumSet.of(Vis.LOW), "low"); 606 VisMAP.put(EnumSet.of(Vis.FAINT), "faint"); 607 VisMAP.put(EnumSet.of(Vis.INTEN), "intensified"); 608 VisMAP.put(EnumSet.of(Vis.UNINTEN), "unintensified"); 609 VisMAP.put(EnumSet.of(Vis.REST), "restricted"); 610 VisMAP.put(EnumSet.of(Vis.OBS), "obscured"); 611 VisMAP.put(EnumSet.of(Vis.PARTOBS), "part_obscured"); 612 } 613 614 private Vis[] Visibility = new Vis[10]; 615 616 public Vis getVisibility() { 617 if (Visibility[sectorIndex] == null) 618 return (Visibility[0]); 619 return Visibility[sectorIndex]; 620 } 621 622 public void setVisibility(Vis visibility) { 607 623 if (sectorIndex == 0) 608 Radius = new String[10];609 Radius[sectorIndex] = radius;624 Visibility = new Vis[10]; 625 Visibility[sectorIndex] = visibility; 610 626 } 611 627 … … 926 942 if (values.length > 2) 927 943 Bearing2[index] = values[2]; 928 if (values.length > 3)929 Radius[index] = values[3];930 944 } else { 931 945 index = 0; … … 1191 1205 for (int i = 1; i < 10; i++) { 1192 1206 if ((colour = lightColour[i]) != Col.UNKNOWN) 1193 if (colour.equals("R")) {1194 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i + ":colour", "red"));1195 if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null))1196 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i, "red:" + Bearing1[i] + ":"1197 + Bearing2[i] + ":" + Radius[i]));1198 } else if (colour.equals("G")) {1199 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i + ":colour", "green"));1200 if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null))1201 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i, "green:" + Bearing1[i] + ":"1202 + Bearing2[i] + ":" + Radius[i]));1203 } else if (colour.equals("W")) {1204 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i + ":colour", "white"));1205 if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null))1206 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i, "white:" + Bearing1[i] + ":"1207 + Bearing2[i] + ":" + Radius[i]));1208 }1207 // if (colour.equals("R")) { 1208 // Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i + ":colour", "red")); 1209 // if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null)) 1210 // Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i, "red:" + Bearing1[i] + ":" 1211 // + Bearing2[i] + ":" + Radius[i])); 1212 // } else if (colour.equals("G")) { 1213 // Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i + ":colour", "green")); 1214 // if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null)) 1215 // Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i, "green:" + Bearing1[i] + ":" 1216 // + Bearing2[i] + ":" + Radius[i])); 1217 // } else if (colour.equals("W")) { 1218 // Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i + ":colour", "white")); 1219 // if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null)) 1220 // Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i, "white:" + Bearing1[i] + ":" 1221 // + Bearing2[i] + ":" + Radius[i])); 1222 // } 1209 1223 if (LightPeriod[i] != null) 1210 1224 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i + ":period", LightPeriod[i]));
Note:
See TracChangeset
for help on using the changeset viewer.