Changeset 26830 in osm for applications/editors
- Timestamp:
- 2011-10-11T14:25:26+02: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/PanelCol.java
r26720 r26830 41 41 if (button.isSelected()) { 42 42 if (dlg.mark != null) { 43 dlg.mark.setColour(ent, col); 44 if (ent != Ent.LIGHT) { 43 if (ent == Ent.LIGHT) { 44 dlg.mark.setColour(ent, col); 45 } else { 45 46 if (button == offButton) { 46 stack.remove(stackCol.get(stackIdx)); 47 stackCol.remove(stackIdx); 47 if (stackCol.size() != 0) { 48 dlg.mark.subColour(ent, stackIdx); 49 stackCol.get(stackIdx).removeActionListener(alStack); 50 stackColours.remove(stackCol.get(stackIdx)); 51 stack.remove(stackCol.get(stackIdx)); 52 stackCol.remove(stackIdx); 53 if ((stackCol.size() == stackIdx) && (stackIdx != 0)) 54 stackIdx--; 55 } 48 56 } else if (button == addButton) { 49 stackCol.add(stackIdx, new JRadioButton()); 57 if (stackCol.size() != 0) stackIdx++; 58 dlg.mark.addColour(ent, stackIdx, col); 59 stackCol.add(stackIdx, new JRadioButton(new ImageIcon(getClass().getResource("/images/ColourButton.png")))); 50 60 stackCol.get(stackIdx).setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 51 61 stack.add(stackCol.get(stackIdx)); 62 stackColours.add(stackCol.get(stackIdx)); 63 stackCol.get(stackIdx).addActionListener(alStack); 64 } else { 65 dlg.mark.setColour(ent, stackIdx, col); 52 66 } 53 for (int i = 0; stackCol.size() > i; i++) { 54 stackCol.get(i).setBounds(37, (89 + (i * (60 / stackCol.size()))), 30, (60 / stackCol.size())); 55 stackCol.get(i).setBackground(dlg.mark.ColMAP.get(dlg.mark.getColour(ent, i))); 67 if (stackCol.size() != 0) { 68 int height = 60 / stackCol.size(); 69 for (int i = 0; stackCol.size() > i; i++) { 70 JRadioButton btnI = stackCol.get(i); 71 btnI.setBounds(2, (2 + (i * height)), 30, height); 72 btnI.setBackground(dlg.mark.ColMAP.get(dlg.mark.getColour(ent, i))); 73 if (stackIdx == i) { 74 btnI.setBorderPainted(true); 75 } else { 76 btnI.setBorderPainted(false); 77 } 78 } 56 79 } 57 80 } … … 74 97 stackIdx = i; 75 98 button.setBorderPainted(true); 76 } else 99 } else { 77 100 button.setBorderPainted(false); 101 } 78 102 } 79 103 } … … 95 119 this.add(getColButton(violetButton, 0, 128, 34, 16, Messages.getString("Violet"), Col.VIOLET), null); 96 120 if (ent != Ent.LIGHT) { 97 this.add(getColButton(addButton, 0, 144, 34, 16, Messages.getString("AddColour"), Col. UNKNOWN), null);98 this.add(getColButton(blackButton, 3 5, 0, 34, 16, Messages.getString("Black"), Col.BLACK), null);99 this.add(getColButton(greyButton, 3 5, 16, 34, 16, Messages.getString("Grey"), Col.GREY), null);100 this.add(getColButton(brownButton, 3 5, 32, 34, 16, Messages.getString("Brown"), Col.BROWN), null);101 this.add(getColButton(magentaButton, 3 5, 48, 34, 16, Messages.getString("Magenta"), Col.MAGENTA), null);102 this.add(getColButton(pinkButton, 3 5, 64, 34, 16, Messages.getString("Pink"), Col.PINK), null);121 this.add(getColButton(addButton, 0, 144, 34, 16, Messages.getString("AddColour"), Col.BLANK), null); 122 this.add(getColButton(blackButton, 37, 0, 34, 16, Messages.getString("Black"), Col.BLACK), null); 123 this.add(getColButton(greyButton, 37, 16, 34, 16, Messages.getString("Grey"), Col.GREY), null); 124 this.add(getColButton(brownButton, 37, 32, 34, 16, Messages.getString("Brown"), Col.BROWN), null); 125 this.add(getColButton(magentaButton, 37, 48, 34, 16, Messages.getString("Magenta"), Col.MAGENTA), null); 126 this.add(getColButton(pinkButton, 37, 64, 34, 16, Messages.getString("Pink"), Col.PINK), null); 103 127 104 128 stack = new JPanel(); 105 129 stack.setBorder(BorderFactory.createLineBorder(Color.black)); 106 stack.setBounds(37, 89, 30, 60); 130 stack.setBounds(38, 87, 34, 64); 131 stack.setLayout(null); 107 132 this.add(stack); 108 133 if (dlg.mark != null) { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java
r26631 r26830 21 21 this.setLayout(null); 22 22 panelPat = new PanelPat(dlg); 23 panelPat.setBounds(new Rectangle(0, 0, 1 00, 160));23 panelPat.setBounds(new Rectangle(0, 0, 110, 160)); 24 24 this.add(panelPat, null); 25 25 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPat.java
r26713 r26830 45 45 this.setLayout(null); 46 46 panelCol = new PanelCol(dlg, alType, Ent.BODY); 47 panelCol.setBounds(new Rectangle(0, 0, 68, 160));47 panelCol.setBounds(new Rectangle(0, 0, 72, 160)); 48 48 this.add(panelCol, null); 49 this.add(getPatButton(noneButton, 7 2, 0, 27, 27, "NoPat", Pat.NONE), null);50 this.add(getPatButton(horizButton, 7 2, 26, 27, 27, "HorizPat", Pat.HORIZ), null);51 this.add(getPatButton(vertButton, 7 2, 52, 27, 27, "VertPat", Pat.VERT), null);52 this.add(getPatButton(diagButton, 7 2, 78, 27, 27, "DiagPat", Pat.DIAG), null);53 this.add(getPatButton(squareButton, 7 2, 104, 27, 27, "SquarePat", Pat.SQUARE), null);54 this.add(getPatButton(borderButton, 7 2, 130, 27, 27, "BorderPat", Pat.BORDER), null);49 this.add(getPatButton(noneButton, 76, 0, 27, 27, "NoPat", Pat.NONE), null); 50 this.add(getPatButton(horizButton, 76, 26, 27, 27, "HorizPat", Pat.HORIZ), null); 51 this.add(getPatButton(vertButton, 76, 52, 27, 27, "VertPat", Pat.VERT), null); 52 this.add(getPatButton(diagButton, 76, 78, 27, 27, "DiagPat", Pat.DIAG), null); 53 this.add(getPatButton(squareButton, 76, 104, 27, 27, "SquarePat", Pat.SQUARE), null); 54 this.add(getPatButton(borderButton, 76, 130, 27, 27, "BorderPat", Pat.BORDER), null); 55 55 56 56 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26713 r26830 257 257 258 258 public enum Col { 259 UNKNOWN, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, GREY, BROWN, MAGENTA, PINK259 UNKNOWN, BLANK, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, GREY, BROWN, MAGENTA, PINK 260 260 } 261 261 … … 364 364 case LIGHT: 365 365 lightColour.set(i, col); 366 break; 367 } 368 } 369 370 public void addColour(Ent ent, int i, Col col) { 371 switch (ent) { 372 case BODY: 373 case BUOY: 374 case BEACON: 375 case FLOAT: 376 bodyColour.add(i, col); 377 break; 378 case TOPMARK: 379 topColour.add(i, col); 380 break; 381 case DAYMARK: 382 dayColour.add(i, col); 383 break; 384 case LIGHT: 385 lightColour.add(i, col); 366 386 break; 367 387 }
Note:
See TracChangeset
for help on using the changeset viewer.