public void actionPerformed(java.awt.event.ActionEvent e) { for (Sts sts : statuses.keySet()) { int idx = statuses.get(sts); if (dlg.panelMain.mark != null && (idx == statusBox.getSelectedIndex())) dlg.panelMain.mark.setStatus(sts); } }
public void actionPerformed(java.awt.event.ActionEvent e) { for (Cns cns : constructions.keySet()) { int idx = constructions.get(cns); if (dlg.panelMain.mark != null && (idx == constrBox.getSelectedIndex())) dlg.panelMain.mark.setConstr(cns); } }
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 actionPerformed(java.awt.event.ActionEvent e) { for (Cat cat : categories.keySet()) { int idx = categories.get(cat); if (dlg.node != null && (idx == categoryBox.getSelectedIndex())) dlg.panelMain.mark.setCategory(cat); } }
public void actionPerformed(java.awt.event.ActionEvent e) { for (Con con : reflectivities.keySet()) { int idx = reflectivities.get(con); if (dlg.panelMain.mark != null && (idx == reflBox.getSelectedIndex())) dlg.panelMain.mark.setRefl(con); } }
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() { panelPat.syncPanel(); regionAButton.setBorderPainted(dlg.panelMain.mark.getRegion() == Reg.A); regionBButton.setBorderPainted(dlg.panelMain.mark.getRegion() == Reg.B); regionCButton.setBorderPainted(dlg.panelMain.mark.getRegion() == Reg.C); elevBox.setText(dlg.panelMain.mark.getElevation()); heightBox.setText(dlg.panelMain.mark.getObjectHeight()); sourceBox.setText(dlg.panelMain.mark.getSource()); infoBox.setText(dlg.panelMain.mark.getInfo()); for (Sts sts : statuses.keySet()) { int item = statuses.get(sts); if (dlg.panelMain.mark.getStatus() == sts) statusBox.setSelectedIndex(item); } for (Cns cns : constructions.keySet()) { int item = constructions.get(cns); if (dlg.panelMain.mark.getConstr() == cns) constrBox.setSelectedIndex(item); } for (Con con : conspicuities.keySet()) { int item = conspicuities.get(con); if (dlg.panelMain.mark.getConsp() == con) conBox.setSelectedIndex(item); } for (Con con : reflectivities.keySet()) { int item = reflectivities.get(con); if (dlg.panelMain.mark.getRefl() == con) reflBox.setSelectedIndex(item); } }
public void actionPerformed(java.awt.event.ActionEvent e) { for (Cat cat : moorings.keySet()) { int idx = moorings.get(cat); if (dlg.node != null && (idx == mooringBox.getSelectedIndex())) { dlg.panelMain.mark.setCategory(cat); if ((cat == Cat.INB_CALM) || (cat == Cat.INB_SBM)) { dlg.panelMain.mark.setObject(Obj.BOYINB); dlg.panelMain.mark.setShape(Shp.UNKSHP); } else { dlg.panelMain.mark.setObject(Obj.MORFAC); if (cat != Cat.MOR_BUOY) dlg.panelMain.mark.setShape(Shp.UNKSHP); } } } if (dlg.node != null) syncPanel(); }
public EnrollmentDialog( Frame owner, int maxCount, final String reasonToFail, EnumMap<DPFPFingerIndex, DPFPTemplate> templates) { super(owner, true); this.templates = templates; setTitle("Fingerprint Enrollment"); DPFPEnrollmentControl enrollmentControl = new DPFPEnrollmentControl(); EnumSet<DPFPFingerIndex> fingers = EnumSet.noneOf(DPFPFingerIndex.class); fingers.addAll(templates.keySet()); enrollmentControl.setEnrolledFingers(fingers); enrollmentControl.setMaxEnrollFingerCount(maxCount); enrollmentControl.addEnrollmentListener( new DPFPEnrollmentListener() { public void fingerDeleted(DPFPEnrollmentEvent e) throws DPFPEnrollmentVetoException { if (reasonToFail != null) { throw new DPFPEnrollmentVetoException(reasonToFail); } else { EnrollmentDialog.this.templates.remove(e.getFingerIndex()); } } public void fingerEnrolled(DPFPEnrollmentEvent e) throws DPFPEnrollmentVetoException { if (reasonToFail != null) { // e.setStopCapture(false); throw new DPFPEnrollmentVetoException(reasonToFail); } else EnrollmentDialog.this.templates.put(e.getFingerIndex(), e.getTemplate()); } }); getContentPane().setLayout(new BorderLayout()); JButton closeButton = new JButton("Close"); closeButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); // End Dialog } }); JPanel bottom = new JPanel(); bottom.add(closeButton); add(enrollmentControl, BorderLayout.CENTER); add(bottom, BorderLayout.PAGE_END); pack(); setLocationRelativeTo(null); }
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(); }
private void addCatItem(String str, Cat cat) { categories.put(cat, categoryBox.getItemCount()); categoryBox.addItem(str); }
private void addReflItem(String str, Con con) { reflectivities.put(con, reflBox.getItemCount()); reflBox.addItem(str); }
private void addConItem(String str, Con con) { conspicuities.put(con, conBox.getItemCount()); conBox.addItem(str); }
private void addCnsItem(String str, Cns cns) { constructions.put(cns, constrBox.getItemCount()); constrBox.addItem(str); }
private void addStsItem(String str, Sts sts) { statuses.put(sts, statusBox.getItemCount()); statusBox.addItem(str); }
private void addMorItem(String str, Cat cat) { moorings.put(cat, mooringBox.getItemCount()); mooringBox.addItem(str); }