public void actionPerformed(java.awt.event.ActionEvent e) { if ((dlg.panelMain.mark.getObject() != Obj.MORFAC) || (dlg.panelMain.mark.getCategory() == Cat.MOR_BUOY)) { for (Shp shp : shapes.keySet()) { JRadioButton button = shapes.get(shp); if (button.isSelected()) { dlg.panelMain.mark.setShape(shp); if (SeaMark.EntMAP.get(dlg.panelMain.mark.getObject()) != Ent.MOORING) { dlg.panelMain.mark.setObject(objects.get(shp)); if (dlg.panelMain.mark.getObjColour(0) == Col.UNKCOL) { dlg.panelMain.mark.setObjPattern(Pat.NOPAT); dlg.panelMain.mark.setObjColour(Col.YELLOW); } if (button == cairnButton) { dlg.panelMain.mark.setObjPattern(Pat.NOPAT); dlg.panelMain.mark.setObjColour(Col.UNKCOL); } topmarkButton.setVisible(dlg.panelMain.mark.testValid()); } button.setBorderPainted(true); } else button.setBorderPainted(false); } dlg.panelMain.panelMore.syncPanel(); } }
public void syncPanel() { for (Shp shp : shapes.keySet()) { JRadioButton button = shapes.get(shp); if (SmedAction.panelMain.mark.getShape() == shp) { button.setBorderPainted(true); } else button.setBorderPainted(false); } }
public void actionPerformed(java.awt.event.ActionEvent e) { for (Shp shp : shapes.keySet()) { JRadioButton button = shapes.get(shp); if (button.isSelected()) { SmedAction.panelMain.mark.setShape(shp); SmedAction.panelMain.mark.setObject(objects.get(shp)); button.setBorderPainted(true); } else button.setBorderPainted(false); } if (SmedAction.panelMain.mark.testValid()) { SmedAction.panelMain.panelChan.topmarkButton.setVisible(true); SmedAction.panelMain.panelChan.lightButton.setVisible(true); if (SmedAction.panelMain.mark.getCategory() == Cat.LAM_STBD) { switch (SmedAction.panelMain.mark.getRegion()) { case A: SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT); SmedAction.panelMain.mark.setObjColour(Col.GREEN); break; case B: SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT); SmedAction.panelMain.mark.setObjColour(Col.RED); break; case C: SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP); SmedAction.panelMain.mark.setObjColour(Col.GREEN); SmedAction.panelMain.mark.addObjColour(Col.WHITE); SmedAction.panelMain.mark.addObjColour(Col.GREEN); SmedAction.panelMain.mark.addObjColour(Col.WHITE); break; } } else { SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP); switch (SmedAction.panelMain.mark.getRegion()) { case A: SmedAction.panelMain.mark.setObjColour(Col.GREEN); SmedAction.panelMain.mark.addObjColour(Col.RED); SmedAction.panelMain.mark.addObjColour(Col.GREEN); break; case B: SmedAction.panelMain.mark.setObjColour(Col.RED); SmedAction.panelMain.mark.addObjColour(Col.GREEN); SmedAction.panelMain.mark.addObjColour(Col.RED); break; case C: SmedAction.panelMain.mark.setObjColour(Col.RED); SmedAction.panelMain.mark.addObjColour(Col.GREEN); SmedAction.panelMain.mark.addObjColour(Col.RED); SmedAction.panelMain.mark.addObjColour(Col.GREEN); break; } } SmedAction.panelMain.panelMore.syncPanel(); } else { SmedAction.panelMain.panelChan.topmarkButton.setVisible(false); SmedAction.panelMain.panelChan.lightButton.setVisible(false); } }
private JRadioButton getShapeButton( JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { button.setBounds(new Rectangle(x, y, w, h)); button.setBorder(BorderFactory.createLoweredBevelBorder()); button.setToolTipText(Messages.getString(tip)); button.addActionListener(alShape); shapeButtons.add(button); shapes.put(shp, button); objects.put(shp, obj); return button; }
public void syncPanel() { if (SeaMark.EntMAP.get(dlg.panelMain.mark.getObject()) == Ent.MOORING) { mooringButton.setBorderPainted(true); categoryBox.setVisible(false); mooringBox.setVisible(true); pillarButton.setEnabled(false); sparButton.setEnabled(false); beaconButton.setEnabled(false); towerButton.setEnabled(false); stakeButton.setEnabled(false); cairnButton.setEnabled(false); noticeButton.setEnabled(false); topmarkButton.setVisible(false); for (Cat cat : moorings.keySet()) { int item = moorings.get(cat); if (dlg.panelMain.mark.getCategory() == cat) mooringBox.setSelectedIndex(item); } } else { mooringButton.setBorderPainted(false); mooringBox.setVisible(false); categoryBox.setVisible(true); pillarButton.setEnabled(true); sparButton.setEnabled(true); beaconButton.setEnabled(true); towerButton.setEnabled(true); stakeButton.setEnabled(true); cairnButton.setEnabled(true); noticeButton.setEnabled(true); topmarkButton.setBorderPainted(dlg.panelMain.mark.getTopmark() != Top.NOTOP); topmarkButton.setSelected(dlg.panelMain.mark.getTopmark() != Top.NOTOP); topmarkButton.setVisible(dlg.panelMain.mark.testValid()); for (Cat cat : categories.keySet()) { int item = categories.get(cat); if (dlg.panelMain.mark.getCategory() == cat) categoryBox.setSelectedIndex(item); } } for (Shp shp : shapes.keySet()) { JRadioButton button = shapes.get(shp); if (dlg.panelMain.mark.getShape() == shp) { button.setBorderPainted(true); } else button.setBorderPainted(false); } noticeButton.setBorderPainted(false); dlg.panelMain.mark.testValid(); }
public void actionPerformed(java.awt.event.ActionEvent e) { dlg.panelMain.mark.setObject(Obj.UNKOBJ); dlg.panelMain.mark.setCategory(Cat.NOCAT); dlg.panelMain.mark.setTopmark(Top.NOTOP); if (mooringButton.isSelected()) { dlg.panelMain.mark.setObject(Obj.MORFAC); categoryBox.setVisible(false); mooringBox.setVisible(true); pillarButton.setEnabled(false); sparButton.setEnabled(false); beaconButton.setEnabled(false); towerButton.setEnabled(false); stakeButton.setEnabled(false); cairnButton.setEnabled(false); mooringButton.setBorderPainted(true); } else { mooringBox.setVisible(false); categoryBox.setVisible(true); pillarButton.setEnabled(true); sparButton.setEnabled(true); beaconButton.setEnabled(true); towerButton.setEnabled(true); stakeButton.setEnabled(true); cairnButton.setEnabled(true); mooringButton.setBorderPainted(false); } syncPanel(); }